Title: wp_localize_script() conflict
Last modified: August 31, 2016

---

# wp_localize_script() conflict

 *  Resolved [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp_localize_script-conflict/)
 * Hi there,
 * When you register your own scripts or styles within WordPress, it’s not a bad
   idea to use something more unique to your plugin. For instance, you register 
   your fb.js script with a handle of “myownscript” – not very unique, nor describing
   of what it is. A better alternative would be something like “fb-pagelike-widget”
   or “milap-fb-pagelike-widget”. I don’t have an issue with this in particular,
   but it’s not impossible that someone else decided to name their script “myownscript”,
   which would make either your or their JS to not be loaded on the site.
 * The same thing goes for when using `wp_localize_script()`. You’re assigning some
   values to an object called `vars`(these objects are within the global JS scope,
   so can be overwritten), which again is not really unique. I have another plugin
   that does the same thing. The result is that the other plugin breaks.
 * So, please with the next version just change at least the second parameter of`
   wp_localize_script()` to try and prevent race conditions like this from happening.
 * Thank you 🙂
 * [https://wordpress.org/plugins/facebook-pagelike-widget/](https://wordpress.org/plugins/facebook-pagelike-widget/)

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

 *  Plugin Author [Milap](https://wordpress.org/support/users/milap/)
 * (@milap)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp_localize_script-conflict/#post-7183228)
 * Hi Nikola,
 * First of all i would like to thank you for suggestion. Yes you are absolutely
   right, i must have to change mentioned terms in my plugin and i will do it soon.
   Thanks for taking time to check my plugin code and wrote me.
 * This is one of the reasons behind the success of WordPress, because of people
   like you. God bless you.
 * Kind Regards,
    Milap
 *  Thread Starter [Nikola Nikolov](https://wordpress.org/support/users/nikolovtmw/)
 * (@nikolovtmw)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp_localize_script-conflict/#post-7183230)
 * Glad I was able to help improve your plugin 🙂
 * Thank you for working on it and releasing it for everyone to use for free!
 *  Plugin Author [Milap](https://wordpress.org/support/users/milap/)
 * (@milap)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/wp_localize_script-conflict/#post-7183248)
 * Hi Nikola,
 * I have updated both. You can check now in my plugin.
    Again thanks for your suggestions.
 * Kind Regards,
    Milap

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

The topic ‘wp_localize_script() conflict’ is closed to new replies.

 * ![](https://ps.w.org/facebook-pagelike-widget/assets/icon-256x256.png?rev=3518584)
 * [Buttonizer - Social Media Share Buttons, Social Icons, & Social Feeds](https://wordpress.org/plugins/facebook-pagelike-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/facebook-pagelike-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/facebook-pagelike-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/facebook-pagelike-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/facebook-pagelike-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/facebook-pagelike-widget/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Milap](https://wordpress.org/support/users/milap/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/wp_localize_script-conflict/#post-7183248)
 * Status: resolved