WordPress.org

Plugin Directory

Changeset 577450


Ignore:
Timestamp:
07/26/12 01:29:07 (21 months ago)
Author:
askapache
Message:

Added ability to view wordpress crons and more database query work

Location:
askapache-debug-viewer
Files:
9 added
3 edited

Legend:

Unmodified
Added
Removed
  • askapache-debug-viewer/trunk/askapache-debug-viewer.php

    r522298 r577450  
    66 * Description: Displays Advanced Debugging Output 
    77 * Author: askapache,cduke250 
    8  * Version: 2.3.1 
    9  * Updated: 3/22/2012 - 11:03 AM 
     8 * Version: 2.3.2 
     9 * Updated: 7/25/2012 - 11:03 AM 
    1010 * Requires at least: 2.9 
    11  * Tested up to: 3.4-alpha-19719 
     11 * Tested up to: 3.4.1 
    1212 * Tags: debug, debugging, error, errors, problems, support, admin, programmer, developer, plugin, development, information, stats, logs, queries, htaccess, password, error, support, askapache 
    1313 * Contributors: askapache,cduke250 
     
    10851085     *      [qn] => askapache_debug 
    10861086     *      [http] => //w 
    1087      *      [file] => /home/askapach/sites/askapache.com/htdocs/wp-content/plugins/askapache-debug-viewer/askapache-debug-viewer.php 
     1087     *      [file] => /askapache.com/htdocs/wp-content/plugins/askapache-debug-viewer/askapache-debug-viewer.php 
    10881088     *      [title] => <a href="http://www.askapache.com/wordpress/debug-viewer-plugin.html" title="Visit plugin homepage">AskApache Debug Viewer</a> 
    10891089     *      [pb] => askapache-debug-viewer/askapache-debug-viewer.php 
     
    11071107     *      [page] => home 
    11081108     *      [logfile] => /opt/a22161/logs/vhost_custom/www.askapache.com/php_error.log 
    1109      *      [dirtoexplore] => /home/askapach/sites/askapache.com/tmp 
     1109     *      [dirtoexplore] => /askapache.com/tmp 
    11101110     *      [log_errors] => 1 
    11111111     *      [debug_live] => 0 
     
    11331133        'error_reporting' => 4983, //2147483647, 
    11341134        'plugin_debug_level' => 0, 
    1135         'debug_mods_v' => 7, 
    1136         'debug_mods' => 7583 
     1135        'debug_mods_v' => 524294, 
     1136        'debug_mods' => 531871 
    11371137    ); 
    11381138     
     
    12731273     * 
    12741274     * [old_inis] => Array 
    1275      *      [open_basedir] => /home/askapach/sites/askapache.com/tmp/:/home/askapach/sites/askapache.com/htdocs/:/home/askapach/sites/askapache.com/cgi-bin/:/home/askapach/sites/askapache.com/inc/:/home/askapach/sites/askapache.com/logs/:/opt/a22161/logs/vhost_custom/www.askapache.com/:/home/askapach/sites/captcha.askapache.com:/home/askapach/sites/uploads.askapache.com 
     1275     *      [open_basedir] => /askapache.com/tmp/:/askapache.com/htdocs/ 
    12761276     *      [tidy.clean_output] =>  
    12771277     *      [xdebug.default_enable] =>  
     
    13921392        $D[(1 << sizeof($D))]=array('get_debug_sockets',            'Sockets'); 
    13931393        $D[(1 << sizeof($D))]=array('get_debug_queries',            'DataBase Queries'); 
     1394        $D[(1 << sizeof($D))]=array('get_debug_crons',          'WordPress Crons'); 
    13941395        $this->debug_mods=$D; 
    13951396        unset($D); 
     
    14401441                             'plugin_debug_level' => 0, 
    14411442                             'display_height' => 500, 
    1442                              'debug_mods_v' =>7, 
    1443                              'debug_mods' => 7583 
     1443                            'debug_mods_v' => 524294, 
     1444                            'debug_mods' => 531871 
    14441445                            ); 
    14451446         
     
    23872388     *      [qn] => askapache_debug 
    23882389     *      [http] => //w 
    2389      *      [file] => /home/askapach/sites/askapache.com/htdocs/wp-content/plugins/askapache-debug-viewer/askapache-debug-viewer.php 
     2390     *      [file] => /askapache.com/htdocs/wp-content/plugins/askapache-debug-viewer/askapache-debug-viewer.php 
    23902391     *      [title] => <a href="http://www.askapache.com/wordpress/debug-viewer-plugin.html" title="Visit plugin homepage">AskApache Debug Viewer</a> 
    23912392     *      [pb] => askapache-debug-viewer/askapache-debug-viewer.php 
     
    25912592     
    25922593    /** AA_DEBUG::get_debug_queries() 
     2594     * @m 2.3.2 
     2595     * @v 1.0.1 
    25932596    */ 
    25942597    function get_debug_queries($vb=false)  
     
    25982601             
    25992602        $out = ''; 
     2603         
     2604        $total_time = (timer_stop( false, 22 ) +1); 
     2605        $total_query_time = 0; 
     2606         
    26002607        if ($wpdb->queries) { 
    26012608            $x = 0; 
    2602             $total_time = (timer_stop( false, 22 ) +1); 
    2603             $total_query_time = 0; 
    26042609            $class = '';  
    2605             $out .= '<ol>' . "\n"; 
     2610            $out .= '<ol>'; 
    26062611             
    26072612            foreach ($wpdb->queries as $q) { 
     
    26102615                $total_query_time += $q[1]; 
    26112616                $out .= "<li>"; 
    2612                 if ( isset($q[1]) ) $out .= '<strong title=\''.$q[1].'\'>' . __('Query:') . '</strong> ' . htmlentities( $q[0] ); 
    2613                 if ( isset($q[2]) ) $out .= '<br /><strong>' . __('Call from:') . '</strong> ' . htmlentities( $q[2] ); 
     2617                if ( isset($q[1]) ) $out .= '<strong title=\''.$q[1].'\'>Query:</strong> ' . htmlentities( $q[0] ); 
     2618                if ( isset($q[2]) ) $out .= '<br /><strong>Call from:</strong> ' . htmlentities( $q[2] ); 
    26142619                $out .= '</li>' . "\n"; 
    26152620                $x++; 
    26162621            } 
    26172622             
    2618             $out .= '</ol>' . "\n\n"; 
     2623            $out .= '</ol>'; 
    26192624        } 
    26202625         
    26212626        $php_time = $total_time - $total_query_time; 
    26222627        // Create the percentages 
    2623         //$mysqlper = number_format_i18n( $total_query_time / $total_time * 100, 2 ); 
    2624         //$phpper   = number_format_i18n( $php_time / $total_time * 100, 2 ); 
    26252628        $out1=$out; 
    2626         $out=''; 
    2627         /* 
    2628         $out .= '<ul>' . "\n"; 
    2629         $out .= '<li><strong>' . __('Total query time:') . ' ' . number_format_i18n( $total_query_time, 5 ) . __('s for') . ' ' . count($wpdb->queries) . ' ' . __('queries.') . '</strong></li>'; 
     2629        $out='<ul>'; 
     2630         
     2631         
    26302632        if ( count($wpdb->queries) != get_num_queries() ) { 
    2631             $out .= '<li><strong>' . __('Total num_query time:') . ' ' . timer_stop() . ' ' . __('for') . ' ' . get_num_queries() . ' ' . __('num_queries.') . '</strong></li>' . "\n"; 
    2632             $out .= '<li class="none_list">' . __('&raquo; Different values in num_query and query? - please set the constant') . ' <code>define(\'SAVEQUERIES\', true);</code>' . __('in your') . ' <code>wp-config.php</code></li>' . "\n"; 
    2633         } 
    2634         if ( $total_query_time == 0 ) 
    2635             $out .= '<li class="none_list">' . __('&raquo; Query time is null (0)? - please set the constant') . ' <code>SAVEQUERIES</code>' . ' ' . __('at') . ' <code>TRUE</code> ' . __('in your') . ' <code>wp-config.php</code></li>' . "\n"; 
    2636         $out .= '<li>' . __('Page generated in'). ' ' . number_format_i18n( $total_time, 5 ) . __('s, ') . $phpper . __('% PHP') . ', ' . $mysqlper . __('% MySQL') . '</li>' . "\n"; 
    2637         $out .= '</ul>' . "\n"; 
    2638         */ 
     2633            $out .= '<li><strong>Total num_query time: ' . timer_stop() . ' for ' . get_num_queries() . ' num_queries.</strong></li>'; 
     2634            $out .= '<li class="none_list">&raquo; Different values in num_query and query? - please set the constant <code>define(\'SAVEQUERIES\', true);</code>in your <code>wp-config.php</code></li>'; 
     2635        } 
     2636         
     2637        if ( $total_query_time == 0 ) $out .= '<li class="none_list">&raquo; Query time is null (0)? - please set the constant <code>SAVEQUERIES</code> at <code>TRUE</code> in your <code>wp-config.php</code></li>'; 
     2638         
     2639        $out .= '<li>Page generated in'. number_format_i18n( $total_time, 5 ) . 's, ' . number_format_i18n( $php_time / $total_time * 100, 2 ) . '% PHP, ' . number_format_i18n( $total_query_time / $total_time * 100, 2 ) . '% MySQL</li></ul>'; 
     2640         
    26392641         
    26402642        $this->t(__FILE__,__CLASS__,__FUNCTION__,__LINE__,'',5); 
     
    35003502        return $this->pp($oa,true); 
    35013503    } 
    3502  
    3503  
     3504     
     3505     
     3506     
     3507    /** AA_DEBUG::get_debug_crons( $vb = false ) 
     3508     * 
     3509     * @m 2.3.2 
     3510     * @v 1.0.1 
     3511     */ 
     3512    function get_debug_crons( $vb = false ) 
     3513    { 
     3514        $this->t(__FILE__,__CLASS__,__FUNCTION__,__LINE__,'',5); 
     3515         
     3516        $schedules=wp_get_schedules(); 
     3517        $crons=_get_cron_array(); 
     3518         
     3519        $out='<ul>'; 
     3520        foreach ($schedules as $interval=>$description){ 
     3521            $out.='<li><strong>'.$interval.'</strong>: &quot;'.$description['display'].'&quot; ('.$description['interval'].')</li>'; 
     3522        } 
     3523        $out.='</ul>'; 
     3524         
     3525        /* 
     3526        foreach ( $crons as $timestamp => $cron ) { 
     3527            if ( isset( $cron[$hook][$key] ) ) $cron[$hook][$key]['schedule']; 
     3528    }*/ 
     3529         
     3530         
     3531        $oa=array('out'=>$out, 
     3532                     'schedules'=>$schedules, 
     3533                     'crons'=>$crons 
     3534                     ); 
     3535                                                              
     3536 
     3537        $this->t(__FILE__,__CLASS__,__FUNCTION__,__LINE__,'',5); 
     3538        return $out; 
     3539        return $this->pp($oa,true); 
     3540    } 
    35043541 
    35053542 
     
    49374974    /** AA_DEBUG::get_file_lines_at() 
    49384975    */ 
    4939     //@@ /home/redstate/sites/redstate.com/htdocs/wp-includes/load.php 106 - 116 
    49404976    function get_file_lines_at($f='', $s=0, $e=0) 
    49414977    { 
  • askapache-debug-viewer/trunk/f/admin.css

    r522076 r577450  
    1212#aao h2 { background-color:#888;clear:both;color:#010101;height:25px;line-height:25px;margin:0 auto;width:100%;padding:0;text-indent:10px;} 
    1313#aao h2 a { line-height:25px;text-decoration:none;font-size:12px;padding-left:10px;height:25px;color:#D3D3D3;} 
    14  
     14#aao ul {margin:.5em 1em; } 
    1515.aa_pre2 { background:none repeat scroll 0 0 #FFFFFF;clear:both;color:#000000;font:11px/16px monospace;margin:1px auto;max-width:100%;overflow-x:auto;padding:0;width:99%;border-bottom:40px solid #FFFFFF;} 
    1616.aa_label1 { float:left;display:block;width:125px;color:#666;} 
  • askapache-debug-viewer/trunk/readme.txt

    r522298 r577450  
    44Tags: debug, debugging, error, errors, problems, support, admin, programmer, developer, plugin, development, information, stats, logs, queries, htaccess, password, error, support, askapache 
    55Requires at least: 3.0 
    6 Tested up to: 3.4-alpha-20244 
    7 Stable tag: 2.3.1 
     6Tested up to: 3.4.1 
     7Stable tag: 2.3.2 
    88 
    99This advanced debugging plugin is custom-made for WordPress Developers, Plugin Developers, or anyone wanting to see under the hood of their website and diagnose problems such as with the AskApache PassPro Plugin. 
Note: See TracChangeset for help on using the changeset viewer.