Support » Plugin: W3 Total Cache » Minify HTML break Borlabs Content Blocker

  • Resolved justrobsi

    (@justrobsi)


    Hi, I have a problem with the minify settings of W3TC and my instagram content, blocked with borlabs cookie content blocker. Everything works fine without enabling minify HTML & XML option, but if I turn it on and click on “load content” of my borlabs content blocker, the console gives me this error: Uncaught DOMException: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded. The content itself is then loading correctly but the “load content”-frame does not disappear.

    I hope somebody can help.

    Best,
    Robert

    • This topic was modified 2 months, 2 weeks ago by justrobsi.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @justrobsi

    Thank you for reaching out and I am happy to assist you with this.
    Can you please share which HTML minifier: you are using in Performance>General settings, and if you are using Minify default, try switching to HTML Tidy, save all settings and purge the cache and see if the problem persists?

    Thanks!

    Thread Starter justrobsi

    (@justrobsi)

    Hi and thanks 😀 switching the general settings from HTML Tidy to Minify solved the problem. Unfortunately my pagespeed score is way better with HTML Tidy at about 92+ and only about 70+ with Minify. Is there any other option I can try?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @justrobsi

    Thank you for your feedback.
    I am not sure I understand. You stated that the score is better with HTML Tidy or with Minify default.
    Can you please confirm this?
    HTML minify (Minify default)
    When minifying an HTML file, your primary goal is to remove redundant or unnecessary data.
    Comments: While comments are useful for a developer, they are unnecessary to the browser and should be removed.
    Whitespace: Whitespace is also useful for a developer but unnecessary for a browser, so HTML minify removes all unnecessary spaces, tabs, and line breaks.
    When removed the HTML code is much smaller and faster to load.
    For example the HTML code may look like this:

    <html>
    <head>
     <!-- This is the content that shows in the browser tab -->
     <title>Homepage</title>
     </head>
    <body>
     <!-- This is a comment. -->
     <H1>Hello, world!</H1>
     </body>

    After minification and after all comments and whitespaces are removed it should look like this:
    <html><head><title>Homepage</title></head><body><H1>Hello, world!</H1></body></html>

    Size-wise, the original resource contains 190 bytes of data, whereas the minified resource contains 85 bytes of data. By removing all of the comments and all of the whitespace, the file size has been reduced by over 50%.

    HTML Tidy
    HTML Tidy is doing the same job as Minify default, except it has the ability to add corrections to the HTML code. Sometimes, developers may forget to close some tags, or quotes, which can cause issues when HTML is minified
    Tidy corrects the mark-up in a way that matches where possible the observed rendering, so you can say that TIDY perfects your HTML for you.
    Here are some examples:

    <h1>heading
       <h2>subheading</h3>

    After Tidy:

    <h1>heading</h1>
        <h2>subheading</h2>

    So if the problem is gone when switching to HTML Tidy, it means that the code itself contains some problems or typos

    Thanks!

    Thread Starter justrobsi

    (@justrobsi)

    Okay, first, HTML Tidy gives the better score. Second, I have removed the whole instagram feed and switched to static version. So no more errors here. However, while using HTML Tidy I see that some icons and other things are gone now. That’s because HTML Tidy removes empty elements. I’d like to change the settings for Tidy to not remove them, but I haven’t find any way to configure it. Can you tell me, where I can find a config file for HTML Tidy or something like that?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @justrobsi

    Sorry for the late reply and thank you for the clarification.
    Unfortunately, there is no way to configure the HTML minify not to remove it as this depends on the HTML Minify method.
    HTML Tidy corrects and cleans up HTML and XML documents by fixing markup errors and upgrading legacy code to modern standards.
    You can find the file in /wp-contnent/plugins/w3-total-cache/lib/Minify/Minify/HTMLTidy.php

    Thanks!

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