mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-28 16:34:25 +00:00
Upgrade/Install: Avoid unnecessary db operations for plugin dependencies.
The Plugin Dependencies feature saves a list of any plugins that have been disabled due to unmet dependencies to a transient in order to give user feedback in the admin about what has taken place. This ensures that the DB operations to write this transient is skipped if there are no dependent plugins to deactivate. Props joemcgill, costdev, afragen. Fixes #60518. git-svn-id: https://develop.svn.wordpress.org/trunk@57617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -686,6 +686,11 @@ class WP_Plugin_Dependencies {
|
||||
);
|
||||
}
|
||||
|
||||
// Bail early if there are no dependents to deactivate.
|
||||
if ( empty( $dependents_to_deactivate ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$dependents_to_deactivate = array_unique( $dependents_to_deactivate );
|
||||
|
||||
deactivate_plugins( $dependents_to_deactivate );
|
||||
|
||||
Reference in New Issue
Block a user