This code is generated by the WordPress core to pass values to the frontend scripts of plugins. Without this code the plugin will not work correctly any longer since all options from the backend would then be missing.
Also see: https://developer.wordpress.org/reference/functions/wp_localize_script/
For future updates I may update this to pass the settings as inline script (https://developer.wordpress.org/reference/functions/wp_add_inline_script/) – but this will only move the location of this code to another position. It will still be needed to pass options to the frontend script.
Thread Starter
Юрец
(@juurec)
Thanks, I will be waiting for an update)
Just to avoid any confusion: after the update the code will still be there – it will just look a bit different.
I just checked this: no, this script must be there. There is no other way and the script will stay there.
Explanation:
The frontend script must know which options you have set and this can only be done by passing these options as variables to the script. In addition these variables have to be set before the frontend script is loaded.