[wp-hackers] What Should A Plugin Author Do To Make Plugins Extensible?

Mike Schinkel mikeschinkel at newclarity.net
Tue Aug 31 04:34:21 UTC 2010

On Aug 31, 2010, at 12:06 AM, Andrew Nacin wrote:
> There's been a resolution. The core developers are in agreement [1] that the
> existing hook structure is more than adequate for a dependencies system, if
> not ideal.
> [1] http://core.trac.wordpress.org/ticket/11308 complete with code examples
> and suggested best practices for plugins that are dependencies and will be
> dependencies.

I stand corrected; I was not aware of that discussion and it came after and/or in parallel with some of the discussions I was referring to.

That said, I don't think the ticket you mention addresses the use-case I was exactly referring to, at least not as far as I can tell (the examples were all abstract with no actual use-cases mentioned, ironic since I'm always asked for use-cases, but I digress...)

If I understood correctly what has been resolved is how to allow a plugin to have another plugin expose optional functionality.  For example I might has an analytics component interfaces with Google analytics but if a plugin is installed that supports Clicky then my plugin could give the user the option to use Clicky analytics instead.

That's very useful functionality and I agree with the approach.  But that's not the same use-case I was referring to.  Instead I'm referring to a system where a plugin A could identify that it needs plugin B, C and D and that it can then automatically download and install B, C and D (with user permission, of course.)  

Now that may be what westi was referring to when he said "I'm quite strongly against the idea of plugin dependencies. I would much prefer for plugins to be written using hooks and actions in the same way that WordPress is." If so, and respectfully speak, that's much like me saying "I'm quite strongly against people feeding the poor." It might be the case (I'm not, btw, just an example) but my potentially being against feeding the poor doesn't take away their need to eat.  Similarly even if someone is against plugin dependencies it doesn't mean those dependencies won't exist, they'll just be haphazardly managed.

This is about simplifying things for the end user.  Hasn't that been WordPress' calling card since day one?


More information about the wp-hackers mailing list