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.
Built from https://develop.svn.wordpress.org/trunk@58252


git-svn-id: http://core.svn.wordpress.org/trunk@57715 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2024-05-30 15:15:10 +00:00
parent 4ddc6531d5
commit 568d9ad5a2
2 changed files with 2 additions and 1 deletions

View File

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

View File

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