Skip to content

Commit 7b32fd0

Browse files
committed
Make sure no errors are displayed when Query Monitor activation query fails
1 parent 3a9b4b8 commit 7b32fd0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

integrations/query-monitor/boot.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,16 @@ function register_sqlite_enhancements_for_query_monitor() {
117117

118118
$query_monitor_active = false;
119119
try {
120-
$value = $wpdb->get_row(
120+
// Make sure no errors are displayed when the query fails.
121+
$show_errors = $wpdb->hide_errors();
122+
$value = $wpdb->get_row(
121123
$wpdb->prepare(
122124
"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
123125
'active_plugins'
124126
)
125127
);
128+
$wpdb->show_errors( $show_errors );
129+
126130
if ( null !== $value ) {
127131
$query_monitor_active = in_array(
128132
'query-monitor/query-monitor.php',

0 commit comments

Comments
 (0)