Make WordPress Core

Opened 5 weeks ago

Last modified 4 weeks ago

#64493 assigned defect (bug)

Plugin dependencies: better messaging or management of plugin active states

Reported by: joedolson's profile joedolson Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.5
Component: Plugins Keywords: has-patch
Focuses: administration, ui-copy Cc:

Description

Currently, if a plugin cannot be deleted due to plugin dependencies, it has a single message that shows "Note: This plugin cannot be deactivated or deleted until the plugins that require it are deactivated or deleted."

The message is inaccurate in two ways - you cannot delete a plugin unless the plugins that require it are deleted; deactivating is not sufficient; and it does not reflect the current state of the plugin. If the plugin with dependents is already deactivated, it still states that it cannot be deactivated.

Much of the structure of plugin dependencies seems to ignore whether a referenced plugin is active or not.

The checks are dependent on get_dependent_names(), which does not contain any reference to whether or not a plugin is active.

At minimum, the messages should be improved so that they accurately reflect what needs to happen; alternately, the messages and states should be matched so that the possible scenarios are reflected more accurately.

Attachments (2)

2026-01-13-13-23-42@2x.png (142.3 KB) - added by johnbillion 5 weeks ago.
Screenshot of a misleading dependency message
64493-fix-plugin-dependency-note.patch (918 bytes) - added by solankisoftware 4 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 @joedolson
5 weeks ago

  • Component changed from General to Plugins

#2 @joedolson
5 weeks ago

Related, but not the same: #64475

@johnbillion
5 weeks ago

Screenshot of a misleading dependency message

#3 @solankisoftware
4 weeks ago

  • Keywords has-patch added

The dependency note shown in the Plugins list table currently states that both
deactivation and deletion are blocked, which is misleading.

This patch updates add_dependents_to_dependency_plugin_row() to distinguish
between:

  • blocking deactivation when dependent plugins are active, and
  • blocking deletion when dependents exist but are inactive.

The change reuses WP_Plugin_Dependencies::has_active_dependents() and is
messaging-only.
Patch attached.

Note: See TracTickets for help on using tickets.