WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#15709 closed defect (bug) (fixed)

Plugin deletion when running multisite

Reported by: flashingcursor Owned by: PeteMall
Milestone: 3.1 Priority: normal
Severity: normal Version: 3.1
Component: Network Admin Keywords: has-patch i18n-change
Focuses: multisite Cc:

Description

When you try to delete a plugin at the network admin level and that plugin is active on a site, it seems to fail deletion without warning.

Network deactivate doesn't work properly, nor is it an option unless you've network activated it first. Since plugins can be active at the site level and not network activated, the only way to delete a plugin is to find the site that has it activated, deactivate it, then delete it.

This should probably act the same way for themes and plugins:

Network admin: Delete indiscriminately with warning
Network admin: Enable / Disable network wide
Site admin: No delete option when network is enabled
Site admin: activate / deactivate if have cap

Still a lot of loose ends with network admin of plugins and themes...

Attachments (5)

plugin-deletion.png (70.3 KB) - added by PeteMall 5 years ago.
15709.diff (1.7 KB) - added by PeteMall 5 years ago.
15709.2.diff (2.6 KB) - added by PeteMall 5 years ago.
15709.3.diff (3.4 KB) - added by PeteMall 5 years ago.
New patch removes the delete action link from the network admin if the plugin is active on the main site. It also removes the plugin(s) from the deletion list for the bulk actions and shows an error if no other plugin was selected for bulk-deletion.
15709.4.diff (3.3 KB) - added by PeteMall 5 years ago.
Updated error string

Download all attachments as: .zip

Change History (18)

comment:1 @PeteMall5 years ago

There is a pending patch for this on another ticket. I'll be addressing these issues later today.

comment:2 @nacin5 years ago

  • Milestone changed from Awaiting Review to 3.1

comment:3 @ocean905 years ago

PeteMall: Something new?

comment:4 @PeteMall5 years ago

  • Owner set to PeteMall
  • Status changed from new to accepted

@PeteMall5 years ago

@PeteMall5 years ago

comment:5 @PeteMall5 years ago

validate_active_plugins() should only validate network activated plugins in the network admin. This will avoid the error message displayed in the network admin for a deleted plugin that was activated on the main site.

@PeteMall5 years ago

comment:6 @PeteMall5 years ago

rborem: validate_active_plugins() should have some new args rather than doing is_network_admin() and is_super_admin() checks

Version 0, edited 5 years ago by PeteMall (next)

comment:7 @nacin5 years ago

How to fix this:

  1. Hide the delete link if the plugin is active on the main site.
  1. On the plugin deletion confirmation screen, if is_network_admin() && ! is_network_only_plugin(), include a div class="error" with a warning similar to the JS confirmation dialog on #15707.

@PeteMall5 years ago

New patch removes the delete action link from the network admin if the plugin is active on the main site. It also removes the plugin(s) from the deletion list for the bulk actions and shows an error if no other plugin was selected for bulk-deletion.

@PeteMall5 years ago

Updated error string

comment:8 @PeteMall5 years ago

  • Keywords has-patch added

comment:9 @nacin5 years ago

  • Keywords i18n-change added

comment:10 @ryan5 years ago

(In [17033]) Remove the delete action link from the network admin if the plugin is active on the main site. Remove the plugin(s) from the deletion list for the bulk actions and shows an error if no other plugin was selected for bulk-deletion. Props PeteMall. see #15709

comment:11 @ryan5 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

comment:12 @nacin5 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Need to warn super admins on the plugin deletion screen that the plugin may be activated elsewhere. Only if ! is_network_only plugin.

Handling.

comment:13 @nacin5 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [17036]) Network Admin: Show a warning when deleting non-network-only plugins, as they may be activated on subsites. fixes #15709.

Note: See TracTickets for help on using tickets.