diff --git a/plugins/performance-lab/includes/admin/plugins.php b/plugins/performance-lab/includes/admin/plugins.php index 7093000615..2b77ffb581 100644 --- a/plugins/performance-lab/includes/admin/plugins.php +++ b/plugins/performance-lab/includes/admin/plugins.php @@ -71,7 +71,7 @@ function perflab_query_plugin_info( string $plugin_slug ) { $plugins = array(); $standalone_plugins = array_merge( array_flip( perflab_get_standalone_plugins() ), - array( 'optimization-detective' => array() ) // TODO: Programmatically discover the plugin dependencies and add them here. + array( 'optimization-detective' => array() ) // TODO: Programmatically discover the plugin dependencies and add them here. See . ); foreach ( $response->plugins as $plugin_data ) { if ( ! isset( $standalone_plugins[ $plugin_data['slug'] ] ) ) { @@ -324,6 +324,11 @@ function perflab_install_and_activate_plugin( string $plugin_slug, array &$proce return $plugin_data; } + // Add recommended plugins (soft dependencies) to the list of plugins installed and activated. + if ( 'embed-optimizer' === $plugin_slug ) { + $plugin_data['requires_plugins'][] = 'optimization-detective'; + } + // Install and activate plugin dependencies first. foreach ( $plugin_data['requires_plugins'] as $requires_plugin_slug ) { $result = perflab_install_and_activate_plugin( $requires_plugin_slug );