WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to install extra plugins on certain plugin installation/activation? I tried to install them using:

$upgrader = new Plugin_Upgrader(); 

But it's not working. Any suggestions? Thanks in advance!

share|improve this question
Yes, post more details. What is Plugin_Updater? See How to Ask. – brasofilo Sep 24 '13 at 12:24
There is nothing worse than plugins relying on other plugins and/or forcing things upon the user. Why not just merge them into a single plugin? – Twifty Sep 24 '13 at 12:25

Yes, though its slightly complicated by this bug, which I discuss on this post (original: http://stephenharris.info/deactivate-other-plug-ins-on-deactivation/) They actually handle deactivating, rather than activating, but the principles are the same.

At time of writing that trac ticket has a patch committed for 3.7.

The following should activate 'B' when 'A' is activated:

//This all goes inside Plugin A.

//When A is activated. Activate B.
function my_plugin_A_activate(){
    $dependent = 'B/B.php';
    if( !is_plugin_active( $dependent ) ){
         add_action('update_option_active_plugins', 'my_activate_dependent_B');

function my_activate_dependent_B(){
    $dependent = 'B/B.php';
    activate_plugins( $dependent );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.