Query Monitor - Version 3.6.6

Version Description

Download this release

Release Info

Developer johnbillion
Plugin Icon 128x128 Query Monitor
Version 3.6.6
Comparing to
See all releases

Code changes from version 3.6.5 to 3.6.6

assets/query-monitor-dark.css CHANGED
@@ -342,7 +342,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
342
  display: flex !important;
343
  flex-shrink: 0 !important;
344
  height: 27px !important;
345
- padding: 0 0 0 5px !important;
346
  -moz-user-select: none !important;
347
  -ms-user-select: none !important;
348
  -webkit-user-select: none !important;
@@ -455,6 +455,10 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
455
  height: auto !important;
456
  }
457
 
 
 
 
 
458
  #query-monitor-main #qm-panel-menu li button {
459
  background: #23282d !important;
460
  border-bottom: 1px solid #32373c !important;
@@ -462,7 +466,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
462
  color: #eaeef2 !important;
463
  cursor: pointer !important;
464
  display: block !important;
465
- padding: 8px 28px 8px 6px !important;
466
  position: relative !important;
467
  text-decoration: none !important;
468
  width: 100% !important;
@@ -485,6 +489,10 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
485
  text-shadow: 0 -1px 1px #006291, 1px 0 1px #006291, 0 1px 1px #006291, -1px 0 1px #006291 !important;
486
  }
487
 
 
 
 
 
488
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
489
  background: #32373c !important;
490
  color: #eaeef2 !important;
@@ -890,6 +898,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
890
  right: 5px !important;
891
  text-align: center !important;
892
  top: 5px !important;
 
893
  width: 18px !important;
894
  }
895
 
342
  display: flex !important;
343
  flex-shrink: 0 !important;
344
  height: 27px !important;
345
+ padding: 0 0 0 10px !important;
346
  -moz-user-select: none !important;
347
  -ms-user-select: none !important;
348
  -webkit-user-select: none !important;
455
  height: auto !important;
456
  }
457
 
458
+ #query-monitor-main #qm-panel-menu li ul {
459
+ display: none !important;
460
+ }
461
+
462
  #query-monitor-main #qm-panel-menu li button {
463
  background: #23282d !important;
464
  border-bottom: 1px solid #32373c !important;
466
  color: #eaeef2 !important;
467
  cursor: pointer !important;
468
  display: block !important;
469
+ padding: 6px 32px 6px 10px !important;
470
  position: relative !important;
471
  text-decoration: none !important;
472
  width: 100% !important;
489
  text-shadow: 0 -1px 1px #006291, 1px 0 1px #006291, 0 1px 1px #006291, -1px 0 1px #006291 !important;
490
  }
491
 
492
+ #query-monitor-main #qm-panel-menu li.qm-current-menu ul {
493
+ display: block !important;
494
+ }
495
+
496
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
497
  background: #32373c !important;
498
  color: #eaeef2 !important;
898
  right: 5px !important;
899
  text-align: center !important;
900
  top: 5px !important;
901
+ user-select: none;
902
  width: 18px !important;
903
  }
904
 
assets/query-monitor.css CHANGED
@@ -342,7 +342,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
342
  display: flex !important;
343
  flex-shrink: 0 !important;
344
  height: 27px !important;
345
- padding: 0 0 0 5px !important;
346
  -moz-user-select: none !important;
347
  -ms-user-select: none !important;
348
  -webkit-user-select: none !important;
@@ -455,6 +455,10 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
455
  height: auto !important;
456
  }
457
 
 
 
 
 
458
  #query-monitor-main #qm-panel-menu li button {
459
  background: #f3f3f3 !important;
460
  border-bottom: 1px solid #ddd !important;
@@ -462,7 +466,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
462
  color: #333 !important;
463
  cursor: pointer !important;
464
  display: block !important;
465
- padding: 8px 28px 8px 6px !important;
466
  position: relative !important;
467
  text-decoration: none !important;
468
  width: 100% !important;
@@ -485,6 +489,10 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
485
  text-shadow: 0 -1px 1px #006291, 1px 0 1px #006291, 0 1px 1px #006291, -1px 0 1px #006291 !important;
486
  }
487
 
 
 
 
 
488
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
489
  background: #def !important;
490
  color: #222 !important;
@@ -890,6 +898,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
890
  right: 5px !important;
891
  text-align: center !important;
892
  top: 5px !important;
 
893
  width: 18px !important;
894
  }
895
 
342
  display: flex !important;
343
  flex-shrink: 0 !important;
344
  height: 27px !important;
345
+ padding: 0 0 0 10px !important;
346
  -moz-user-select: none !important;
347
  -ms-user-select: none !important;
348
  -webkit-user-select: none !important;
455
  height: auto !important;
456
  }
457
 
458
+ #query-monitor-main #qm-panel-menu li ul {
459
+ display: none !important;
460
+ }
461
+
462
  #query-monitor-main #qm-panel-menu li button {
463
  background: #f3f3f3 !important;
464
  border-bottom: 1px solid #ddd !important;
466
  color: #333 !important;
467
  cursor: pointer !important;
468
  display: block !important;
469
+ padding: 6px 32px 6px 10px !important;
470
  position: relative !important;
471
  text-decoration: none !important;
472
  width: 100% !important;
489
  text-shadow: 0 -1px 1px #006291, 1px 0 1px #006291, 0 1px 1px #006291, -1px 0 1px #006291 !important;
490
  }
491
 
492
+ #query-monitor-main #qm-panel-menu li.qm-current-menu ul {
493
+ display: block !important;
494
+ }
495
+
496
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
497
  background: #def !important;
498
  color: #222 !important;
898
  right: 5px !important;
899
  text-align: center !important;
900
  top: 5px !important;
901
+ user-select: none;
902
  width: 18px !important;
903
  }
904
 
classes/Dispatcher.php CHANGED
@@ -52,6 +52,14 @@ abstract class QM_Dispatcher {
52
  *
53
  * The dynamic portion of the hook name, `$this->id`, refers to the dispatcher ID.
54
  *
 
 
 
 
 
 
 
 
55
  * @since 2.8.0
56
  *
57
  * @param bool $true Whether or not the dispatcher is enabled.
52
  *
53
  * The dynamic portion of the hook name, `$this->id`, refers to the dispatcher ID.
54
  *
55
+ * Possible filter names include:
56
+ *
57
+ * - `qm/dispatch/html`
58
+ * - `qm/dispatch/ajax`
59
+ * - `qm/dispatch/redirect`
60
+ * - `qm/dispatch/rest`
61
+ * - `qm/dispatch/wp_die`
62
+ *
63
  * @since 2.8.0
64
  *
65
  * @param bool $true Whether or not the dispatcher is enabled.
classes/Plugin.php CHANGED
@@ -60,7 +60,7 @@ abstract class QM_Plugin {
60
  /**
61
  * Populates and returns the current plugin info.
62
  */
63
- final private function _plugin( $item, $file = '' ) {
64
  if ( ! array_key_exists( $item, $this->plugin ) ) {
65
  switch ( $item ) {
66
  case 'url':
60
  /**
61
  * Populates and returns the current plugin info.
62
  */
63
+ private function _plugin( $item, $file = '' ) {
64
  if ( ! array_key_exists( $item, $this->plugin ) ) {
65
  switch ( $item ) {
66
  case 'url':
classes/QM.php CHANGED
@@ -13,8 +13,8 @@ class QM {
13
  *
14
  * @since 3.1.0
15
  *
16
- * @param string $message The message.
17
- * @param array $context The context passed.
18
  */
19
  do_action( 'qm/emergency', $message, $context );
20
  }
@@ -25,8 +25,8 @@ class QM {
25
  *
26
  * @since 3.1.0
27
  *
28
- * @param string $message The message.
29
- * @param array $context The context passed.
30
  */
31
  do_action( 'qm/alert', $message, $context );
32
  }
@@ -37,8 +37,8 @@ class QM {
37
  *
38
  * @since 3.1.0
39
  *
40
- * @param string $message The message.
41
- * @param array $context The context passed.
42
  */
43
  do_action( 'qm/critical', $message, $context );
44
  }
@@ -49,8 +49,8 @@ class QM {
49
  *
50
  * @since 3.1.0
51
  *
52
- * @param string $message The message.
53
- * @param array $context The context passed.
54
  */
55
  do_action( 'qm/error', $message, $context );
56
  }
@@ -61,8 +61,8 @@ class QM {
61
  *
62
  * @since 3.1.0
63
  *
64
- * @param string $message The message.
65
- * @param array $context The context passed.
66
  */
67
  do_action( 'qm/warning', $message, $context );
68
  }
@@ -73,8 +73,8 @@ class QM {
73
  *
74
  * @since 3.1.0
75
  *
76
- * @param string $message The message.
77
- * @param array $context The context passed.
78
  */
79
  do_action( 'qm/notice', $message, $context );
80
  }
@@ -85,8 +85,8 @@ class QM {
85
  *
86
  * @since 3.1.0
87
  *
88
- * @param string $message The message.
89
- * @param array $context The context passed.
90
  */
91
  do_action( 'qm/info', $message, $context );
92
  }
@@ -97,8 +97,8 @@ class QM {
97
  *
98
  * @since 3.1.0
99
  *
100
- * @param string $message The message.
101
- * @param array $context The context passed.
102
  */
103
  do_action( 'qm/debug', $message, $context );
104
  }
13
  *
14
  * @since 3.1.0
15
  *
16
+ * @param mixed $message The message or data to log.
17
+ * @param array $context The context passed.
18
  */
19
  do_action( 'qm/emergency', $message, $context );
20
  }
25
  *
26
  * @since 3.1.0
27
  *
28
+ * @param mixed $message The message or data to log.
29
+ * @param array $context The context passed.
30
  */
31
  do_action( 'qm/alert', $message, $context );
32
  }
37
  *
38
  * @since 3.1.0
39
  *
40
+ * @param mixed $message The message or data to log.
41
+ * @param array $context The context passed.
42
  */
43
  do_action( 'qm/critical', $message, $context );
44
  }
49
  *
50
  * @since 3.1.0
51
  *
52
+ * @param mixed $message The message or data to log.
53
+ * @param array $context The context passed.
54
  */
55
  do_action( 'qm/error', $message, $context );
56
  }
61
  *
62
  * @since 3.1.0
63
  *
64
+ * @param mixed $message The message or data to log.
65
+ * @param array $context The context passed.
66
  */
67
  do_action( 'qm/warning', $message, $context );
68
  }
73
  *
74
  * @since 3.1.0
75
  *
76
+ * @param mixed $message The message or data to log.
77
+ * @param array $context The context passed.
78
  */
79
  do_action( 'qm/notice', $message, $context );
80
  }
85
  *
86
  * @since 3.1.0
87
  *
88
+ * @param mixed $message The message or data to log.
89
+ * @param array $context The context passed.
90
  */
91
  do_action( 'qm/info', $message, $context );
92
  }
97
  *
98
  * @since 3.1.0
99
  *
100
+ * @param mixed $message The message or data to log.
101
+ * @param array $context The context passed.
102
  */
103
  do_action( 'qm/debug', $message, $context );
104
  }
collectors/http.php CHANGED
@@ -232,6 +232,8 @@ class QM_Collector_HTTP extends QM_Collector {
232
  'airplane_mode_enabled',
233
  ) );
234
 
 
 
235
  foreach ( $this->data['http'] as $key => & $http ) {
236
 
237
  if ( ! isset( $http['response'] ) ) {
@@ -272,6 +274,10 @@ class QM_Collector_HTTP extends QM_Collector {
272
 
273
  $http['component'] = $http['trace']->get_component();
274
 
 
 
 
 
275
  $this->log_type( $http['type'] );
276
  $this->log_component( $http['component'], $http['ltime'], $http['type'] );
277
 
232
  'airplane_mode_enabled',
233
  ) );
234
 
235
+ $home_host = (string) parse_url( home_url(), PHP_URL_HOST );
236
+
237
  foreach ( $this->data['http'] as $key => & $http ) {
238
 
239
  if ( ! isset( $http['response'] ) ) {
274
 
275
  $http['component'] = $http['trace']->get_component();
276
 
277
+ $host = (string) parse_url( $http['url'], PHP_URL_HOST );
278
+
279
+ $http['local'] = ( $host === $home_host );
280
+
281
  $this->log_type( $http['type'] );
282
  $this->log_component( $http['component'], $http['ltime'], $http['type'] );
283
 
collectors/logger.php CHANGED
@@ -88,8 +88,18 @@ class QM_Collector_Logger extends QM_Collector {
88
  }
89
 
90
  if ( ! QM_Util::is_stringy( $message ) ) {
 
 
 
 
 
 
 
 
91
  $type = 'dump';
92
  $message = print_r( $message, true );
 
 
93
  }
94
 
95
  $this->data['logs'][] = array(
88
  }
89
 
90
  if ( ! QM_Util::is_stringy( $message ) ) {
91
+ if ( null === $message ) {
92
+ $message = 'null';
93
+ } elseif ( false === $message ) {
94
+ $message = 'false';
95
+ } elseif ( true === $message ) {
96
+ $message = 'true';
97
+ }
98
+
99
  $type = 'dump';
100
  $message = print_r( $message, true );
101
+ } elseif ( '' === trim( $message ) ) {
102
+ $message = '(Empty string)';
103
  }
104
 
105
  $this->data['logs'][] = array(
dispatchers/Html.php CHANGED
@@ -179,11 +179,7 @@ class QM_Dispatcher_Html extends QM_Dispatcher {
179
 
180
  $css = 'query-monitor';
181
 
182
- if ( method_exists( 'Dark_Mode', 'is_using_dark_mode' ) && is_user_logged_in() ) {
183
- if ( Dark_Mode::is_using_dark_mode() ) {
184
- $css .= '-dark';
185
- }
186
- } elseif ( defined( 'QM_DARK_MODE' ) && QM_DARK_MODE ) {
187
  $css .= '-dark';
188
  }
189
 
179
 
180
  $css = 'query-monitor';
181
 
182
+ if ( defined( 'QM_DARK_MODE' ) && QM_DARK_MODE ) {
 
 
 
 
183
  $css .= '-dark';
184
  }
185
 
output/html/http.php CHANGED
@@ -104,7 +104,7 @@ class QM_Output_Html_HTTP extends QM_Output_Html {
104
  $url = preg_replace( '|^http:|', '<span class="qm-warn">http</span>:', $url );
105
 
106
  if ( 'https' === parse_url( $row['url'], PHP_URL_SCHEME ) ) {
107
- if ( empty( $row['args']['sslverify'] ) && empty( $row['args']['local'] ) ) {
108
  $info .= '<span class="qm-warn"><span class="dashicons dashicons-warning" aria-hidden="true"></span>' . esc_html( sprintf(
109
  /* translators: An HTTP API request has disabled certificate verification. 1: Relevant argument name */
110
  __( 'Certificate verification disabled (%s)', 'query-monitor' ),
104
  $url = preg_replace( '|^http:|', '<span class="qm-warn">http</span>:', $url );
105
 
106
  if ( 'https' === parse_url( $row['url'], PHP_URL_SCHEME ) ) {
107
+ if ( empty( $row['args']['sslverify'] ) && ! $row['local'] ) {
108
  $info .= '<span class="qm-warn"><span class="dashicons dashicons-warning" aria-hidden="true"></span>' . esc_html( sprintf(
109
  /* translators: An HTTP API request has disabled certificate verification. 1: Relevant argument name */
110
  __( 'Certificate verification disabled (%s)', 'query-monitor' ),
query-monitor.php CHANGED
@@ -10,7 +10,7 @@
10
  *
11
  * Plugin Name: Query Monitor
12
  * Description: The Developer Tools Panel for WordPress.
13
- * Version: 3.6.5
14
  * Plugin URI: https://querymonitor.com/
15
  * Author: John Blackbourn
16
  * Author URI: https://querymonitor.com/
10
  *
11
  * Plugin Name: Query Monitor
12
  * Description: The Developer Tools Panel for WordPress.
13
+ * Version: 3.6.6
14
  * Plugin URI: https://querymonitor.com/
15
  * Author: John Blackbourn
16
  * Author URI: https://querymonitor.com/
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: johnbillion
3
  Tags: debug, debug-bar, debugging, development, developer, performance, profiler, queries, query monitor, rest-api
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
- Stable tag: 3.6.5
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
  Donate link: https://johnblackbourn.com/donations/
@@ -45,6 +45,13 @@ By default, Query Monitor's output is only shown to Administrators on single-sit
45
 
46
  In addition to this, you can set an authentication cookie which allows you to view Query Monitor output when you're not logged in (or if you're logged in as a non-Administrator). See the Settings panel for details.
47
 
 
 
 
 
 
 
 
48
  = Privacy Statement =
49
 
50
  Query Monitor is private by default and always will be. It does not persistently store any of the data that it collects. It does not send data to any third party, nor does it include any third party resources.
@@ -63,7 +70,11 @@ Query Monitor is private by default and always will be. It does not persistently
63
 
64
  == Frequently Asked Questions ==
65
 
66
- = Who can see Query Monitor's output? =
 
 
 
 
67
 
68
  By default, Query Monitor's output is only shown to Administrators on single-site installations, and Super Admins on Multisite installations.
69
 
@@ -122,6 +133,16 @@ In addition, if you like the plugin then I'd love for you to [leave a review](ht
122
 
123
  ## Changelog ##
124
 
 
 
 
 
 
 
 
 
 
 
125
  ### 3.6.5 ###
126
 
127
  * Always show the Logs panel, with a link to help docs.
@@ -449,22 +470,3 @@ New features! Read about them here: https://querymonitor.com/blog/2019/02/new-fe
449
  * Improved display for parameter values in call stacks.
450
  * Any files within `wp-content` which don't have a component are now grouped by the root directory or file name.
451
 
452
-
453
- ### 2.15.0 ###
454
-
455
- * Reverse the order of stack traces so they're in natural order, and improve styling.
456
- * Enable query types to be clicked in the Overview.
457
- * Add a highlight to the currently applied table filter.
458
- * Improve table row highlighting when the row header spans multiple rows.
459
- * Expose a link to the main query from the Request panel.
460
- * Better stack traces for transient sets and HTTP API requests.
461
- * Group and sort the Languages output by textdomain.
462
- * Log and expose PHP extensions, and improve styling for error reporting level.
463
- * Better highlighting of PHP warnings and QM errors.
464
- * Add support for a `vendor` directory in the root of the `mu-plugins` directory when detecting components.
465
- * Log the size of the value of updated transients.
466
- * Add a help link when query components aren't available.
467
- * Make the Hooks table output reusable by other components.
468
- * Add a bit of vertical breathing room.
469
- * Various improvements to terminology.
470
- * Coding standards.
3
  Tags: debug, debug-bar, debugging, development, developer, performance, profiler, queries, query monitor, rest-api
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
+ Stable tag: 3.6.6
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
  Donate link: https://johnblackbourn.com/donations/
45
 
46
  In addition to this, you can set an authentication cookie which allows you to view Query Monitor output when you're not logged in (or if you're logged in as a non-Administrator). See the Settings panel for details.
47
 
48
+ = Other Plugins =
49
+
50
+ I maintain several other plugins for developers. Check them out:
51
+
52
+ * [User Switching](https://wordpress.org/plugins/user-switching/) provides instant switching between user accounts in WordPress.
53
+ * [WP Crontrol](https://wordpress.org/plugins/wp-crontrol/) lets you view and control what's happening in the WP-Cron system
54
+
55
  = Privacy Statement =
56
 
57
  Query Monitor is private by default and always will be. It does not persistently store any of the data that it collects. It does not send data to any third party, nor does it include any third party resources.
70
 
71
  == Frequently Asked Questions ==
72
 
73
+ = Does this plugin work with PHP 8? =
74
+
75
+ Yes.
76
+
77
+ = Who can access Query Monitor's output? =
78
 
79
  By default, Query Monitor's output is only shown to Administrators on single-site installations, and Super Admins on Multisite installations.
80
 
133
 
134
  ## Changelog ##
135
 
136
+ ### 3.6.6 ###
137
+
138
+ * PHP 8 fix.
139
+ * Improve the display for various empty values when logging.
140
+ * Don't display child menus until the parent menu is active. Makes the menu clearer.
141
+ * Detect local host names in HTTP API requests and don't mark them as ignoring certificate verification.
142
+ * Prevent the text in toggle buttons from being selected when selecting data in tables.
143
+ * Remove support for the Dark Mode plugin which isn't Dark Mode any more.
144
+
145
+
146
  ### 3.6.5 ###
147
 
148
  * Always show the Logs panel, with a link to help docs.
470
  * Improved display for parameter values in call stacks.
471
  * Any files within `wp-content` which don't have a component are now grouped by the root directory or file name.
472
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
wp-content/db.php CHANGED
@@ -30,13 +30,13 @@ if ( defined( 'DOING_CRON' ) && DOING_CRON ) {
30
  }
31
 
32
  # No autoloaders for us. See https://github.com/johnbillion/query-monitor/issues/7
33
- $qm_dir = dirname( dirname( __FILE__ ) );
34
- $plugin = "{$qm_dir}/classes/Plugin.php";
35
 
36
- if ( ! is_readable( $plugin ) ) {
37
  return;
38
  }
39
- require_once $plugin;
40
 
41
  if ( ! QM_Plugin::php_version_met() ) {
42
  return;
@@ -77,12 +77,13 @@ class QM_DB extends wpdb {
77
  }
78
 
79
  /**
80
- * Perform a MySQL database query, using current database connection.
81
  *
82
  * @see wpdb::query()
83
  *
84
  * @param string $query Database query
85
- * @return int|false Number of rows affected/selected or false on error
 
86
  */
87
  public function query( $query ) {
88
  if ( ! $this->ready ) {
30
  }
31
 
32
  # No autoloaders for us. See https://github.com/johnbillion/query-monitor/issues/7
33
+ $qm_dir = dirname( dirname( __FILE__ ) );
34
+ $qm_plugin = "{$qm_dir}/classes/Plugin.php";
35
 
36
+ if ( ! is_readable( $qm_plugin ) ) {
37
  return;
38
  }
39
+ require_once $qm_plugin;
40
 
41
  if ( ! QM_Plugin::php_version_met() ) {
42
  return;
77
  }
78
 
79
  /**
80
+ * Performs a MySQL database query, using current database connection.
81
  *
82
  * @see wpdb::query()
83
  *
84
  * @param string $query Database query
85
+ * @return int|bool Boolean true for CREATE, ALTER, TRUNCATE and DROP queries. Number of rows
86
+ * affected/selected for all other queries. Boolean false on error.
87
  */
88
  public function query( $query ) {
89
  if ( ! $this->ready ) {