Skip to content

Commit 2a344c9

Browse files
committed
Adjust transient expiration time based on plugin availability
1 parent 89b4c7f commit 2a344c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/performance-lab/includes/admin/plugins.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ function perflab_query_plugin_info( string $plugin_slug ) {
113113
'message' => __( 'Plugin not found in API response.', 'performance-lab' ),
114114
),
115115
);
116-
}
117116

118-
set_transient( $transient_key, $plugins, HOUR_IN_SECONDS );
117+
set_transient( $transient_key, $plugins, MINUTE_IN_SECONDS );
118+
} else {
119+
set_transient( $transient_key, $plugins, HOUR_IN_SECONDS );
120+
}
119121

120122
if ( isset( $plugins[ $plugin_slug ]['error'] ) ) {
121123
return new WP_Error(

0 commit comments

Comments
 (0)