Opened 9 years ago
Closed 8 years ago
#35145 closed defect (bug) (wontfix)
Plugins: introduce a check for activated plugins when deleting plugins in the same directory
Reported by: | afercia | Owned by: | swissspidy |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.4 |
Component: | Plugins | Keywords: | has-patch needs-testing 2nd-opinion |
Focuses: | ui, multisite | Cc: |
Description
Noticed while investigating on #34439
Sometimes, plugin authors bundle multiple plugins in the same directory. They shouldn't to this in the first place, but they do.
When deleting one of the "same directory" plugins, WordPress handles this displaying a warning with a message that correctly lists all the plugins that are going to be deleted:
By the way, if one of these plugin is activated, there's no warning and users can actually delete an activated plugin. This should definitely be avoided.
Also, needs to check what happens on multisite installations :)
cc @swissspidy
Attachments (2)
Change History (10)
#3
@
9 years ago
35145.2.diff is a new patch that prevents bulk deletion of plugins when there's at least 1 active plugin the same folder.
For this, I moved the logic into a new _is_plugin_bundle_active()
function.
Patch in action:
#4
@
9 years ago
- Keywords 2nd-opinion added
Bundled plugins aren't that common, not sure if this is worth fixing.
#5
@
9 years ago
Bundled plugins aren't that common, not sure if this is worth fixing.
I tend to agree. I'm not sure if it's already the case, but on the 'Are you sure?' page maybe it could be listed there if they're active instead? Just append an (Active)
to it or something? (if someone really feels that this needs "fixing")
#6
@
9 years ago
On the 'Are you sure?' page maybe it could be listed there if they're active instead? Just append an
(Active)
to it or something? (if someone really feels that this needs "fixing")
When someone ignores that hint and still deletes the plugin, he'll still get the same error message. With the current patch we avoid getting into this trouble.
With 35145.diff, no "Delete" link is added when there's at least 1 active plugin in the same directory (or "bundle").
There's also a check for multisite, just needs some testing there and for bulk edit as well.
Screenshot:
Plugin A, B and C are all in the same folder under
wp-content/plugins/bundle/
and A is active. The others can't be selected for deletion.