Skip to content

Commit

Permalink
Account for plugin dependencies when storing relevant plugin info
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Oct 21, 2024
1 parent 6cc4ba5 commit f385a43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions plugins/performance-lab/includes/admin/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* @return array{name: string, slug: string, short_description: string, requires: string|false, requires_php: string|false, requires_plugins: string[], download_link: string, version: string}|WP_Error Array of plugin data or WP_Error if failed.
*/
function perflab_query_plugin_info( string $plugin_slug ) {
$transient_key = 'perflab_plugins_info';
$transient_key = 'perflab_plugins_info-v2';
$plugins = get_transient( $transient_key );

if ( is_array( $plugins ) ) {
Expand Down Expand Up @@ -68,8 +68,9 @@ function perflab_query_plugin_info( string $plugin_slug ) {
return new WP_Error( 'no_plugins', __( 'No plugins found in the API response.', 'performance-lab' ) );
}

$plugins = array();
$standalone_plugins = array_flip( perflab_get_standalone_plugins() );
$plugins = array();
$standalone_plugins = array_flip( perflab_get_standalone_plugins() );
$standalone_plugins[] = 'optimization-detective'; // TODO: Programmatically discover the plugin dependencies and add them here.
foreach ( $response->plugins as $plugin_data ) {
if ( ! isset( $standalone_plugins[ $plugin_data['slug'] ] ) ) {
continue;
Expand Down
4 changes: 2 additions & 2 deletions plugins/performance-lab/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Performance plugin from the WordPress Performance Team, which is a collection of standalone performance features.
* Requires at least: 6.5
* Requires PHP: 7.2
* Version: 3.5.0
* Version: 3.5.1
* Author: WordPress Performance Team
* Author URI: https://make.wordpress.org/performance/
* License: GPLv2 or later
Expand All @@ -19,7 +19,7 @@
exit; // Exit if accessed directly.
}

define( 'PERFLAB_VERSION', '3.5.0' );
define( 'PERFLAB_VERSION', '3.5.1' );
define( 'PERFLAB_MAIN_FILE', __FILE__ );
define( 'PERFLAB_PLUGIN_DIR_PATH', plugin_dir_path( PERFLAB_MAIN_FILE ) );
define( 'PERFLAB_SCREEN', 'performance-lab' );
Expand Down
8 changes: 7 additions & 1 deletion plugins/performance-lab/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributors: wordpressdotorg
Tested up to: 6.7
Stable tag: 3.5.0
Stable tag: 3.5.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Tags: performance, site health, measurement, optimization, diagnostics
Expand Down Expand Up @@ -71,6 +71,12 @@ Contributions are always welcome! Learn more about how to get involved in the [C

== Changelog ==

= 3.5.1 =

**Bug Fixes**

* Account for plugin dependencies when storing relevant plugin info. ([1613](https://github.com/WordPress/performance/pull/1613))

= 3.5.0 =

**Enhancements**
Expand Down

0 comments on commit f385a43

Please sign in to comment.