<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16042] trunk/wp-includes/admin-bar:
  Debug should be a plugin not a core feature for now.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16042">16042</a></dd>
<dt>Author</dt> <dd>westi</dd>
<dt>Date</dt> <dd>2010-10-28 08:48:52 +0000 (Thu, 28 Oct 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Debug should be a plugin not a core feature for now. See <a href="http://trac.wordpress.org/ticket/14772">#14772</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpincludesadminbaradminbarclassphp">trunk/wp-includes/admin-bar/admin-bar-class.php</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkwpincludesadminbaradminbardebugphp">trunk/wp-includes/admin-bar/admin-bar-debug.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpincludesadminbaradminbarclassphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/admin-bar/admin-bar-class.php (16041 => 16042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/admin-bar/admin-bar-class.php        2010-10-28 08:45:35 UTC (rev 16041)
+++ trunk/wp-includes/admin-bar/admin-bar-class.php        2010-10-28 08:48:52 UTC (rev 16042)
</span><span class="lines">@@ -11,7 +11,6 @@
</span><span class="cx"> 
</span><span class="cx">                 /* Only load super admin menu code if the logged in user is a super admin */
</span><span class="cx">                 if ( is_super_admin() ) {
</span><del>-                        require( ABSPATH . WPINC . '/admin-bar/admin-bar-debug.php' );
</del><span class="cx">                         require( ABSPATH . WPINC . '/admin-bar/admin-bar-superadmin.php' );
</span><span class="cx">                 }
</span><span class="cx">                 
</span></span></pre></div>
<a id="trunkwpincludesadminbaradminbardebugphp"></a>
<div class="delfile"><h4>Deleted: trunk/wp-includes/admin-bar/admin-bar-debug.php (16041 => 16042)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/admin-bar/admin-bar-debug.php        2010-10-28 08:45:35 UTC (rev 16041)
+++ trunk/wp-includes/admin-bar/admin-bar-debug.php        2010-10-28 08:48:52 UTC (rev 16042)
</span><span class="lines">@@ -1,170 +0,0 @@
</span><del>-&lt;?php
-/***
- * Debug Functions
- *
- * When logged in as a super admin, these functions will run to provide
- * debugging information when specific super admin menu items are selected.
- *
- * They are not used when a regular user is logged in.
- */
-
-function wp_admin_bar_debug_menu() {
-        global $wp_admin_bar, $wpdb;
-
-        if ( ! is_super_admin() || ! apply_filters('wp_admin_bar_enable_debug_menu', false ) )
-                return;
-
-        $queries = $wpdb-&gt;num_queries;
-        $seconds = timer_stop();
-
-        /* Add the main siteadmin menu item */
-        $wp_admin_bar-&gt;add_menu( array( 'id' =&gt; 'queries', 'title' =&gt; &quot;{$queries}q/{$seconds}&quot;, 'href' =&gt; 'javascript:toggle_query_list()', 'meta' =&gt; array( 'class' =&gt; 'ab-sadmin' ) ) );
-}
-add_action( 'wp_before_admin_bar_render', 'wp_admin_bar_debug_menu', 1000 );
-
-function wp_admin_bar_query_debug_list() {
-        global $wpdb, $wp_object_cache;
-
-        if ( !is_super_admin() )
-                return false;
-
-        $debugs = array();
-
-        if ( defined('SAVEQUERIES') &amp;&amp; SAVEQUERIES )
-                $debugs['wpdb'] = array( __('Queries'), 'wp_admin_bar_debug_queries' );
-
-        if ( is_object($wp_object_cache) &amp;&amp; method_exists($wp_object_cache, 'stats') )
-                $debugs['object-cache'] = array( __('Object Cache'), 'wp_admin_bar_debug_object_cache' );
-
-        $debugs = apply_filters( 'wp_admin_bar_debugs_list', $debugs );
-
-        if ( empty($debugs) )
-                return;
-
-?&gt;
-        &lt;script type=&quot;text/javascript&quot;&gt;
-        /* &lt;![CDATA[ */
-        var toggle_query_list = function() { 
-                var querylist = document.getElementById( 'querylist' );
-                if( querylist &amp;&amp; querylist.style.display == 'block' ) {
-                        querylist.style.display='none';
-                } else {
-                        querylist.style.display='block';
-                }
-        }
-
-        var clickDebugLink = function( targetsGroupId, obj) {
-                var sectionDivs = document.getElementById( targetsGroupId ).childNodes;
-                for ( var i = 0; i &lt; sectionDivs.length; i++ ) {
-                        if ( 1 != sectionDivs[i].nodeType ) {
-                                continue;
-                        }
-                        sectionDivs[i].style.display = 'none';
-                }
-                document.getElementById( obj.href.substr( obj.href.indexOf( '#' ) + 1 ) ).style.display = 'block';
-
-                for ( var i = 0; i &lt; obj.parentNode.parentNode.childNodes.length; i++ ) {
-                        if ( 1 != obj.parentNode.parentNode.childNodes[i].nodeType ) {
-                                continue;
-                        }
-                        obj.parentNode.parentNode.childNodes[i].removeAttribute( 'class' );
-                }
-                obj.parentNode.setAttribute( 'class', 'current' );
-                return false;
-        };
-        /* ]]&gt; */
-        &lt;/script&gt;
-        &lt;div align='left' id='querylist'&gt;
-
-        &lt;h1&gt;Debugging blog #&lt;?php echo $GLOBALS['blog_id']; ?&gt; on &lt;?php echo php_uname( 'n' ); ?&gt;&lt;/h1&gt;
-        &lt;div id=&quot;debug-status&quot;&gt;
-                &lt;p class=&quot;left&quot;&gt;&lt;/p&gt;
-                &lt;p class=&quot;right&quot;&gt;PHP Version: &lt;?php echo phpversion(); ?&gt;&lt;/p&gt;
-        &lt;/div&gt;
-        &lt;ul class=&quot;debug-menu-links&quot;&gt;
-
-&lt;?php        $current = ' class=&quot;current&quot;'; foreach ( $debugs as $debug =&gt; $debug_output ) : ?&gt;
-
-                &lt;li&lt;?php echo $current; ?&gt;&gt;&lt;a id=&quot;debug-menu-link-&lt;?php echo $debug; ?&gt;&quot; href=&quot;#debug-menu-target-&lt;?php echo $debug; ?&gt;&quot; onclick=&quot;try { return clickDebugLink( 'debug-menu-targets', this ); } catch (e) { return true; }&quot;&gt;&lt;?php echo $debug_output[0] ?&gt;&lt;/a&gt;&lt;/li&gt;
-
-&lt;?php        $current = ''; endforeach; ?&gt;
-
-        &lt;/ul&gt;
-
-        &lt;div id=&quot;debug-menu-targets&quot;&gt;
-
-&lt;?php        $current = ' style=&quot;display: block&quot;'; foreach ( $debugs as $debug =&gt; $debug_output ) : ?&gt;
-
-        &lt;div id=&quot;debug-menu-target-&lt;?php echo $debug; ?&gt;&quot; class=&quot;debug-menu-target&quot;&lt;?php echo $current; ?&gt;&gt;
-                &lt;?php echo str_replace( '&amp;nbsp;', '', call_user_func( $debug_output[1] ) ); ?&gt;
-        &lt;/div&gt;
-
-&lt;?php        $current = ''; endforeach; ?&gt;
-
-        &lt;/div&gt;
-
-&lt;?php        do_action( 'wp_admin_bar_debug' ); ?&gt;
-
-        &lt;/div&gt;
-
-&lt;?php
-}
-add_action( 'wp_after_admin_bar_render', 'wp_admin_bar_query_debug_list' );
-
-function wp_admin_bar_debug_queries() {
-        global $wpdb;
-
-        $queries = array();
-        $out = '';
-        $total_time = 0;
-
-        if ( !empty($wpdb-&gt;queries) ) {
-                $show_many = isset($_GET['debug_queries']);
-
-                if ( $wpdb-&gt;num_queries &gt; 500 &amp;&amp; !$show_many )
-                        $out .= &quot;&lt;p&gt;There are too many queries to show easily! &lt;a href='&quot; . add_query_arg( 'debug_queries', 'true' ) . &quot;'&gt;Show them anyway&lt;/a&gt;.&lt;/p&gt;&quot;;
-
-                $out .= '&lt;ol id=&quot;wpd-queries&quot;&gt;';
-                $first_query = 0;
-                $counter = 0;
-
-                foreach ( $wpdb-&gt;queries as $q ) {
-                        list($query, $elapsed, $debug) = $q;
-
-                        $total_time += $elapsed;
-
-                        if ( !$show_many &amp;&amp; ++$counter &gt; 500 )
-                                continue;
-
-                        $query = nl2br(esc_html($query));
-
-                        // $dbhname, $host, $port, $name, $tcp, $elapsed
-                        $out .= &quot;&lt;li&gt;$query&lt;br/&gt;&lt;div class='qdebug'&gt;$debug &lt;span&gt;#{$counter} (&quot; . number_format(sprintf('%0.1f', $elapsed * 1000), 1, '.', ',') . &quot;ms)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;\n&quot;;
-                }
-                $out .= '&lt;/ol&gt;';
-        } else {
-                $out .= &quot;&lt;p&gt;&lt;strong&gt;There are no queries on this page, you won the prize!!! :)&lt;/strong&gt;&lt;/p&gt;&quot;;
-        }
-
-        $query_count = '&lt;h2&gt;&lt;span&gt;Total Queries:&lt;/span&gt;' . number_format( $wpdb-&gt;num_queries ) . &quot;&lt;/h2&gt;\n&quot;;
-        $query_time = '&lt;h2&gt;&lt;span&gt;Total query time:&lt;/span&gt;' . number_format(sprintf('%0.1f', $total_time * 1000), 1) . &quot;ms&lt;/h2&gt;\n&quot;;
-        $memory_usage = '&lt;h2&gt;&lt;span&gt;Peak Memory Used:&lt;/span&gt;' . number_format( memory_get_peak_usage( ) ) . &quot; bytes&lt;/h2&gt;\n&quot;;
-
-        $out = $query_count . $query_time . $memory_usage . $out;
-
-        return $out;
-}
-
-function wp_admin_bar_debug_object_cache() {
-        global $wp_object_cache;
-        ob_start();
-        echo &quot;&lt;div id='object-cache-stats'&gt;&quot;;
-                $wp_object_cache-&gt;stats();
-        echo &quot;&lt;/div&gt;&quot;;
-        $out = ob_get_contents();
-        ob_end_clean();
-
-        return $out;
-}
-
-?&gt;
</del></span></pre>
</div>
</div>

</body>
</html>