File tree Expand file tree Collapse file tree
integrations/query-monitor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,20 @@ function register_sqlite_enhancements_for_query_monitor() {
9595 return ;
9696}
9797
98+ // Check if Query Monitor is installed.
99+ if ( defined ( 'WP_PLUGIN_DIR ' ) ) {
100+ $ plugins_dir = WP_PLUGIN_DIR ;
101+ } else {
102+ $ plugins_dir = WP_CONTENT_DIR . '/plugins ' ;
103+ }
104+
105+ $ qm_dir = "{$ plugins_dir }/query-monitor " ;
106+ $ qm_php = "{$ qm_dir }/classes/PHP.php " ;
107+
108+ if ( ! is_readable ( $ qm_php ) ) {
109+ return ;
110+ }
111+
98112// Check if Query Monitor is active.
99113if ( null === $ wpdb ->options ) {
100114 global $ table_prefix ;
@@ -124,20 +138,7 @@ function register_sqlite_enhancements_for_query_monitor() {
124138 return ;
125139}
126140
127- // Determine the plugins directory.
128- if ( defined ( 'WP_PLUGIN_DIR ' ) ) {
129- $ plugins_dir = WP_PLUGIN_DIR ;
130- } else {
131- $ plugins_dir = WP_CONTENT_DIR . '/plugins ' ;
132- }
133-
134- // Load Query Monitor (as per the original "db.php" file).
135- $ qm_dir = "{$ plugins_dir }/query-monitor " ;
136- $ qm_php = "{$ qm_dir }/classes/PHP.php " ;
137-
138- if ( ! is_readable ( $ qm_php ) ) {
139- return ;
140- }
141+ // Load Query Monitor eagerly (as per the original "db.php" file).
141142require_once $ qm_php ;
142143
143144if ( ! QM_PHP ::version_met () ) {
You can’t perform that action at this time.
0 commit comments