Plugin Directory

wp pear debug

Author: Silasco Solutions

This plugin incorporates the pear php_debug library into wordpress.

I started creating a new website around wordpress and noticed that there was no way to quickly access debug information so I integrated this class into wordpress for quick easy debugging when developing or experiencing problems on your wordpress website.

Please feel free to discuss it here: Plugin Home.

Unfortunately php_debug only works in php5 so this plugin will only work in php5. I will happly incorporate another library that can work with php4 if someone sends me one. Please also note that I developed this plugin on wordpress 2.6 and can't guarantee that it will work on v2.5. This plugin makes use of some features only avaialable in the newest wordpress releases.

  • Features

This plugin unlike most operates from within a class. There are several options which can be set in the admin section 1. Debug Status: Overall this option allows you to enable and disable debugging entirely 2. Display Debugging for: Guests This option allows you to enable debugging when no user is logged in 3. The rest are a list of roles found in the sytem, eg. editor, contributor, administrator For each you have the following options: Admin & Front End, Admin Only, Front End Only, Disable 4. The plugin shows queries that were run by wordpress Please not that some queries run before the plugin is initialized 5. You can easly add debug information to the debugger by making use of several functions

    <?php 

            $oDebug = wp_pear_debug::get();     
            $oDebug->add($variable); //add variable to debug
            $oDebug->dump($object,$varname); //var_dump an array or object. $varname optional
            $oDebug->queryRel($info); //add query related info
            $oDebug->error($info); //add user error
            //more options available in the pear::php_debug documentation

            //With v1.2 you have access to several wrapper functions
                    wp_pear_debug::add();
                    wp_pear_debug::dump();
                    wp_pear_debug::error();
                    wp_pear_debug::queryRel();


         ?>
  1. Debug information appears in a neat panel controlled by javascript. The options expand and collapse. The debug panel also has a close button to completely remove the debug panel.

  2. Note that the debug bar floats at the top right and will not disrupt your layout.

  3. TO ensure layout stability the mod is hard coded to use only the HTML Div Renderer

  4. displaying server and response varables.

    • Request
    • Response
    • Setings
    • Globals
    • Php
    • Files
    • Database queries
    • Execution time
    • Errors and messages
    • Link to w3c validator
  5. With v1.2 you can add debug information via shortcode from within your post.

Download

FYI

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(1 ratings)