[wp-hackers] Plugin dependency checking

scribu scribu at gmail.com
Fri Jun 12 07:28:20 GMT 2009

> Thus if a sub-plugin is dependent on more than one other plugins, it may
> choose ONE other plugin to be its Master.

I don't think choosing ONE master plugin is useful. Instead, each plugin
should have a button that, when pressed, simply computes the list of other
plugins that depend on the plugin at hand. That button may be the
"Deactivate" link or a new one.

1) via good old plugin_basename.  "myplugin/myplugin.php" is well
> established in WP, and **by definition** unique.

The Extend slug is also unique.

2) A plugin can register itself as "pluggable" via a function. In the
> process it establishes its own "master" tag for use by dependents.  E.g.
>        register_master_plugin( __FILE__, 'myplugin' );

If we use either of these methods, there will be no way to retrieve the
normal plugin name that you mention here:

2) If a user tries to activate a Dependent plugin and the master is missing
> or inactive, we need some way to tell the user "You also need Plugin X".
>  That is, the plugin name -- not just the "id tag" discussed earlier.  Maybe
> sub plugins can define their own custom error message for this?

Error messages should be standard.


More information about the wp-hackers mailing list