Plugin Directory

Changeset 389436


Ignore:
Timestamp:
05/26/2011 04:15:59 PM (15 years ago)
Author:
kunalb
Message:

Updated the README.

Location:
kb-debug/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kb-debug/trunk/README

    r389430 r389436  
    1 KB_Debug
    2 ========
     1=== kb_debug.php  ===
     2Contributors: kunalb
     3Tags: Debugging
     4Requires at least: WordPress 3.0
     5Tested up to: 3.2
     6Stable tag: 0.1
    37
    4 A swiss army knife for debugging WordPress/BuddyPress plugins.
     8Debug your plugins and themes.
    59
    6 Drop this into wp-content/mu-plugins/ to start logging notices and warnings and displaying them.
     10== Description ==
    711
    8 WP_DEBUG must be set to true for anything to display.
     12To log and show a list of all warnings, errors and notices generated by your plugin, add a ?KB_Debug_Errors to your URL. To see a list of all hooks in the order they fire as well as what arguments they are called with and what functions run on them (again, in which order), add a ?KB_Debug_Hooks to the URL.
    913
    10 DO NOT USE THIS ON PRODUCTION SITES.
     14To see both just add ?KB_Debug_Errors&KB_Debug_Hooks. (Essentially $_GET[var] must be set to enable that feature).
    1115
    12 Set the following constants anywhere in your code to display:
    1316
    14 # KB_DISPLAY_HOOKS Set to true to display hooks, as well as functions called with arguments. Only use with modern browsers that can handle lots of data.
    15 # KB_FORCE_HIDE Sometimes, you might not want to display anything. Setting this to true ensures that nothing is displayed.
     17== Installation ==
    1618
     19Upload `kb_debug.php` and 'kb-debug.css' to the `/wp-content/mu-plugins/` directory. (Create this directory if it doesn't exist).
     20
     21
     22== Features ==
     23* Logs and displays all warnings, errors, etc. alongwith their context.
     24* Logs and displays all hooks alongwith the argument(s) each hook is called with and the functions that run on that particular hook (in order).
     25
     26== Frequently Asked Questions ==
     27
     28= Why? =
     29Because.
     30
     31== Screenshots ==
     32None yet.
     33
     34== Changelog ==
     35
     36= 0.2 =
     37* Plugin completely refactored.
     38* No longer uses buffering.
     39* Features are now activated by setting $_GET variables.
     40
     41= 0.1 =
     42First version.
  • kb-debug/trunk/kb_debug.php

    r389435 r389436  
    233233        new KB_Debug_Hooks();
    234234}
     235
     236
     237/* 2. Reset capabilities to initial state if KB_RESET_CAPS is set in $_GET */
     238
     239/**
     240 * Reverts capabilities to default state.
     241 *
     242 * Useful while debugging.
     243 */
     244function kb_reset_caps() {
     245    global $wpdb;
     246    $key = $wpdb->prefix . 'user_roles';
     247
     248    //Bye, bye, existing caps
     249    delete_option( $key );
     250
     251    //Repopulate
     252    require_once( "/home/kunalb/dev/eventpress/wp-admin/includes/schema.php" );
     253    populate_roles();
     254}
     255if (isset( $_GET['KB_RESET_CAPS'] ))
     256    add_action( 'init', kb_reset_caps );
Note: See TracChangeset for help on using the changeset viewer.