From 46221f3bb533c7b1e51425d83dfd8797025d6b39 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Tue, 13 Feb 2024 13:02:08 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-plugin-dependencies.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-plugin-dependencies.php b/wp-includes/class-wp-plugin-dependencies.php index c8b9bebb52..d7332b4186 100644 --- a/wp-includes/class-wp-plugin-dependencies.php +++ b/wp-includes/class-wp-plugin-dependencies.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index b6f63b3278..46492bff1c 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.