sammela.com header image 2

WiPeD: A Useful WordPress Debugger Plugin

October 6th, 2009 · No Comments · WordPress, article

I like the WiPeD (WordPress Printf Debugging) Plugin for four reasons:

  1. It does what I want
  2. It is easy to install
  3. It is easy to use
  4. It is easy to customize

As a bonus, I should say, I talked to the author (Sterling “Chip” Camden)  on the phone today, and he’s very helpful.

Problems with echo

PHP programmers typically use the echo keyword to output debugging information.

But there are some annoyances  with this approach.

  1. Echo output that precedes headers can cause PHP errors.
  2. Echo statements are difficult to turn on and off.
  3. It can be difficult to locate diagnostic echo statements when they are sprinkled throughout code.

WiPeD to the Rescue

WiPeD solves the problems listed above by queing diagnostic outputs.  The diagnostic data is then dumped all at one, at a location chosen by the programmer.

Once the plugin is installed, it is a simple matter to write debug information to the queue.  Here’s an example:

1
2
// Queue a message
WPD_print("This is a test of the WiPeD WPD_print function");

Output

Typically you don’t have to worry about output. In the default install configuration, WiPeD outputs the queued diagnostic data on the get_footer and admin_footer actions, which means it winds up at the bottom of your page. Note, however, you can set it to display on any actions you want (see “Options” below).

Options

When WiPeD is installed, it adds a “WiPeD” options menu item to the bottom of the Admin “Settings” menu. In the otpions menu you can set the following:

  • User capability level required to record debug info
  • User capability level required to display debug info
  • Actions that trigger display of debug info
  • Clear debug log when displayed (check yes/no)
  • Clear debug log now (check yes/no)

Summary

WiPeD is a handy expanable debug support Plugin that does just what it should.

Want it? Visit the WiPeD links below:

  Author: Sterling “Chip” Camden
  Visit: plugin site

 

Related Article

Add backtrace to the WiPeD Debugger.

Tags:

No Comments so far ↓

There are no comments yet...Kick things off by filling out the form below.

Leave a Comment