Query Monitor - Version 3.6.2

Version Description

Download this release

Release Info

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

Code changes from version 3.6.1 to 3.6.2

assets/query-monitor-dark.css CHANGED
@@ -136,7 +136,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
136
  box-shadow: none !important;
137
  box-sizing: border-box !important;
138
  clear: both !important;
139
- color: #bbc8d4 !important;
140
  float: none !important;
141
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
142
  font-size: 12px !important;
@@ -220,7 +220,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
220
  box-shadow: none !important;
221
  box-sizing: border-box !important;
222
  clear: both !important;
223
- color: #bbc8d4 !important;
224
  float: none !important;
225
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
226
  font-size: 12px !important;
@@ -261,7 +261,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
261
 
262
  #query-monitor-main ::selection {
263
  background-color: #B9D6FB !important;
264
- color: #bbc8d4 !important;
265
  }
266
 
267
  #query-monitor-main strong,
@@ -365,6 +365,8 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
365
 
366
  #query-monitor-main #qm-title .dashicons {
367
  transition: none !important;
 
 
368
  }
369
 
370
  #query-monitor-main #qm-title .qm-button-container-close {
@@ -372,6 +374,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
372
  }
373
 
374
  #query-monitor-main #qm-title .qm-button-container-close .dashicons {
 
375
  margin: 3px 0 3px !important;
376
  }
377
 
@@ -456,7 +459,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
456
  background: #23282d !important;
457
  border-bottom: 1px solid #32373c !important;
458
  border-right: 1px solid #50626f !important;
459
- color: #bbc8d4 !important;
460
  cursor: pointer !important;
461
  display: block !important;
462
  padding: 8px 28px 8px 6px !important;
@@ -484,12 +487,12 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
484
 
485
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
486
  background: #32373c !important;
487
- color: #bbc8d4 !important;
488
  }
489
 
490
  #query-monitor-main #qm-panel-menu li.qm-current-menu button:focus {
491
  background: #3e444a !important;
492
- color: #bbc8d4 !important;
493
  }
494
 
495
  #query-monitor-main #qm-panel-menu li.qm-current-menu button:hover {
@@ -575,7 +578,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
575
  border: none !important;
576
  border-collapse: collapse !important;
577
  box-shadow: 0px 1px 0px 0px #50626f !important;
578
- color: #bbc8d4 !important;
579
  margin: 0 !important;
580
  table-layout: auto !important;
581
  width: 100% !important;
@@ -852,7 +855,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
852
  }
853
 
854
  #query-monitor-main .qm .qm-info {
855
- color: #666 !important;
856
  }
857
 
858
  #query-monitor-main .qm .qm-supplemental {
@@ -986,13 +989,13 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
986
  #query-monitor-main .qm tbody tr td.qm-highlight,
987
  #query-monitor-main .qm tbody tr.qm-highlight td {
988
  background-color: #57572a !important;
989
- color: #bbc8d4 !important;
990
  }
991
 
992
  #query-monitor-main .qm tbody tr.qm-odd td.qm-highlight,
993
  #query-monitor-main .qm tbody tr.qm-odd.qm-highlight td {
994
  background-color: #494923 !important;
995
- color: #bbc8d4 !important;
996
  }
997
 
998
  #query-monitor-main .qm tbody tr.qm-odd.qm-hovered th,
@@ -1008,7 +1011,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
1008
 
1009
  #query-monitor-main .qm thead th.qm-filtered select.qm-filter {
1010
  background-color: #57572a !important;
1011
- color: #bbc8d4 !important;
1012
  }
1013
 
1014
  #query-monitor-main .qm button.qm-filter-trigger,
@@ -1107,7 +1110,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
1107
  }
1108
 
1109
  #query-monitor-main .qm label {
1110
- color: #bbc8d4 !important;
1111
  cursor: pointer !important;
1112
  font-size: 12px !important;
1113
  font-style: normal !important;
@@ -1139,7 +1142,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
1139
  appearance: menulist !important;
1140
  background: #32373c !important;
1141
  border: none !important;
1142
- color: #bbc8d4 !important;
1143
  cursor: pointer !important;
1144
  display: block !important;
1145
  float: none !important;
@@ -1208,7 +1211,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
1208
 
1209
  #query-monitor-main .qm .qm-sorted-desc .qm-sort-arrow,
1210
  #query-monitor-main .qm .qm-sorted-asc .qm-sort-arrow {
1211
- color: #bbc8d4 !important;
1212
  }
1213
 
1214
  #query-monitor-main .qm thead th.qm-sortable-column:hover .qm-sort-arrow {
@@ -1367,7 +1370,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
1367
  }
1368
 
1369
  #query-monitor-main.qm-broken .qm button.qm-filter-trigger {
1370
- color: #bbc8d4 !important;
1371
  cursor: text !important;
1372
  }
1373
 
136
  box-shadow: none !important;
137
  box-sizing: border-box !important;
138
  clear: both !important;
139
+ color: #eaeef2 !important;
140
  float: none !important;
141
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
142
  font-size: 12px !important;
220
  box-shadow: none !important;
221
  box-sizing: border-box !important;
222
  clear: both !important;
223
+ color: #eaeef2 !important;
224
  float: none !important;
225
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
226
  font-size: 12px !important;
261
 
262
  #query-monitor-main ::selection {
263
  background-color: #B9D6FB !important;
264
+ color: #eaeef2 !important;
265
  }
266
 
267
  #query-monitor-main strong,
365
 
366
  #query-monitor-main #qm-title .dashicons {
367
  transition: none !important;
368
+ height: 20px !important;
369
+ width: 20px !important;
370
  }
371
 
372
  #query-monitor-main #qm-title .qm-button-container-close {
374
  }
375
 
376
  #query-monitor-main #qm-title .qm-button-container-close .dashicons {
377
+ font-size: 17px !important;
378
  margin: 3px 0 3px !important;
379
  }
380
 
459
  background: #23282d !important;
460
  border-bottom: 1px solid #32373c !important;
461
  border-right: 1px solid #50626f !important;
462
+ color: #eaeef2 !important;
463
  cursor: pointer !important;
464
  display: block !important;
465
  padding: 8px 28px 8px 6px !important;
487
 
488
  #query-monitor-main #qm-panel-menu li.qm-current-menu button {
489
  background: #32373c !important;
490
+ color: #eaeef2 !important;
491
  }
492
 
493
  #query-monitor-main #qm-panel-menu li.qm-current-menu button:focus {
494
  background: #3e444a !important;
495
+ color: #eaeef2 !important;
496
  }
497
 
498
  #query-monitor-main #qm-panel-menu li.qm-current-menu button:hover {
578
  border: none !important;
579
  border-collapse: collapse !important;
580
  box-shadow: 0px 1px 0px 0px #50626f !important;
581
+ color: #eaeef2 !important;
582
  margin: 0 !important;
583
  table-layout: auto !important;
584
  width: 100% !important;
855
  }
856
 
857
  #query-monitor-main .qm .qm-info {
858
+ color: #aaa !important;
859
  }
860
 
861
  #query-monitor-main .qm .qm-supplemental {
989
  #query-monitor-main .qm tbody tr td.qm-highlight,
990
  #query-monitor-main .qm tbody tr.qm-highlight td {
991
  background-color: #57572a !important;
992
+ color: #eaeef2 !important;
993
  }
994
 
995
  #query-monitor-main .qm tbody tr.qm-odd td.qm-highlight,
996
  #query-monitor-main .qm tbody tr.qm-odd.qm-highlight td {
997
  background-color: #494923 !important;
998
+ color: #eaeef2 !important;
999
  }
1000
 
1001
  #query-monitor-main .qm tbody tr.qm-odd.qm-hovered th,
1011
 
1012
  #query-monitor-main .qm thead th.qm-filtered select.qm-filter {
1013
  background-color: #57572a !important;
1014
+ color: #eaeef2 !important;
1015
  }
1016
 
1017
  #query-monitor-main .qm button.qm-filter-trigger,
1110
  }
1111
 
1112
  #query-monitor-main .qm label {
1113
+ color: #eaeef2 !important;
1114
  cursor: pointer !important;
1115
  font-size: 12px !important;
1116
  font-style: normal !important;
1142
  appearance: menulist !important;
1143
  background: #32373c !important;
1144
  border: none !important;
1145
+ color: #eaeef2 !important;
1146
  cursor: pointer !important;
1147
  display: block !important;
1148
  float: none !important;
1211
 
1212
  #query-monitor-main .qm .qm-sorted-desc .qm-sort-arrow,
1213
  #query-monitor-main .qm .qm-sorted-asc .qm-sort-arrow {
1214
+ color: #eaeef2 !important;
1215
  }
1216
 
1217
  #query-monitor-main .qm thead th.qm-sortable-column:hover .qm-sort-arrow {
1370
  }
1371
 
1372
  #query-monitor-main.qm-broken .qm button.qm-filter-trigger {
1373
+ color: #eaeef2 !important;
1374
  cursor: text !important;
1375
  }
1376
 
assets/query-monitor.css CHANGED
@@ -365,6 +365,8 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
365
 
366
  #query-monitor-main #qm-title .dashicons {
367
  transition: none !important;
 
 
368
  }
369
 
370
  #query-monitor-main #qm-title .qm-button-container-close {
@@ -372,6 +374,7 @@ body.admin-color-light #wp-admin-bar-query-monitor:not(.qm-all-clear):not(:hover
372
  }
373
 
374
  #query-monitor-main #qm-title .qm-button-container-close .dashicons {
 
375
  margin: 3px 0 3px !important;
376
  }
377
 
365
 
366
  #query-monitor-main #qm-title .dashicons {
367
  transition: none !important;
368
+ height: 20px !important;
369
+ width: 20px !important;
370
  }
371
 
372
  #query-monitor-main #qm-title .qm-button-container-close {
374
  }
375
 
376
  #query-monitor-main #qm-title .qm-button-container-close .dashicons {
377
+ font-size: 17px !important;
378
  margin: 3px 0 3px !important;
379
  }
380
 
collectors/environment.php CHANGED
@@ -192,8 +192,13 @@ class QM_Collector_Environment extends QM_Collector {
192
  'CONCATENATE_SCRIPTS' => self::format_bool_constant( 'CONCATENATE_SCRIPTS' ),
193
  'COMPRESS_SCRIPTS' => self::format_bool_constant( 'COMPRESS_SCRIPTS' ),
194
  'COMPRESS_CSS' => self::format_bool_constant( 'COMPRESS_CSS' ),
195
- 'WP_LOCAL_DEV' => self::format_bool_constant( 'WP_LOCAL_DEV' ),
196
  );
 
 
 
 
 
197
  $this->data['wp']['constants'] = apply_filters( 'qm/environment-constants', $constants );
198
 
199
  if ( is_multisite() ) {
@@ -259,12 +264,15 @@ class QM_Collector_Environment extends QM_Collector {
259
 
260
  $php_u = null;
261
 
262
- if ( function_exists( 'posix_getpwuid' ) ) {
263
  $u = posix_getpwuid( posix_getuid() );
264
- $g = posix_getgrgid( $u['gid'] );
265
 
266
- if ( ! empty( $u ) && ! empty( $g ) ) {
267
- $php_u = $u['name'] . ':' . $g['name'];
 
 
 
 
268
  }
269
  }
270
 
192
  'CONCATENATE_SCRIPTS' => self::format_bool_constant( 'CONCATENATE_SCRIPTS' ),
193
  'COMPRESS_SCRIPTS' => self::format_bool_constant( 'COMPRESS_SCRIPTS' ),
194
  'COMPRESS_CSS' => self::format_bool_constant( 'COMPRESS_CSS' ),
195
+ 'WP_ENVIRONMENT_TYPE' => self::format_bool_constant( 'WP_ENVIRONMENT_TYPE' ),
196
  );
197
+
198
+ if ( function_exists( 'wp_get_environment_type' ) ) {
199
+ $this->data['wp']['environment_type'] = wp_get_environment_type();
200
+ }
201
+
202
  $this->data['wp']['constants'] = apply_filters( 'qm/environment-constants', $constants );
203
 
204
  if ( is_multisite() ) {
264
 
265
  $php_u = null;
266
 
267
+ if ( function_exists( 'posix_getpwuid' ) && function_exists( 'posix_getuid' ) && function_exists( 'posix_getgrgid' ) ) {
268
  $u = posix_getpwuid( posix_getuid() );
 
269
 
270
+ if ( ! empty( $u ) && isset( $u['gid']) ) {
271
+ $g = posix_getgrgid( $u['gid'] );
272
+
273
+ if ( ! empty( $g ) && isset( $u['name'], $g['name'] ) ) {
274
+ $php_u = $u['name'] . ':' . $g['name'];
275
+ }
276
  }
277
  }
278
 
collectors/php_errors.php CHANGED
@@ -23,6 +23,9 @@ class QM_Collector_PHP_Errors extends QM_Collector {
23
 
24
  parent::__construct();
25
 
 
 
 
26
  // Non-fatal error handler for all PHP versions:
27
  set_error_handler( array( $this, 'error_handler' ), ( E_ALL ^ QM_ERROR_FATALS ) );
28
 
@@ -37,6 +40,17 @@ class QM_Collector_PHP_Errors extends QM_Collector {
37
  $this->error_reporting = error_reporting();
38
  $this->display_errors = ini_get( 'display_errors' );
39
  ini_set( 'display_errors', 0 );
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  /**
@@ -76,7 +90,7 @@ class QM_Collector_PHP_Errors extends QM_Collector {
76
  exit( 1 );
77
  }
78
 
79
- public function error_handler( $errno, $message, $file = null, $line = null, $context = null ) {
80
 
81
  /**
82
  * Fires before logging the PHP error in Query Monitor.
@@ -163,7 +177,7 @@ class QM_Collector_PHP_Errors extends QM_Collector {
163
  'file' => $file,
164
  'filename' => QM_Util::standard_dir( $file, '' ),
165
  'line' => $line,
166
- 'trace' => $trace,
167
  'calls' => 1,
168
  );
169
  }
@@ -377,8 +391,10 @@ class QM_Collector_PHP_Errors extends QM_Collector {
377
  foreach ( $error_types as $type => $title ) {
378
  if ( isset( $this->data[ $error_group ][ $type ] ) ) {
379
  foreach ( $this->data[ $error_group ][ $type ] as $error ) {
380
- $component = $error['trace']->get_component();
381
- $components[ $component->name ] = $component->name;
 
 
382
  }
383
  }
384
  }
@@ -404,6 +420,11 @@ class QM_Collector_PHP_Errors extends QM_Collector {
404
  if ( $this->is_reportable_error( $error['errno'], $allowed_level ) ) {
405
  continue;
406
  }
 
 
 
 
 
407
  if ( ! $this->is_affected_component( $error['trace']->get_component(), $component_type, $component_context ) ) {
408
  continue;
409
  }
23
 
24
  parent::__construct();
25
 
26
+ // Capture the last error that occurred before QM loaded:
27
+ $prior_error = error_get_last();
28
+
29
  // Non-fatal error handler for all PHP versions:
30
  set_error_handler( array( $this, 'error_handler' ), ( E_ALL ^ QM_ERROR_FATALS ) );
31
 
40
  $this->error_reporting = error_reporting();
41
  $this->display_errors = ini_get( 'display_errors' );
42
  ini_set( 'display_errors', 0 );
43
+
44
+ if ( $prior_error ) {
45
+ $this->error_handler(
46
+ $prior_error['type'],
47
+ $prior_error['message'],
48
+ $prior_error['file'],
49
+ $prior_error['line'],
50
+ null,
51
+ false
52
+ );
53
+ }
54
  }
55
 
56
  /**
90
  exit( 1 );
91
  }
92
 
93
+ public function error_handler( $errno, $message, $file = null, $line = null, $context = null, $do_trace = true ) {
94
 
95
  /**
96
  * Fires before logging the PHP error in Query Monitor.
177
  'file' => $file,
178
  'filename' => QM_Util::standard_dir( $file, '' ),
179
  'line' => $line,
180
+ 'trace' => ( $do_trace ? $trace : null ),
181
  'calls' => 1,
182
  );
183
  }
391
  foreach ( $error_types as $type => $title ) {
392
  if ( isset( $this->data[ $error_group ][ $type ] ) ) {
393
  foreach ( $this->data[ $error_group ][ $type ] as $error ) {
394
+ if ( $error['trace'] ) {
395
+ $component = $error['trace']->get_component();
396
+ $components[ $component->name ] = $component->name;
397
+ }
398
  }
399
  }
400
  }
420
  if ( $this->is_reportable_error( $error['errno'], $allowed_level ) ) {
421
  continue;
422
  }
423
+
424
+ if ( ! $error['trace'] ) {
425
+ continue;
426
+ }
427
+
428
  if ( ! $this->is_affected_component( $error['trace']->get_component(), $component_type, $component_context ) ) {
429
  continue;
430
  }
output/Html.php CHANGED
@@ -505,7 +505,7 @@ abstract class QM_Output_Html extends QM_Output {
505
  * @link https://querymonitor.com/blog/2019/02/clickable-stack-traces-and-function-names-in-query-monitor/
506
  * @since 3.0.0
507
  *
508
- * @param array $file_map Array of file path mappings.
509
  */
510
  return apply_filters( 'qm/output/file_path_map', array() );
511
  }
505
  * @link https://querymonitor.com/blog/2019/02/clickable-stack-traces-and-function-names-in-query-monitor/
506
  * @since 3.0.0
507
  *
508
+ * @param string[] $file_map Array of file path mappings. Keys are the source paths and values are the replacement paths.
509
  */
510
  return apply_filters( 'qm/output/file_path_map', array() );
511
  }
output/html/db_queries.php CHANGED
@@ -458,28 +458,54 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
458
 
459
  }
460
 
461
- public function admin_title( array $title ) {
462
 
463
  $data = $this->collector->get_data();
464
 
465
  if ( isset( $data['dbs'] ) ) {
466
  foreach ( $data['dbs'] as $key => $db ) {
 
 
 
 
 
 
 
 
 
467
  $title[] = sprintf(
468
- /* translators: %s: Database query time in seconds */
469
- '%s' . esc_html( _nx( '%s S', '%s S', $db->total_time, 'Query time', 'query-monitor' ) ),
470
  ( count( $data['dbs'] ) > 1 ? '•   ' : '' ),
471
  number_format_i18n( $db->total_time, 4 )
472
  );
 
 
 
 
 
 
 
 
 
 
473
  $title[] = sprintf(
474
- /* translators: %s: Number of database queries */
475
- esc_html( _nx( '%s Q', '%s Q', $db->total_qs, 'Query count', 'query-monitor' ) ),
476
  number_format_i18n( $db->total_qs )
477
  );
478
  }
479
  } elseif ( isset( $data['total_qs'] ) ) {
 
 
 
 
 
 
 
 
 
480
  $title[] = sprintf(
481
  /* translators: %s: Number of database queries */
482
- esc_html( _nx( '%s Q', '%s Q', $data['total_qs'], 'Query count', 'query-monitor' ) ),
483
  number_format_i18n( $data['total_qs'] )
484
  );
485
  }
@@ -488,6 +514,8 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
488
  $t = preg_replace( '#\s?([^0-9,\.]+)#', '<small>$1</small>', $t );
489
  }
490
 
 
 
491
  return $title;
492
  }
493
 
458
 
459
  }
460
 
461
+ public function admin_title( array $existing ) {
462
 
463
  $data = $this->collector->get_data();
464
 
465
  if ( isset( $data['dbs'] ) ) {
466
  foreach ( $data['dbs'] as $key => $db ) {
467
+ /* translators: %s: Database query time in seconds */
468
+ $text = _nx( '%s S', '%s S', $db->total_time, 'Query time', 'query-monitor' );
469
+
470
+ // Avoid a potentially blank translation for the plural form.
471
+ // @see https://meta.trac.wordpress.org/ticket/5377
472
+ if ( '' === $text ) {
473
+ $text = '%s S';
474
+ }
475
+
476
  $title[] = sprintf(
477
+ esc_html( '%s' . $text ),
 
478
  ( count( $data['dbs'] ) > 1 ? '&bull;&nbsp;&nbsp;&nbsp;' : '' ),
479
  number_format_i18n( $db->total_time, 4 )
480
  );
481
+
482
+ /* translators: %s: Number of database queries */
483
+ $text = _nx( '%s Q', '%s Q', $db->total_qs, 'Query count', 'query-monitor' );
484
+
485
+ // Avoid a potentially blank translation for the plural form.
486
+ // @see https://meta.trac.wordpress.org/ticket/5377
487
+ if ( '' === $text ) {
488
+ $text = '%s Q';
489
+ }
490
+
491
  $title[] = sprintf(
492
+ esc_html( $text ),
 
493
  number_format_i18n( $db->total_qs )
494
  );
495
  }
496
  } elseif ( isset( $data['total_qs'] ) ) {
497
+ /* translators: %s: Number of database queries */
498
+ $text = _nx( '%s Q', '%s Q', $data['total_qs'], 'Query count', 'query-monitor' );
499
+
500
+ // Avoid a potentially blank translation for the plural form.
501
+ // @see https://meta.trac.wordpress.org/ticket/5377
502
+ if ( '' === $text ) {
503
+ $text = '%s Q';
504
+ }
505
+
506
  $title[] = sprintf(
507
  /* translators: %s: Number of database queries */
508
+ esc_html( $text ),
509
  number_format_i18n( $data['total_qs'] )
510
  );
511
  }
514
  $t = preg_replace( '#\s?([^0-9,\.]+)#', '<small>$1</small>', $t );
515
  }
516
 
517
+ $title = array_merge( $existing, $title );
518
+
519
  return $title;
520
  }
521
 
output/html/environment.php CHANGED
@@ -248,6 +248,20 @@ class QM_Output_Html_Environment extends QM_Output_Html {
248
  echo '<td>' . esc_html( $data['wp']['version'] ) . '</td>';
249
  echo '</tr>';
250
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
251
  foreach ( $data['wp']['constants'] as $key => $val ) {
252
 
253
  echo '<tr>';
248
  echo '<td>' . esc_html( $data['wp']['version'] ) . '</td>';
249
  echo '</tr>';
250
 
251
+ if ( isset( $data['wp']['environment_type'] ) ) {
252
+ echo '<tr>';
253
+ echo '<th scope="row">';
254
+ esc_html_e( 'Environment Type', 'query-monitor' );
255
+ printf(
256
+ '&nbsp;<span class="qm-info">(<a href="%s" target="_blank" class="qm-external-link">%s</a>)</span>',
257
+ 'https://make.wordpress.org/core/2020/07/24/new-wp_get_environment_type-function-in-wordpress-5-5/',
258
+ esc_html__( 'Help', 'query-monitor' )
259
+ );
260
+ echo '</th>';
261
+ echo '<td>' . esc_html( $data['wp']['environment_type'] ) . '</td>';
262
+ echo '</tr>';
263
+ }
264
+
265
  foreach ( $data['wp']['constants'] as $key => $val ) {
266
 
267
  echo '<tr>';
output/html/overview.php CHANGED
@@ -254,7 +254,7 @@ class QM_Output_Html_Overview extends QM_Output_Html {
254
  $this->after_non_tabular_output();
255
  }
256
 
257
- public function admin_title( array $title ) {
258
 
259
  $data = $this->collector->get_data();
260
 
@@ -279,6 +279,8 @@ class QM_Output_Html_Overview extends QM_Output_Html {
279
  $t = preg_replace( '#\s?([^0-9,\.]+)#', '<small>$1</small>', $t );
280
  }
281
 
 
 
282
  return $title;
283
  }
284
 
254
  $this->after_non_tabular_output();
255
  }
256
 
257
+ public function admin_title( array $existing ) {
258
 
259
  $data = $this->collector->get_data();
260
 
279
  $t = preg_replace( '#\s?([^0-9,\.]+)#', '<small>$1</small>', $t );
280
  }
281
 
282
+ $title = array_merge( $existing, $title );
283
+
284
  return $title;
285
  }
286
 
output/html/php_errors.php CHANGED
@@ -70,14 +70,17 @@ class QM_Output_Html_PHP_Errors extends QM_Output_Html {
70
 
71
  foreach ( $data[ $error_group ][ $type ] as $error_key => $error ) {
72
 
73
- $component = $error['trace']->get_component();
74
  $row_attr = array();
75
- $row_attr['data-qm-component'] = $component->name;
76
  $row_attr['data-qm-type'] = ucfirst( $type );
77
  $row_attr['data-qm-key'] = $error_key;
78
 
79
- if ( 'core' !== $component->context ) {
80
- $row_attr['data-qm-component'] .= ' non-core';
 
 
 
 
 
81
  }
82
 
83
  $attr = '';
@@ -110,19 +113,22 @@ class QM_Output_Html_PHP_Errors extends QM_Output_Html {
110
  echo '<td class="qm-num">' . esc_html( number_format_i18n( $error['calls'] ) ) . '</td>';
111
 
112
  $stack = array();
113
- $filtered_trace = $error['trace']->get_display_trace();
114
-
115
- // debug_backtrace() (used within QM_Backtrace) doesn't like being used within an error handler so
116
- // we need to handle its somewhat unreliable stack trace items.
117
- // https://bugs.php.net/bug.php?id=39070
118
- // https://bugs.php.net/bug.php?id=64987
119
- foreach ( $filtered_trace as $i => $item ) {
120
- if ( isset( $item['file'] ) && isset( $item['line'] ) ) {
121
- $stack[] = self::output_filename( $item['display'], $item['file'], $item['line'] );
122
- } elseif ( 0 === $i ) {
123
- $stack[] = self::output_filename( $item['display'], $error['file'], $error['line'] );
124
- } else {
125
- $stack[] = $item['display'] . '<br><span class="qm-info qm-supplemental"><em>' . __( 'Unknown location', 'query-monitor' ) . '</em></span>';
 
 
 
126
  }
127
  }
128
 
@@ -143,7 +149,7 @@ class QM_Output_Html_PHP_Errors extends QM_Output_Html {
143
 
144
  echo '</ol></td>';
145
 
146
- if ( $component ) {
147
  echo '<td class="qm-nowrap">' . esc_html( $component->name ) . '</td>';
148
  } else {
149
  echo '<td><em>' . esc_html__( 'Unknown', 'query-monitor' ) . '</em></td>';
70
 
71
  foreach ( $data[ $error_group ][ $type ] as $error_key => $error ) {
72
 
 
73
  $row_attr = array();
 
74
  $row_attr['data-qm-type'] = ucfirst( $type );
75
  $row_attr['data-qm-key'] = $error_key;
76
 
77
+ if ( $error['trace'] ) {
78
+ $component = $error['trace']->get_component();
79
+ $row_attr['data-qm-component'] = $component->name;
80
+
81
+ if ( 'core' !== $component->context ) {
82
+ $row_attr['data-qm-component'] .= ' non-core';
83
+ }
84
  }
85
 
86
  $attr = '';
113
  echo '<td class="qm-num">' . esc_html( number_format_i18n( $error['calls'] ) ) . '</td>';
114
 
115
  $stack = array();
116
+
117
+ if ( $error['trace'] ) {
118
+ $filtered_trace = $error['trace']->get_display_trace();
119
+
120
+ // debug_backtrace() (used within QM_Backtrace) doesn't like being used within an error handler so
121
+ // we need to handle its somewhat unreliable stack trace items.
122
+ // https://bugs.php.net/bug.php?id=39070
123
+ // https://bugs.php.net/bug.php?id=64987
124
+ foreach ( $filtered_trace as $i => $item ) {
125
+ if ( isset( $item['file'] ) && isset( $item['line'] ) ) {
126
+ $stack[] = self::output_filename( $item['display'], $item['file'], $item['line'] );
127
+ } elseif ( 0 === $i ) {
128
+ $stack[] = self::output_filename( $item['display'], $error['file'], $error['line'] );
129
+ } else {
130
+ $stack[] = $item['display'] . '<br><span class="qm-info qm-supplemental"><em>' . __( 'Unknown location', 'query-monitor' ) . '</em></span>';
131
+ }
132
  }
133
  }
134
 
149
 
150
  echo '</ol></td>';
151
 
152
+ if ( ! empty( $component ) ) {
153
  echo '<td class="qm-nowrap">' . esc_html( $component->name ) . '</td>';
154
  } else {
155
  echo '<td><em>' . esc_html__( 'Unknown', 'query-monitor' ) . '</em></td>';
output/html/request.php CHANGED
@@ -133,7 +133,8 @@ class QM_Output_Html_Request extends QM_Output_Html {
133
  echo '</section>';
134
 
135
  echo '<section>';
136
- echo '<h3>' . esc_html__( 'Queried Object', 'query-monitor' ) . '</h3>';
 
137
 
138
  if ( ! empty( $data['queried_object'] ) ) {
139
  printf( // WPCS: XSS ok.
@@ -145,10 +146,7 @@ class QM_Output_Html_Request extends QM_Output_Html {
145
  echo '<p><em>' . esc_html__( 'none', 'query-monitor' ) . '</em></p>';
146
  }
147
 
148
- echo '</section>';
149
-
150
- echo '<section>';
151
- echo '<h3>' . esc_html__( 'Current User', 'query-monitor' ) . '</h3>';
152
 
153
  if ( ! empty( $data['user']['data'] ) ) {
154
  printf( // WPCS: XSS ok.
@@ -159,11 +157,8 @@ class QM_Output_Html_Request extends QM_Output_Html {
159
  echo '<p><em>' . esc_html__( 'none', 'query-monitor' ) . '</em></p>';
160
  }
161
 
162
- echo '</section>';
163
-
164
  if ( ! empty( $data['multisite'] ) ) {
165
- echo '<section>';
166
- echo '<h3>' . esc_html__( 'Multisite', 'query-monitor' ) . '</h3>';
167
 
168
  foreach ( $data['multisite'] as $var => $value ) {
169
  printf( // WPCS: XSS ok.
@@ -171,10 +166,10 @@ class QM_Output_Html_Request extends QM_Output_Html {
171
  esc_html( $value['title'] )
172
  );
173
  }
174
-
175
- echo '</section>';
176
  }
177
 
 
 
178
  if ( ! empty( $raw_request ) ) {
179
  $raw_data = $raw_request->get_data();
180
  echo '<section>';
133
  echo '</section>';
134
 
135
  echo '<section>';
136
+ echo '<h3>' . esc_html__( 'Response', 'query-monitor' ) . '</h3>';
137
+ echo '<h4>' . esc_html__( 'Queried Object', 'query-monitor' ) . '</h4>';
138
 
139
  if ( ! empty( $data['queried_object'] ) ) {
140
  printf( // WPCS: XSS ok.
146
  echo '<p><em>' . esc_html__( 'none', 'query-monitor' ) . '</em></p>';
147
  }
148
 
149
+ echo '<h4>' . esc_html__( 'Current User', 'query-monitor' ) . '</h4>';
 
 
 
150
 
151
  if ( ! empty( $data['user']['data'] ) ) {
152
  printf( // WPCS: XSS ok.
157
  echo '<p><em>' . esc_html__( 'none', 'query-monitor' ) . '</em></p>';
158
  }
159
 
 
 
160
  if ( ! empty( $data['multisite'] ) ) {
161
+ echo '<h4>' . esc_html__( 'Multisite', 'query-monitor' ) . '</h4>';
 
162
 
163
  foreach ( $data['multisite'] as $var => $value ) {
164
  printf( // WPCS: XSS ok.
166
  esc_html( $value['title'] )
167
  );
168
  }
 
 
169
  }
170
 
171
+ echo '</section>';
172
+
173
  if ( ! empty( $raw_request ) ) {
174
  $raw_data = $raw_request->get_data();
175
  echo '<section>';
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.1
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.2
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.5
6
- Stable tag: 3.6.1
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
@@ -113,6 +113,15 @@ No, I do not accept donations. If you like the plugin, I'd love for you to [leav
113
 
114
  ## Changelog ##
115
 
 
 
 
 
 
 
 
 
 
116
  ### 3.6.1 ###
117
 
118
  * Adjust the bottom margin when the QM panel is open so QM doesn't cover the bottom of the page. Works more often than not.
@@ -462,17 +471,3 @@ New features! Read about them here: https://querymonitor.com/blog/2019/02/new-fe
462
  - Correct filename output for Timber templates
463
  - Use latest HHVM on Trusty during Travis testing
464
 
465
-
466
- ### 2.13.2 ###
467
-
468
- - Fix the layout of QM when the Twenty Seventeen theme is in use.
469
- - Display QM at the bottom of GlotPress' output.
470
- - Add support for logging queries made through HyperDB.
471
- - Display a more appropriate message when a conflicting db.php file is present.
472
- - `paged.php` is no longer part of the template hierarchy.
473
- - Some more CSS fixes to prevent themes having an effect.
474
- - Increase some contrast.
475
- - Correct the template hierarchy for templates that have a `theme-compat` version in core. Currently only affects `embed.php`.
476
- - Include a back-compat version of `wp_normalize_path()` for WordPress < 3.9.
477
- - Ensure the use of newer conditional functions such as `is_embed()` don't cause PHP warnings on older versions of WordPress.
478
-
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.5
6
+ Stable tag: 3.6.2
7
  License: GPLv2 or later
8
  Requires PHP: 5.3
9
 
113
 
114
  ## Changelog ##
115
 
116
+ ### 3.6.2 ###
117
+
118
+ * Introduce the ability to capture and display the most recent PHP error that occurred before QM loaded.
119
+ * Add support for the environment type added in WP 5.5.
120
+ * Avoid a potentially blank translation for some plural forms.
121
+ * Increase some contrast in dark mode.
122
+ * Combine the response-related sections of the Request panel.
123
+ * Add extra sanity checking when attempting to fetch the posix user information.
124
+
125
  ### 3.6.1 ###
126
 
127
  * Adjust the bottom margin when the QM panel is open so QM doesn't cover the bottom of the page. Works more often than not.
471
  - Correct filename output for Timber templates
472
  - Use latest HHVM on Trusty during Travis testing
473