Title: [Plugin: Facebook Social Widgets] Undefined Variable Causing Problems when WP_DEBUG is true
Last modified: August 20, 2016

---

# [Plugin: Facebook Social Widgets] Undefined Variable Causing Problems when WP_DEBUG is true

 *  [Wes Todd](https://wordpress.org/support/users/jawesomeclay/)
 * (@jawesomeclay)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-facebook-social-widgets-undefined-variable-causing-problems-when-wp_debug-is-true/)
 * The problem I am having is that while I am developing and have WP_DEBUG set to
   true I am not able to start a session because the headers have already been sent
   by the WordPess error handling. Here is the error that I am receiving:
 * Notice: Undefined property: FacebookWidgets::$pluginDirectory in …/…/wp-content/
   plugins/facebook-social-widgets/facebook-social-widgets.php on line 26
 * Warning: session_start() [function.session-start]: Cannot send session cache 
   limiter – headers already sent (output started at …/…/wp-content/plugins/facebook-
   social-widgets/facebook-social-widgets.php:26) in …/…/wp-content/plugins/wp-custom-
   admin-bar/custom-admin-bar-functions.php on line 8
 * My suggestion would be to declare that variable as a member of the class:
    `protected
   $pluginDirectory;`
 * Or something like that to get rid of the warning. Thanks for the great work and
   for helping me out by taking care of this problem.
 * [http://wordpress.org/extend/plugins/facebook-social-widgets/](http://wordpress.org/extend/plugins/facebook-social-widgets/)

The topic ‘[Plugin: Facebook Social Widgets] Undefined Variable Causing Problems
when WP_DEBUG is true’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/facebook-social-widgets.svg)
 * [Facebook Social Widgets](https://wordpress.org/plugins/facebook-social-widgets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/facebook-social-widgets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-social-widgets/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-social-widgets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-social-widgets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-social-widgets/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Wes Todd](https://wordpress.org/support/users/jawesomeclay/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/plugin-facebook-social-widgets-undefined-variable-causing-problems-when-wp_debug-is-true/)
 * Status: not resolved