Version Description
Updated to handle a new deprecated message in WordPress 4.0.
Download this release
Release Info
Developer | nacin |
Plugin | Debug Bar |
Version | 0.8.2 |
Comparing to | |
See all releases |
Code changes from version 0.8.1 to 0.8.2
- compat.php +44 -0
- css/debug-bar.css +1 -1
- css/debug-bar.dev.css +1 -0
- debug-bar.php +9 -5
- js/debug-bar-js.dev.js +16 -6
- js/debug-bar-js.js +1 -1
- js/debug-bar.dev.js +16 -1
- js/debug-bar.js +1 -1
- panels/class-debug-bar-deprecated.php +35 -12
- panels/class-debug-bar-js.php +2 -5
- panels/class-debug-bar-php.php +17 -8
- panels/class-debug-bar-wp-query.php +13 -12
- readme.txt +5 -2
compat.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//Backcompat for pre this function making it into WordPress
|
3 |
+
if ( ! function_exists( 'wp_debug_backtrace_summary' ) ) {
|
4 |
+
/**
|
5 |
+
* Return a comma separated string of functions that have been called to get to the current point in code.
|
6 |
+
* @link http://core.trac.wordpress.org/ticket/19589
|
7 |
+
* @since 3.4
|
8 |
+
*
|
9 |
+
* @param string $ignore_class A class to ignore all function calls within - useful when you want to just give info about the callee
|
10 |
+
* @param string $skip_frames A number of stack frames to skip - useful for unwinding back to the source of the issue
|
11 |
+
* @param bool $pretty Whether or not you want a comma separated string or raw array returned
|
12 |
+
* @return string|array Either a string containing a reversed comma separated trace or an array of individual calls.
|
13 |
+
*/
|
14 |
+
function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) {
|
15 |
+
$trace = debug_backtrace( false );
|
16 |
+
$caller = array();
|
17 |
+
$check_class = ! is_null( $ignore_class );
|
18 |
+
$skip_frames++; // skip this function
|
19 |
+
|
20 |
+
foreach ( $trace as $call ) {
|
21 |
+
if ( $skip_frames > 0 ) {
|
22 |
+
$skip_frames--;
|
23 |
+
} elseif ( isset( $call['class'] ) ) {
|
24 |
+
if ( $check_class && $ignore_class == $call['class'] )
|
25 |
+
continue; // Filter out calls
|
26 |
+
|
27 |
+
$caller[] = "{$call['class']}{$call['type']}{$call['function']}";
|
28 |
+
} else {
|
29 |
+
if ( in_array( $call['function'], array( 'do_action', 'apply_filters' ) ) ) {
|
30 |
+
$caller[] = "{$call['function']}('{$call['args'][0]}')";
|
31 |
+
} elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ) ) ) {
|
32 |
+
$caller[] = $call['function'] . "('" . str_replace( array( WP_CONTENT_DIR, ABSPATH ) , '', $call['args'][0] ) . "')";
|
33 |
+
} else {
|
34 |
+
$caller[] = $call['function'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
if ( $pretty )
|
39 |
+
return join( ', ', array_reverse( $caller ) );
|
40 |
+
else
|
41 |
+
return $caller;
|
42 |
+
}
|
43 |
+
}
|
44 |
+
?>
|
css/debug-bar.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#wpadminbar #wp-admin-bar-debug-bar{float:right;}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922;background-image:-moz-linear-gradient(bottom,#ee6f00,#ff8922);background-image:-webkit-gradient(linear,left bottom,left top,from(#ee6f00),to(#ff8922));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00;background-image:-moz-linear-gradient(bottom,#ff8922,#ee6f00);background-image:-webkit-gradient(linear,left bottom,left top,from(#ff8922),to(#ee6f00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #884000;}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#f44;background-image:-moz-linear-gradient(bottom,#d00,#f44);background-image:-webkit-gradient(linear,left bottom,left top,from(#d00),to(#f44));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00;background-image:-moz-linear-gradient(bottom,#f44,#d00);background-image:-webkit-gradient(linear,left bottom,left top,from(#f44),to(#d00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #700;}#wpadminbar #wp-admin-bar-debug-bar ul{right:0;}#querylist{display:none;position:fixed;height:33%;min-height:350px;font-family:"Helvetica Neue",sans-serif;left:0;right:0;bottom:0;background:#f1f1f1;z-index:99000;color:#000;line-height:150%!important;text-align:left;font-size:12px;}#querylist a{border:0;}.debug-bar-visible #querylist{display:block;}.debug-bar-maximized #querylist{position:fixed;top:28px;height:auto;}body.debug-bar-maximized.debug-bar-visible{overflow:hidden;}#debug-bar-info{height:60px;width:100%;position:absolute;z-index:200;background:#f1f1f1;border-bottom:1px solid #fff;box-shadow:0 0 6px rgba(0,0,0,0.4);background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-moz-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-o-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#dfdfdf));background-image:-webkit-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:linear-gradient(top,#f9f9f9,#dfdfdf);}#debug-bar-menu{position:absolute;top:61px;left:0;width:250px;bottom:0;z-index:100;overflow:hidden;text-shadow:0 1px 1px rgba(0,0,0,0.9);background:#333;-webkit-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);-moz-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);}#debug-menu-targets{overflow:auto;position:absolute;top:61px;left:250px;right:0;bottom:0;z-index:150;}#debug-status{float:left;padding-left:20px;color:#bbb;font-size:14px;line-height:60px;}.debug-status{float:left;margin-right:40px;}#debug-status .debug-status-title{color:#555;font-weight:500;line-height:18px;font-size:12px;margin-top:10px;}#debug-status .debug-status-data{color:#999;font-weight:200;line-height:20px;font-size:18px;}#debug-status #debug-status-warning{font-weight:bold;color:red;}#debug-status #debug-status-site{font-weight:bold;}#querylist pre{font-size:12px;padding:10px;}#querylist .left{float:left;}#querylist .right{float:right;}#querylist h1,#querylist h2,#querylist h3{font-weight:normal;}#debug-menu-links{overflow:hidden;list-style:none;margin:0;}#debug-menu-links li{float:left;margin-bottom:0!important;}#debug-menu-links li a{padding:0 20px;width:210px;line-height:40px;outline:none;display:block;margin:0;color:#fff!important;text-decoration:none!important;font-weight:500!important;font-size:14px;}#debug-menu-links li a.current{background:rgba(0,0,0,0.2);}#querylist h2{float:left;min-width:150px;border:1px solid #eee;padding:5px 10px 15px;clear:none;text-align:center;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important;}#querylist h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px;}#object-cache-stats h2{border:none;float:none;text-align:left;font-size:22px;margin-bottom:0;}#querylist h3{margin-bottom:15px;}#querylist ol.wpd-queries{padding:0!important;margin:0!important;list-style:none;clear:left;}#querylist ol.wpd-queries li{padding:10px;background:#f0f0f0;margin:0 0 10px 0;}#querylist ol.wpd-queries li div.qdebug{background:#e8e8e8;margin:10px -10px -10px -10px;padding:5px 150px 5px 5px;font-size:11px;position:relative;min-height:20px;}#querylist ol.wpd-queries li div.qdebug span{position:absolute;right:10px;top:5px;white-space:nowrap;}#querylist a{text-decoration:underline!important;color:blue!important;}#querylist a:hover{text-decoration:none!important;}#querylist .debug-menu-target{margin:20px;display:none;}#querylist ol{font:12px Monaco,"Courier New",Courier,Fixed!important;line-height:180%!important;}#debug-bar-php ol.debug-bar-php-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-php ol.debug-bar-php-list li{padding:10px;margin:0 0 10px 0;}#debug-bar-php .debug-bar-php-warning{background-color:#ffebe8;border:1px solid #c00;}#debug-bar-php .debug-bar-php-notice{background-color:#ffffe0;border:1px solid #e6db55;}#debug-bar-deprecated ol.debug-bar-deprecated-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-deprecated ol.debug-bar-deprecated-list li{padding:10px;margin:0 0 10px 0;background:#f0f0f0;}#debug-bar-wp-query ol.debug-bar-wp-query-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-wp-query ol.debug-bar-wp-query-list li,#debug-bar-wp-query p,#debug-bar-request p{padding:10px;margin:0 0 10px 0;background:#f0f0f0;}#debug-bar-wp-query ol.debug-bar-wp-query-list li ol{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-wp-query h3,#debug-bar-request h3{float:none;clear:both;font-family:georgia,times,serif;font-size:22px;margin:15px 10px 15px 0!important;}#debug-bar-actions{position:absolute;top:21px;right:20px;z-index:300;}#debug-bar-actions span{-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;display:block;float:left;height:19px;width:19px;margin-left:5px;font-size:18px;line-height:14px;text-align:center;font-weight:bold;color:#eee;background:#aaa;cursor:pointer;}#debug-bar-actions span:hover{background:#888;}#debug-bar-actions span.restore{line-height:15px;}.debug-bar-maximized #debug-bar-actions span.restore{display:block;}.debug-bar-maximized #debug-bar-actions span.maximize{display:none;}.debug-bar-partial #debug-bar-actions span.restore{display:none;}.debug-bar-partial #debug-bar-actions span.maximize{display:block;}#debug-menu-links li a#debug-menu-link-Debug_Bar_JS{display:none;}#debug-bar-js ol.debug-bar-js-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-js ol.debug-bar-js-list li{padding:10px;margin:0 0 10px 0;}#debug-bar-js .debug-bar-js-error{background-color:#ffebe8;border:1px solid #c00;}#debug-bar-js .debug-bar-js-error span{color:#666;font-size:.8em;display:block;}#debug-bar-js .debug-bar-js-error:hover span{color:#000;}
|
1 |
+
#wpadminbar #wp-admin-bar-debug-bar{float:right;}#wpadminbar #wp-admin-bar-debug-bar.active{background:#555;background:-moz-linear-gradient(bottom,#555,#3e3e3e);background:-webkit-gradient(linear,left bottom,left top,from(#555),to(#3e3e3e));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ff8922;background-image:-moz-linear-gradient(bottom,#ee6f00,#ff8922);background-image:-webkit-gradient(linear,left bottom,left top,from(#ee6f00),to(#ff8922));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus{background-color:#ee6f00;background-image:-moz-linear-gradient(bottom,#ff8922,#ee6f00);background-image:-webkit-gradient(linear,left bottom,left top,from(#ff8922),to(#ee6f00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #884000;}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#f44;background-image:-moz-linear-gradient(bottom,#d00,#f44);background-image:-webkit-gradient(linear,left bottom,left top,from(#d00),to(#f44));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,.debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus{background-color:#d00;background-image:-moz-linear-gradient(bottom,#f44,#d00);background-image:-webkit-gradient(linear,left bottom,left top,from(#f44),to(#d00));}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item{color:#fff;text-shadow:0 -1px 0 #700;}#wpadminbar #wp-admin-bar-debug-bar ul{right:0;}#querylist{display:none;position:fixed;height:33%;min-height:350px;font-family:"Helvetica Neue",sans-serif;left:0;right:0;bottom:0;background:#f1f1f1;z-index:99000;color:#000;line-height:150%!important;text-align:left;font-size:12px;}#querylist a{border:0;}.debug-bar-visible #querylist{display:block;}.debug-bar-maximized #querylist{position:fixed;top:28px;height:auto;}body.debug-bar-maximized.debug-bar-visible{overflow:hidden;}#debug-bar-info{height:60px;width:100%;position:absolute;z-index:200;background:#f1f1f1;border-bottom:1px solid #fff;box-shadow:0 0 6px rgba(0,0,0,0.4);background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-moz-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-o-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#dfdfdf));background-image:-webkit-linear-gradient(top,#f9f9f9,#dfdfdf);background-image:linear-gradient(top,#f9f9f9,#dfdfdf);}#debug-bar-menu{position:absolute;top:61px;left:0;width:250px;bottom:0;z-index:100;overflow:hidden;text-shadow:0 1px 1px rgba(0,0,0,0.9);background:#333;-webkit-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);-moz-box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);box-shadow:inset -3px 0 6px rgba(0,0,0,0.4);}#debug-menu-targets{overflow:auto;position:absolute;top:61px;left:250px;right:0;bottom:0;z-index:150;}#debug-status{float:left;padding-left:20px;color:#bbb;font-size:14px;line-height:60px;}.debug-status{float:left;margin-right:40px;}#debug-status .debug-status-title{color:#555;font-weight:500;line-height:18px;font-size:12px;margin-top:10px;}#debug-status .debug-status-data{color:#999;font-weight:200;line-height:20px;font-size:18px;}#debug-status #debug-status-warning{font-weight:bold;color:red;}#debug-status #debug-status-site{font-weight:bold;}#querylist pre{font-size:12px;padding:10px;}#querylist .left{float:left;}#querylist .right{float:right;}#querylist h1,#querylist h2,#querylist h3{font-weight:normal;}#debug-menu-links{overflow:hidden;list-style:none;margin:0;padding:0;}#debug-menu-links li{float:left;margin-bottom:0!important;}#debug-menu-links li a{padding:0 20px;width:210px;line-height:40px;outline:none;display:block;margin:0;color:#fff!important;text-decoration:none!important;font-weight:500!important;font-size:14px;}#debug-menu-links li a.current{background:rgba(0,0,0,0.2);}#querylist h2{float:left;min-width:150px;border:1px solid #eee;padding:5px 10px 15px;clear:none;text-align:center;font-family:georgia,times,serif;font-size:28px;margin:15px 10px 15px 0!important;}#querylist h2 span{font-size:12px;color:#888;text-transform:uppercase;white-space:nowrap;display:block;margin-bottom:5px;}#object-cache-stats h2{border:none;float:none;text-align:left;font-size:22px;margin-bottom:0;}#querylist h3{margin-bottom:15px;}#querylist ol.wpd-queries{padding:0!important;margin:0!important;list-style:none;clear:left;}#querylist ol.wpd-queries li{padding:10px;background:#f0f0f0;margin:0 0 10px 0;}#querylist ol.wpd-queries li div.qdebug{background:#e8e8e8;margin:10px -10px -10px -10px;padding:5px 150px 5px 5px;font-size:11px;position:relative;min-height:20px;}#querylist ol.wpd-queries li div.qdebug span{position:absolute;right:10px;top:5px;white-space:nowrap;}#querylist a{text-decoration:underline!important;color:blue!important;}#querylist a:hover{text-decoration:none!important;}#querylist .debug-menu-target{margin:20px;display:none;}#querylist ol{font:12px Monaco,"Courier New",Courier,Fixed!important;line-height:180%!important;}#debug-bar-php ol.debug-bar-php-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-php ol.debug-bar-php-list li{padding:10px;margin:0 0 10px 0;}#debug-bar-php .debug-bar-php-warning{background-color:#ffebe8;border:1px solid #c00;}#debug-bar-php .debug-bar-php-notice{background-color:#ffffe0;border:1px solid #e6db55;}#debug-bar-deprecated ol.debug-bar-deprecated-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-deprecated ol.debug-bar-deprecated-list li{padding:10px;margin:0 0 10px 0;background:#f0f0f0;}#debug-bar-wp-query ol.debug-bar-wp-query-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-wp-query ol.debug-bar-wp-query-list li,#debug-bar-wp-query p,#debug-bar-request p{padding:10px;margin:0 0 10px 0;background:#f0f0f0;}#debug-bar-wp-query ol.debug-bar-wp-query-list li ol{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-wp-query h3,#debug-bar-request h3{float:none;clear:both;font-family:georgia,times,serif;font-size:22px;margin:15px 10px 15px 0!important;}#debug-bar-actions{position:absolute;top:21px;right:20px;z-index:300;}#debug-bar-actions span{-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;display:block;float:left;height:19px;width:19px;margin-left:5px;font-size:18px;line-height:14px;text-align:center;font-weight:bold;color:#eee;background:#aaa;cursor:pointer;}#debug-bar-actions span:hover{background:#888;}#debug-bar-actions span.restore{line-height:15px;}.debug-bar-maximized #debug-bar-actions span.restore{display:block;}.debug-bar-maximized #debug-bar-actions span.maximize{display:none;}.debug-bar-partial #debug-bar-actions span.restore{display:none;}.debug-bar-partial #debug-bar-actions span.maximize{display:block;}#debug-menu-links li a#debug-menu-link-Debug_Bar_JS{display:none;}#debug-bar-js ol.debug-bar-js-list{padding:0!important;margin:0!important;list-style:none;clear:left;}#debug-bar-js ol.debug-bar-js-list li{padding:10px;margin:0 0 10px 0;}#debug-bar-js .debug-bar-js-error{background-color:#ffebe8;border:1px solid #c00;}#debug-bar-js .debug-bar-js-error span{color:#666;font-size:.8em;display:block;}#debug-bar-js .debug-bar-js-error:hover span{color:#000;}
|
css/debug-bar.dev.css
CHANGED
@@ -194,6 +194,7 @@ body.debug-bar-maximized.debug-bar-visible {
|
|
194 |
overflow: hidden;
|
195 |
list-style: none;
|
196 |
margin: 0;
|
|
|
197 |
}
|
198 |
|
199 |
#debug-menu-links li {
|
194 |
overflow: hidden;
|
195 |
list-style: none;
|
196 |
margin: 0;
|
197 |
+
padding: 0;
|
198 |
}
|
199 |
|
200 |
#debug-menu-links li {
|
debug-bar.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/debug-bar/
|
5 |
Description: Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
6 |
Author: wordpressdotorg
|
7 |
-
Version: 0.8.
|
8 |
Author URI: http://wordpress.org/
|
9 |
*/
|
10 |
|
@@ -31,7 +31,8 @@ class Debug_Bar {
|
|
31 |
return;
|
32 |
|
33 |
add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu' ), 1000 );
|
34 |
-
add_action( '
|
|
|
35 |
add_action( 'wp_head', array( &$this, 'ensure_ajaxurl' ), 1 );
|
36 |
add_filter( 'body_class', array( &$this, 'body_class' ) );
|
37 |
add_filter( 'admin_body_class', array( &$this, 'body_class' ) );
|
@@ -57,17 +58,19 @@ class Debug_Bar {
|
|
57 |
}
|
58 |
|
59 |
function requirements() {
|
|
|
|
|
60 |
$recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js' );
|
61 |
foreach ( $recs as $rec )
|
62 |
-
require_once "panels/class-debug-bar-$rec.php";
|
63 |
}
|
64 |
|
65 |
function enqueue() {
|
66 |
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
67 |
|
68 |
-
wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '
|
69 |
|
70 |
-
wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '
|
71 |
|
72 |
do_action('debug_bar_enqueue_scripts');
|
73 |
}
|
@@ -80,6 +83,7 @@ class Debug_Bar {
|
|
80 |
'Debug_Bar_Deprecated',
|
81 |
'Debug_Bar_Request',
|
82 |
'Debug_Bar_Object_Cache',
|
|
|
83 |
);
|
84 |
|
85 |
foreach ( $classes as $class ) {
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/debug-bar/
|
5 |
Description: Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
6 |
Author: wordpressdotorg
|
7 |
+
Version: 0.8.2
|
8 |
Author URI: http://wordpress.org/
|
9 |
*/
|
10 |
|
31 |
return;
|
32 |
|
33 |
add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu' ), 1000 );
|
34 |
+
add_action( 'admin_footer', array( &$this, 'render' ), 1000 );
|
35 |
+
add_action( 'wp_footer', array( &$this, 'render' ), 1000 );
|
36 |
add_action( 'wp_head', array( &$this, 'ensure_ajaxurl' ), 1 );
|
37 |
add_filter( 'body_class', array( &$this, 'body_class' ) );
|
38 |
add_filter( 'admin_body_class', array( &$this, 'body_class' ) );
|
58 |
}
|
59 |
|
60 |
function requirements() {
|
61 |
+
$path = plugin_dir_path( __FILE__ );
|
62 |
+
require_once( $path . '/compat.php' );
|
63 |
$recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated', 'js' );
|
64 |
foreach ( $recs as $rec )
|
65 |
+
require_once "$path/panels/class-debug-bar-$rec.php";
|
66 |
}
|
67 |
|
68 |
function enqueue() {
|
69 |
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
70 |
|
71 |
+
wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20120317' );
|
72 |
|
73 |
+
wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20121228.2', true );
|
74 |
|
75 |
do_action('debug_bar_enqueue_scripts');
|
76 |
}
|
83 |
'Debug_Bar_Deprecated',
|
84 |
'Debug_Bar_Request',
|
85 |
'Debug_Bar_Object_Cache',
|
86 |
+
'Debug_Bar_JS',
|
87 |
);
|
88 |
|
89 |
foreach ( $classes as $class ) {
|
js/debug-bar-js.dev.js
CHANGED
@@ -1,7 +1,22 @@
|
|
1 |
(function() {
|
2 |
-
var count, list,
|
|
|
|
|
3 |
|
4 |
window.onerror = function( errorMsg, url, lineNumber ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
var errorLine, place, button, tab;
|
7 |
|
@@ -36,11 +51,6 @@
|
|
36 |
errorLine.appendChild( place );
|
37 |
list.appendChild( errorLine );
|
38 |
|
39 |
-
return false;
|
40 |
};
|
41 |
|
42 |
-
// suppress error handling
|
43 |
-
window.addEventListener( 'error', function( e ) {
|
44 |
-
e.preventDefault();
|
45 |
-
}, true );
|
46 |
})();
|
1 |
(function() {
|
2 |
+
var count, list, dbjsError,
|
3 |
+
rawCount = 0,
|
4 |
+
errors = [];
|
5 |
|
6 |
window.onerror = function( errorMsg, url, lineNumber ) {
|
7 |
+
if ( ! document.getElementById( 'debug-bar-js-error-count' ) )
|
8 |
+
errors[ errors.length ] = [errorMsg, url, lineNumber];
|
9 |
+
else
|
10 |
+
dbjsError(errorMsg, url, lineNumber);
|
11 |
+
}
|
12 |
+
|
13 |
+
jQuery(document).ready( function(){
|
14 |
+
for ( err in errors )
|
15 |
+
dbjsError( errors[err][0], errors[err][1], errors[err][2] );
|
16 |
+
|
17 |
+
});
|
18 |
+
|
19 |
+
dbjsError = function( errorMsg, url, lineNumber ) {
|
20 |
|
21 |
var errorLine, place, button, tab;
|
22 |
|
51 |
errorLine.appendChild( place );
|
52 |
list.appendChild( errorLine );
|
53 |
|
|
|
54 |
};
|
55 |
|
|
|
|
|
|
|
|
|
56 |
})();
|
js/debug-bar-js.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
(function(){var
|
1 |
+
(function(){var count,list,dbjsError,rawCount=0,errors=[];window.onerror=function(errorMsg,url,lineNumber){if(!document.getElementById("debug-bar-js-error-count")){errors[errors.length]=[errorMsg,url,lineNumber]}else{dbjsError(errorMsg,url,lineNumber)}};jQuery(document).ready(function(){for(err in errors){dbjsError(errors[err][0],errors[err][1],errors[err][2])}});dbjsError=function(errorMsg,url,lineNumber){var errorLine,place,button,tab;rawCount++;if(!count){count=document.getElementById("debug-bar-js-error-count")}if(!list){list=document.getElementById("debug-bar-js-errors")}if(!count||!list){return}if(1==rawCount){button=document.getElementById("wp-admin-bar-debug-bar");if(!button){return}if(button.className.indexOf("debug-bar-php-warning-summary")===-1){button.className=button.className+" debug-bar-php-warning-summary"}tab=document.getElementById("debug-menu-link-Debug_Bar_JS");if(tab){tab.style.display="block"}}count.textContent=rawCount;errorLine=document.createElement("li");errorLine.className="debug-bar-js-error";errorLine.textContent=errorMsg;place=document.createElement("span");place.textContent=url+" line "+lineNumber;errorLine.appendChild(place);list.appendChild(errorLine)}})();
|
js/debug-bar.dev.js
CHANGED
@@ -18,6 +18,10 @@ wpDebugBar = api = {
|
|
18 |
api.actions.init();
|
19 |
},
|
20 |
|
|
|
|
|
|
|
|
|
21 |
toggle: {
|
22 |
init: function() {
|
23 |
$('#wp-admin-bar-debug-bar').click( function(e) {
|
@@ -26,7 +30,7 @@ wpDebugBar = api = {
|
|
26 |
});
|
27 |
},
|
28 |
visibility: function( show ) {
|
29 |
-
show = typeof show == 'undefined' ? ! api.
|
30 |
|
31 |
// Show/hide the debug bar.
|
32 |
api.body.toggleClass( 'debug-bar-visible', show );
|
@@ -63,6 +67,17 @@ wpDebugBar = api = {
|
|
63 |
init: function() {
|
64 |
var actions = $('#debug-bar-actions');
|
65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
$('.maximize', actions).click( api.actions.maximize );
|
67 |
$('.restore', actions).click( api.actions.restore );
|
68 |
$('.close', actions).click( api.actions.close );
|
18 |
api.actions.init();
|
19 |
},
|
20 |
|
21 |
+
isVisible: function() {
|
22 |
+
return api.body.hasClass( 'debug-bar-visible' );
|
23 |
+
},
|
24 |
+
|
25 |
toggle: {
|
26 |
init: function() {
|
27 |
$('#wp-admin-bar-debug-bar').click( function(e) {
|
30 |
});
|
31 |
},
|
32 |
visibility: function( show ) {
|
33 |
+
show = typeof show == 'undefined' ? ! api.isVisible() : show;
|
34 |
|
35 |
// Show/hide the debug bar.
|
36 |
api.body.toggleClass( 'debug-bar-visible', show );
|
67 |
init: function() {
|
68 |
var actions = $('#debug-bar-actions');
|
69 |
|
70 |
+
// Close the panel with the esc key if it's open
|
71 |
+
// 27 = esc
|
72 |
+
$(document).keydown( function( e ) {
|
73 |
+
var key = e.key || e.which || e.keyCode;
|
74 |
+
if ( 27 != key || ! api.isVisible() )
|
75 |
+
return;
|
76 |
+
|
77 |
+
e.preventDefault();
|
78 |
+
return api.actions.close();
|
79 |
+
});
|
80 |
+
|
81 |
$('.maximize', actions).click( api.actions.maximize );
|
82 |
$('.restore', actions).click( api.actions.restore );
|
83 |
$('.close', actions).click( api.actions.close );
|
js/debug-bar.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var wpDebugBar;(function(
|
1 |
+
var wpDebugBar;(function(i){var e;wpDebugBar=e={body:void 0,init:function(){e.body=i(document.body),e.toggle.init(),e.tabs(),e.actions.init()},isVisible:function(){return e.body.hasClass("debug-bar-visible")},toggle:{init:function(){i("#wp-admin-bar-debug-bar").click(function(i){i.preventDefault(),e.toggle.visibility()})},visibility:function(t){t=t===void 0?!e.isVisible():t,e.body.toggleClass("debug-bar-visible",t),i(this).toggleClass("active",t)}},tabs:function(){var e=i(".debug-menu-link"),t=i(".debug-menu-target");e.click(function(a){var n=i(this);a.preventDefault(),n.hasClass("current")||(t.hide().trigger("debug-bar-hide"),e.removeClass("current"),n.addClass("current"),i("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show"))})},actions:{init:function(){var t=i("#debug-bar-actions");i(document).keydown(function(i){var t=i.key||i.which||i.keyCode;if(27==t&&e.isVisible())return i.preventDefault(),e.actions.close()}),i(".maximize",t).click(e.actions.maximize),i(".restore",t).click(e.actions.restore),i(".close",t).click(e.actions.close)},maximize:function(){e.body.removeClass("debug-bar-partial"),e.body.addClass("debug-bar-maximized")},restore:function(){e.body.removeClass("debug-bar-maximized"),e.body.addClass("debug-bar-partial")},close:function(){e.toggle.visibility(!1),console.log("boo")}}},wpDebugBar.Panel=function(){},i(document).ready(wpDebugBar.init)})(jQuery);
|
panels/class-debug-bar-deprecated.php
CHANGED
@@ -33,27 +33,45 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
|
33 |
echo '<h2><span>Total Files:</span>' . number_format( count( $this->deprecated_files ) ) . "</h2>\n";
|
34 |
if ( count( $this->deprecated_functions ) ) {
|
35 |
echo '<ol class="debug-bar-deprecated-list">';
|
36 |
-
foreach ( $this->deprecated_functions as $location => $
|
37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
echo '</ol>';
|
39 |
}
|
40 |
if ( count( $this->deprecated_files ) ) {
|
41 |
echo '<ol class="debug-bar-deprecated-list">';
|
42 |
-
foreach ( $this->deprecated_files as $location => $
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
echo '</ol>';
|
45 |
}
|
46 |
if ( count( $this->deprecated_arguments ) ) {
|
47 |
echo '<ol class="debug-bar-deprecated-list">';
|
48 |
-
foreach ( $this->deprecated_arguments as $location => $
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
echo '</ol>';
|
51 |
}
|
52 |
echo "</div>";
|
53 |
}
|
54 |
|
55 |
function deprecated_function_run($function, $replacement, $version) {
|
56 |
-
$backtrace = debug_backtrace();
|
57 |
$bt = 4;
|
58 |
// Check if we're a hook callback.
|
59 |
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
@@ -66,11 +84,11 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
|
66 |
else
|
67 |
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $function, $version );
|
68 |
|
69 |
-
$this->deprecated_functions[$file.':'.$line] = $message;
|
70 |
}
|
71 |
|
72 |
function deprecated_file_included( $old_file, $replacement, $version, $message ) {
|
73 |
-
$backtrace = debug_backtrace();
|
74 |
$file = $backtrace[4]['file'];
|
75 |
$file_abs = str_replace(ABSPATH, '', $file);
|
76 |
$line = $backtrace[4]['line'];
|
@@ -80,11 +98,16 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
|
80 |
else
|
81 |
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $file_abs, $version ) . $message;
|
82 |
|
83 |
-
$this->
|
84 |
}
|
85 |
|
86 |
function deprecated_argument_run( $function, $message, $version) {
|
87 |
-
$backtrace = debug_backtrace();
|
|
|
|
|
|
|
|
|
|
|
88 |
$bt = 4;
|
89 |
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
90 |
$bt = 6;
|
@@ -92,6 +115,6 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
|
|
92 |
$file = $backtrace[ $bt ]['file'];
|
93 |
$line = $backtrace[ $bt ]['line'];
|
94 |
|
95 |
-
$this->
|
96 |
}
|
97 |
}
|
33 |
echo '<h2><span>Total Files:</span>' . number_format( count( $this->deprecated_files ) ) . "</h2>\n";
|
34 |
if ( count( $this->deprecated_functions ) ) {
|
35 |
echo '<ol class="debug-bar-deprecated-list">';
|
36 |
+
foreach ( $this->deprecated_functions as $location => $message_stack) {
|
37 |
+
list( $message, $stack) = $message_stack;
|
38 |
+
echo "<li class='debug-bar-deprecated-function'>";
|
39 |
+
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
40 |
+
echo "<br/>";
|
41 |
+
echo $stack;
|
42 |
+
echo "</li>";
|
43 |
+
}
|
44 |
echo '</ol>';
|
45 |
}
|
46 |
if ( count( $this->deprecated_files ) ) {
|
47 |
echo '<ol class="debug-bar-deprecated-list">';
|
48 |
+
foreach ( $this->deprecated_files as $location => $message_stack) {
|
49 |
+
list( $message, $stack) = $message_stack;
|
50 |
+
echo "<li class='debug-bar-deprecated-file'>";
|
51 |
+
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
52 |
+
echo "<br/>";
|
53 |
+
echo $stack;
|
54 |
+
echo "</li>";
|
55 |
+
}
|
56 |
echo '</ol>';
|
57 |
}
|
58 |
if ( count( $this->deprecated_arguments ) ) {
|
59 |
echo '<ol class="debug-bar-deprecated-list">';
|
60 |
+
foreach ( $this->deprecated_arguments as $location => $message_stack) {
|
61 |
+
list( $message, $stack) = $message_stack;
|
62 |
+
echo "<li class='debug-bar-deprecated-argument'>";
|
63 |
+
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
64 |
+
echo "<br/>";
|
65 |
+
echo $stack;
|
66 |
+
echo "</li>";
|
67 |
+
}
|
68 |
echo '</ol>';
|
69 |
}
|
70 |
echo "</div>";
|
71 |
}
|
72 |
|
73 |
function deprecated_function_run($function, $replacement, $version) {
|
74 |
+
$backtrace = debug_backtrace( false );
|
75 |
$bt = 4;
|
76 |
// Check if we're a hook callback.
|
77 |
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
84 |
else
|
85 |
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $function, $version );
|
86 |
|
87 |
+
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
88 |
}
|
89 |
|
90 |
function deprecated_file_included( $old_file, $replacement, $version, $message ) {
|
91 |
+
$backtrace = debug_backtrace( false );
|
92 |
$file = $backtrace[4]['file'];
|
93 |
$file_abs = str_replace(ABSPATH, '', $file);
|
94 |
$line = $backtrace[4]['line'];
|
98 |
else
|
99 |
$message = sprintf( __('%1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 'debug-bar'), $file_abs, $version ) . $message;
|
100 |
|
101 |
+
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, 4 ) );
|
102 |
}
|
103 |
|
104 |
function deprecated_argument_run( $function, $message, $version) {
|
105 |
+
$backtrace = debug_backtrace( false );
|
106 |
+
if ( $function === 'define()' ) {
|
107 |
+
$this->deprecated_functions[] = array( $message, '' );
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
|
111 |
$bt = 4;
|
112 |
if ( ! isset( $backtrace[4]['file'] ) && 'call_user_func_array' == $backtrace[5]['function'] ) {
|
113 |
$bt = 6;
|
115 |
$file = $backtrace[ $bt ]['file'];
|
116 |
$line = $backtrace[ $bt ]['line'];
|
117 |
|
118 |
+
$this->deprecated_functions[$file.':'.$line] = array( $message, wp_debug_backtrace_summary( null, $bt ) );
|
119 |
}
|
120 |
}
|
panels/class-debug-bar-js.php
CHANGED
@@ -4,15 +4,12 @@ class Debug_Bar_JS extends Debug_Bar_Panel {
|
|
4 |
var $real_error_handler = array();
|
5 |
|
6 |
function init() {
|
7 |
-
if ( !defined( 'SCRIPT_DEBUG' ) || !SCRIPT_DEBUG )
|
8 |
-
return false;
|
9 |
-
|
10 |
$this->title( __('JavaScript', 'debug-bar') );
|
11 |
|
12 |
// attach here instead of debug_bar_enqueue_scripts
|
13 |
// because we want to be as early as possible!
|
14 |
-
$
|
15 |
-
wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js.
|
16 |
}
|
17 |
|
18 |
function render() {
|
4 |
var $real_error_handler = array();
|
5 |
|
6 |
function init() {
|
|
|
|
|
|
|
7 |
$this->title( __('JavaScript', 'debug-bar') );
|
8 |
|
9 |
// attach here instead of debug_bar_enqueue_scripts
|
10 |
// because we want to be as early as possible!
|
11 |
+
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
|
12 |
+
wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js$suffix.js", dirname(__FILE__) ), array(), '20111216' );
|
13 |
}
|
14 |
|
15 |
function render() {
|
panels/class-debug-bar-php.php
CHANGED
@@ -32,11 +32,11 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
|
|
32 |
switch ( $type ) {
|
33 |
case E_WARNING :
|
34 |
case E_USER_WARNING :
|
35 |
-
$this->warnings[$_key] = array( $file.':'.$line, $message );
|
36 |
break;
|
37 |
case E_NOTICE :
|
38 |
case E_USER_NOTICE :
|
39 |
-
$this->notices[$_key] = array( $file.':'.$line, $message );
|
40 |
break;
|
41 |
case E_STRICT :
|
42 |
// TODO
|
@@ -62,17 +62,25 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
|
|
62 |
echo '<h2><span>Total Notices:</span>' . number_format( count( $this->notices ) ) . "</h2>\n";
|
63 |
if ( count( $this->warnings ) ) {
|
64 |
echo '<ol class="debug-bar-php-list">';
|
65 |
-
foreach ( $this->warnings as $
|
66 |
-
list( $location, $message) = $
|
67 |
-
echo
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
echo '</ol>';
|
70 |
}
|
71 |
if ( count( $this->notices ) ) {
|
72 |
echo '<ol class="debug-bar-php-list">';
|
73 |
-
foreach ( $this->notices as $
|
74 |
-
list( $location, $message) = $
|
75 |
-
echo
|
|
|
|
|
|
|
|
|
76 |
}
|
77 |
echo '</ol>';
|
78 |
}
|
@@ -80,3 +88,4 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
|
|
80 |
|
81 |
}
|
82 |
}
|
|
32 |
switch ( $type ) {
|
33 |
case E_WARNING :
|
34 |
case E_USER_WARNING :
|
35 |
+
$this->warnings[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
|
36 |
break;
|
37 |
case E_NOTICE :
|
38 |
case E_USER_NOTICE :
|
39 |
+
$this->notices[$_key] = array( $file.':'.$line, $message, wp_debug_backtrace_summary( __CLASS__ ) );
|
40 |
break;
|
41 |
case E_STRICT :
|
42 |
// TODO
|
62 |
echo '<h2><span>Total Notices:</span>' . number_format( count( $this->notices ) ) . "</h2>\n";
|
63 |
if ( count( $this->warnings ) ) {
|
64 |
echo '<ol class="debug-bar-php-list">';
|
65 |
+
foreach ( $this->warnings as $location_message_stack ) {
|
66 |
+
list( $location, $message, $stack) = $location_message_stack;
|
67 |
+
echo '<li class="debug-bar-php-warning">WARNING: ';
|
68 |
+
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
69 |
+
echo '<br/>';
|
70 |
+
echo $stack;
|
71 |
+
echo '</li>';
|
72 |
}
|
73 |
echo '</ol>';
|
74 |
}
|
75 |
if ( count( $this->notices ) ) {
|
76 |
echo '<ol class="debug-bar-php-list">';
|
77 |
+
foreach ( $this->notices as $location_message_stack) {
|
78 |
+
list( $location, $message, $stack) = $location_message_stack;
|
79 |
+
echo '<li class="debug-bar-php-notice">NOTICE: ';
|
80 |
+
echo str_replace(ABSPATH, '', $location) . ' - ' . strip_tags($message);
|
81 |
+
echo '<br/>';
|
82 |
+
echo $stack;
|
83 |
+
echo '</li>';
|
84 |
}
|
85 |
echo '</ol>';
|
86 |
}
|
88 |
|
89 |
}
|
90 |
}
|
91 |
+
|
panels/class-debug-bar-wp-query.php
CHANGED
@@ -86,20 +86,21 @@ class Debug_Bar_WP_Query extends Debug_Bar_Panel {
|
|
86 |
if ( ! is_null( $queried_object ) ) {
|
87 |
echo '<h3>Queried Object:</h3>';
|
88 |
echo '<ol class="debug-bar-wp-query-list">';
|
89 |
-
|
90 |
-
// See: http://wordpress.org/support/topic/plugin-debug-bar-custom-post-type-archive-catchable-fatal-error
|
91 |
-
// TODO: Fix better
|
92 |
-
if ( is_object( $value ) ) {
|
93 |
-
echo '<li>' . $key . ' => <ol>';
|
94 |
-
foreach ( $value as $_key => $_value )
|
95 |
-
echo '<li>' . $_key . ' => ' . $_value . '</li>';
|
96 |
-
echo '</ol></li>';
|
97 |
-
} else {
|
98 |
-
echo '<li>' . $key . ' => ' . $value . '</li>';
|
99 |
-
}
|
100 |
-
}
|
101 |
echo '</ol>';
|
102 |
}
|
103 |
echo '</div>';
|
104 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
}
|
86 |
if ( ! is_null( $queried_object ) ) {
|
87 |
echo '<h3>Queried Object:</h3>';
|
88 |
echo '<ol class="debug-bar-wp-query-list">';
|
89 |
+
$this->_recursive_print_kv($queried_object);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
echo '</ol>';
|
91 |
}
|
92 |
echo '</div>';
|
93 |
}
|
94 |
+
|
95 |
+
protected function _recursive_print_kv( $kv_array ) {
|
96 |
+
foreach ( $kv_array as $key => $value ) {
|
97 |
+
if( is_object( $value ) || is_array( $value ) ) {
|
98 |
+
printf( '<li>%s => <ol>', $key );
|
99 |
+
$this->_recursive_print_kv( $value );
|
100 |
+
echo '</ol></li>';
|
101 |
+
} else {
|
102 |
+
echo "<li>{$key} => {$value}</li>";
|
103 |
+
}
|
104 |
+
}
|
105 |
+
}
|
106 |
}
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== Debug Bar ===
|
2 |
Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka
|
3 |
Tags: debug
|
4 |
-
Tested up to:
|
5 |
-
Stable tag: 0.8
|
6 |
Requires at least: 3.1
|
7 |
|
8 |
Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
@@ -21,6 +21,9 @@ Add a PHP/MySQL console with the [Debug Bar Console plugin](http://wordpress.org
|
|
21 |
|
22 |
== Upgrade Notice ==
|
23 |
|
|
|
|
|
|
|
24 |
= 0.8.1 =
|
25 |
Minor security fix.
|
26 |
|
1 |
=== Debug Bar ===
|
2 |
Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka
|
3 |
Tags: debug
|
4 |
+
Tested up to: 4.1-alpha
|
5 |
+
Stable tag: 0.8.2
|
6 |
Requires at least: 3.1
|
7 |
|
8 |
Adds a debug menu to the admin bar that shows query, cache, and other helpful debugging information.
|
21 |
|
22 |
== Upgrade Notice ==
|
23 |
|
24 |
+
= 0.8.2 =
|
25 |
+
Updated to handle a new deprecated message in WordPress 4.0.
|
26 |
+
|
27 |
= 0.8.1 =
|
28 |
Minor security fix.
|
29 |
|