Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How does DD32's tool determine the WordPress version of an installation. Its not working fine for WP 3.1 but it doesn't uses meta generator tag or the readme.txt of WP. So what else can it be?

share|improve this question
    
You could try reverse engineering it, just have it check your own site and watch the HTTP requests it generates. –  mtekk Feb 27 '11 at 21:39
add comment

4 Answers 4

up vote 3 down vote accepted

I'm just assuming here but this is usually done by fingerprinting for specific version files/directory's/code and sometimes even size.

For example you can remove all the meta versions tags ( isn't there like 12 places) and .txt file for 3.1 but since 3.1 is the only version to include the following new file by default, it is rather easy to fingerprint.

wp-includes/js/l10n.js

Since each release has many new additions, if you spend enough time writing a smart bot, it not very hard to find release specific data. Hiding all this info would be a lot of work for every release.

share|improve this answer
1  
What do you mean by 12 meta version tags? –  Simon Blackbourn Feb 27 '11 at 22:36
    
I got your point but +1 for Simon's question –  Ashfame Feb 27 '11 at 23:26
1  
Sorry I should make that more clear. The meta version tag is inserted in several places, for instance you can get rid of it on the default header of your blog, but it shows up elsewhere. That's why you use a global "get rid of it" filter instead of just commenting out the html header output. That number is probably exaggerated though. For instance look at Otto's script below. –  Wyck Feb 28 '11 at 3:17
    
Thanks for explaining! –  Ashfame Feb 28 '11 at 5:29
add comment

This is a bit of code I wrote a while back to do WP version detection in the most obvious ways: http://ottodestruct.com/class-wp-detection.phps

There are other methods, more subtle and less obvious. His method is file fingerprinting. Basically checking for whether certain files exist or not.

share|improve this answer
    
Thanks for the class Otto, made it more clear :) –  Ashfame Feb 28 '11 at 5:30
add comment

I know there's already been an accepted answer, but just throwing this out there. The way I do it is parse out the $wp_version variable from your blog dir's 'wp-includes/version.php' file:

function get_wp_version() {
 $versionFile = ABS_PATH.'/wp-includes/version.php'
 // NO VERSION FILE //
 if (($versionStr = @file_get_contents($versionFile))=='') return ''; 

 $regex = "wp_version.*'(?<wpVersion>.*)'";
 if (preg_match('/'.$regex.'/', $versionStr, $matches)) {
  return $matches['wpVersion'];
 }
 return '';
}
share|improve this answer
    
Nice but I can bump it up & if I run the latest version, I shouldn't have any problem. –  Ashfame Feb 28 '11 at 5:31
    
Moreover you should be executing on the same server for this to work. Didn't notice that before. lol –  Ashfame Nov 22 '11 at 14:42
add comment

You can also use online WordPress version search engine where you enter the URL of your site and it gives you back the version number. Available at https://www.facebook.com/princessdesignnet/app_119469354894717 (Slovenian and English version)

share|improve this answer
    
Welcome to the WPSE! It is required here to mention if you are affiliated with the service. You can edit your question to add the disclosure if that's the case. Thanks! See the help center for more information. –  Michal Mau Aug 27 '13 at 19:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.