Chip's Tips for Developers

Contains coding, but not narcotic.

WiPeD out trying to debug WordPress XMLRPC

October 15th, 2007 4:40:15 am pst by Sterling Camden

So I was coding along one fine day, happily using my WiPeD debugger for WordPress, when I suddenly stumbled on a problem with it.  I was attempting to debug a function that was hooked to an action that was supposed to be triggered by the MetaWebLog API (‘save_post’, when posting from a blog authoring tool), and none of my debug messages were being displayed!  Suddenly the heel of my hand went *bonk* on my forehead — of course I couldn’t retrieve any messages from XMLRPC processing, because I was saving the messages in a session variable, and the client in that case is my authoring tool instead of my browser – so the sessions aren’t the same.  Duh, time to rethink.

The downloadable version below saves the debug messages to the database instead of to a session variable.  Obviously, that means that multiple users will mix their output in the log.  Of course, you’d expect to be debugging on a private site, but just in case I added an options page where you can exclude users based on their capabilities — with the default being ‘level_9′ (administrators only).  I also added options to allow you to customize when the debug log is displayed, as well as when it’s cleared.  Spin it up, and check out the Readme-WiPeD.txt file.

UPDATE: get the latest version here.

Posted in PHP, Web, Wildly popular, WordPress | 10 Comments » RSS 2.0 | Sphere it!

10 Responses to “WiPeD out trying to debug WordPress XMLRPC”

  1. Rirath says:

    This looks great, can’t wait to try. Like you said, I’m always using a ton of echo statements that may or may not actually give me any clue what’s going on. Should help make things easier.

  2. Rirath says:

    Hmm… I seem to get a fatal error trying to activate it.

    Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in [MY PATH]/plugins/WiPeD.php on line 13

  3. [...] Peak (aka Rirath) helped to identify an incompatibility with PHP version 4 in my WiPeD plugin for WordPress.  Now, if back-porting to version 4 had involved a major rewrite I would have said [...]

  4. [...] 15th 2007 12:40pm [-] From: chipstips.com [...]

Leave a Reply

Better Tag Cloud