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 @@ -99,6 +99,20 @@ function register_sqlite_enhancements_for_query_monitor() {
9999 return ;
100100}
101101
102+ // Check if Query Monitor is installed.
103+ if ( defined ( 'WP_PLUGIN_DIR ' ) ) {
104+ $ plugins_dir = WP_PLUGIN_DIR ;
105+ } else {
106+ $ plugins_dir = WP_CONTENT_DIR . '/plugins ' ;
107+ }
108+
109+ $ qm_dir = "{$ plugins_dir }/query-monitor " ;
110+ $ qm_php = "{$ qm_dir }/classes/PHP.php " ;
111+
112+ if ( ! is_readable ( $ qm_php ) ) {
113+ return ;
114+ }
115+
102116// Check if Query Monitor is active.
103117if ( null === $ wpdb ->options ) {
104118 global $ table_prefix ;
@@ -128,20 +142,7 @@ function register_sqlite_enhancements_for_query_monitor() {
128142 return ;
129143}
130144
131- // Determine the plugins directory.
132- if ( defined ( 'WP_PLUGIN_DIR ' ) ) {
133- $ plugins_dir = WP_PLUGIN_DIR ;
134- } else {
135- $ plugins_dir = WP_CONTENT_DIR . '/plugins ' ;
136- }
137-
138- // Load Query Monitor (as per the original "db.php" file).
139- $ qm_dir = "{$ plugins_dir }/query-monitor " ;
140- $ qm_php = "{$ qm_dir }/classes/PHP.php " ;
141-
142- if ( ! is_readable ( $ qm_php ) ) {
143- return ;
144- }
145+ // Load Query Monitor eagerly (as per the original "db.php" file).
145146require_once $ qm_php ;
146147
147148if ( ! QM_PHP ::version_met () ) {
You can’t perform that action at this time.
0 commit comments