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.

Built from https://develop.svn.wordpress.org/trunk@57617


git-svn-id: http://core.svn.wordpress.org/trunk@57118 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2024-02-13 13:02:08 +00:00
parent 62afd089f3
commit 46221f3bb5
2 changed files with 6 additions and 1 deletions

View File

@ -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 );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57616';
$wp_version = '6.5-alpha-57617';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.