• I am running a WP Multisite Network.

    I am curious to know how WordPress knows that a plugin is installed on a network site:

    • how does WP know that a plugin is Network Activated?
    • how does WP know that a plugin is activated at the site level?

    Does it record this instance in a DB Table somewhere? If so, which table and how is it tagged?

    Thanks for helping.

Viewing 1 replies (of 1 total)
  • First the How:

    Compare the two functions WordPress uses to detect active plugins:

    is_plugin_active_for_network

    and

    is_plugin_active

    Each offer up their array of active plugins from their respective options in the DB

    $plugins = get_site_option( 'active_sitewide_plugins');

    $plugins = get_option( 'active_plugins');

    And now the WHERE

    The “active_sitewide_plugins” DB entry occurs once alongside the other unique main site wp_options.

    Whereas active_plugins option will be in each set of wp_##_options added to each subsite added to your network.

    Oh, I forgot about the extras – WordPress can also auto-activate plugins dropped in to an mu-plugins (“Must Use”) folder if you have one of those in your wp-content alongside the regular plugins folder.

    There are also plugins you can drop directly into wp-content as “Drop In” plugins as well.

    There is no DB entry for Must Use and Drop In plugins, WordPress autoloads these without an option.

Viewing 1 replies (of 1 total)
  • The topic ‘How does WordPress Multisite know that a Plugin is installed?’ is closed to new replies.