[wp-trac] [WordPress Trac] #60491: Fix handling of plugins with unmet requirements

WordPress Trac noreply at wordpress.org
Sat Feb 10 03:32:46 UTC 2024


#60491: Fix handling of plugins with unmet requirements
--------------------------+-----------------------------
 Reporter:  azaozz        |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Future Release
Component:  Plugins       |     Version:  5.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+-----------------------------

Comment (by costdev):

 The main difference between "not loaded" and "deactivated" in the context
 of #60457 is that deactivating performs a DB write to `active_plugins`,
 whereas not loading just skips the `require_once`.

 To avoid a DB write, we would have to remove the automatic deactivation of
 dependents with unmet dependencies, at least from the frontend.

 Changing so that automatic deactivation is only performed on
 `plugins.php`, for example, will involve relocating
 `WP_Plugin_Dependencies::initialize()` to below `require ABSPATH . WPINC .
 '/vars.php';` in `wp-settings.php`. This means that `$pagenow` is defined
 and can therefore be used in a guard.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60491#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list