[wp-hackers] auto-loading plugin deps ( prev: pluggable functions )

Mike Schinkel mike at newclarity.net
Mon Oct 29 06:38:30 UTC 2012

Hi Ben,

Thanks for the follow up.

On Oct 29, 2012, at 1:17 AM, Ben Lobaugh <lists at lobaugh.net> wrote:
> I think it would be great to see something similar to the enqueue scripts that you can pass required dependencies to, probably the slug of the plugin from the repo. If it does not exist then WP will disable the plugin and/or prompt you to install the dependency to enable the plugin.
> I have written a few library plugins as well and I can sympathize with the dependency management and load order of plugins. It is tricky with the current way WP works, but I do not think it would be too difficult to add something of that sort to the system. 

For clarity I was explicitly proposing simple PHP libraries and not wanting to open the can of worms that would be plugin dependency management.  After considering the problem for a long time I think the reason this has not gotten addressed yet for plugins is that plugins are for users not for developers. Developers need something lower level, i.e. ability to just safely "require()" a PHP library.  

There's really no need for tree-based dependency management and no need for all the complexity or overhead of making sure plugins are auto-downloaded, safely activated and then loaded in the correct order.  All that's needed is the ability to signal to WordPress that we need a bit of PHP code that someone else developed, named and versioned and that please WordPress only require() one of them.

> Check and see if anything like that exists on Trac,

My memory is that there's been several discussions about parts of this on trac or here on wp-hackers over the years.  I'm not particularly good at finding them though so I'll leave that to others to find.

> if not would you be interested in exploring a solution to patch core to do that with me?

I was proposing to offer a strawman patch if anyone of the core team would be open to considering it.  Otherwise it would rather be a waste of effort, I think.


More information about the wp-hackers mailing list