Changeset 389436
- Timestamp:
- 05/26/2011 04:15:59 PM (15 years ago)
- Location:
- kb-debug/trunk
- Files:
-
- 2 edited
-
README (modified) (1 diff)
-
kb_debug.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kb-debug/trunk/README
r389430 r389436 1 KB_Debug 2 ======== 1 === kb_debug.php === 2 Contributors: kunalb 3 Tags: Debugging 4 Requires at least: WordPress 3.0 5 Tested up to: 3.2 6 Stable tag: 0.1 3 7 4 A swiss army knife for debugging WordPress/BuddyPress plugins.8 Debug your plugins and themes. 5 9 6 Drop this into wp-content/mu-plugins/ to start logging notices and warnings and displaying them. 10 == Description == 7 11 8 WP_DEBUG must be set to true for anything to display.12 To 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. 9 13 10 DO NOT USE THIS ON PRODUCTION SITES.14 To see both just add ?KB_Debug_Errors&KB_Debug_Hooks. (Essentially $_GET[var] must be set to enable that feature). 11 15 12 Set the following constants anywhere in your code to display:13 16 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 == 16 18 19 Upload `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? = 29 Because. 30 31 == Screenshots == 32 None 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 = 42 First version. -
kb-debug/trunk/kb_debug.php
r389435 r389436 233 233 new KB_Debug_Hooks(); 234 234 } 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 */ 244 function 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 } 255 if (isset( $_GET['KB_RESET_CAPS'] )) 256 add_action( 'init', kb_reset_caps );
Note: See TracChangeset
for help on using the changeset viewer.