From 20b0c741872aa2599028659a1618d0398c386ae9 Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Thu, 30 May 2024 15:13:58 +0000 Subject: [PATCH] Plugin Dependencies: Ensure dependency detection for newly installed plugins. Resolves a bug by first initializing in the AJAX callback `WP_Plugin_Dependencies::check_plugin_dependencies_during_ajax()`. More details: [57658] removed auto-deactivation and bootstrapping logic from the Plugin Dependencies feature. In doing so, initialization calls were added to various locations in Core to ensure dependencies were detected and ready to be checked. However, an initialization call was missed in the AJAX callback before checking plugin dependencies. This means that a plugin's dependencies may not be detected, and lead to a false positive, which in turn allows the user to click Activate only to see a failure message. Follow-up to [57658]. Props kevinwhoffman, costdev, afragen. Fixes #61294. git-svn-id: https://develop.svn.wordpress.org/trunk@58252 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-plugin-dependencies.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/wp-includes/class-wp-plugin-dependencies.php b/src/wp-includes/class-wp-plugin-dependencies.php index d28b401c4d..0850ffd2a2 100644 --- a/src/wp-includes/class-wp-plugin-dependencies.php +++ b/src/wp-includes/class-wp-plugin-dependencies.php @@ -488,6 +488,7 @@ class WP_Plugin_Dependencies { $status['activateUrl'] = add_query_arg( array( 'networkwide' => 1 ), $status['activateUrl'] ); } + self::initialize(); $dependencies = self::get_dependencies( $plugin_file ); if ( empty( $dependencies ) ) { $status['message'] = __( 'The plugin has no required plugins.' );