Skip to content

Commit 9e4cc6f

Browse files
committed
Register SQLite enhancements for Query Monitor when booting it, not in the plugin
This makes the enhancements work in WordPress Playground, as Playground only loads the SQLite driver and not all of the SQLite Database Inegration plugin.
1 parent c71e5f6 commit 9e4cc6f

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

integrations/query-monitor/boot.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,12 @@
125125

126126
// 5. Mark the Query Monitor integration as loaded.
127127
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)