Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Implemented the suggested changes.
  • Loading branch information
narenin authored Sep 25, 2024
commit b4b4dfd05cbfad9bf8962b33b125bab29ff4b8da
8 changes: 6 additions & 2 deletions plugins/performance-lab/includes/admin/plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ function perflab_query_plugin_info( string $plugin_slug ) {
$transient_key = 'perflab_plugins_info';
$plugins = get_transient( $transient_key );

if ( is_array( $plugins ) && isset( $plugins[ $plugin_slug ] ) ) {
return $plugins[ $plugin_slug ];
if ( is_array( $plugins ) ) {
/* If the specific plugin_slug is not in the cache, return an error. */
if ( ! isset( $plugins[ $plugin_slug ] ) ) {
return new WP_Error( 'plugin_not_found', __( 'Plugin not found.', 'performance-lab' ) );
}
return $plugins[ $plugin_slug ]; // Return cached plugin info if found
}

$response = wp_remote_get( 'https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[author]=wordpressdotorg&request[tag]=performance&request[per_page]=100' );
Expand Down