[wp-hackers] Facebook API and WordPress Plugin Development - Insight / Best Practice

Bryan Petty bryan at ibaku.net
Thu Nov 15 05:01:42 UTC 2012

On Wed, Nov 14, 2012 at 6:19 PM, Mike Schinkel <mike at newclarity.net> wrote:
> https://github.com/getsunrise/imperative/blob/master/imperative.php

This could be way more flexible (and less code) if it just used
version_compare() along with uksort(). It would probably also be best
to just require the plugin to specify the version as a second
parameter instead of trying to parse the filename for it, the plugin
should already know the version anyway. That way library file names
can also go unmodified, and use vendor folder conventions that play
nicely with version control.


There is one option available to solve this issue without requiring
any changes to core, is compatible with PHP 5.2, and doesn't require
any modifications to the 3rd party library. Unfortunately, it involves
building a service in front of the library in question that doesn't
include WP in any way, which you can then interface with like any
other external API. It can still be distributed with the plugin rather
than relying on an external server if preferred though. The downsides
are that this involves a slightly more complicated code architecture,
and can become very inefficient if designed incorrectly. The upside is
that it helps you build modular code (literally by forcing you to),
assuming you consider this a good thing anyway.

Bryan Petty

More information about the wp-hackers mailing list