Title: Undefined variable
Last modified: August 30, 2016

---

# Undefined variable

 *  Resolved [cvongrim](https://wordpress.org/support/users/cvongrim/)
 * (@cvongrim)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/)
 * When activating the plugin I receive a noticed for
 * Notice: Undefined variable: addthis_sidebar in /vagrant/html/wp-content/plugins/
   addthis/addthis_social_widget.php on line 1337
 * I can’t figure out what is causing it. I can update that line to have an if statement
   to check if addthis_sidebar is set but I know any updates to the plugin will 
   remove that change.
 * [https://wordpress.org/plugins/addthis/](https://wordpress.org/plugins/addthis/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Contributor [Julka Grodel](https://wordpress.org/support/users/jgrodel/)
 * (@jgrodel)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446437)
 * Thanks for the report cvongrim. We’re working on a fix.
 *  [David Higgins](https://wordpress.org/support/users/higginsdzoulcreationscom/)
 * (@higginsdzoulcreationscom)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446509)
 * I have the same problem. This shows up immediately after updating, when WP_DEBUG
   is turned on.
 * addthis_social_widget.php:1337
 * Seems to only be an issue when you have “I want to control my plugin from…” set
   to WordPress.
 *  Plugin Contributor [Julka Grodel](https://wordpress.org/support/users/jgrodel/)
 * (@jgrodel)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446519)
 * cvongrim & David, thank for lettings us know about your finding.
 * We’ve got a fix primed to go out with version 5.1.1. However, since this is a
   PHP notice and not an error, we’re leaning towards holding off on a new bug fix
   release until we have more substantial changes to put out.
 *  Thread Starter [cvongrim](https://wordpress.org/support/users/cvongrim/)
 * (@cvongrim)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446630)
 * Well if someone wants temporary fix until then, here is what I did.
 * I just wrapped line 1337 in the addthis_social_widget.php with an if statement
   to check that the variable has been set.
 *     ```
       if(isset($addthis_sidebar)){
                   $AddThis_addjs_sharing_button_plugin->addAfterScript($addthis_sidebar);
               }
       ```
   
 *  [pl2000](https://wordpress.org/support/users/pl2000/)
 * (@pl2000)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446648)
 * Thanks cvongrim – that has fixed it for me.
 *  [hongpong](https://wordpress.org/support/users/hongpong/)
 * (@hongpong)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446666)
 * Thanks [@cvongrim](https://wordpress.org/support/users/cvongrim/) that also works
   for me.
 *  Plugin Contributor [Julka Grodel](https://wordpress.org/support/users/jgrodel/)
 * (@jgrodel)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446696)
 * 5.1.1 was released moments ago and it resolves this issue. Please let us know
   if you’re still having problems after upgrading.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Undefined variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/addthis_70cced.svg)
 * [WordPress Share Buttons Plugin – AddThis](https://wordpress.org/plugins/addthis/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/addthis/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/addthis/)
 * [Active Topics](https://wordpress.org/support/plugin/addthis/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/addthis/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/addthis/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [Julka Grodel](https://wordpress.org/support/users/jgrodel/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/undefined-variable-27/#post-6446696)
 * Status: resolved