Skip to content

Commit e6135b8

Browse files
authored
Use function_exists( 'tests_add_filter' ) instead of class_exists( 'Test_OD_Optimization' )
1 parent 7343e6b commit e6135b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/optimization-detective/optimization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function od_maybe_add_template_output_buffer_filter(): void {
8686
'reason' => __( 'Page is not optimized because od_can_optimize_response() returned false. This can be overridden with the od_can_optimize_response filter.', 'optimization-detective' ),
8787
),
8888
array(
89-
'test' => ! od_is_rest_api_unavailable() || ( wp_get_environment_type() === 'local' && ! class_exists( 'Test_OD_Optimization' ) ),
89+
'test' => ! od_is_rest_api_unavailable() || ( wp_get_environment_type() === 'local' && ! function_exists( 'tests_add_filter' ) ),
9090
'reason' => __( 'Page is not optimized because the REST API for storing URL Metrics is not available.', 'optimization-detective' ),
9191
),
9292
array(

0 commit comments

Comments
 (0)