Skip to content

Commit

Permalink
Merge pull request #1613 from WordPress/fix/storing-standalone-plugin…
Browse files Browse the repository at this point in the history
…-info

Account for plugin dependencies when storing relevant plugin info
  • Loading branch information
westonruter authored Oct 21, 2024
2 parents 6cc4ba5 + cf0d3f2 commit 70ca5b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
7 changes: 5 additions & 2 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 @@ -69,7 +69,10 @@ function perflab_query_plugin_info( string $plugin_slug ) {
}

$plugins = array();
$standalone_plugins = array_flip( perflab_get_standalone_plugins() );
$standalone_plugins = array_merge(
array_flip( perflab_get_standalone_plugins() ),
array( 'optimization-detective' => array() ) // 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 70ca5b5

Please sign in to comment.