WordPress FirePHP plugin

While tracing some code in WordPress i got tired of var_dumps, so i quickly coded FirePHP plugin. All it does is include FirePHP and forces WordPress to load it before other plugins, so that you can use it in plugin development.


It’s tested on WP 2.7 and someone might find it useful! I got few more ideas to implement to make it useful for theme debugging, but that’s another version 😉

You made it all the way down here so you must have enjoyed this post! You may also like:

Extending Pimcore with plugins Zoran Salamun
Zoran Salamun, | 9

Extending Pimcore with plugins

Using dynamically created Javascript from WordPress plugin Darko Goles
Darko Goles, | 0

Using dynamically created Javascript from WordPress plugin

A new WordPress Members Plugin blows away its predecessors Mauro Dalu
Mauro Dalu, | 5

A new WordPress Members Plugin blows away its predecessors


  1. @George n – sounds like you need to address your php.ini setup or .htaccess. Does your error say something along the lines of “Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive”
    In which case you need to google for php ini output buffering, the correct fix will depend upon your server setup and whether you have ssh access.

  2. I am getting the uncaught exception errors too. Is is possible that we can get a breakdown on how to use this plugin. I’m sure I’m not the only only one that wants to use it but am getting errors. Thanks.

  3. Tried this with WP 3.0.1 and works fine (couldn’t get WP_FirePHP to fly).
    Easiest thing in the world to use. Install and activate plugin as per. Then anywhere in your template files just call the fb() function as per FirePHP docs http://www.firephp.org/HQ/Use.htm .
    So I’m working on dynamic sidebars responding to the new Nav Menu structures, so I can call


    to find out which Nav Menus are available.
    Don’t forget to install the FirePHP extension to Firebug too https://addons.mozilla.org/en-US/firefox/addon/6149/

  4. Sorry, I paste the php code again:

    $firephp = FirePHP::getInstance(true);

    $var = array(‘i’=>10, ‘j’=>20);

    $firephp->log($var, ‘Iterators’);

    Thanks in advance!!

  5. @Javier:
    This plugin starts output caching(ob_start()) at init hook.

    I’m not sure if this error has anything to do with my plugin since i see that your firephp class is at /var/www/wordpress2/FirePHPCore/FirePHP.class.php. Or did you change include path?

    If you’re using FirePHP that you included yourself, just try to add ob_start() before any wp output.

    Or just remove any instance of FirePHP if you have it and install v.0.2 of my plugin.

  6. Hello all,

    I am having troubles to get the plugin to work. That’s what i did:

    1) Unzip the plugin into the /plugins directory.
    2) Insert this code in my index.php:

    10, ‘j’=>20);

    $firephp->log($var, ‘Iterators’);


    But then I get the following error:

    Fatal error: Uncaught exception ‘Exception’ with message ‘Headers already sent in /var/www/wordpress2/wp-content/themes/extended/header.php on line 2. Cannot send log data to FirePHP. You must have Output Buffering enabled via ob_start() or output_buffering ini directive.’ in /var/www/wordpress2/FirePHPCore/FirePHP.class.php:949 Stack trace: #0 /var/www/wordpress2/FirePHPCore/FirePHP.class.php(624): FirePHP->newException(‘Headers already…’) #1 /var/www/wordpress2/FirePHPCore/FirePHP.class.php(510): FirePHP->fb(Array, ‘Iterators’, ‘LOG’) #2 /var/www/wordpress2/wp-content/themes/extended/index.php(11): FirePHP->log(Array, ‘Iterators’) #3 /var/www/wordpress2/wp-includes/template-loader.php(27): include(‘/var/www/wordpr…’) #4 /var/www/wordpress2/wp-blog-header.php(16): require_once(‘/var/www/wordpr…’) #5 /var/www/wordpress2/index.php(17): require(‘/var/www/wordpr…’) #6 {main} thrown in /var/www/wordpress2/FirePHPCore/FirePHP.class.php on line 949

    Any help would be really appreciated as I usually develop for wordpress.

    Thanks in advance.

    PS: My server config:

    # Sistema Operativo : Linux
    # Servidor : Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 PHP/5.2.4-2ubuntu5.5 with Suhosin-Patch
    # Uso de memoria : 26.69 MB
    # Versión de MySQL : 5.0.51a-3ubuntu5.4
    # Modo SQL : No definido
    # Versión de PHP : 5.2.4-2ubuntu5.5

  7. I just added some small changes. Now theme debugging should work.

    @jding: It should solve your functions.php problem.

  8. I just cannot get this to work. Installs fine on WP 2.7.1 running php 5. I’ve got both Firebug and Firephp plugins installed. I typed in fb(‘hello’); in my functions.php for just for a test but nothing shows up on the console. Any ideas?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <blockquote cite=""> <code> <del datetime=""> <em> <s> <strike> <strong>. You may use following syntax for source code: <pre><code>$current = "Inchoo";</code></pre>.

Tell us about your project

Drop us a line. We'd love to know more about your project.