• Resolved Lee

    (@leewickham)


    Hey guys, I have been using your Site Reviews on my website https://www.fireworks.co.uk
    for a while now and recently just noticed after an update of the plugin it now adds the following java code call to all pages within my website.
    https://cdn.polyfill.io/v2/polyfill.js

    Politely requesting that you please do one of the following.

    A: Alter the plugin so that this javascript code is only called on the exact pages where the shortcode for the plugin is called (Recommended best practise method)
    Or
    B: Give us the end user a way to defer or async the code (for SEO reasons).

    Additionally a heads up: please be aware that using the javascript may automatically make your plugin in breach of GDPR as your potentially sending customer details to a 3rd party site. Yoast recently stoped using polyfill for this exact reason

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    @leewickham

    1. I’ve just released an update which provides two filter hooks which will allow you customize which scripts use the async tag and which the defer tag:

    site-reviews/async-scripts and site-reviews/defer-scripts

    Example usage (add to your theme’s functions.php file):

    /**
     * Add a "defer" attribute to the polyfill.io script from Site Reviews
     * @return array
     */
    add_filter( 'site-reviews/defer-scripts', function( $handles ) {
        $handles[] = 'geminilabs-site-reviews/polyfill';
        return $handles;
    });

    Both of these filter hooks return an array of script handles.

    2. The polyfill script only checks (and adds polyfills as needed) for the following browser features:

    • CustomEvent
    • Element.prototype.closest
    • Element.prototype.dataset
    • Event

    These checks provide browser compatibility for IE 9-10.

    3. The Polyfill service provide “fallbacks” that allow applications written in modern javascript, HTML, and CSS standards to work properly in older browsers (or in the case of Site Reviews: Internet Explorer v9-10).

    In order to provide the polyfills, the Polyfill Service receives from your browser certain technical information including:

    • browser details;
    • connection details (such as your IP address which can identify your approximate location and/or name of your ISP);
    • the URL of the web page which has made the request to the Service.

    This information is used to determine which polyfills are required by the browser.

    The only information that is retained is:

    • the domain of the web page which has made the request to the Service;
    • the user agent string for your browser;
    • the set of polyfills that were requested by the web page.

    According the the pricacy policy of the Polyfill Service, it does not retain any identifying information.

    4. If you do not need the polyfill script on your website, you can disable it using the following code in your theme’s functions.php file:

    /**
     * Disable the polyfill.io script from Site Reviews
     * @return bool
     */
    add_filter( 'site-reviews/assets/polyfill', '__return_false' );
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    Plugin Author Gemini Labs

    (@geminilabs)

    It is not a good idea to add defer/async to the polyfill.io script because it needs to be loaded before the Site Reviews script in order for the polyfills to work.

    Wordpress automatically adds a dns-prefetch link tag for all 3rd-party domains that load assets, and the size of the polyfill script (if unused) is only 305 bytes (!) if gzip is enabled on your server. All modern browsers also support HTTP/2. For these reasons, the script should not affect the speed of your website at all.

    However, if you do not need to support Internet Explorer 9-10, I suggest you just disable the script as shown in #4 above.

    • This reply was modified 6 years, 3 months ago by Gemini Labs.
    Thread Starter Lee

    (@leewickham)

    Cheers for the quick turn around and update, ill be going ahead and using the hook to disable polyfill as it’s not required for the moment.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘cdn.polyfill.io’ is closed to new replies.