Skip to content

Commit 7b1469a

Browse files
committed
Make sure no errors are displayed when Query Monitor activation query fails
1 parent 11e51be commit 7b1469a

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
@@ -121,12 +121,16 @@ function register_sqlite_enhancements_for_query_monitor() {
121121

122122
$query_monitor_active = false;
123123
try {
124-
$value = $wpdb->get_row(
124+
// Make sure no errors are displayed when the query fails.
125+
$show_errors = $wpdb->hide_errors();
126+
$value = $wpdb->get_row(
125127
$wpdb->prepare(
126128
"SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
127129
'active_plugins'
128130
)
129131
);
132+
$wpdb->show_errors( $show_errors );
133+
130134
if ( null !== $value ) {
131135
$query_monitor_active = in_array(
132136
'query-monitor/query-monitor.php',

0 commit comments

Comments
 (0)