WordPress.org

Ready to get started?Download WordPress

Forums

Network dashboard has disappeared after deactivating plugin. (8 posts)

  1. Steveningram
    Member
    Posted 5 months ago #

    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

  2. Whats the plugin?

  3. Steveningram
    Member
    Posted 5 months ago #

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

  4. 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.

  5. Steveningram
    Member
    Posted 5 months ago #

    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.

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

  7. Steveningram
    Member
    Posted 5 months ago #

    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.

  8. 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.

Reply

You must log in to post.

About this Topic