• Hey,

    is it possible for you to adjust your plugin so that it’s compatible with “Subresource Integrity”? In my case, the test is failed if checked a site on https://observatory.mozilla.org and the plugin is active. Without all is fine.
    I get the error message “Subresource Integrity (SRI) not implemented, and external scripts are loaded over HTTP or use protocol-relative URLs via src=”//…””.

    Thanks!

    Best regards,
    Olaf de Viesel

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi Olaf,

    I have not seen this error message before, but I have an idea why it might be reported. The plugin uses protocol relative URLs to enqueue style and script resources, to make sure that are always loaded via the correct protocol. Seems like that supporting SRI is not compatible with that (?).

    To resolve it, you may have to make a tiny change to one of the plugin files. Before editing, please make sure to have a full site back-up just in case!

    1. Open up the wp-content\plugins\ajax-search-lite\ajax-search-lite.php file on your server

    2. Scroll to line 24, which should be this:

    define('ASL_URL_NP', str_replace(array("http://", "https://"), "//", plugin_dir_url(__FILE__)));

    3. ..try replacing that line with this:

    define('ASL_URL_NP', plugin_dir_url(__FILE__));

    4. Save the file.

    Make sure to also clear your site and browser cache, and then try testing again. Hopefully it should be fine afterwards.

    Best regards,
    Ernest M.

    Thread Starter olafdeviesel

    (@olafdeviesel)

    Hey Ernest,

    yes! Thats it! With this change the test at https://observatory.mozilla.org is successful. Thank you very much.

    Can you set this setting as an option in your plugin please, beacause with the next update this change will discard?

    Best regards,
    Olaf

    Plugin Author wpdreams

    (@wpdreams)

    Hi Olaf,

    I will find a different solution to prevent protocolless URLs in the next release. It was initially implemented to prevent HTTP -> HTTPS migration problems with caches, but I think I can construct a redundant method to bypass this in a different way.

    Best regards,
    Ernest M.

    Hi,

    Was that already solved?
    I’ve just installed your plugin and got -50 points in Mozilla’s Observatory tool.

    TIA.

    Plugin Author wpdreams

    (@wpdreams)

    Hi,

    Let me check on this one, I am not sure. We are enrolling an update tomorrow, if I find this was not patched, I will make sure to include it.

    Best,
    Ernest M.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Subresource Integrity’ is closed to new replies.