Opened 6 months ago
Closed 6 months ago
#60688 closed defect (bug) (wontfix)
Plugin Dependencies Not Enforced After Manual Code Modification to Add Dependency
Reported by: | adarshposimyth | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 6.5 |
Component: | Plugins | Keywords: | |
Focuses: | administration | Cc: |
Description
Expected Behavior: A plugin with specified dependencies should only activate if all dependencies are installed and active.
Observed Behavior: After adding dependency declarations within a plugin's code, the plugin remains active (if it was already active when code changes were made not as plugin update even if its dependencies are not met. )
The plugin does not adhere to the intended dependency flow and must be manually deactivated for changes to take effect.
Steps to reproduce :
1) Install the beta version of WordPress on a test environment.
2) Install two plugins:
Plugin A (the plugin you'll modify)
Plugin B (a dependency for Plugin A)
3)Edit the code of Plugin A: Include code that explicitly declares Plugin B as a dependency.
Hi @adarshposimyth, welcome back to Trac and thanks for opening this ticket!
This is actually the new intended behaviour after [57658], as consensus determined that automatic deactivation was not desired. This is also consistent with the behaviour when the minimum required PHP version has increased for an active plugin.
See #60465, where the pull request includes new notices to make it clear to users that if a plugin was active and its required plugins are no longer met, it may not function correctly until its required plugins are installed and activated.