File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
plugins/optimization-detective Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -298,17 +298,18 @@ function od_maybe_render_installed_extensions_admin_notice(): void {
298298 echo wp_kses ( $ notice , wp_kses_allowed_html ( 'post ' ) );
299299}
300300/**
301- * Checks for installed extensions and displays an admin notice if none are found.
301+ * Checks for installed extensions and displays an admin notice once if none are found.
302302 *
303303 * @since n.e.x.t
304304 * @access private
305305 */
306306function od_maybe_check_installed_extensions (): void {
307- $ installed_extensions = get_transient ( 'od_installed_extensions ' );
308- if ( ! is_array ( $ installed_extensions ) ) {
309- $ installed_extensions = od_check_installed_extensions ();
310- set_transient ( 'od_installed_extensions ' , $ installed_extensions , WEEK_IN_SECONDS );
307+ if ( 1 === (int ) get_option ( 'od_installed_extensions_admin_notice ' , '0 ' ) ) {
308+ return ;
311309 }
310+ update_option ( 'od_installed_extensions_admin_notice ' , '1 ' );
311+
312+ $ installed_extensions = od_check_installed_extensions ();
312313 if ( count ( $ installed_extensions ) > 0 ) {
313314 return ;
314315 }
Original file line number Diff line number Diff line change 1818 OD_URL_Metrics_Post_Type::delete_all_posts ();
1919 wp_unschedule_hook ( OD_URL_Metrics_Post_Type::GC_CRON_EVENT_NAME );
2020
21- // Clear out site health check data .
21+ // Clear out options and transients .
2222 delete_option ( 'od_rest_api_unavailable ' );
23+ delete_option ( 'od_installed_extensions_admin_notice ' );
2324 delete_transient ( 'od_rest_api_health_check_response ' );
2425};
2526
You can’t perform that action at this time.
0 commit comments