• Resolved Scott

    (@sstracy)


    Hello,

    I am seeing JS script appear near the top of all my pages (even when not logged in) and I am focusing on security as well as page load speed – this script is triggering a red flag for me. Starts with:


    <script id=’pw-gift-cards-js-extra’>
    var pwgc = {“ajaxurl”:”\/wp-admin\/admin-ajax.php”,”denomination_attribute_slug”:”gift-card-amount”,

    Is there a way to at least limit when this script is added to my pages?

    Thank you for your time and help!

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

    (@pimwick)

    As per the WordPress documentation, we use the wp_localize_script() function to define variables for things such as translation and settings.

    The script is simply defining a variable (pwgc) and would not run slowly. If you edit the /wp-content/plugins/pw-gift-cards/pw-gift-cards.php file you can see where we call the wp_localize_script() function to define these values.

    Hope this makes sense, I’m marking the thread as resolved but if you have any further questions let us know.

Viewing 1 replies (of 1 total)
  • The topic ‘Script appearing on all pages when not needed’ is closed to new replies.