[wp-hackers] WordPress.org API

Matt Mullenweg m at mullenweg.com
Sat Jan 19 09:48:02 GMT 2008

Ryan McCue wrote:
> Is documentation for the api.wordpress.org service available? Even 
> better, the source code? I'm looking into building a version checker 
> into my own software and, although it seems easy to build my own based 
> on what is returned, it would be really handy to see the source to see:

It's a fancy front-end to version_compare. (Actually not that fancy.)

>    * What the php_version parameter is used for
>    * What the locale parameter is used for

Both are unused currently, but the idea is that if there was a new 
version of a plugin that was only compatible with, say, PHP 5.2.1 it 
could figure that out and only show you the newest version compatible 
with your setup. This becomes more important when there's one click install.

Same thing with locale, think pre-localized plugins that might get 
updates at different times.

>    * Any other tricks you might use

Having a unique global identifier (like a slug) makes things infinitely 
easier. The only real complexity in our code is the juggling the 
identifiers for plugins. For the core version check it's literally a 
hard-coded file with some version compare switches, designed just to be 
as fast as possible because we didn't know what the load would be like 
post-launch, no DB access at all.

Matt Mullenweg
  http://photomatt.net | http://wordpress.org
http://automattic.com | http://akismet.com

More information about the wp-hackers mailing list