Debug Bar - Version 0.8

Version Description

WordPress 3.3 compatibility UI refresh Removed jQuery UI requirement Full screen by default New debug-bar query parameter to show on page load Removed display cookies JavaScript error tracking (disabled by default)

Download this release

Release Info

Developer nacin
Plugin Icon 128x128 Debug Bar
Version 0.8
Comparing to
See all releases

Code changes from version 0.7 to 0.8

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-warning-summary{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:hover,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary.active{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 a{color:#fff;text-shadow:0 -1px 0 #700;}#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary{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:hover,#wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary.active{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 a{color:#fff;text-shadow:0 -1px 0 #884000;}#querylist{font-family:Arial,Tahoma,sans-serif;display:none;position:fixed;height:250px;left:0;right:0;bottom:0;background:#fff;z-index:99999;color:#000;line-height:150%!important;text-align:left;}#querylist.db-dockable-disabled{height:auto;top:28px;}#debug-bar-handle{border-color:#c6c6c6;border-style:solid;border-width:1px 0;height:2px;background:#fff;cursor:n-resize;}.db-dockable-disabled #debug-bar-handle{cursor:inherit;height:1px;border-top:0;}#debug-bar-menu{background:#d9d9d9;background:-moz-linear-gradient(bottom,#d7d7d7,#e4e4e4);background:-webkit-gradient(linear,left bottom,left top,from(#d7d7d7),to(#e4e4e4));overflow:hidden;height:24px;text-shadow:0 1px 0 #f4f4f4;}#debug-bar-menu-right{float:right;}#debug-status{float:left;text-align:right;padding-top:4px;padding-right:15px;color:#bbb;}#debug-status .debug-status-title{color:#999;}#debug-status .debug-status-data{color:#999;font-weight:bold;}#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{clear:left;padding:3px 15px 0;overflow:hidden;list-style:none;margin:0;}#debug-menu-links li{float:left;margin-right:10px;margin-bottom:0!important;}#debug-menu-links li a{outline:none;display:block;line-height:16px;padding:2px 9px 3px;margin-right:0;color:#777!important;text-decoration:none!important;font-weight:bold!important;font-size:12px;-webkit-border-top-right-radius:4px;-webkit-border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px;}#debug-menu-links li a:hover{color:#555!important;background-color:#eee;background-image:-moz-linear-gradient(bottom,#ddd,#eee);background-image:-webkit-gradient(linear,left bottom,left top,from(#ddd),to(#eee));}#debug-menu-links li a.current{background:#fff;color:#222!important;}#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;}#debug-menu-targets{overflow:auto;position:absolute;top:28px;left:0;right:0;bottom:0;}#querylist .debug-menu-target{margin:10px;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{float:left;margin-top:5px;margin-right:5px;}#debug-bar-actions span{-moz-border-radius:20px;-webkit-border-radius:20px;border-radius:20px;display:block;float:left;font-size:18px;height:12px;line-height:10px;width:12px;color:#eee;background:#aaa;background:-moz-linear-gradient(bottom,#999,#bbb);background:-webkit-gradient(linear,left bottom,left top,from(#999),to(#bbb));text-shadow:0 1px 0 #999;border:1px solid #999;text-align:center;cursor:pointer;}#debug-bar-actions span.minus{line-height:10px;font-size:14px;}#debug-bar-actions span:hover{background:#888;background:-moz-linear-gradient(bottom,#999,#777);background:-webkit-gradient(linear,left bottom,left top,from(#999),to(#777));border:1px solid #777;text-shadow:0 1px 0 #777;}
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;}
css/debug-bar.dev.css CHANGED
@@ -1,6 +1,6 @@
1
- /**
2
- * Admin bar styling
3
- */
4
 
5
  #wpadminbar #wp-admin-bar-debug-bar {
6
  float: right;
@@ -12,36 +12,46 @@
12
  background: -webkit-gradient(linear, left bottom, left top, from(#555), to(#3e3e3e));
13
  }
14
 
15
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  background-color: #f44;
17
  background-image: -moz-linear-gradient(bottom, #d00, #f44);
18
  background-image: -webkit-gradient(linear, left bottom, left top, from(#d00), to(#f44));
19
  }
20
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary:hover,
21
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary.active {
 
 
22
  background-color: #d00;
23
  background-image: -moz-linear-gradient(bottom, #f44, #d00 );
24
  background-image: -webkit-gradient(linear, left bottom, left top, from(#f44), to(#d00));
25
  }
26
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary a {
27
  color: #fff;
28
  text-shadow: 0 -1px 0 #700;
29
  }
30
 
31
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary {
32
- background-color: #ff8922;
33
- background-image: -moz-linear-gradient(bottom, #ee6f00, #ff8922);
34
- background-image: -webkit-gradient(linear, left bottom, left top, from(#ee6f00), to(#ff8922));
35
- }
36
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary:hover,
37
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary.active {
38
- background-color: #ee6f00;
39
- background-image: -moz-linear-gradient(bottom, #ff8922, #ee6f00 );
40
- background-image: -webkit-gradient(linear, left bottom, left top, from(#ff8922), to(#ee6f00));
41
- }
42
- #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary a {
43
- color: #fff;
44
- text-shadow: 0 -1px 0 #884000;
45
  }
46
 
47
  /**
@@ -49,64 +59,111 @@
49
  */
50
 
51
  #querylist {
52
- font-family: Arial, Tahoma, sans-serif;
53
  display: none;
54
  position: fixed;
55
- height: 250px;
 
 
56
  left: 0;
57
  right: 0;
58
  bottom: 0;
59
- background: #fff;
60
- z-index: 99999;
61
  color: #000;
62
  line-height: 150% !important;
63
  text-align: left;
 
64
  }
65
- #querylist.db-dockable-disabled {
66
- height: auto;
 
 
 
 
 
 
 
 
 
 
67
  top: 28px;
 
68
  }
69
 
70
- #debug-bar-handle {
71
- border-color: #c6c6c6;
72
- border-style: solid;
73
- border-width: 1px 0;
74
- height: 2px;
75
- background: #fff;
76
- cursor: n-resize;
77
  }
78
 
79
- .db-dockable-disabled #debug-bar-handle {
80
- cursor: inherit;
81
- height: 1px;
82
- border-top: 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
 
85
  #debug-bar-menu {
86
- background: #d9d9d9; /* fallback color */
87
- background:-moz-linear-gradient(bottom, #d7d7d7, #e4e4e4);
88
- background:-webkit-gradient(linear, left bottom, left top, from(#d7d7d7), to(#e4e4e4));
 
 
 
 
89
  overflow: hidden;
90
- height: 24px;
91
- text-shadow: 0 1px 0 #f4f4f4;
 
 
 
92
  }
93
- #debug-bar-menu-right {
94
- float: right;
 
 
 
 
 
 
 
95
  }
96
 
97
  #debug-status {
98
  float: left;
99
- text-align: right;
100
- padding-top: 4px;
101
- padding-right: 15px;
102
  color: #bbb;
 
 
103
  }
 
 
 
 
 
 
104
  #debug-status .debug-status-title {
105
- color: #999;
 
 
 
 
106
  }
107
  #debug-status .debug-status-data {
108
  color: #999;
109
- font-weight: bold;
 
 
110
  }
111
  #debug-status #debug-status-warning {
112
  font-weight: bold;
@@ -134,8 +191,6 @@
134
  }
135
 
136
  #debug-menu-links {
137
- clear: left;
138
- padding: 3px 15px 0;
139
  overflow: hidden;
140
  list-style: none;
141
  margin: 0;
@@ -143,35 +198,24 @@
143
 
144
  #debug-menu-links li {
145
  float: left;
146
- margin-right: 10px;
147
  margin-bottom: 0 !important;
148
  }
149
 
150
  #debug-menu-links li a {
 
 
 
151
  outline: none;
152
  display: block;
153
- line-height: 16px;
154
- padding: 2px 9px 3px;
155
- margin-right: 0;
156
- color: #777 !important;
157
  text-decoration: none !important;
158
- font-weight: bold !important;
159
- font-size: 12px;
160
- -webkit-border-top-right-radius: 4px;
161
- -webkit-border-top-left-radius: 4px;
162
- -moz-border-radius-topright: 4px;
163
- -moz-border-radius-topleft: 4px;
164
  }
165
 
166
- #debug-menu-links li a:hover {
167
- color: #555 !important;
168
- background-color: #eee;
169
- background-image: -moz-linear-gradient(bottom, #ddd, #eee);
170
- background-image: -webkit-gradient(linear, left bottom, left top, from(#ddd), to(#eee));
171
- }
172
  #debug-menu-links li a.current {
173
- background: #fff;
174
- color: #222 !important;
175
  }
176
 
177
  #querylist h2 {
@@ -245,17 +289,8 @@
245
  text-decoration: none !important;
246
  }
247
 
248
- #debug-menu-targets {
249
- overflow: auto;
250
- position: absolute;
251
- top: 28px;
252
- left: 0;
253
- right: 0;
254
- bottom: 0;
255
- }
256
-
257
  #querylist .debug-menu-target {
258
- margin: 10px;
259
  display: none;
260
  }
261
 
@@ -327,10 +362,15 @@
327
  margin: 15px 10px 15px 0 !important;
328
  }
329
 
 
 
 
 
330
  #debug-bar-actions {
331
- float: left;
332
- margin-top: 5px;
333
- margin-right: 5px;
 
334
  }
335
  #debug-bar-actions span {
336
  -moz-border-radius: 20px;
@@ -338,27 +378,73 @@
338
  border-radius: 20px;
339
  display: block;
340
  float: left;
 
 
 
 
341
  font-size: 18px;
342
- height: 12px;
343
- line-height: 10px;
344
- width: 12px;
 
345
  color: #eee;
346
  background: #aaa;
347
- background: -moz-linear-gradient(bottom, #999, #bbb);
348
- background: -webkit-gradient(linear, left bottom, left top, from(#999), to(#bbb));
349
- text-shadow: 0 1px 0 #999;
350
- border: 1px solid #999;
351
- text-align: center;
352
  cursor: pointer;
353
  }
354
- #debug-bar-actions span.minus {
355
- line-height: 10px;
356
- font-size: 14px;
357
- }
358
  #debug-bar-actions span:hover {
359
  background: #888;
360
- background: -moz-linear-gradient(bottom, #999, #777);
361
- background: -webkit-gradient(linear, left bottom, left top, from(#999), to(#777));
362
- border: 1px solid #777;
363
- text-shadow: 0 1px 0 #777;
364
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* =========================================================================
2
+ * Admin bar styling
3
+ * ========================================================================= */
4
 
5
  #wpadminbar #wp-admin-bar-debug-bar {
6
  float: right;
12
  background: -webkit-gradient(linear, left bottom, left top, from(#555), to(#3e3e3e));
13
  }
14
 
15
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,
16
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus {
17
+ background-color: #ff8922;
18
+ background-image: -moz-linear-gradient(bottom, #ee6f00, #ff8922);
19
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#ee6f00), to(#ff8922));
20
+ }
21
+
22
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:hover,
23
+ .debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary,
24
+ .debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item:focus {
25
+ background-color: #ee6f00;
26
+ background-image: -moz-linear-gradient(bottom, #ff8922, #ee6f00 );
27
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#ff8922), to(#ee6f00));
28
+ }
29
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-notice-summary .ab-item {
30
+ color: #fff;
31
+ text-shadow: 0 -1px 0 #884000;
32
+ }
33
+
34
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,
35
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus {
36
  background-color: #f44;
37
  background-image: -moz-linear-gradient(bottom, #d00, #f44);
38
  background-image: -webkit-gradient(linear, left bottom, left top, from(#d00), to(#f44));
39
  }
40
+
41
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:hover,
42
+ .debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary,
43
+ .debug-bar-visible #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item:focus {
44
  background-color: #d00;
45
  background-image: -moz-linear-gradient(bottom, #f44, #d00 );
46
  background-image: -webkit-gradient(linear, left bottom, left top, from(#f44), to(#d00));
47
  }
48
+ #wpadminbar #wp-admin-bar-debug-bar.debug-bar-php-warning-summary .ab-item {
49
  color: #fff;
50
  text-shadow: 0 -1px 0 #700;
51
  }
52
 
53
+ #wpadminbar #wp-admin-bar-debug-bar ul {
54
+ right: 0;
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
 
57
  /**
59
  */
60
 
61
  #querylist {
 
62
  display: none;
63
  position: fixed;
64
+ height: 33%;
65
+ min-height: 350px;
66
+ font-family: "Helvetica Neue", sans-serif;
67
  left: 0;
68
  right: 0;
69
  bottom: 0;
70
+ background: #f1f1f1;
71
+ z-index: 99000;
72
  color: #000;
73
  line-height: 150% !important;
74
  text-align: left;
75
+ font-size: 12px;
76
  }
77
+
78
+ /* reset debug bar links */
79
+ #querylist a {
80
+ border: 0;
81
+ }
82
+
83
+ .debug-bar-visible #querylist {
84
+ display: block;
85
+ }
86
+
87
+ .debug-bar-maximized #querylist {
88
+ position: fixed;
89
  top: 28px;
90
+ height: auto;
91
  }
92
 
93
+ body.debug-bar-maximized.debug-bar-visible {
94
+ overflow: hidden;
 
 
 
 
 
95
  }
96
 
97
+ #debug-bar-info {
98
+ height: 60px;
99
+ width: 100%;
100
+ position: absolute;
101
+ z-index: 200;
102
+
103
+ background: #f1f1f1;
104
+ border-bottom: 1px solid #fff;
105
+ box-shadow: 0 0 6px rgba( 0, 0, 0, 0.4 );
106
+
107
+ background-color: #f1f1f1; /* Fallback */
108
+ background-image: -ms-linear-gradient(top, #f9f9f9, #dfdfdf); /* IE10 */
109
+ background-image: -moz-linear-gradient(top, #f9f9f9, #dfdfdf); /* Firefox */
110
+ background-image: -o-linear-gradient(top, #f9f9f9, #dfdfdf); /* Opera */
111
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#dfdfdf)); /* old Webkit */
112
+ background-image: -webkit-linear-gradient(top, #f9f9f9, #dfdfdf); /* new Webkit */
113
+ background-image: linear-gradient(top, #f9f9f9, #dfdfdf); /* proposed W3C Markup */
114
  }
115
 
116
  #debug-bar-menu {
117
+ position: absolute;
118
+ top: 61px;
119
+ left: 0;
120
+ width: 250px;
121
+ bottom: 0;
122
+ z-index: 100;
123
+
124
  overflow: hidden;
125
+ text-shadow: 0 1px 1px rgba( 0, 0, 0, 0.9 );
126
+ background: #333;
127
+ -webkit-box-shadow: inset -3px 0 6px rgba( 0, 0, 0, 0.4 );
128
+ -moz-box-shadow: inset -3px 0 6px rgba( 0, 0, 0, 0.4 );
129
+ box-shadow: inset -3px 0 6px rgba( 0, 0, 0, 0.4 );
130
  }
131
+
132
+ #debug-menu-targets {
133
+ overflow: auto;
134
+ position: absolute;
135
+ top: 61px;
136
+ left: 250px;
137
+ right: 0;
138
+ bottom: 0;
139
+ z-index: 150;
140
  }
141
 
142
  #debug-status {
143
  float: left;
144
+ padding-left: 20px;
 
 
145
  color: #bbb;
146
+ font-size: 14px;
147
+ line-height: 60px;
148
  }
149
+
150
+ .debug-status {
151
+ float: left;
152
+ margin-right: 40px;
153
+ }
154
+
155
  #debug-status .debug-status-title {
156
+ color: #555;
157
+ font-weight: 500;
158
+ line-height: 18px;
159
+ font-size: 12px;
160
+ margin-top: 10px;
161
  }
162
  #debug-status .debug-status-data {
163
  color: #999;
164
+ font-weight: 200;
165
+ line-height: 20px;
166
+ font-size: 18px;
167
  }
168
  #debug-status #debug-status-warning {
169
  font-weight: bold;
191
  }
192
 
193
  #debug-menu-links {
 
 
194
  overflow: hidden;
195
  list-style: none;
196
  margin: 0;
198
 
199
  #debug-menu-links li {
200
  float: left;
 
201
  margin-bottom: 0 !important;
202
  }
203
 
204
  #debug-menu-links li a {
205
+ padding: 0 20px;
206
+ width: 210px;
207
+ line-height: 40px;
208
  outline: none;
209
  display: block;
210
+ margin: 0;
211
+ color: #fff !important;
 
 
212
  text-decoration: none !important;
213
+ font-weight: 500 !important;
214
+ font-size: 14px;
 
 
 
 
215
  }
216
 
 
 
 
 
 
 
217
  #debug-menu-links li a.current {
218
+ background: rgba( 0, 0, 0, 0.2 );
 
219
  }
220
 
221
  #querylist h2 {
289
  text-decoration: none !important;
290
  }
291
 
 
 
 
 
 
 
 
 
 
292
  #querylist .debug-menu-target {
293
+ margin: 20px;
294
  display: none;
295
  }
296
 
362
  margin: 15px 10px 15px 0 !important;
363
  }
364
 
365
+ /* =========================================================================
366
+ * Actions: Maximize / restore
367
+ * ========================================================================= */
368
+
369
  #debug-bar-actions {
370
+ position: absolute;
371
+ top: 21px;
372
+ right: 20px;
373
+ z-index: 300;
374
  }
375
  #debug-bar-actions span {
376
  -moz-border-radius: 20px;
378
  border-radius: 20px;
379
  display: block;
380
  float: left;
381
+ height: 19px;
382
+ width: 19px;
383
+ margin-left: 5px;
384
+
385
  font-size: 18px;
386
+ line-height: 14px;
387
+ text-align: center;
388
+ font-weight: bold;
389
+
390
  color: #eee;
391
  background: #aaa;
392
+
 
 
 
 
393
  cursor: pointer;
394
  }
 
 
 
 
395
  #debug-bar-actions span:hover {
396
  background: #888;
397
+ }
398
+
399
+ #debug-bar-actions span.restore {
400
+ line-height: 15px;
401
+ }
402
+
403
+ .debug-bar-maximized #debug-bar-actions span.restore {
404
+ display: block;
405
+ }
406
+ .debug-bar-maximized #debug-bar-actions span.maximize {
407
+ display: none;
408
+ }
409
+
410
+ .debug-bar-partial #debug-bar-actions span.restore {
411
+ display: none;
412
+ }
413
+ .debug-bar-partial #debug-bar-actions span.maximize {
414
+ display: block;
415
+ }
416
+
417
+ /* =========================================================================
418
+ * JS Error item styling
419
+ * ========================================================================= */
420
+
421
+ #debug-menu-links li a#debug-menu-link-Debug_Bar_JS {
422
+ display: none;
423
+ }
424
+
425
+ #debug-bar-js ol.debug-bar-js-list {
426
+ padding: 0 !important;
427
+ margin: 0 !important;
428
+ list-style: none;
429
+ clear: left;
430
+ }
431
+
432
+ #debug-bar-js ol.debug-bar-js-list li {
433
+ padding: 10px;
434
+ margin: 0 0 10px 0;
435
+ }
436
+
437
+ #debug-bar-js .debug-bar-js-error {
438
+ background-color: #ffebe8;
439
+ border: 1px solid #c00;
440
+ }
441
+
442
+ #debug-bar-js .debug-bar-js-error span {
443
+ color: #666;
444
+ font-size: 0.8em;
445
+ display: block;
446
+ }
447
+
448
+ #debug-bar-js .debug-bar-js-error:hover span {
449
+ color: #000;
450
+ }
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.7
8
  Author URI: http://wordpress.org/
9
  */
10
 
@@ -33,17 +33,19 @@ class Debug_Bar {
33
  add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu' ), 1000 );
34
  add_action( 'wp_after_admin_bar_render', array( &$this, 'render' ) );
35
  add_action( 'wp_head', array( &$this, 'ensure_ajaxurl' ), 1 );
 
 
36
 
37
  $this->requirements();
38
  $this->enqueue();
39
  $this->init_panels();
40
  }
41
-
42
  /* Are we on the wp-login.php page?
43
  * We can get here while logged in and break the page as the admin bar isn't shown and otherthings the js relies on aren't available.
44
  */
45
  function is_wp_login() {
46
- return 'wp-login.php' == basename( $_SERVER['SCRIPT_NAME']);
47
  }
48
 
49
  function init_ajax() {
@@ -55,7 +57,7 @@ class Debug_Bar {
55
  }
56
 
57
  function requirements() {
58
- $recs = array( 'panel', 'php', 'queries', 'request', 'wp-query', 'object-cache', 'deprecated' );
59
  foreach ( $recs as $rec )
60
  require_once "panels/class-debug-bar-$rec.php";
61
  }
@@ -63,9 +65,9 @@ class Debug_Bar {
63
  function enqueue() {
64
  $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
65
 
66
- wp_enqueue_style( 'debug-bar', plugins_url( "css/debug-bar$suffix.css", __FILE__ ), array(), '20110316a' );
67
- wp_enqueue_script( 'debug-bar-ui-dockable', plugins_url( "js/ui-dockable$suffix.js", __FILE__ ), array('jquery-ui-mouse'), '20110113', true );
68
- wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array('jquery', 'debug-bar-ui-dockable', 'utils'), '20110114', true );
69
 
70
  do_action('debug_bar_enqueue_scripts');
71
  }
@@ -73,8 +75,8 @@ class Debug_Bar {
73
  function init_panels() {
74
  $classes = array(
75
  'Debug_Bar_PHP',
76
- 'Debug_Bar_WP_Query',
77
  'Debug_Bar_Queries',
 
78
  'Debug_Bar_Deprecated',
79
  'Debug_Bar_Request',
80
  'Debug_Bar_Object_Cache',
@@ -85,26 +87,12 @@ class Debug_Bar {
85
  }
86
 
87
  $this->panels = apply_filters( 'debug_bar_panels', $this->panels );
88
-
89
- foreach ( $this->panels as $panel_key => $panel ) {
90
- if ( ! $panel->is_visible() )
91
- unset( $this->panels[ $panel_key ] );
92
- }
93
  }
94
 
95
- function ensure_ajaxurl() {
96
- if ( is_admin() )
97
- return;
98
- $current_user = wp_get_current_user();
99
- ?>
100
  <script type="text/javascript">
101
  //<![CDATA[
102
- var userSettings = {
103
- 'url': '<?php echo SITECOOKIEPATH; ?>',
104
- 'uid': '<?php echo $current_user->ID; ?>',
105
- 'time':'<?php echo time() ?>'
106
- },
107
- ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
108
  //]]>
109
  </script>
110
  <?php
@@ -128,10 +116,41 @@ class Debug_Bar {
128
 
129
  /* Add the main siteadmin menu item */
130
  $wp_admin_bar->add_menu( array(
131
- 'id' => 'debug-bar',
132
- 'title' => __('Debug', 'debug-bar'),
133
- 'meta' => array( 'class' => $classes )
 
134
  ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  }
136
 
137
  function render() {
@@ -149,41 +168,42 @@ class Debug_Bar {
149
  ?>
150
  <div id='querylist'>
151
 
152
- <div id='debug-bar-handle'></div>
153
- <div id='debug-bar-menu'>
154
- <div id='debug-bar-menu-right'>
 
 
 
 
155
  <div id="debug-status">
156
  <?php //@todo: Add a links to information about WP_DEBUG, PHP version, MySQL version, and Peak Memory.
157
  $statuses = array();
158
- if ( ! WP_DEBUG )
159
- $statuses[] = array( 'warning', __('WP_DEBUG OFF', 'debug-bar'), '' );
160
- $statuses[] = array( 'site', sprintf( __('Site #%d on %s', 'debug-bar'), $GLOBALS['blog_id'], php_uname( 'n' ) ), '' );
161
  $statuses[] = array( 'php', __('PHP', 'debug-bar'), phpversion() );
162
- $statuses[] = array( 'db', __('DB', 'debug-bar'), $wpdb->db_version() );
163
- $statuses[] = array( 'memory', __('Mem.', 'debug-bar'), sprintf( __('%s bytes', 'debug-bar'), number_format( $this->safe_memory_get_peak_usage() ) ) );
 
 
 
 
164
 
165
  $statuses = apply_filters( 'debug_bar_statuses', $statuses );
166
 
167
- $status_html = array();
168
- foreach ( $statuses as $status ) {
169
  list( $slug, $title, $data ) = $status;
170
 
171
- $html = "<span id='debug-status-$slug' class='debug-status'>";
172
- $html .= "<span class='debug-status-title'>$title</span>";
173
- if ( ! empty( $data ) )
174
- $html .= " <span class='debug-status-data'>$data</span>";
175
- $html .= '</span>';
176
- $status_html[] = $html;
177
- }
178
-
179
- echo implode( ' | ', $status_html );
180
  ?>
181
  </div>
182
- <div id="debug-bar-actions">
183
- <span class="plus">+</span>
184
- <span class="minus" style="display: none">&ndash;</span>
185
- </div>
186
- </div>
187
  <ul id="debug-menu-links">
188
 
189
  <?php
@@ -229,5 +249,3 @@ class Debug_Bar {
229
  }
230
 
231
  $GLOBALS['debug_bar'] = new Debug_Bar();
232
-
233
- ?>
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
 
33
  add_action( 'admin_bar_menu', array( &$this, 'admin_bar_menu' ), 1000 );
34
  add_action( 'wp_after_admin_bar_render', array( &$this, 'render' ) );
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' ) );
38
 
39
  $this->requirements();
40
  $this->enqueue();
41
  $this->init_panels();
42
  }
43
+
44
  /* Are we on the wp-login.php page?
45
  * We can get here while logged in and break the page as the admin bar isn't shown and otherthings the js relies on aren't available.
46
  */
47
  function is_wp_login() {
48
+ return 'wp-login.php' == basename( $_SERVER['SCRIPT_NAME'] );
49
  }
50
 
51
  function init_ajax() {
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
  }
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(), '20111209' );
69
+
70
+ wp_enqueue_script( 'debug-bar', plugins_url( "js/debug-bar$suffix.js", __FILE__ ), array( 'jquery' ), '20111209', true );
71
 
72
  do_action('debug_bar_enqueue_scripts');
73
  }
75
  function init_panels() {
76
  $classes = array(
77
  'Debug_Bar_PHP',
 
78
  'Debug_Bar_Queries',
79
+ 'Debug_Bar_WP_Query',
80
  'Debug_Bar_Deprecated',
81
  'Debug_Bar_Request',
82
  'Debug_Bar_Object_Cache',
87
  }
88
 
89
  $this->panels = apply_filters( 'debug_bar_panels', $this->panels );
 
 
 
 
 
90
  }
91
 
92
+ function ensure_ajaxurl() { ?>
 
 
 
 
93
  <script type="text/javascript">
94
  //<![CDATA[
95
+ var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
 
 
 
 
 
96
  //]]>
97
  </script>
98
  <?php
116
 
117
  /* Add the main siteadmin menu item */
118
  $wp_admin_bar->add_menu( array(
119
+ 'id' => 'debug-bar',
120
+ 'parent' => 'top-secondary',
121
+ 'title' => apply_filters( 'debug_bar_title', __('Debug', 'debug-bar') ),
122
+ 'meta' => array( 'class' => $classes ),
123
  ) );
124
+
125
+ // @todo: Uncomment and finish me!
126
+ // foreach ( $this->panels as $panel_key => $panel ) {
127
+ // if ( ! $panel->is_visible() )
128
+ // continue;
129
+ //
130
+ // $panel_class = get_class( $panel );
131
+ //
132
+ // $wp_admin_bar->add_menu( array(
133
+ // 'parent' => 'debug-bar',
134
+ // 'id' => "debug-bar-$panel_class",
135
+ // 'title' => $panel->title(),
136
+ // ) );
137
+ // }
138
+ }
139
+
140
+ function body_class( $classes ) {
141
+ if ( is_array( $classes ) )
142
+ $classes[] = 'debug-bar-maximized';
143
+ else
144
+ $classes .= ' debug-bar-maximized ';
145
+
146
+ if ( isset( $_GET['debug-bar'] ) ) {
147
+ if ( is_array( $classes ) )
148
+ $classes[] = 'debug-bar-visible';
149
+ else
150
+ $classes .= ' debug-bar-visible ';
151
+ }
152
+
153
+ return $classes;
154
  }
155
 
156
  function render() {
168
  ?>
169
  <div id='querylist'>
170
 
171
+ <div id="debug-bar-actions">
172
+ <span class="maximize">+</span>
173
+ <span class="restore">&ndash;</span>
174
+ <span class="close">&times;</span>
175
+ </div>
176
+
177
+ <div id='debug-bar-info'>
178
  <div id="debug-status">
179
  <?php //@todo: Add a links to information about WP_DEBUG, PHP version, MySQL version, and Peak Memory.
180
  $statuses = array();
181
+ $statuses[] = array( 'site', php_uname( 'n' ), sprintf( __( '#%d', 'debug-bar' ), get_current_blog_id() ) );
 
 
182
  $statuses[] = array( 'php', __('PHP', 'debug-bar'), phpversion() );
183
+ $db_title = empty( $wpdb->is_mysql ) ? __( 'DB', 'debug-bar' ) : 'MySQL';
184
+ $statuses[] = array( 'db', $db_title, $wpdb->db_version() );
185
+ $statuses[] = array( 'memory', __('Memory Usage', 'debug-bar'), sprintf( __('%s bytes', 'debug-bar'), number_format_i18n( $this->safe_memory_get_peak_usage() ) ) );
186
+
187
+ if ( ! WP_DEBUG )
188
+ $statuses[] = array( 'warning', __('Please Enable', 'debug-bar'), 'WP_DEBUG' );
189
 
190
  $statuses = apply_filters( 'debug_bar_statuses', $statuses );
191
 
192
+ foreach ( $statuses as $status ):
 
193
  list( $slug, $title, $data ) = $status;
194
 
195
+ ?><div id='debug-status-<?php echo esc_attr( $slug ); ?>' class='debug-status'>
196
+ <div class='debug-status-title'><?php echo $title; ?></div>
197
+ <?php if ( ! empty( $data ) ): ?>
198
+ <div class='debug-status-data'><?php echo $data; ?></div>
199
+ <?php endif; ?>
200
+ </div><?php
201
+ endforeach;
 
 
202
  ?>
203
  </div>
204
+ </div>
205
+
206
+ <div id='debug-bar-menu'>
 
 
207
  <ul id="debug-menu-links">
208
 
209
  <?php
249
  }
250
 
251
  $GLOBALS['debug_bar'] = new Debug_Bar();
 
 
js/debug-bar-js.dev.js ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ var count, list, rawCount = 0;
3
+
4
+ window.onerror = function( errorMsg, url, lineNumber ) {
5
+
6
+ var errorLine, place, button, tab;
7
+
8
+ rawCount++;
9
+
10
+ if ( !count )
11
+ count = document.getElementById( 'debug-bar-js-error-count' );
12
+ if ( !list )
13
+ list = document.getElementById( 'debug-bar-js-errors' );
14
+
15
+ if ( !count || !list )
16
+ return; // threw way too early... @todo cache these?
17
+
18
+ if ( 1 == rawCount ) {
19
+ button = document.getElementById( 'wp-admin-bar-debug-bar' );
20
+ if ( !button )
21
+ return; // how did this happen?
22
+ if ( button.className.indexOf( 'debug-bar-php-warning-summary' ) === -1 )
23
+ button.className = button.className + ' debug-bar-php-warning-summary';
24
+
25
+ tab = document.getElementById('debug-menu-link-Debug_Bar_JS');
26
+ if ( tab )
27
+ tab.style.display = 'block';
28
+ }
29
+
30
+ count.textContent = rawCount;
31
+ errorLine = document.createElement( 'li' );
32
+ errorLine.className = 'debug-bar-js-error';
33
+ errorLine.textContent = errorMsg;
34
+ place = document.createElement( 'span' );
35
+ place.textContent = url + ' line ' + lineNumber;
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
+ })();
js/debug-bar-js.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(){var b,c,a=0;window.onerror=function(j,g,d){var f,e,h,i;a++;if(!b){b=document.getElementById("debug-bar-js-error-count")}if(!c){c=document.getElementById("debug-bar-js-errors")}if(!b||!c){return}if(1==a){h=document.getElementById("wp-admin-bar-debug-bar");if(!h){return}if(h.className.indexOf("debug-bar-php-warning-summary")===-1){h.className=h.className+" debug-bar-php-warning-summary"}i=document.getElementById("debug-menu-link-Debug_Bar_JS");if(i){i.style.display="block"}}b.textContent=a;f=document.createElement("li");f.className="debug-bar-js-error";f.textContent=j;e=document.createElement("span");e.textContent=g+" line "+d;f.appendChild(e);c.appendChild(f);return false};window.addEventListener("error",function(d){d.preventDefault()},true)})();
js/debug-bar.dev.js CHANGED
@@ -2,147 +2,45 @@ var wpDebugBar;
2
 
3
  (function($) {
4
 
5
- var debugBar, bounds, api, $win;
6
-
7
- bounds = {
8
- adminBarHeight: 0,
9
- minHeight: 0,
10
- marginBottom: 0,
11
-
12
- inUpper: function(){
13
- return debugBar.offset().top - $win.scrollTop() >= bounds.adminBarHeight;
14
- },
15
- inLower: function(){
16
- return debugBar.outerHeight() >= bounds.minHeight
17
- && $win.height() >= bounds.minHeight;
18
- },
19
- update: function( to ){
20
- if ( typeof to == "number" || to == 'auto' )
21
- debugBar.height( to );
22
- if ( ! bounds.inUpper() || to == 'upper' )
23
- debugBar.height( $win.height() - bounds.adminBarHeight );
24
- if ( ! bounds.inLower() || to == 'lower' )
25
- debugBar.height( bounds.minHeight );
26
- api.spacer.css( 'margin-bottom', debugBar.height() + bounds.marginBottom );
27
- },
28
- restore: function(){
29
- api.spacer.css( 'margin-bottom', bounds.marginBottom );
30
- }
31
- };
32
 
33
  wpDebugBar = api = {
34
  // The element that we will pad to prevent the debug bar
35
  // from overlapping the bottom of the page.
36
- spacer: undefined,
37
 
38
- init: function(){
39
- // Initialize variables.
40
- debugBar = $('#querylist');
41
- $win = $(window);
42
-
43
- // In the admin, we need to pad the footer.
44
- api.spacer = $('.wp-admin #footer');
45
  // If we're not in the admin, pad the body.
46
- if ( ! api.spacer.length )
47
- api.spacer = $(document.body);
48
-
49
- bounds.minHeight = $('#debug-bar-handle').outerHeight() + $('#debug-bar-menu').outerHeight();
50
- bounds.adminBarHeight = $('#wpadminbar').outerHeight();
51
- bounds.marginBottom = parseInt( api.spacer.css('margin-bottom'), 10 );
52
 
53
- api.dock();
54
  api.toggle.init();
55
  api.tabs();
56
  api.actions.init();
57
- api.cookie.restore();
58
- },
59
-
60
- cookie: {
61
- get: function() {
62
- var cookie = wpCookies.getHash('wp-debug-bar-' + userSettings.uid);
63
-
64
- if ( ! cookie )
65
- return;
66
-
67
- // Convert the properties to the correct types.
68
- cookie.visible = cookie.visible == 'true';
69
- cookie.height = parseInt( cookie.height, 10 );
70
- return cookie;
71
- },
72
- update: function() {
73
- var name = 'wp-debug-bar-' + userSettings.uid,
74
- expires = new Date(),
75
- path = userSettings.url,
76
- value = {
77
- visible: debugBar.is(':visible'),
78
- height: debugBar.height()
79
- };
80
-
81
- expires.setTime( expires.getTime() + 31536000000 );
82
-
83
- wpCookies.setHash( name, value, expires, path );
84
- },
85
- restore: function() {
86
- var cookie = api.cookie.get();
87
-
88
- if ( ! cookie )
89
- return;
90
-
91
- api.toggle.pending = cookie.height;
92
- api.toggle.visibility( cookie.visible );
93
- }
94
- },
95
-
96
- dock: function(){
97
- debugBar.dockable({
98
- handle: '#debug-bar-handle',
99
- resize: function( e, ui ) {
100
- return bounds.inUpper() && bounds.inLower();
101
- },
102
- resized: function( e, ui ) {
103
- bounds.update();
104
- },
105
- stop: function( e, ui ) {
106
- api.cookie.update();
107
- }
108
- });
109
-
110
- // If the window is resized, make sure the debug bar isn't too large.
111
- $win.resize( function(){
112
- if ( debugBar.is(':visible') && ! debugBar.dockable('option', 'disabled') )
113
- bounds.update();
114
- });
115
  },
116
 
117
  toggle: {
118
- pending: '',
119
  init: function() {
120
  $('#wp-admin-bar-debug-bar').click( function(e) {
121
  e.preventDefault();
122
  api.toggle.visibility();
123
  });
124
  },
125
- visibility: function( show ){
126
- show = typeof show == 'undefined' ? debugBar.is(':hidden') : show;
127
 
128
- debugBar.toggle( show );
129
- $(this).toggleClass( 'active', show );
130
 
131
- if ( show ) {
132
- bounds.update( api.toggle.pending );
133
- api.toggle.pending = '';
134
- } else {
135
- bounds.restore();
136
- }
137
- api.cookie.update();
138
  }
139
  },
140
 
141
- tabs: function(){
142
  var debugMenuLinks = $('.debug-menu-link'),
143
  debugMenuTargets = $('.debug-menu-target');
144
 
145
- debugMenuLinks.click( function(e){
146
  var t = $(this);
147
 
148
  e.preventDefault();
@@ -151,48 +49,43 @@ wpDebugBar = api = {
151
  return;
152
 
153
  // Deselect other tabs and hide other panels.
154
- debugMenuTargets.hide();
155
  debugMenuLinks.removeClass('current');
156
 
157
  // Select the current tab and show the current panel.
158
  t.addClass('current');
159
  // The hashed component of the href is the id that we want to display.
160
- $('#' + this.href.substr( this.href.indexOf( '#' ) + 1 ) ).show();
161
  });
162
  },
163
 
164
  actions: {
165
- height: 0,
166
- overflow: 'auto',
167
- buttons: {},
168
-
169
  init: function() {
170
  var actions = $('#debug-bar-actions');
171
 
172
- api.actions.height = debugBar.height();
173
- api.actions.overflow = api.spacer.css( 'overflow' );
174
-
175
- api.actions.buttons.max = $('.plus', actions).click( api.actions.maximize );
176
- api.actions.buttons.res = $('.minus', actions).click( api.actions.restore );
177
  },
178
  maximize: function() {
179
- api.actions.height = debugBar.height();
180
- api.spacer.css( 'overflow', 'hidden' );
181
- bounds.update( 'auto' );
182
- api.actions.buttons.max.hide();
183
- api.actions.buttons.res.show();
184
- debugBar.dockable('disable');
185
  },
186
  restore: function() {
187
- api.spacer.css( 'overflow', api.actions.overflow );
188
- bounds.update( api.actions.height );
189
- api.actions.buttons.res.hide();
190
- api.actions.buttons.max.show();
191
- debugBar.dockable('enable');
 
192
  }
193
  }
194
  };
195
 
 
 
 
 
196
  $(document).ready( wpDebugBar.init );
197
 
198
  })(jQuery);
2
 
3
  (function($) {
4
 
5
+ var api;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  wpDebugBar = api = {
8
  // The element that we will pad to prevent the debug bar
9
  // from overlapping the bottom of the page.
10
+ body: undefined,
11
 
12
+ init: function() {
 
 
 
 
 
 
13
  // If we're not in the admin, pad the body.
14
+ api.body = $(document.body);
 
 
 
 
 
15
 
 
16
  api.toggle.init();
17
  api.tabs();
18
  api.actions.init();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  },
20
 
21
  toggle: {
 
22
  init: function() {
23
  $('#wp-admin-bar-debug-bar').click( function(e) {
24
  e.preventDefault();
25
  api.toggle.visibility();
26
  });
27
  },
28
+ visibility: function( show ) {
29
+ show = typeof show == 'undefined' ? ! api.body.hasClass( 'debug-bar-visible' ) : show;
30
 
31
+ // Show/hide the debug bar.
32
+ api.body.toggleClass( 'debug-bar-visible', show );
33
 
34
+ // Press/unpress the button.
35
+ $(this).toggleClass( 'active', show );
 
 
 
 
 
36
  }
37
  },
38
 
39
+ tabs: function() {
40
  var debugMenuLinks = $('.debug-menu-link'),
41
  debugMenuTargets = $('.debug-menu-target');
42
 
43
+ debugMenuLinks.click( function(e) {
44
  var t = $(this);
45
 
46
  e.preventDefault();
49
  return;
50
 
51
  // Deselect other tabs and hide other panels.
52
+ debugMenuTargets.hide().trigger('debug-bar-hide');
53
  debugMenuLinks.removeClass('current');
54
 
55
  // Select the current tab and show the current panel.
56
  t.addClass('current');
57
  // The hashed component of the href is the id that we want to display.
58
+ $('#' + this.href.substr( this.href.indexOf( '#' ) + 1 ) ).show().trigger('debug-bar-show');
59
  });
60
  },
61
 
62
  actions: {
 
 
 
 
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 );
 
 
69
  },
70
  maximize: function() {
71
+ api.body.removeClass('debug-bar-partial');
72
+ api.body.addClass('debug-bar-maximized');
 
 
 
 
73
  },
74
  restore: function() {
75
+ api.body.removeClass('debug-bar-maximized');
76
+ api.body.addClass('debug-bar-partial');
77
+ },
78
+ close: function() {
79
+ api.toggle.visibility( false );
80
+ console.log( 'boo');
81
  }
82
  }
83
  };
84
 
85
+ wpDebugBar.Panel = function() {
86
+
87
+ };
88
+
89
  $(document).ready( wpDebugBar.init );
90
 
91
  })(jQuery);
js/debug-bar.js CHANGED
@@ -1 +1 @@
1
- var wpDebugBar;(function(c){var d,b,a,e;b={adminBarHeight:0,minHeight:0,marginBottom:0,inUpper:function(){return d.offset().top-e.scrollTop()>=b.adminBarHeight},inLower:function(){return d.outerHeight()>=b.minHeight&&e.height()>=b.minHeight},update:function(f){if(typeof f=="number"||f=="auto"){d.height(f)}if(!b.inUpper()||f=="upper"){d.height(e.height()-b.adminBarHeight)}if(!b.inLower()||f=="lower"){d.height(b.minHeight)}a.spacer.css("margin-bottom",d.height()+b.marginBottom)},restore:function(){a.spacer.css("margin-bottom",b.marginBottom)}};wpDebugBar=a={spacer:undefined,init:function(){d=c("#querylist");e=c(window);a.spacer=c(".wp-admin #footer");if(!a.spacer.length){a.spacer=c(document.body)}b.minHeight=c("#debug-bar-handle").outerHeight()+c("#debug-bar-menu").outerHeight();b.adminBarHeight=c("#wpadminbar").outerHeight();b.marginBottom=parseInt(a.spacer.css("margin-bottom"),10);a.dock();a.toggle.init();a.tabs();a.actions.init();a.cookie.restore()},cookie:{get:function(){var f=wpCookies.getHash("wp-debug-bar-"+userSettings.uid);if(!f){return}f.visible=f.visible=="true";f.height=parseInt(f.height,10);return f},update:function(){var g="wp-debug-bar-"+userSettings.uid,f=new Date(),i=userSettings.url,h={visible:d.is(":visible"),height:d.height()};f.setTime(f.getTime()+31536000000);wpCookies.setHash(g,h,f,i)},restore:function(){var f=a.cookie.get();if(!f){return}a.toggle.pending=f.height;a.toggle.visibility(f.visible)}},dock:function(){d.dockable({handle:"#debug-bar-handle",resize:function(g,f){return b.inUpper()&&b.inLower()},resized:function(g,f){b.update()},stop:function(g,f){a.cookie.update()}});e.resize(function(){if(d.is(":visible")&&!d.dockable("option","disabled")){b.update()}})},toggle:{pending:"",init:function(){c("#wp-admin-bar-debug-bar").click(function(f){f.preventDefault();a.toggle.visibility()})},visibility:function(f){f=typeof f=="undefined"?d.is(":hidden"):f;d.toggle(f);c(this).toggleClass("active",f);if(f){b.update(a.toggle.pending);a.toggle.pending=""}else{b.restore()}a.cookie.update()}},tabs:function(){var g=c(".debug-menu-link"),f=c(".debug-menu-target");g.click(function(i){var h=c(this);i.preventDefault();if(h.hasClass("current")){return}f.hide();g.removeClass("current");h.addClass("current");c("#"+this.href.substr(this.href.indexOf("#")+1)).show()})},actions:{height:0,overflow:"auto",buttons:{},init:function(){var f=c("#debug-bar-actions");a.actions.height=d.height();a.actions.overflow=a.spacer.css("overflow");a.actions.buttons.max=c(".plus",f).click(a.actions.maximize);a.actions.buttons.res=c(".minus",f).click(a.actions.restore)},maximize:function(){a.actions.height=d.height();a.spacer.css("overflow","hidden");b.update("auto");a.actions.buttons.max.hide();a.actions.buttons.res.show();d.dockable("disable")},restore:function(){a.spacer.css("overflow",a.actions.overflow);b.update(a.actions.height);a.actions.buttons.res.hide();a.actions.buttons.max.show();d.dockable("enable")}}};c(document).ready(wpDebugBar.init)})(jQuery);
1
+ var wpDebugBar;(function(b){var a;wpDebugBar=a={body:undefined,init:function(){a.body=b(document.body);a.toggle.init();a.tabs();a.actions.init()},toggle:{init:function(){b("#wp-admin-bar-debug-bar").click(function(c){c.preventDefault();a.toggle.visibility()})},visibility:function(c){c=typeof c=="undefined"?!a.body.hasClass("debug-bar-visible"):c;a.body.toggleClass("debug-bar-visible",c);b(this).toggleClass("active",c)}},tabs:function(){var d=b(".debug-menu-link"),c=b(".debug-menu-target");d.click(function(g){var f=b(this);g.preventDefault();if(f.hasClass("current")){return}c.hide().trigger("debug-bar-hide");d.removeClass("current");f.addClass("current");b("#"+this.href.substr(this.href.indexOf("#")+1)).show().trigger("debug-bar-show")})},actions:{init:function(){var c=b("#debug-bar-actions");b(".maximize",c).click(a.actions.maximize);b(".restore",c).click(a.actions.restore);b(".close",c).click(a.actions.close)},maximize:function(){a.body.removeClass("debug-bar-partial");a.body.addClass("debug-bar-maximized")},restore:function(){a.body.removeClass("debug-bar-maximized");a.body.addClass("debug-bar-partial")},close:function(){a.toggle.visibility(false);console.log("boo")}}};wpDebugBar.Panel=function(){};b(document).ready(wpDebugBar.init)})(jQuery);
panels/class-debug-bar-deprecated.php CHANGED
@@ -95,6 +95,3 @@ class Debug_Bar_Deprecated extends Debug_Bar_Panel {
95
  $this->deprecated_arguments[$file.':'.$line] = $message;
96
  }
97
  }
98
-
99
-
100
- ?>
95
  $this->deprecated_arguments[$file.':'.$line] = $message;
96
  }
97
  }
 
 
 
panels/class-debug-bar-js.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ 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
+ $wcsf2011 = '20110813';
15
+ wp_enqueue_script( 'debug-bar-js', plugins_url( "js/debug-bar-js.dev.js", dirname(__FILE__) ), array(), $wcsf2011 );
16
+ }
17
+
18
+ function render() {
19
+ echo '<div id="debug-bar-js">';
20
+ echo '<h2><span>' . __( 'Total Errors:', 'debug-bar' ) . "</span><div id='debug-bar-js-error-count'>0</div></h2>\n";
21
+ echo '<ol class="debug-bar-js-list" id="debug-bar-js-errors"></ol>' . "\n";
22
+ echo '</div>';
23
+ }
24
+ }
panels/class-debug-bar-object-cache.php CHANGED
@@ -22,5 +22,3 @@ class Debug_Bar_Object_Cache extends Debug_Bar_Panel {
22
  echo $out;
23
  }
24
  }
25
-
26
- ?>
22
  echo $out;
23
  }
24
  }
 
 
panels/class-debug-bar-panel.php CHANGED
@@ -45,5 +45,3 @@ class Debug_Bar_Panel {
45
  return $classes;
46
  }
47
  }
48
-
49
- ?>
45
  return $classes;
46
  }
47
  }
 
 
panels/class-debug-bar-php.php CHANGED
@@ -14,8 +14,8 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
14
  $this->real_error_handler = set_error_handler( array( &$this, 'error_handler' ) );
15
  }
16
 
17
- function prerender() {
18
- $this->set_visible( count( $this->notices ) || count( $this->warnings ) );
19
  }
20
 
21
  function debug_bar_classes( $classes ) {
@@ -80,5 +80,3 @@ class Debug_Bar_PHP extends Debug_Bar_Panel {
80
 
81
  }
82
  }
83
-
84
- ?>
14
  $this->real_error_handler = set_error_handler( array( &$this, 'error_handler' ) );
15
  }
16
 
17
+ function is_visible() {
18
+ return count( $this->notices ) || count( $this->warnings );
19
  }
20
 
21
  function debug_bar_classes( $classes ) {
80
 
81
  }
82
  }
 
 
panels/class-debug-bar-queries.php CHANGED
@@ -11,7 +11,7 @@ class Debug_Bar_Queries extends Debug_Bar_Panel {
11
 
12
  function debug_bar_classes( $classes ) {
13
  if ( ! empty($GLOBALS['EZSQL_ERROR']) )
14
- $classes[] = 'warning';
15
  return $classes;
16
  }
17
 
@@ -78,5 +78,3 @@ class Debug_Bar_Queries extends Debug_Bar_Panel {
78
  echo $out;
79
  }
80
  }
81
-
82
- ?>
11
 
12
  function debug_bar_classes( $classes ) {
13
  if ( ! empty($GLOBALS['EZSQL_ERROR']) )
14
+ $classes[] = 'debug-bar-php-warning-summary';
15
  return $classes;
16
  }
17
 
78
  echo $out;
79
  }
80
  }
 
 
panels/class-debug-bar-request.php CHANGED
@@ -49,5 +49,3 @@ class Debug_Bar_Request extends Debug_Bar_Panel {
49
  echo '</div>';
50
  }
51
  }
52
-
53
- ?>
49
  echo '</div>';
50
  }
51
  }
 
 
panels/class-debug-bar-wp-query.php CHANGED
@@ -103,5 +103,3 @@ class Debug_Bar_WP_Query extends Debug_Bar_Panel {
103
  echo '</div>';
104
  }
105
  }
106
-
107
- ?>
103
  echo '</div>';
104
  }
105
  }
 
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Debug Bar ===
2
- Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_
3
  Tags: debug
4
- Tested up to: 3.1
5
- Stable tag: 0.6
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,11 +21,21 @@ Add a PHP/MySQL console with the [Debug Bar Console plugin](http://wordpress.org
21
 
22
  == Upgrade Notice ==
23
 
 
 
 
 
 
 
 
 
 
24
  = 0.7 =
25
  Made compatible with PHP < 5.2.0
26
  CSS Tweaks
27
  Load JavaScript in Footer
28
  Fixed display issues for WP_Query debug on CPT archives pages
 
29
 
30
  = 0.6 =
31
  Added maximize/restore button
@@ -64,6 +74,7 @@ Made compatible with PHP < 5.2.0
64
  CSS Tweaks
65
  Load JavaScript in Footer
66
  Fixed display issues for WP_Query debug on CPT archives pages
 
67
 
68
  = 0.6 =
69
  Added maximize/restore button
1
  === Debug Bar ===
2
+ Contributors: wordpressdotorg, ryan, westi, koopersmith, duck_, mitchoyoshitaka
3
  Tags: debug
4
+ Tested up to: 3.5
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
 
22
  == Upgrade Notice ==
23
 
24
+ = 0.8 =
25
+ WordPress 3.3 compatibility
26
+ UI refresh
27
+ Removed jQuery UI requirement
28
+ Full screen by default
29
+ New debug-bar query parameter to show on page load
30
+ Removed display cookies
31
+ JavaScript error tracking (disabled by default)
32
+
33
  = 0.7 =
34
  Made compatible with PHP < 5.2.0
35
  CSS Tweaks
36
  Load JavaScript in Footer
37
  Fixed display issues for WP_Query debug on CPT archives pages
38
+ SQL/DB error tracking
39
 
40
  = 0.6 =
41
  Added maximize/restore button
74
  CSS Tweaks
75
  Load JavaScript in Footer
76
  Fixed display issues for WP_Query debug on CPT archives pages
77
+ SQL/DB error tracking
78
 
79
  = 0.6 =
80
  Added maximize/restore button