Version Description
Download this release
Release Info
Developer | johnbillion |
Plugin | Query Monitor |
Version | 2.13.4 |
Comparing to | |
See all releases |
Code changes from version 2.13.3 to 2.13.4
- assets/query-monitor.css +76 -26
- collectors/db_queries.php +6 -4
- composer.json +2 -5
- output/Html.php +23 -3
- output/html/db_callers.php +1 -1
- output/html/db_components.php +1 -1
- output/html/db_queries.php +26 -2
- output/html/overview.php +1 -1
- query-monitor.php +1 -1
- readme.txt +1 -1
assets/query-monitor.css
CHANGED
@@ -198,11 +198,11 @@ body.wp-admin.folded #qm {
|
|
198 |
|
199 |
#qm-title ul {
|
200 |
margin: 10px 10px 0 !important;
|
201 |
-
font-family: Menlo, Monaco, Consolas, monospace !important;
|
202 |
-
font-size: 11px !important;
|
203 |
-
font-weight: normal !important;
|
204 |
font-style: normal !important;
|
|
|
|
|
205 |
line-height: 16px !important;
|
|
|
206 |
list-style: none !important;
|
207 |
padding: 0 !important;
|
208 |
}
|
@@ -218,6 +218,7 @@ body.wp-admin.folded #qm {
|
|
218 |
#qm-title li a {
|
219 |
display: block !important;
|
220 |
padding: 4px 7px !important;
|
|
|
221 |
}
|
222 |
|
223 |
.qm {
|
@@ -290,19 +291,21 @@ body.wp-admin.folded #qm {
|
|
290 |
.qm th,
|
291 |
.qm caption {
|
292 |
background: #fff !important;
|
|
|
293 |
box-sizing: border-box !important;
|
294 |
text-align: left !important;
|
295 |
-
font-family: Menlo, Monaco, Consolas, monospace !important;
|
296 |
-
font-size: 11px !important;
|
297 |
-
font-weight: normal !important;
|
298 |
font-style: normal !important;
|
|
|
|
|
299 |
line-height: 16px !important;
|
|
|
300 |
border: 1px solid #e8e8e8 !important;
|
301 |
padding: 4px 6px 3px !important;
|
302 |
vertical-align: top !important;
|
303 |
text-shadow: none !important;
|
304 |
text-transform: none !important;
|
305 |
-webkit-font-smoothing: auto !important;
|
|
|
306 |
}
|
307 |
|
308 |
.qm caption,
|
@@ -310,6 +313,10 @@ body.wp-admin.folded #qm {
|
|
310 |
border-bottom-width: 0 !important;
|
311 |
}
|
312 |
|
|
|
|
|
|
|
|
|
313 |
.qm tbody tr:hover th,
|
314 |
.qm tbody tr:hover td {
|
315 |
background: #f9f9f9 !important;
|
@@ -342,11 +349,21 @@ body.wp-admin.folded #qm {
|
|
342 |
padding: 0 !important;
|
343 |
}
|
344 |
|
|
|
345 |
.qm td .qm-toggler {
|
346 |
-
padding: 4px
|
347 |
position: relative !important;
|
348 |
}
|
349 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
350 |
.qm .qm-inner-toggle {
|
351 |
padding: 4px 6px 3px !important;
|
352 |
}
|
@@ -380,6 +397,12 @@ body.wp-admin.folded #qm {
|
|
380 |
margin: 0 !important;
|
381 |
padding: 0 !important;
|
382 |
display: list-item !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
}
|
384 |
|
385 |
.qm li::before {
|
@@ -387,11 +410,11 @@ body.wp-admin.folded #qm {
|
|
387 |
}
|
388 |
|
389 |
.qm pre {
|
390 |
-
font-family: Menlo, Monaco, Consolas, monospace !important;
|
391 |
-
font-size: 11px !important;
|
392 |
-
font-weight: normal !important;
|
393 |
font-style: normal !important;
|
|
|
|
|
394 |
line-height: 16px !important;
|
|
|
395 |
color: inherit !important;
|
396 |
background: transparent !important;
|
397 |
border: none !important;
|
@@ -400,11 +423,11 @@ body.wp-admin.folded #qm {
|
|
400 |
}
|
401 |
|
402 |
.qm code {
|
403 |
-
font-family: Menlo, Monaco, Consolas, monospace !important;
|
404 |
-
font-size: 11px !important;
|
405 |
-
font-weight: normal !important;
|
406 |
font-style: normal !important;
|
|
|
|
|
407 |
line-height: 16px !important;
|
|
|
408 |
color: inherit !important;
|
409 |
background: #f1f1f1 !important;
|
410 |
padding: 3px 4px 2px !important;
|
@@ -430,6 +453,7 @@ body.wp-admin.folded #qm {
|
|
430 |
white-space: nowrap !important;
|
431 |
}
|
432 |
|
|
|
433 |
.qm .qm-nonselectsql {
|
434 |
color: #a0a !important;
|
435 |
}
|
@@ -440,6 +464,11 @@ body.wp-admin.folded #qm {
|
|
440 |
|
441 |
.qm .qm-info {
|
442 |
color: #777 !important;
|
|
|
|
|
|
|
|
|
|
|
443 |
}
|
444 |
|
445 |
.qm .qm-supplemental {
|
@@ -479,9 +508,11 @@ html[dir="rtl"] .qm .qm-ltr .qm-toggle {
|
|
479 |
border-right: none !important;
|
480 |
border-left: 1px solid #e8e8e8 !important;
|
481 |
border-bottom: 1px solid #e8e8e8 !important;
|
482 |
-
font-
|
483 |
font-weight: normal !important;
|
484 |
font-size: 11px !important;
|
|
|
|
|
485 |
position: absolute !important;
|
486 |
top: 0 !important;
|
487 |
right: 0 !important;
|
@@ -519,21 +550,37 @@ html[dir="rtl"] .qm .qm-ltr .qm-toggle {
|
|
519 |
|
520 |
/* Filters */
|
521 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
.qm label {
|
523 |
cursor: pointer !important;
|
524 |
color: #333 !important;
|
525 |
font-weight: normal !important;
|
526 |
font-size: 11px !important;
|
|
|
527 |
margin: 0 !important;
|
528 |
}
|
529 |
|
530 |
select.qm-filter {
|
531 |
display: block !important;
|
532 |
-
font-
|
533 |
font-weight: normal !important;
|
534 |
-
font-size:
|
|
|
|
|
535 |
margin: 4px 0 2px !important;
|
536 |
-
border: 1px solid #
|
537 |
padding: 1px !important;
|
538 |
background: #fff !important;
|
539 |
color: #333 !important;
|
@@ -545,6 +592,7 @@ select.qm-filter {
|
|
545 |
text-transform: none !important;
|
546 |
-webkit-appearance: menulist !important;
|
547 |
-moz-appearance: menulist !important;
|
|
|
548 |
}
|
549 |
|
550 |
.qm-hide,
|
@@ -563,12 +611,6 @@ select.qm-filter {
|
|
563 |
text-align: center !important;
|
564 |
}
|
565 |
|
566 |
-
.qm button,
|
567 |
-
.qm a,
|
568 |
-
.qm select {
|
569 |
-
outline: none !important;
|
570 |
-
}
|
571 |
-
|
572 |
.qm button:focus,
|
573 |
.qm a:focus,
|
574 |
.qm select:focus {
|
@@ -578,9 +620,11 @@ select.qm-filter {
|
|
578 |
.qm .qm-sort {
|
579 |
color: #767676 !important;
|
580 |
display: block !important;
|
|
|
|
|
581 |
font-size: 15px !important;
|
582 |
-
font-family: Menlo, Monaco, Consolas, monospace !important;
|
583 |
line-height: 11px !important;
|
|
|
584 |
border: 0 !important;
|
585 |
padding: 0 !important;
|
586 |
width: 30px !important;
|
@@ -686,12 +730,15 @@ html[dir="rtl"] .qm .qm-toggle {
|
|
686 |
|
687 |
.qm-debug-bar textarea,
|
688 |
.qm-debug-bar pre {
|
689 |
-
font-size: 11px !important;
|
690 |
padding: 10px !important;
|
691 |
border: 1px solid #e8e8e8 !important;
|
692 |
margin: 4px 0 !important;
|
693 |
color: inherit !important;
|
694 |
background: transparent !important;
|
|
|
|
|
|
|
|
|
695 |
font-family: Menlo, Monaco, Consolas, monospace !important;
|
696 |
}
|
697 |
|
@@ -708,8 +755,11 @@ html[dir="rtl"] .qm .qm-toggle {
|
|
708 |
}
|
709 |
|
710 |
.qm-debug-bar h1, .qm-debug-bar h2, .qm-debug-bar h3 {
|
711 |
-
font-
|
712 |
font-weight: normal !important;
|
|
|
|
|
|
|
713 |
}
|
714 |
|
715 |
.qm-debug-bar h2 {
|
198 |
|
199 |
#qm-title ul {
|
200 |
margin: 10px 10px 0 !important;
|
|
|
|
|
|
|
201 |
font-style: normal !important;
|
202 |
+
font-weight: normal !important;
|
203 |
+
font-size: 11px !important;
|
204 |
line-height: 16px !important;
|
205 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
206 |
list-style: none !important;
|
207 |
padding: 0 !important;
|
208 |
}
|
218 |
#qm-title li a {
|
219 |
display: block !important;
|
220 |
padding: 4px 7px !important;
|
221 |
+
font: 13px/15px 'Open Sans', Arial !important;
|
222 |
}
|
223 |
|
224 |
.qm {
|
291 |
.qm th,
|
292 |
.qm caption {
|
293 |
background: #fff !important;
|
294 |
+
color: #333 !important;
|
295 |
box-sizing: border-box !important;
|
296 |
text-align: left !important;
|
|
|
|
|
|
|
297 |
font-style: normal !important;
|
298 |
+
font-weight: normal !important;
|
299 |
+
font-size: 11px !important;
|
300 |
line-height: 16px !important;
|
301 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
302 |
border: 1px solid #e8e8e8 !important;
|
303 |
padding: 4px 6px 3px !important;
|
304 |
vertical-align: top !important;
|
305 |
text-shadow: none !important;
|
306 |
text-transform: none !important;
|
307 |
-webkit-font-smoothing: auto !important;
|
308 |
+
letter-spacing: normal !important;
|
309 |
}
|
310 |
|
311 |
.qm caption,
|
313 |
border-bottom-width: 0 !important;
|
314 |
}
|
315 |
|
316 |
+
.qm caption {
|
317 |
+
caption-side: top !important;
|
318 |
+
}
|
319 |
+
|
320 |
.qm tbody tr:hover th,
|
321 |
.qm tbody tr:hover td {
|
322 |
background: #f9f9f9 !important;
|
349 |
padding: 0 !important;
|
350 |
}
|
351 |
|
352 |
+
.qm td.qm-has-toggle p,
|
353 |
.qm td .qm-toggler {
|
354 |
+
padding: 4px 20px 3px 6px !important;
|
355 |
position: relative !important;
|
356 |
}
|
357 |
|
358 |
+
.qm td.qm-has-toggle p {
|
359 |
+
font-style: normal !important;
|
360 |
+
font-weight: normal !important;
|
361 |
+
font-size: 11px !important;
|
362 |
+
line-height: 16px !important;
|
363 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
364 |
+
margin: 0 !important;
|
365 |
+
}
|
366 |
+
|
367 |
.qm .qm-inner-toggle {
|
368 |
padding: 4px 6px 3px !important;
|
369 |
}
|
397 |
margin: 0 !important;
|
398 |
padding: 0 !important;
|
399 |
display: list-item !important;
|
400 |
+
list-style: none !important;
|
401 |
+
font-style: normal !important;
|
402 |
+
font-weight: normal !important;
|
403 |
+
font-size: 11px !important;
|
404 |
+
line-height: 16px !important;
|
405 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
406 |
}
|
407 |
|
408 |
.qm li::before {
|
410 |
}
|
411 |
|
412 |
.qm pre {
|
|
|
|
|
|
|
413 |
font-style: normal !important;
|
414 |
+
font-weight: normal !important;
|
415 |
+
font-size: 11px !important;
|
416 |
line-height: 16px !important;
|
417 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
418 |
color: inherit !important;
|
419 |
background: transparent !important;
|
420 |
border: none !important;
|
423 |
}
|
424 |
|
425 |
.qm code {
|
|
|
|
|
|
|
426 |
font-style: normal !important;
|
427 |
+
font-weight: normal !important;
|
428 |
+
font-size: 11px !important;
|
429 |
line-height: 16px !important;
|
430 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
431 |
color: inherit !important;
|
432 |
background: #f1f1f1 !important;
|
433 |
padding: 3px 4px 2px !important;
|
453 |
white-space: nowrap !important;
|
454 |
}
|
455 |
|
456 |
+
.qm td.qm-has-toggle p,
|
457 |
.qm .qm-nonselectsql {
|
458 |
color: #a0a !important;
|
459 |
}
|
464 |
|
465 |
.qm .qm-info {
|
466 |
color: #777 !important;
|
467 |
+
font-style: normal !important;
|
468 |
+
font-weight: normal !important;
|
469 |
+
font-size: 11px !important;
|
470 |
+
line-height: 16px !important;
|
471 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
472 |
}
|
473 |
|
474 |
.qm .qm-supplemental {
|
508 |
border-right: none !important;
|
509 |
border-left: 1px solid #e8e8e8 !important;
|
510 |
border-bottom: 1px solid #e8e8e8 !important;
|
511 |
+
font-style: normal !important;
|
512 |
font-weight: normal !important;
|
513 |
font-size: 11px !important;
|
514 |
+
line-height: 16px !important;
|
515 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
516 |
position: absolute !important;
|
517 |
top: 0 !important;
|
518 |
right: 0 !important;
|
550 |
|
551 |
/* Filters */
|
552 |
|
553 |
+
.qm button,
|
554 |
+
.qm a,
|
555 |
+
.qm select {
|
556 |
+
outline: none !important;
|
557 |
+
margin: 0 !important;
|
558 |
+
border-radius: 0 !important;
|
559 |
+
transition: none !important;
|
560 |
+
height: auto !important;
|
561 |
+
width: auto !important;
|
562 |
+
background: none !important;
|
563 |
+
box-shadow: none !important;
|
564 |
+
}
|
565 |
+
|
566 |
.qm label {
|
567 |
cursor: pointer !important;
|
568 |
color: #333 !important;
|
569 |
font-weight: normal !important;
|
570 |
font-size: 11px !important;
|
571 |
+
font-style: normal !important;
|
572 |
margin: 0 !important;
|
573 |
}
|
574 |
|
575 |
select.qm-filter {
|
576 |
display: block !important;
|
577 |
+
font-style: normal !important;
|
578 |
font-weight: normal !important;
|
579 |
+
font-size: 11px !important;
|
580 |
+
line-height: 16px !important;
|
581 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
582 |
margin: 4px 0 2px !important;
|
583 |
+
border: 1px solid #ccc !important;
|
584 |
padding: 1px !important;
|
585 |
background: #fff !important;
|
586 |
color: #333 !important;
|
592 |
text-transform: none !important;
|
593 |
-webkit-appearance: menulist !important;
|
594 |
-moz-appearance: menulist !important;
|
595 |
+
letter-spacing: normal !important;
|
596 |
}
|
597 |
|
598 |
.qm-hide,
|
611 |
text-align: center !important;
|
612 |
}
|
613 |
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
.qm button:focus,
|
615 |
.qm a:focus,
|
616 |
.qm select:focus {
|
620 |
.qm .qm-sort {
|
621 |
color: #767676 !important;
|
622 |
display: block !important;
|
623 |
+
font-style: normal !important;
|
624 |
+
font-weight: normal !important;
|
625 |
font-size: 15px !important;
|
|
|
626 |
line-height: 11px !important;
|
627 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
628 |
border: 0 !important;
|
629 |
padding: 0 !important;
|
630 |
width: 30px !important;
|
730 |
|
731 |
.qm-debug-bar textarea,
|
732 |
.qm-debug-bar pre {
|
|
|
733 |
padding: 10px !important;
|
734 |
border: 1px solid #e8e8e8 !important;
|
735 |
margin: 4px 0 !important;
|
736 |
color: inherit !important;
|
737 |
background: transparent !important;
|
738 |
+
font-style: normal !important;
|
739 |
+
font-weight: normal !important;
|
740 |
+
font-size: 11px !important;
|
741 |
+
line-height: 16px !important;
|
742 |
font-family: Menlo, Monaco, Consolas, monospace !important;
|
743 |
}
|
744 |
|
755 |
}
|
756 |
|
757 |
.qm-debug-bar h1, .qm-debug-bar h2, .qm-debug-bar h3 {
|
758 |
+
font-style: normal !important;
|
759 |
font-weight: normal !important;
|
760 |
+
font-size: 11px !important;
|
761 |
+
line-height: 16px !important;
|
762 |
+
font-family: Menlo, Monaco, Consolas, monospace !important;
|
763 |
}
|
764 |
|
765 |
.qm-debug-bar h2 {
|
collectors/db_queries.php
CHANGED
@@ -99,7 +99,7 @@ class QM_Collector_DB_Queries extends QM_Collector {
|
|
99 |
}
|
100 |
|
101 |
public function process_db_object( $id, wpdb $db ) {
|
102 |
-
global $EZSQL_ERROR;
|
103 |
|
104 |
$rows = array();
|
105 |
$types = array();
|
@@ -176,7 +176,9 @@ class QM_Collector_DB_Queries extends QM_Collector {
|
|
176 |
$types[$type]['callers'][$caller]++;
|
177 |
}
|
178 |
|
179 |
-
$
|
|
|
|
|
180 |
|
181 |
if ( is_wp_error( $result ) ) {
|
182 |
$this->data['errors'][] = $row;
|
@@ -195,8 +197,8 @@ class QM_Collector_DB_Queries extends QM_Collector {
|
|
195 |
// Fallback for displaying database errors when wp-content/db.php isn't in place
|
196 |
foreach ( $EZSQL_ERROR as $error ) {
|
197 |
$row = array(
|
198 |
-
'caller' => 'Unknown',
|
199 |
-
'caller_name' => 'Unknown',
|
200 |
'stack' => '',
|
201 |
'sql' => $error['query'],
|
202 |
'result' => new WP_Error( 'qmdb', $error['error_str'] ),
|
99 |
}
|
100 |
|
101 |
public function process_db_object( $id, wpdb $db ) {
|
102 |
+
global $EZSQL_ERROR, $wp_the_query;
|
103 |
|
104 |
$rows = array();
|
105 |
$types = array();
|
176 |
$types[$type]['callers'][$caller]++;
|
177 |
}
|
178 |
|
179 |
+
$is_main_query = ( $sql === trim( $wp_the_query->request ) && ( false !== strpos( $stack, ' WP->main,' ) ) );
|
180 |
+
|
181 |
+
$row = compact( 'caller', 'caller_name', 'stack', 'sql', 'ltime', 'result', 'type', 'component', 'trace', 'is_main_query' );
|
182 |
|
183 |
if ( is_wp_error( $result ) ) {
|
184 |
$this->data['errors'][] = $row;
|
197 |
// Fallback for displaying database errors when wp-content/db.php isn't in place
|
198 |
foreach ( $EZSQL_ERROR as $error ) {
|
199 |
$row = array(
|
200 |
+
'caller' => __( 'Unknown', 'query-monitor' ),
|
201 |
+
'caller_name' => __( 'Unknown', 'query-monitor' ),
|
202 |
'stack' => '',
|
203 |
'sql' => $error['query'],
|
204 |
'result' => new WP_Error( 'qmdb', $error['error_str'] ),
|
composer.json
CHANGED
@@ -19,9 +19,6 @@
|
|
19 |
"composer/installers": "~1.0"
|
20 |
},
|
21 |
"require-dev" : {
|
22 |
-
"phpunit/phpunit": "
|
23 |
-
|
24 |
-
"config": {
|
25 |
-
"bin-dir": "bin/"
|
26 |
-
}
|
27 |
}
|
19 |
"composer/installers": "~1.0"
|
20 |
},
|
21 |
"require-dev" : {
|
22 |
+
"phpunit/phpunit": "~5.7"
|
23 |
+
}
|
|
|
|
|
|
|
24 |
}
|
output/Html.php
CHANGED
@@ -74,23 +74,43 @@ abstract class QM_Output_Html extends QM_Output {
|
|
74 |
* @param string $name The name for the `data-` attributes that get filtered by this control.
|
75 |
* @param array $values Possible values for this control.
|
76 |
* @param string $label Label text for the filter control.
|
77 |
-
* @param
|
|
|
|
|
|
|
78 |
* @return string Markup for the table filter controls.
|
79 |
*/
|
80 |
-
protected function build_filter( $name, array $values, $label, $
|
81 |
|
82 |
if ( empty( $values ) ) {
|
83 |
return esc_html( $label ); // Return label text, without being marked up as a label element.
|
84 |
}
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
usort( $values, 'strcasecmp' );
|
87 |
|
88 |
$filter_id = 'qm-filter-' . $this->collector->id . '-' . $name;
|
89 |
|
90 |
$out = '<label for="' . esc_attr( $filter_id ) .'">' . esc_html( $label ) . '</label>';
|
91 |
-
$out .= '<select id="' . esc_attr( $filter_id ) . '" class="qm-filter" data-filter="' . esc_attr( $name ) . '" data-highlight="' . esc_attr( $highlight ) . '">';
|
92 |
$out .= '<option value="">' . esc_html_x( 'All', '"All" option for filters', 'query-monitor' ) . '</option>';
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
foreach ( $values as $value ) {
|
95 |
$out .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>';
|
96 |
}
|
74 |
* @param string $name The name for the `data-` attributes that get filtered by this control.
|
75 |
* @param array $values Possible values for this control.
|
76 |
* @param string $label Label text for the filter control.
|
77 |
+
* @param array $args {
|
78 |
+
* @type string $highlihgt The name for the `data-` attributes that get highlighted by this control.
|
79 |
+
* @type array $prepend Associative array of options to prepend to the list of values.
|
80 |
+
* }
|
81 |
* @return string Markup for the table filter controls.
|
82 |
*/
|
83 |
+
protected function build_filter( $name, array $values, $label, $args = array() ) {
|
84 |
|
85 |
if ( empty( $values ) ) {
|
86 |
return esc_html( $label ); // Return label text, without being marked up as a label element.
|
87 |
}
|
88 |
|
89 |
+
if ( ! is_array( $args ) ) {
|
90 |
+
$args = array(
|
91 |
+
'highlight' => $args,
|
92 |
+
);
|
93 |
+
}
|
94 |
+
|
95 |
+
$args = array_merge( array(
|
96 |
+
'highlight' => '',
|
97 |
+
'prepend' => array(),
|
98 |
+
), $args );
|
99 |
+
|
100 |
usort( $values, 'strcasecmp' );
|
101 |
|
102 |
$filter_id = 'qm-filter-' . $this->collector->id . '-' . $name;
|
103 |
|
104 |
$out = '<label for="' . esc_attr( $filter_id ) .'">' . esc_html( $label ) . '</label>';
|
105 |
+
$out .= '<select id="' . esc_attr( $filter_id ) . '" class="qm-filter" data-filter="' . esc_attr( $name ) . '" data-highlight="' . esc_attr( $args['highlight'] ) . '">';
|
106 |
$out .= '<option value="">' . esc_html_x( 'All', '"All" option for filters', 'query-monitor' ) . '</option>';
|
107 |
|
108 |
+
if ( ! empty( $args['prepend'] ) ) {
|
109 |
+
foreach ( $args['prepend'] as $value => $label ) {
|
110 |
+
$out .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $label ) . '</option>';
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
foreach ( $values as $value ) {
|
115 |
$out .= '<option value="' . esc_attr( $value ) . '">' . esc_html( $value ) . '</option>';
|
116 |
}
|
output/html/db_callers.php
CHANGED
@@ -83,7 +83,7 @@ class QM_Output_Html_DB_Callers extends QM_Output_Html {
|
|
83 |
$total_stime = number_format_i18n( $total_time, 4 );
|
84 |
|
85 |
echo '<tr>';
|
86 |
-
echo '<td
|
87 |
|
88 |
foreach ( $data['types'] as $type_name => $type_count ) {
|
89 |
echo '<td class="qm-num">' . esc_html( number_format_i18n( $type_count ) ) . '</td>';
|
83 |
$total_stime = number_format_i18n( $total_time, 4 );
|
84 |
|
85 |
echo '<tr>';
|
86 |
+
echo '<td>' . esc_html__( 'Total', 'query-monitor' ) . '</td>';
|
87 |
|
88 |
foreach ( $data['types'] as $type_name => $type_count ) {
|
89 |
echo '<td class="qm-num">' . esc_html( number_format_i18n( $type_count ) ) . '</td>';
|
output/html/db_components.php
CHANGED
@@ -88,7 +88,7 @@ class QM_Output_Html_DB_Components extends QM_Output_Html {
|
|
88 |
$total_stime = number_format_i18n( $total_time, 4 );
|
89 |
|
90 |
echo '<tr>';
|
91 |
-
echo '<td
|
92 |
|
93 |
foreach ( $data['types'] as $type_name => $type_count ) {
|
94 |
echo '<td class="qm-num">' . esc_html( number_format_i18n( $type_count ) ) . '</td>';
|
88 |
$total_stime = number_format_i18n( $total_time, 4 );
|
89 |
|
90 |
echo '<tr>';
|
91 |
+
echo '<td>' . esc_html__( 'Total', 'query-monitor' ) . '</td>';
|
92 |
|
93 |
foreach ( $data['types'] as $type_name => $type_count ) {
|
94 |
echo '<td class="qm-num">' . esc_html( number_format_i18n( $type_count ) ) . '</td>';
|
output/html/db_queries.php
CHANGED
@@ -193,7 +193,19 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
|
|
193 |
echo $this->build_filter( 'type', array_keys( $db->types ), __( 'Query', 'query-monitor' ) ); // WPCS: XSS ok;
|
194 |
echo '</th>';
|
195 |
echo '<th scope="col">';
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
echo '</th>';
|
198 |
|
199 |
if ( $db->has_trace ) {
|
@@ -333,6 +345,11 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
|
|
333 |
}
|
334 |
if ( isset( $cols['caller'] ) ) {
|
335 |
$row_attr['data-qm-caller'] = $row['caller_name'];
|
|
|
|
|
|
|
|
|
|
|
336 |
}
|
337 |
if ( isset( $cols['time'] ) ) {
|
338 |
$row_attr['data-qm-time'] = $row['ltime'];
|
@@ -367,7 +384,14 @@ class QM_Output_Html_DB_Queries extends QM_Output_Html {
|
|
367 |
echo '<div class="qm-toggled"><li>' . implode( '</li><li>', $stack ) . '</li></div>'; // WPCS: XSS ok.
|
368 |
}
|
369 |
|
370 |
-
echo '</ol
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
}
|
372 |
|
373 |
if ( isset( $cols['stack'] ) ) {
|
193 |
echo $this->build_filter( 'type', array_keys( $db->types ), __( 'Query', 'query-monitor' ) ); // WPCS: XSS ok;
|
194 |
echo '</th>';
|
195 |
echo '<th scope="col">';
|
196 |
+
|
197 |
+
$prepend = array();
|
198 |
+
$has_main_query = wp_list_filter( $db->rows, array(
|
199 |
+
'is_main_query' => true,
|
200 |
+
) );
|
201 |
+
|
202 |
+
if ( $has_main_query ) {
|
203 |
+
$prepend['qm-main-query'] = __( 'Main Query', 'query-monitor' );
|
204 |
+
}
|
205 |
+
|
206 |
+
echo $this->build_filter( 'caller', wp_list_pluck( $data['times'], 'caller' ), __( 'Caller', 'query-monitor' ), array(
|
207 |
+
'prepend' => $prepend,
|
208 |
+
) ); // WPCS: XSS ok;
|
209 |
echo '</th>';
|
210 |
|
211 |
if ( $db->has_trace ) {
|
345 |
}
|
346 |
if ( isset( $cols['caller'] ) ) {
|
347 |
$row_attr['data-qm-caller'] = $row['caller_name'];
|
348 |
+
|
349 |
+
if ( $row['is_main_query'] ) {
|
350 |
+
$row_attr['data-qm-caller'] .= ' qm-main-query';
|
351 |
+
}
|
352 |
+
|
353 |
}
|
354 |
if ( isset( $cols['time'] ) ) {
|
355 |
$row_attr['data-qm-time'] = $row['ltime'];
|
384 |
echo '<div class="qm-toggled"><li>' . implode( '</li><li>', $stack ) . '</li></div>'; // WPCS: XSS ok.
|
385 |
}
|
386 |
|
387 |
+
echo '</ol>';
|
388 |
+
if ( $row['is_main_query'] ) {
|
389 |
+
printf(
|
390 |
+
'<p>%s</p>',
|
391 |
+
esc_html__( 'Main Query', 'query-monitor' )
|
392 |
+
);
|
393 |
+
}
|
394 |
+
echo '</td>';
|
395 |
}
|
396 |
|
397 |
if ( isset( $cols['stack'] ) ) {
|
output/html/overview.php
CHANGED
@@ -130,7 +130,7 @@ class QM_Output_Html_Overview extends QM_Output_Html {
|
|
130 |
if ( $cache_data['ext_object_cache'] ) {
|
131 |
printf(
|
132 |
'<a href="%s">%s</a>',
|
133 |
-
|
134 |
esc_html__( 'External object cache in use', 'query-monitor' )
|
135 |
);
|
136 |
} else {
|
130 |
if ( $cache_data['ext_object_cache'] ) {
|
131 |
printf(
|
132 |
'<a href="%s">%s</a>',
|
133 |
+
network_admin_url( 'plugins.php?plugin_status=dropins' ),
|
134 |
esc_html__( 'External object cache in use', 'query-monitor' )
|
135 |
);
|
136 |
} else {
|
query-monitor.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Query Monitor
|
4 |
Description: Monitoring of database queries, hooks, conditionals and more.
|
5 |
-
Version: 2.13.
|
6 |
Plugin URI: https://github.com/johnbillion/query-monitor
|
7 |
Author: John Blackbourn
|
8 |
Author URI: https://johnblackbourn.com/
|
2 |
/*
|
3 |
Plugin Name: Query Monitor
|
4 |
Description: Monitoring of database queries, hooks, conditionals and more.
|
5 |
+
Version: 2.13.4
|
6 |
Plugin URI: https://github.com/johnbillion/query-monitor
|
7 |
Author: John Blackbourn
|
8 |
Author URI: https://johnblackbourn.com/
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: johnbillion
|
|
3 |
Tags: ajax, debug, debug-bar, debugging, development, developer, performance, profiler, profiling, queries, query monitor, rest-api
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.7
|
6 |
-
Stable tag: 2.13.
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
View debugging and performance information on database queries, hooks, conditionals, HTTP requests, redirects and more.
|
3 |
Tags: ajax, debug, debug-bar, debugging, development, developer, performance, profiler, profiling, queries, query monitor, rest-api
|
4 |
Requires at least: 3.7
|
5 |
Tested up to: 4.7
|
6 |
+
Stable tag: 2.13.4
|
7 |
License: GPLv2 or later
|
8 |
|
9 |
View debugging and performance information on database queries, hooks, conditionals, HTTP requests, redirects and more.
|