File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
plugins/performance-lab/includes/server-timing Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,17 @@ function perflab_register_default_server_timing_before_template_metrics(): void
49
49
'measure_callback ' => static function ( $ metric ) use ( $ current_function ): void {
50
50
// This should never happen, but some odd database implementations may be doing it wrong.
51
51
if ( ! isset ( $ GLOBALS ['wpdb ' ]->queries ) || ! is_array ( $ GLOBALS ['wpdb ' ]->queries ) ) {
52
+ wp_trigger_error (
53
+ $ current_function ,
54
+ esc_html (
55
+ sprintf (
56
+ /* translators: 1: before-template-db-queries, 2: $wpdb->queries */
57
+ __ ( 'Unable to compute server timing for "%1$s" because %2$s is not an array. ' , 'performance-lab ' ),
58
+ 'before-template-db-queries ' ,
59
+ '$wpdb->queries '
60
+ )
61
+ )
62
+ );
52
63
return ;
53
64
}
54
65
You can’t perform that action at this time.
0 commit comments