[wp-hackers] Activating another Plugin when Activating a Plugin

Mohammad Jangda batmoo at gmail.com
Fri Dec 10 17:28:58 UTC 2010

On Fri, Dec 10, 2010 at 12:02 PM, Scott Kingsley Clark <scott at skcdev.com>wrote:

> Just checking in here, has anyone here ever attempted to activate
> another plugin (or ensure it's activated, if not, then activate it)
> within a plugin? For example, when activating Plugin B, the Plugin B
> will activate Plugin A first (or if Plugin A is activated, continue;
> if Plugin A doesn't exist then send error to browser), then complete
> the rest of Plugin B specific activation.

It's doable. You can use the is_plugin_active (
http://codex.wordpress.org/Function_Reference/is_plugin_active) and
functions. (Though, it might be better to do a function_exists /
class_exists check instead if you already have specifics of the plugin).

scribu has a sweet plugin that handles dependencies (

I wrote a similar one too that installs and activates required plugins for
you (but it requires action from the user to install/activate the
dependencies) (

More information about the wp-hackers mailing list