2

http://wordpress.org/extend/plugins/wp-firephp/

I'm simply supposed to call fb('Error message','Lable') but it doesn't work all the time. I can't figure out when and where the relevant files are being included and classes defined in order to make the call to the said method/function.

For example it doesn't work even when I call fb() from wp-content\plugins\wp-firephp\FirePHPCore\fb.php itself and open up http://localhost/wordpress (maybe because the file never gets included) but it works on http://localhost/wordpress/wp-admin. Does that mean wp-firephp plugin only works for /wp-admin and related pages? Because I wanted to use its functionality on non-admin related pages like /footer.php and such. Am I doing it wrong?

2 Answers 2

6

I gave up on using the plugin and use FirePHP straight as a mu-plugin:

FirePHP mu-plugin

And firebug.php file consists of:

<?php
/*
    Plugin Name: FirePHP
    Version: 0.1
*/

require_once( 'FirePHPCore/FirePHP.class.php' );
ob_start();
$firephp = FirePHP::getInstance( true );

function logit( $var, $title='From FirePHP:' )
{
    global $firephp;
    $firephp->log( $var, $title );
}

Then I call it from anywhere (theme, plugin, core) using the function:
logit( $var_to_debug, 'The var contains:' );

2
  • While using this method have you had any problems with FirePHP being instantiated so late in the game? I'd tried a similar approach and had some issues, that's why I instantiate in wp-config.
    – Steve
    Nov 5, 2012 at 14:54
  • 1
    @Stephen, nope, don't remember having any issues. I mainly debug plugins, sometimes themes and rarely the core or in-depth features.
    – brasofilo
    Nov 5, 2012 at 15:36
1

I've had rotten luck and performance with the different FirePHP pluings except for the 'Yet Another Logger' one, but have to admit I didn't look at this one. Eventually I simply setup PEAR on my dev boxes and installed FirePHP.

/**
 * FirePHP simple examples
 */

// For FirePHP Object Oriented API
require_once('FirePHPCore/FirePHP.class.php');
$firephp = FirePHP::getInstance(true);

or

// Procedureal API
require_once('FirePHPCore/fb.php');

The above code is from the wp-config.php file of one of my development sites. It shows the two different methods of invoking FirePHP. Remember use one or the other, not both.

You call FirePHP by different methods depending upon how you invoke it.

For the Object Oriented API:

global $firephp;
$firephp->log( $var, "Label" );

For the Procedural API:

FB::log( $var, "Label" );

So after a slightly off topic answer:

Double check the documentation for the plugin and make sure you're not supposed to be using the procedural API style call. A procedural call will not work with the object oriented API and vice versa.

Another option would be to try the 'Yet Another Logger' plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.