[wp-hackers] Plugin dependency checking

Mike Schinkel mikeschinkel at newclarity.net
Thu Jun 18 06:22:02 GMT 2009


"Shane A. Froebel" <shane at bugssite.org> wrote:
> 1) function_exists or extension_loaded is fine and all, but I see 
> if the function exists in two different versions and it does TWO 
> different things, it would be important for the author of the 
> plugin/theme to define the plugin version that it was tested on. 
> That way the result would be the exactly the way it was.

Agreed, which is where the concept of "interfaces" come in. Interfaces are more granular than plugins and their existence will result in greater reuse of plugins and their lower level functionality, if experience from other languages and platforms holds true which I see no evidence to believe it won't.

If you are not familiar with interfaces think of them as I've proposed for WordPress as "named hook sets" that would encompass not only functions but also actions, filters, constants, globals, tables, fields, and probably more.  

By default and w/o an explicit definition a plugin's interface & version would be equal to the plugin's name & version. OTOH, if explicitly defined a plugin could maintain a versioned interface across many plugin versions but more importantly if could both use and implement more than one interface. =

> 2) Using wordpress.org would only be useful for the current 
> version on the site that could be downloaded.

In earlier emails on this thread we discussed how interfaces could be managed on wordpress.org with a fallback to interfaces defined locally in a plugin which fully addresses this issue. If you read back through this entire thread you can to see the direction we were headed. Without speaking for them I believe scribu and Stephen were appreciating this direction. 

All in all I think the concepts you are working on are mostly a subset of the interfaces proposal and value would come from merging to two efforts.

-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins


More information about the wp-hackers mailing list