WordPress FirePHP plugin

Featured Image

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 ;)


Care to rate this post?


Ivan Weiler

Technical Educator and Consultant

Ivan is a Technical Educator and Consultant. He gained lots of experience managing some of the most complex Magento projects we had at Inchoo.

Other posts from this author

Discussion 16 Comments

Add Comment
  1. Wow great post. I have been searching online for awhile and I came accros this post. It was just what I needed. Thanks and keep up with the great content.

  2. Thanks for implementing a plugin for wordpress.

    I have added a link to this post to the FirePHP Wiki: http://www.firephp.org/Wiki/Libraries/Wordpress

  3. Thank you! I’ll add some more wp functionality when i catch some free time ;)

  4. jding

    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?

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

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

  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. @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.

  8. Sorry, I paste the php code again:

    $firephp = FirePHP::getInstance(true);

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

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

    Thanks in advance!!

  9. thanks for the plugin!
    very useful!

  10. Luke Mackenzie

    please post code example of how to use it!

  11. 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/

  12. george n

    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.

  13. @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.

  14. The actual media adjustments sub-panel is where you specify choices for showing different advertising, primarily photographs, that are available through the media panel in the top routing club.wordpress

  15. Considering a couple of ways the normal person may find out live journal. In case you aren’t utilizing wordpress you have to be. Learn the way you can start to learn about the web’s number 1 …wordpress

  16. Sal

    Is this plugin still valid? Does it work with wp3.3.1?

Add Your Comment

Please wrap all source codes with [code][/code] tags.
  • Wordpress with E-Commerce?

    Wordpress with E-Commerce?

    It is a neat idea for a small businesses. Especially if you want to test your market. However, if you want to switch to an enterprise solution, Magento is the best choice. Take a look at our services and find out what we can do to help.

    Learn more Get a quote
  • Hire Magento Developers

    Magento Certified Developers

    Teams of certified Magento developers are available to work on your next big thing!

    Hire Magento Developers Get a quote
  • Our Latest Project

    Viv & Lou

    Viv & Lou

    When an ordinary gift just won’t do.

    See our work
  • The Inchooers

    Meet The Inchooers, the funny bunch of magento developers.