Viewing 15 replies - 1 through 15 (of 16 total)
  • Anonymous User 16850768

    (@anonymized-16850768)

    This is likely related to the updates to the HTML minification. Does this stop occurring in version 1.6.1 if you exclude inline CSS and JavaScript from the HTML minification? If yes, please provide a direct URL to the page where this error used to be occurring.

    If no, does this stop occurring in version 1.6.1 if you disable HTML minification entirely? If yes, now please provide a direct URL to the page where this error used to be occurring.

    Thread Starter cloudshift

    (@cloudshift)

    If I deactivate the include CSS and JS in minification, it works. If I include inline CSS and JS in the minification the page breaks. The error occurs on page https://cloudshift.de, but I have deactivated the option including CSS and JS for now, as it is a live site. Normal HTML minification still is active.

    Anonymous User 16850768

    (@anonymized-16850768)

    Thank you. That confirms it’s related to removing inline CSS and JavaScript comments. Let me take your page source and troubleshoot this further. Updates to follow shortly.

    Thread Starter cloudshift

    (@cloudshift)

    Thanks a lot for the quick answer and this great Plugin in general! We really appreciate that!

    Anonymous User 16850768

    (@anonymized-16850768)

    You’re most welcome. I’m really happy to hear that. I’ve identified the issue and will have a fix issued in the next release.

    In the meantime you should be able to prevent this issue from occurring by making sure https://www.cloudshift.de/wp-content/uploads/nextcloud.svg is requested instead of https://www.cloudshift.de/wp-content/uploads//nextcloud.svg.

    Anonymous User 16850768

    (@anonymized-16850768)

    (Actually, any image request that has two trailing forward slashes as there are a few in the page that you’ve provided.)

    Thread Starter cloudshift

    (@cloudshift)

    Interesting! Thanks for finding that so quickly! It seems this is somehow theme related and obviously a bug in the theme which only occurs when I have more than one slider element on a page. I will open a ticket there too.

    Anonymous User 16850768

    (@anonymized-16850768)

    I’ve fixed this issue and will have it released in version 1.6.2. Once this is released shortly I’d love to get your feedback to confirm that the issue has indeed been resolved for you.

    Thread Starter cloudshift

    (@cloudshift)

    Thanks for the update. After some testing, I still get an “Uncaught SyntaxError: Unexpected token ‘if'” error when I activate the inline minification.

    • This reply was modified 3 years, 11 months ago by cloudshift.
    Anonymous User 16850768

    (@anonymized-16850768)

    On that same page URL previously provided? When taking the page source, using the updated regular expression, I was able to fix what was occurring, for example:

    Old pattern: https://regex101.com/r/ZrGOSU/1
    New pattern: https://regex101.com/r/cQRNWg/1

    It’s only matching comments on that page source with the new pattern. To confirm, you’re on version 1.6.2 when this occurs and it happens even after clearing the site cache? (The site cache is cleared when the plugin is updated but just to make sure.)

    Thread Starter cloudshift

    (@cloudshift)

    I’m on version 1.6.2 and cleared all caches manually and stilt the page breaks when I minify the inline JS. I’m not really into regex stuff, but I can see that both patterns select a closing script tag (just the “>”). Is this right?

    See line: <script>// wait until all the resources are loaded

    Thanks for your help!

    Anonymous User 16850768

    (@anonymized-16850768)

    No that’s not right. It replaces it with $1 (group 1) so any part in the first group match is placed back, meaning > in the example you’ve provided is not removed.

    When running the page source in order by removing HTML comments, inline CSS and JavaScript comments, and then minifying the HTML itself I’m no longer able to replicate any errors.

    To troubleshoot this further, is it possible to receive a screenshot of the exact console error? It would be good to ensure the complete error is shown in the screenshot. If you’re able to click on the error and provide a screenshot of what it highlights that may also be helpful. (Normally I’d like to inspect this myself but I understand that it won’t work to leave this error live.)

    Thread Starter cloudshift

    (@cloudshift)

    I activate the inline minifying for a moment so that you can see the error in the console for yourself: https://www.cloudshift.de/

    It seems it does not break the page completely but throws an error. Thank you very much for your quick and profound help!

    Anonymous User 16850768

    (@anonymized-16850768)

    Thank you! I really appreciate that as that expedited identifying what was occurring and allowed me to find the issue.

    While the fix in version 1.6.2 did fix mistakenly matching file paths that contained two slashes as comments, like in the images provided above, this different console error isn’t actually related to an issue with Cache Enabler itself. Instead, it’s related to the actual formatting of your inline JavaScript itself and when it’s minified it no longer works (https://i.imgur.com/nqhc75a.png). This issue is in the findSVGElements() function:

    function findSVGElements()
    {
        var elms = document.querySelectorAll(".bfd-svg");
        for (var i = 0; i < elms.length; i++)
        {
            var subdoc = getSubDocument(elms[i])
            if (subdoc)
                subdoc.getElementById("bfd-svg-color").setAttribute("fill", "#ffffff");
        }
    }

    The var subdoc = getSubDocument(elms[i]) should have a closing semicolon ; to indicate the end of line because when minified this statement, along with the rest of the JavaScript, will be on one line, for example:

    function findSVGElements()
    {
        var elms = document.querySelectorAll(".bfd-svg");
        for (var i = 0; i < elms.length; i++)
        {
            var subdoc = getSubDocument(elms[i]);
            if (subdoc)
                subdoc.getElementById("bfd-svg-color").setAttribute("fill", "#ffffff");
        }
    }
    • This reply was modified 3 years, 11 months ago by Anonymous User 16850768. Reason: clarity
    Thread Starter cloudshift

    (@cloudshift)

    Wow, great!!

    I corrected it manually within the plugin and will contact the plugin owner for getting it corrected in further versions. Thanks so much!

    Happy holidays to you!

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Problems after update to 1.6.1’ is closed to new replies.