Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#60688 closed defect (bug) (wontfix)

Plugin Dependencies Not Enforced After Manual Code Modification to Add Dependency

Reported by: adarshposimyth's profile 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.

https://i.postimg.cc/4NbDkgG4/image.png

Change History (3)

#1 @costdev
5 months ago

  • Component changed from General to Plugins
  • Version set to trunk

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.

#2 @adarshposimyth
5 months ago

Thank you. I see all cases covered and working as expected. I think this ticket could be closed as it doesn't require further actions.

#3 @costdev
5 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @adarshposimyth!

Note: See TracTickets for help on using tickets.