• Since the recent release of plugin ver. 2.3.4 a number of webpages broke, i.e. no images were displayed. The browser console showed a javascript error. Apparently, the recent code changes are not longer compatible for js minification through the plugin Autoptimize; even when enabling the option to use try / catch blocks in Autoptimize. Enabling the Fancybox plugin option “not to use wp_add_inline_script/style” did not help either.

    As a quick workaround, I had to exclude all js code from wp-content/plugins/easy-fancybox/ from optimization through the Autoptimize, which works for me.

    Thanks for looking into this.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author FirelightWP

    (@firelightwp)

    Hi,

    I did update some JS code, and re-minified our JS files for the lightboxes. But autooptimize should be able to handle a situation where another plugin updates its own JS.

    You don’t happen to know what the error was that you saw do you? If you are open to it, it would be great if you could temporarily stop excluding our JS, try it again, and if the error appears, just copy that here. That would give me a sense for what the issue might be. You could then add the exclusion back if needed.

    Thanks!

    Thread Starter Matthieu-P. Schapranow

    (@theschappy)

    Thanks for the prompt reply.

    Logged error in the browser console was Uncaught?SyntaxError:?missing } after try block <- try / catch block comes from the plugin Autoptumize. When looking into the code location of the error, it points to the purify js lib. Thus, I was able to drill down the exclusion to purify.min.js and it apparently still works as an expected. Apparently, this 3rd party lib is the root source for the issue.

    Path to exclude from Autoptimize: wp-content/plugins/easy-fancybox/vendor/purify.min.js or even more generic, if any other plugin is making use of Dom purify: vendor/purify.min.js.

    I also tried to replace the bundled version 3.1.5 in your plugin by the latest release 3.1.7 of lib dom purify from the GitHub repo, but it does not fix the error at. I have tried the minified and un-minified version, both result in the same error. Thus, I will open a support ticket at Autoptimize to look into this as well.

    Many thanks!

    Matthieu

    Plugin Author FirelightWP

    (@firelightwp)

    Hi Matthieu,

    Wow, thanks for digging into this. You did most of the troubleshooting for me :). Thanks for narrowing down the issue for me and for others who may see this.

    I’ll also look more into what’s going on here and see if I can find a solution.

    Plugin Author FirelightWP

    (@firelightwp)

    Since we have at least a temporary or work around solution for this – excluding the dompurify script – and since the issue obviously evolves from that third party script itself, I’m going to mark this issue resolved. But I’ll still consider it something we need a better long term solution for.

    Worth noting that the dompurify script/package that’s conflicting with autooptimize here is massively popular. It is effectively the standard script for sanitizing content in JavaScript ecosystem and gets about 6 million downloads per week. Given all that, I’m quite surprised at the conflict.

    • This reply was modified 1 month, 2 weeks ago by FirelightWP.

    Frank from Autoptimize here; the problem turned out to be specific to having “add try/catch block” on which is off by default and which we discourage being activated ??

    Plugin Author FirelightWP

    (@firelightwp)

    @optimizingmatters – Thanks so much for following up here with an update. Much appreciated, and glad to see this is resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.