Query Monitor - Version 3.8.2

Version Description

Download this release

Release Info

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

Code changes from version 3.8.1 to 3.8.2

classes/Collectors.php CHANGED
@@ -24,6 +24,7 @@ class QM_Collectors implements IteratorAggregate {
24
  /**
25
  * @return ArrayIterator<string, QM_Collector>
26
  */
 
27
  public function getIterator() {
28
  return new ArrayIterator( $this->items );
29
  }
24
  /**
25
  * @return ArrayIterator<string, QM_Collector>
26
  */
27
+ #[\ReturnTypeWillChange]
28
  public function getIterator() {
29
  return new ArrayIterator( $this->items );
30
  }
classes/Dispatchers.php CHANGED
@@ -18,6 +18,7 @@ class QM_Dispatchers implements IteratorAggregate {
18
  /**
19
  * @return ArrayIterator<string, QM_Dispatcher>
20
  */
 
21
  public function getIterator() {
22
  return new ArrayIterator( $this->items );
23
  }
18
  /**
19
  * @return ArrayIterator<string, QM_Dispatcher>
20
  */
21
+ #[\ReturnTypeWillChange]
22
  public function getIterator() {
23
  return new ArrayIterator( $this->items );
24
  }
classes/Util.php CHANGED
@@ -503,7 +503,10 @@ class QM_Util {
503
  }
504
 
505
  $words = preg_split( '/\b/', trim( $sql ), 2, PREG_SPLIT_NO_EMPTY );
506
- $type = strtoupper( $words[0] );
 
 
 
507
 
508
  return $type;
509
  }
503
  }
504
 
505
  $words = preg_split( '/\b/', trim( $sql ), 2, PREG_SPLIT_NO_EMPTY );
506
+ $type = 'Unknown';
507
+ if ( isset( $words[0] ) ) {
508
+ $type = strtoupper( $words[0] );
509
+ }
510
 
511
  return $type;
512
  }
collectors/db_queries.php CHANGED
@@ -137,7 +137,7 @@ class QM_Collector_DB_Queries extends QM_Collector {
137
  $has_result = false;
138
  $has_trace = false;
139
  $i = 0;
140
- $request = trim( $wp_the_query->request );
141
 
142
  if ( method_exists( $db, 'remove_placeholder_escape' ) ) {
143
  $request = $db->remove_placeholder_escape( $request );
137
  $has_result = false;
138
  $has_trace = false;
139
  $i = 0;
140
+ $request = trim( $wp_the_query->request ? $wp_the_query->request : '' );
141
 
142
  if ( method_exists( $db, 'remove_placeholder_escape' ) ) {
143
  $request = $db->remove_placeholder_escape( $request );
collectors/request.php CHANGED
@@ -177,7 +177,8 @@ class QM_Collector_Request extends QM_Collector {
177
 
178
  if ( is_admin() ) {
179
  if ( isset( $_SERVER['REQUEST_URI'] ) ) {
180
- $home_path = trim( parse_url( home_url(), PHP_URL_PATH ), '/' );
 
181
  $request = wp_unslash( $_SERVER['REQUEST_URI'] ); // phpcs:ignore
182
 
183
  $this->data['request']['request'] = str_replace( "/{$home_path}/", '', $request );
177
 
178
  if ( is_admin() ) {
179
  if ( isset( $_SERVER['REQUEST_URI'] ) ) {
180
+ $path = parse_url( home_url(), PHP_URL_PATH );
181
+ $home_path = trim( $path ? $path : '', '/' );
182
  $request = wp_unslash( $_SERVER['REQUEST_URI'] ); // phpcs:ignore
183
 
184
  $this->data['request']['request'] = str_replace( "/{$home_path}/", '', $request );
output/html/db_queries.php CHANGED
@@ -341,8 +341,13 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
341
  }
342
 
343
  $stime = number_format_i18n( $row['ltime'], 4 );
 
344
 
345
- $sql = self::format_sql( $row['sql'] );
 
 
 
 
346
 
347
  if ( 'SELECT' !== $row['type'] ) {
348
  $sql = "<span class='qm-nonselectsql'>{$sql}</span>";
341
  }
342
 
343
  $stime = number_format_i18n( $row['ltime'], 4 );
344
+ $sql = $row['sql'];
345
 
346
+ if ( 'Unknown' === $row['type'] ) {
347
+ $sql = "<code>{$sql}</code>";
348
+ } else {
349
+ $sql = self::format_sql( $row['sql'] );
350
+ }
351
 
352
  if ( 'SELECT' !== $row['type'] ) {
353
  $sql = "<span class='qm-nonselectsql'>{$sql}</span>";
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.8.1
14
  * Plugin URI: https://querymonitor.com/
15
  * Author: John Blackbourn
16
  * Author URI: https://querymonitor.com/
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  exit;
34
  }
35
 
36
- define( 'QM_VERSION', '3.8.1' );
37
 
38
  $qm_dir = dirname( __FILE__ );
39
 
10
  *
11
  * Plugin Name: Query Monitor
12
  * Description: The Developer Tools Panel for WordPress.
13
+ * Version: 3.8.2
14
  * Plugin URI: https://querymonitor.com/
15
  * Author: John Blackbourn
16
  * Author URI: https://querymonitor.com/
33
  exit;
34
  }
35
 
36
+ define( 'QM_VERSION', '3.8.2' );
37
 
38
  $qm_dir = dirname( __FILE__ );
39
 
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  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.8
6
- Stable tag: 3.8.1
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
  Donate link: https://johnblackbourn.com/donations/
@@ -141,6 +141,11 @@ In addition, if you like the plugin then I'd love for you to [leave a review](ht
141
 
142
  ## Changelog ##
143
 
 
 
 
 
 
144
  ### 3.8.1 ###
145
 
146
  * Fixes an incompatibility with PHP versions prior to 7.2
@@ -422,41 +427,3 @@ New features! Read about them here: https://querymonitor.com/blog/2019/02/new-fe
422
  * Add extended support for the Members and User Role Editor plugins.
423
  * Fix link hover and focus styles.
424
  * Reset some more CSS styles.
425
-
426
- ### 3.1.0 ###
427
-
428
- **Main changes:**
429
-
430
- * Lots of accessibility improvements.
431
- * Switch to system default fonts to match the WordPress admin area fonts.
432
- * [Implement a PSR-3 compatible logger](https://querymonitor.com/blog/2018/07/profiling-and-logging/).
433
- * UI improvements for mobile/touch/narrow devices.
434
- * Various improvements to the layout of the Scripts and Styles panels.
435
- * Prevent the "overscroll" behaviour that causes the main page to scroll when scrolling to the end of a panel.
436
- * Remove the second table footer when filtering tables.
437
- * Add a settings panel with information about all of the available configuration constants.
438
-
439
- **All other changes:**
440
-
441
- * Show a warning message in the Overview panel when a PHP error is trigger during an Ajax request.
442
- * Display a warning when time or memory usage is above 75% of the respective limit.
443
- * Template Part file string normalization so template parts are correctly shown on Windows systems.
444
- * Don't output toggle links or a blank HTTP API transport if not necessary.
445
- * Add a human readable representation of transient timeouts, and prevent some wrapping.
446
- * Add a tear down for the capability checks collector so that cap checks performed between QM's processing and output don't break things.
447
- * Remove the ability to sort the HTTP API Calls table. This removes a column, increasing the available horizontal space.
448
- * Handle a bunch more known object types when displaying parameter values.
449
- * Allow PHP errors to be filtered by level.
450
- * Shorten the displayed names of long namespaced symbols by initialising the inner portions of the name.
451
- * Combine the Location and Caller columns for PHP Errors to save some horizontal space.
452
- * Don't wrap text in the PHP error type column.
453
- * Improve the authentication cookie toggle so it dynamically reflects the current state.
454
- * For now, force QM to use ltr text direction.
455
- * Clarify terminology around the number of enqueued assets.
456
- * Add fallback support for `wp_cache_get_stats()` to fetch cache stats.
457
- * Improve the message shown when no queries are performed.
458
- * Pluck stats from cache controllers that implement a `getStats()` method and return a nested array of stats for each server.
459
- * Rename the `QM_HIDE_CORE_HOOKS` configuration constant to `QM_HIDE_CORE_ACTIONS`.
460
- * Better handling of environments with unlimited execution time or memory limit. Adds a warning for both.
461
- * When an external cache isn't in use, provide some helpful info if an appropriate extension is installed.
462
-
2
  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.9
6
+ Stable tag: 3.8.2
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
  Donate link: https://johnblackbourn.com/donations/
141
 
142
  ## Changelog ##
143
 
144
+ ### 3.8.2 ###
145
+
146
+ * Fix some deprecated notices with PHP 8.1
147
+ * Improve the handling of SQL queries that consist only of MySQL comments
148
+
149
  ### 3.8.1 ###
150
 
151
  * Fixes an incompatibility with PHP versions prior to 7.2
427
  * Add extended support for the Members and User Role Editor plugins.
428
  * Fix link hover and focus styles.
429
  * Reset some more CSS styles.