Wordpress FirePHP plugin
9 Comments 24th FEB 2009 | Posted by Ivan Weiler in Wordpress

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.
wp_firephp_v.0.2.rar
wp_firephp_v.0.1.rar
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

















February 25th, 2009 at 21:52
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.
February 25th, 2009 at 22:21
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
February 26th, 2009 at 0:56
Thank you! I’ll add some more wp functionality when i catch some free time
April 3rd, 2009 at 22:16
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?
April 4th, 2009 at 16:30
I just added some small changes. Now theme debugging should work.
@jding: It should solve your functions.php problem.
May 20th, 2009 at 18:22
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
May 20th, 2009 at 22:12
@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.
May 21st, 2009 at 10:53
Sorry, I paste the php code again:
$firephp = FirePHP::getInstance(true);
$var = array(‘i’=>10, ‘j’=>20);
$firephp->log($var, ‘Iterators’);
Thanks in advance!!
December 12th, 2009 at 11:57
thanks for the plugin!
very useful!