Skip to content

Commit 9866af6

Browse files
committed
Add QM version detection to load appropriate integration
Detect QM 4.0+ via the QM_VERSION constant and load the collector-based integration. Fall back to the existing HTML output override for QM 3.x.
1 parent ee854d2 commit 9866af6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • packages/plugin-sqlite-database-integration/integrations/query-monitor

packages/plugin-sqlite-database-integration/integrations/query-monitor/boot.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ function register_sqlite_enhancements_for_query_monitor() {
6767
return;
6868
}
6969

70-
require_once __DIR__ . '/plugin.php';
70+
// QM 4.0+ uses client-side Preact rendering — use collector + JS injection.
71+
// QM 3.x uses server-side PHP rendering — use HTML output override.
72+
if ( defined( 'QM_VERSION' ) && version_compare( QM_VERSION, '4.0.0', '>=' ) ) {
73+
require_once __DIR__ . '/collector.php';
74+
} else {
75+
require_once __DIR__ . '/plugin.php';
76+
}
7177

7278
if ( ! defined( 'SQLITE_QUERY_MONITOR_LOADED' ) ) {
7379
define( 'SQLITE_QUERY_MONITOR_LOADED', true );

0 commit comments

Comments
 (0)