Opened 12 years ago
Closed 11 years ago
#24178 closed defect (bug) (fixed)
An active plugin which switches to network-only is impossible to deactivate
Reported by: | johnbillion | Owned by: | |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | major | Version: | |
Component: | Plugins | Keywords: | has-patch commit |
Focuses: | administration, multisite | Cc: |
Description
This might sound like an edge case, but this issue affects W3 Total Cache (which is highly popular) and will affect any other plugin that switches to being a network-only plugin as part of a plugin update.
Steps to reproduce:
- Write a nice plugin and activate it on one of your sites on Multisite.
- Decide that your plugin should only be network-activated. Add the
Network: true
header to the plugin. - Visit the Plugins screen of the site that your plugin is active on. Note that the plugin is nowhere to be seen, even though the plugin is active.
Real-world example: The W3 Total Cache plugin was updated recently (or not so recently) to make it a network-only plugin (by adding the header above). The plugin gets hidden from the list of active Plugins on any site that it was individually activated on. This makes it impossible to deactivate. Even if you activate it network-wide and then deactivate it, the plugin remains active on the site it was originally active on.
Solution: Active plugins should always be shown on the Plugins screen of individual sites if they are active on the site but not active network-wide.
Loosely related: #18967
Attachments (1)
Change History (7)
#1
@
11 years ago
- Focuses administration multisite added
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 3.9
- Severity changed from normal to major
#2
@
11 years ago
- Keywords has-patch added; needs-patch removed
24178.patch is completely untested as I don't have access to a multisite install at the moment, but I think that fixes it.
#4
@
11 years ago
I've just tested and confirmed the patch to work. Steps I took:
- Created test plugin:
<?php /* * Plugin Name: Network Only Test Plugin */ // Just a test plugin for network activation only
- Activated the plugin on a site in the network
- Added the
Network: true
header:<?php /* * Plugin Name: Network Only Test Plugin * Network: true */ // Just a test plugin for network activation only
- Uploaded the modified version (imitating a plugin update)
- The plugin remained visible and active on the site it was activated on in 1.
- Deactivated the plugin and it immediately disappeared, as expected for a Network only plugin.
Ouch. This is severe, let's fix this.