Viewing 1 replies (of 1 total)
  • Plugin Author malihu

    (@malihu)

    Hello,

    You cannot (and should not) move this to other js file.

    The “messy” code is the (CDATA) output of WordPresswp_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.