Title: Uncaught ReferenceError
Last modified: August 21, 2016

---

# Uncaught ReferenceError

 *  Resolved [kevin](https://wordpress.org/support/users/k-win/)
 * (@k-win)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/)
 * I’m trying to prevent the plugin from loading the js files by using `define('
   WPSOCIALITE_LOADSCRIPTS', false);` in the **wp-config** file as said in the **
   faq** but this does not prevent from loading the wpsocialite.js that tries anyway
   to setup the plugin by calling `Socialite.process()` and therefore creating an`
   Uncaught ReferenceError: Socialite is not defined` in the Chrome inspector.
 * [http://wordpress.org/plugins/wpsocialite/](http://wordpress.org/plugins/wpsocialite/)

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

 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/#post-4022171)
 * Kevin,
 * Thank you for bringing that to my attention. The issue was with the wpsocialite_localize_script
   function. It was loading a call to localize Socialite even though we were trying
   to disable it from loading.
 * I wrapped the output of this function in an if/else statement that will check
   if the scripts are disabled. A release is hopefully coming this week, but if 
   you need this solved now open wpsocialite.php in the wpsocialite plugin folder
   and find line 120:
 *     ```
       echo "<script type=\"text/javascript\">Socialite.setup({facebook:{lang:'$fb_locale',appId:null},twitter:{lang:'$tw_locale'},googleplus:{lang:'$gp_locale'},vkontakte:{apiId:'".get_option('wpsocialite_vkontakte_apiId')."'}});</script>";
       ```
   
 * Replace it with the following:
 *     ```
       if( WPSOCIALITE_LOADSCRIPTS && !is_admin() ) {
                       echo "<script type=\"text/javascript\">Socialite.setup({facebook:{lang:'$fb_locale',appId:null},twitter:{lang:'$tw_locale'},googleplus:{lang:'$gp_locale'},vkontakte:{apiId:'".get_option('wpsocialite_vkontakte_apiId')."'}});</script>";
                   }
       ```
   
 * Let me know if this works for you and thanks for using WPSocialite!
 *  Thread Starter [kevin](https://wordpress.org/support/users/k-win/)
 * (@k-win)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/#post-4022201)
 * Tom, when do you plan do publish the next release? My goal is to only load those
   files `wpsocialite.js` and `socialite.min.js` in the blog main page and on single
   posts. Do you plan to support that as well or will it require further coding?(
   not that i’m afraid of doing those if statements).
 * Thanks
 *  Plugin Author [Tom Morton](https://wordpress.org/support/users/tm3909/)
 * (@tm3909)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/#post-4022239)
 * Kevin,
 * Just pushed an update. Look for version 2.4 that has this fixed.
 *  Thread Starter [kevin](https://wordpress.org/support/users/k-win/)
 * (@k-win)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/#post-4022243)
 * Hey Tom, just updated the plugin and even if i’m selecting “_Apply to Single 
   only_” in the admin and deactivate the two lines in `wp-config.php`:
 *     ```
       //define('WPSOCIALITE_LOADSCRIPTS', false);
       //define('WPSOCIALITE_LOADSTYLES', false);
       ```
   
 * It does load all the files on the home page; `wpsocialite.css`, `wpsocialite.
   js` and `socialite.min.js`.
 * If i uncomment both lines, well scripts and css dont load at all.
 * Am i missing something with this 2.4 release or is it on purpose so i let `define('
   WPSOCIALITE_LOADSCRIPTS', false);` and load both js files manually? (Which is
   is fine for me)

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

The topic ‘Uncaught ReferenceError’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpsocialite_f8f8f8.svg)
 * [WPSocialite](https://wordpress.org/plugins/wpsocialite/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpsocialite/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpsocialite/)
 * [Active Topics](https://wordpress.org/support/plugin/wpsocialite/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpsocialite/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpsocialite/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [kevin](https://wordpress.org/support/users/k-win/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/uncaught-referenceerror/#post-4022243)
 * Status: resolved