[wp-hackers] Plugin dependency checking

Stephen Rider wp-hackers at striderweb.com
Tue Jun 16 22:02:27 GMT 2009

On Jun 16, 2009, at 4:12 AM, Shane A. Froebel wrote:

> The way I have it "coded" right now is that when the plugin is even
> placed in WordPress it attaches itself to the 'register' part of the
> class so it can say 'Hello. I am installed and these are my  
> dependencies
> based on version of WordPress and Plugins Needed and their versions  
> for
> me to work properly.'

Certainly in the context of this thread, we have moved away from the  
idea of specifying plugin dependencies in favor of one plugin  
providing some sort of function that another plugin can look for.

Certainly within current WordPress plugins it is frowned upon to look  
for "WordPress version x.x"; instead coders are encouraged to look to  
see if a certain functionality exists.  This is because the latter is  
a more robust method.  For example I know that some people eliminate  
the WP Version string entirely for "security reasons" (aside: let's  
not get into arguments as to whether this is actually a security  
improvement!), but if a function exists, then it exists!

Mike Schinkel's argument is correct that even if I program a dependent  
plugin intending it to be used with "Plugin A", it might be entirely  
legitimate for someone to create "Plugin B" that can also use that  
"sub plugin".  This breaks if the sub plugin is checking for a  
specific "master"; but works just fine if the sub plugin says "I can  
do X for you" and the (any) master says "If any plugins can do X, do  
it now".


Stephen Rider

More information about the wp-hackers mailing list