[wp-hackers] Accessing Update Check API Outside of WordPress

Mark Smith mark.smith1187 at yahoo.com
Sun Nov 11 06:01:09 UTC 2012


I run numerous sites. Rather than have each site use the built in update check I have disabled all update checks from the site via a plugin I made.

Instead I am building a php based cron job that will query the api.wordpress.org site to check for updates and send me an email notification. Personally I prefer that to the constant nags in WordPress to upgrade. While I install minor upgrades as soon as they come out often times I will wait on new major version having to see a nag until I do.

Core updates were easy enough, a simple cURL request to http://api.wordpress.org/core/version-check/1.6/ returns a serialized string which includes the current stable release version. 

$output = unserialize($output);
$current_version = $output['offers'][0]['current'];
unset($output);

Gets me the version number currently available which I can check against my installed versions easily enough.

Plugins and themes are a bit more difficult because I have to post data about what plugins and themes I am checking.  This is obviously not documented, the only documentation is a list of the API endpoints at http://codex.wordpress.org/WordPress.org_API.

I took a look at update.php to see how WordPress does it but the myriad of WordPress functions seems to just confuse me as to what exactly is being posted to the API endpoints http://api.wordpress.org/plugins/update-check/1.0/ and http://api.wordpress.org/themes/update-check/1.0/. Can anyone explain to me what eactly needs to be posted to get the current version of each plugin and theme.

Thanks.


More information about the wp-hackers mailing list