• I recently deactivated a plugin which caused some dashboard pages to disappear including the plugins page. The only way I have figured how to fix is is by activating the plugin via code. The problem is the code activates the plugin on the individual blogs, I need the plugin to be activated on the networks plugin page.

    This is the code I used:

    function run_activate_plugin( $plugin ) {
        $current = get_option( 'active_plugins' );
        $plugin = plugin_basename( trim( $plugin ) );
    
        if ( !in_array( $plugin, $current ) ) {
            $current[] = $plugin;
            sort( $current );
            do_action( 'activate_plugin', trim( $plugin ) );
            update_option( 'active_plugins', $current );
            do_action( 'activate_' . trim( $plugin ) );
            do_action( 'activated_plugin', trim( $plugin) );
        }
    
        return null;
    }
    run_activate_plugin( 'plugin/plugin.php' );

    Would anyone be able to help me change the code so it activates the plugin on the network plugin page? I’ve tried trying to activate it in phpmyadmin but had no luck.

    Thanks

Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Whats the plugin?

    Thread Starter Steveningram

    (@steveningram)

    The plugin I disabled is admin help content
    https://premium.wpmudev.org/project/admin-help-content/

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Have you asked there, first of all?

    Also when you deactivated, did you also delete the files? I wonder if forcing the files to be gone would reset anything.

    Past that, you’d have to look into the database and find where the network activated plugins are stored (I THINK wp_options) and add it in there.

    Thread Starter Steveningram

    (@steveningram)

    I cant create an error log for some reason and no errors are displaying so I don’t know what the problem is.

    I’ve tried deleting the folder completely but still doesn’t work.

    I had a look in the options table but not all the network activated plugins are in there so not sure how else to activate it.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    You mean you turned on wp-debug in wp-config?

    Thread Starter Steveningram

    (@steveningram)

    I’ve manged to find a sitewide_active_plugins table. I’m guessing I can activate the plugin in there, any idea how I do it?

    There’s a few numbers at the start of each plugin like this: i:1331594012;s:39: not sure what there referring to though.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    The s:39 is a serialzation thing and … it’s a PITA to do, so I would just go hard core.

    Copy that content, save it to a text file, and blank it out in the DB. That will turn OFF all network activated plugins.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Network dashboard has disappeared after deactivating plugin.’ is closed to new replies.