From 70f90b6c4809b81b9a11277af7a8c51a214e3b45 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Mon, 11 Nov 2024 09:40:47 -0800 Subject: [PATCH] Revert "Remove hard-coded reference to embed-optimizer" This reverts commit b012d8d9683ee0592946d2da2f1bbd94b04311f1. --- plugins/performance-lab/includes/admin/plugins.php | 8 ++------ plugins/performance-lab/load.php | 4 +--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/performance-lab/includes/admin/plugins.php b/plugins/performance-lab/includes/admin/plugins.php index 155f2725e0..2b77ffb581 100644 --- a/plugins/performance-lab/includes/admin/plugins.php +++ b/plugins/performance-lab/includes/admin/plugins.php @@ -325,12 +325,8 @@ function perflab_install_and_activate_plugin( string $plugin_slug, array &$proce } // Add recommended plugins (soft dependencies) to the list of plugins installed and activated. - $standalone_plugin_data = perflab_get_standalone_plugin_data(); - if ( isset( $standalone_plugin_data[ $plugin_slug ]['suggest'] ) ) { - $plugin_data['requires_plugins'] = array_merge( - $plugin_data['requires_plugins'], - $standalone_plugin_data[ $plugin_slug ]['suggest'] - ); + if ( 'embed-optimizer' === $plugin_slug ) { + $plugin_data['requires_plugins'][] = 'optimization-detective'; } // Install and activate plugin dependencies first. diff --git a/plugins/performance-lab/load.php b/plugins/performance-lab/load.php index 50675a9df3..304089d13c 100644 --- a/plugins/performance-lab/load.php +++ b/plugins/performance-lab/load.php @@ -83,7 +83,7 @@ function perflab_render_generator(): void { * * @since 3.0.0 * - * @return array Associative array of $plugin_slug => $plugin_data pairs. + * @return array Associative array of $plugin_slug => $plugin_data pairs. */ function perflab_get_standalone_plugin_data(): array { /* @@ -91,7 +91,6 @@ function perflab_get_standalone_plugin_data(): array { * Supported keys per plugin are: * - 'constant' (string, required) * - 'experimental' (boolean, optional) - * - 'suggest' (string[], optional) */ return array( 'auto-sizes' => array( @@ -104,7 +103,6 @@ function perflab_get_standalone_plugin_data(): array { 'embed-optimizer' => array( 'constant' => 'EMBED_OPTIMIZER_VERSION', 'experimental' => true, - 'suggest' => array( 'optimization-detective' ), ), 'image-prioritizer' => array( 'constant' => 'IMAGE_PRIORITIZER_VERSION',