Skip to content

Commit 66ae73b

Browse files
authored
Make Query Monitor enhancements work in Playground (#217)
This PR moves the registration of the SQLite enhancements for Query Monitor to the Query Monitor boot process to make them work in Playground, as Playground only loads the SQLite driver and not all the SQLite Database Integration plugin. <img width="737" height="435" alt="Screenshot 2025-07-25 at 13 27 21" src="https://github.com/user-attachments/assets/23dab435-b2c7-4194-a360-aea17a049772" />
1 parent d2c99e7 commit 66ae73b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

integrations/query-monitor/boot.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
}
5757
}
5858

59+
global $wpdb;
5960
if ( ! isset( $wpdb ) ) {
6061
return;
6162
}
@@ -124,3 +125,12 @@
124125

125126
// 5. Mark the Query Monitor integration as loaded.
126127
define( 'SQLITE_QUERY_MONITOR_LOADED', true );
128+
129+
// 6. Register the SQLite enhancements for Query Monitor.
130+
function register_sqlite_enhancements_for_query_monitor() {
131+
require_once __DIR__ . '/plugin.php';
132+
}
133+
134+
if ( function_exists( 'add_action' ) ) {
135+
add_action( 'plugins_loaded', 'register_sqlite_enhancements_for_query_monitor' );
136+
}

load.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,3 @@
2626
require_once __DIR__ . '/deactivate.php';
2727
require_once __DIR__ . '/admin-notices.php';
2828
require_once __DIR__ . '/health-check.php';
29-
30-
// Query Monitor integration:
31-
if ( defined( 'SQLITE_QUERY_MONITOR_LOADED' ) && SQLITE_QUERY_MONITOR_LOADED ) {
32-
require_once __DIR__ . '/integrations/query-monitor/plugin.php';
33-
}

0 commit comments

Comments
 (0)