Title: Page Optimization
Last modified: September 1, 2016

---

# Page Optimization

 *  [ranganbd](https://wordpress.org/support/users/ranganbd/)
 * (@ranganbd)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/page-optimization/)
 * Hi,
    Plugin is working perfectly but I am seeing that in every page there is 
   a messy code like below – [](https://s3.postimg.org/bp0evigeb/141.png)
 * I want to get rid from this. Can I move this piece of code to other JS file ?
 * Thanks
 * [https://wordpress.org/plugins/page-scroll-to-id/](https://wordpress.org/plugins/page-scroll-to-id/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [malihu](https://wordpress.org/support/users/malihu/)
 * (@malihu)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/page-optimization/#post-7685707)
 * Hello,
 * You cannot (and should not) move this to other js file.
 * The “messy” code is the (CDATA) output of WordPress`wp_localize_script` function.
   This function is used within plugins in order to use PHP data in the client by
   printing out a javascript object.
    This object is used by the client-side plugin’s
   script to get the user options and data.
 * This is the proper way of passing PHP data to javascript in WordPress and it 
   is used by many plugins as it separates client from server logic.
 * In addition, it also helps to provide plugin support as I can see the current
   options set in the plugin by the user.

Viewing 1 replies (of 1 total)

The topic ‘Page Optimization’ is closed to new replies.

 * ![](https://ps.w.org/page-scroll-to-id/assets/icon-256x256.png?rev=1401043)
 * [Page scroll to id](https://wordpress.org/plugins/page-scroll-to-id/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/page-scroll-to-id/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/page-scroll-to-id/)
 * [Active Topics](https://wordpress.org/support/plugin/page-scroll-to-id/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/page-scroll-to-id/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/page-scroll-to-id/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [malihu](https://wordpress.org/support/users/malihu/)
 * Last activity: [9 years, 9 months ago](https://wordpress.org/support/topic/page-optimization/#post-7685707)
 * Status: not resolved