<!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>-<?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->num_queries;
-        $seconds = timer_stop();
-
-        /* Add the main siteadmin menu item */
-        $wp_admin_bar->add_menu( array( 'id' => 'queries', 'title' => "{$queries}q/{$seconds}", 'href' => 'javascript:toggle_query_list()', 'meta' => array( 'class' => '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') && SAVEQUERIES )
-                $debugs['wpdb'] = array( __('Queries'), 'wp_admin_bar_debug_queries' );
-
-        if ( is_object($wp_object_cache) && 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;
-
-?>
-        <script type="text/javascript">
-        /* <![CDATA[ */
-        var toggle_query_list = function() {
-                var querylist = document.getElementById( 'querylist' );
-                if( querylist && 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 < 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 < 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;
-        };
-        /* ]]> */
-        </script>
-        <div align='left' id='querylist'>
-
-        <h1>Debugging blog #<?php echo $GLOBALS['blog_id']; ?> on <?php echo php_uname( 'n' ); ?></h1>
-        <div id="debug-status">
-                <p class="left"></p>
-                <p class="right">PHP Version: <?php echo phpversion(); ?></p>
-        </div>
-        <ul class="debug-menu-links">
-
-<?php        $current = ' class="current"'; foreach ( $debugs as $debug => $debug_output ) : ?>
-
-                <li<?php echo $current; ?>><a id="debug-menu-link-<?php echo $debug; ?>" href="#debug-menu-target-<?php echo $debug; ?>" onclick="try { return clickDebugLink( 'debug-menu-targets', this ); } catch (e) { return true; }"><?php echo $debug_output[0] ?></a></li>
-
-<?php        $current = ''; endforeach; ?>
-
-        </ul>
-
-        <div id="debug-menu-targets">
-
-<?php        $current = ' style="display: block"'; foreach ( $debugs as $debug => $debug_output ) : ?>
-
-        <div id="debug-menu-target-<?php echo $debug; ?>" class="debug-menu-target"<?php echo $current; ?>>
-                <?php echo str_replace( '&nbsp;', '', call_user_func( $debug_output[1] ) ); ?>
-        </div>
-
-<?php        $current = ''; endforeach; ?>
-
-        </div>
-
-<?php        do_action( 'wp_admin_bar_debug' ); ?>
-
-        </div>
-
-<?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->queries) ) {
-                $show_many = isset($_GET['debug_queries']);
-
-                if ( $wpdb->num_queries > 500 && !$show_many )
-                        $out .= "<p>There are too many queries to show easily! <a href='" . add_query_arg( 'debug_queries', 'true' ) . "'>Show them anyway</a>.</p>";
-
-                $out .= '<ol id="wpd-queries">';
-                $first_query = 0;
-                $counter = 0;
-
-                foreach ( $wpdb->queries as $q ) {
-                        list($query, $elapsed, $debug) = $q;
-
-                        $total_time += $elapsed;
-
-                        if ( !$show_many && ++$counter > 500 )
-                                continue;
-
-                        $query = nl2br(esc_html($query));
-
-                        // $dbhname, $host, $port, $name, $tcp, $elapsed
-                        $out .= "<li>$query<br/><div class='qdebug'>$debug <span>#{$counter} (" . number_format(sprintf('%0.1f', $elapsed * 1000), 1, '.', ',') . "ms)</span></div></li>\n";
-                }
-                $out .= '</ol>';
-        } else {
-                $out .= "<p><strong>There are no queries on this page, you won the prize!!! :)</strong></p>";
-        }
-
-        $query_count = '<h2><span>Total Queries:</span>' . number_format( $wpdb->num_queries ) . "</h2>\n";
-        $query_time = '<h2><span>Total query time:</span>' . number_format(sprintf('%0.1f', $total_time * 1000), 1) . "ms</h2>\n";
-        $memory_usage = '<h2><span>Peak Memory Used:</span>' . number_format( memory_get_peak_usage( ) ) . " bytes</h2>\n";
-
-        $out = $query_count . $query_time . $memory_usage . $out;
-
-        return $out;
-}
-
-function wp_admin_bar_debug_object_cache() {
-        global $wp_object_cache;
-        ob_start();
-        echo "<div id='object-cache-stats'>";
-                $wp_object_cache->stats();
-        echo "</div>";
-        $out = ob_get_contents();
-        ob_end_clean();
-
-        return $out;
-}
-
-?>
</del></span></pre>
</div>
</div>
</body>
</html>