Support » Plugin: W3 Total Cache » Last update destroyed HTML minify settings

  • Resolved andyet88

    (@andyet88)


    When i update today plugin my HTML minify was destroyed. I am using cherry services and now on my page is html Code with content. For example on main page is

    “”,”after_title”:”<\/h2>”,”pager”:false,”paged”:1,”template”:”default.tmpl”,”item_class”:” services-item”,”container”:”
    %s<\/div>”}’ data-pages=”2″ data-page=”1″ data-cat=”comarch-erp”>”

    If i turn off “HTML minify settings” in Minify everything is ok.

    • This topic was modified 10 months ago by andyet88.

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • 3Lancer

    (@3lancer)

    Confirmed… HTML minify settings: When set to ‘Enabled’ breaks Slider Revolution Version 5.4.8.1. All slide images just disappear and become blank, if enabled.

    malferov

    (@malferov)

    Same thing: HTML minification is broken. Temporarily disable.

    Jim

    (@digitalredefined)

    Same here. Disabling HTML minification didn’t fix either.

    webgirl

    (@webgirl)

    Agree there’s an issue with Minify. Messed up a few onclick pop-up boxes, etc. Once I turned off Minify everything is back to normal.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello,
    Thank you for contacting the support and thank you for bringing this to our attention.
    We’ve made some tests and indeed there is a bug and we’ll release a fix soon.
    What happens is:
    w3-total-cache/lib/Minify/Minify/HTML.php line 346:

    $m[2] = preg_replace('/([a-z0-9]=)[\'"]([^\'"\\s=]+)[\'"](?!\\/)/i', '$1$2', $m[2]);
            $m[2] = preg_replace('/([a-z0-9]=)[\'"]([^\'"\\s=]+)[\'"]\\//i', '$1$2 /', $m[2]);
            $m[2] = preg_replace('/([a-z0-9])=[\'"][\'"]/i', '$1', $m[2]);

    should be:

            $m[2] = preg_replace( '/([a-z0-9]=)\'([^\'\\s=]+)\'(\\s|>)(?!\\/)/i', '$1$2$3', $m[2] );
            $m[2] = preg_replace( '/([a-z0-9]=)"([^"\\s=]+)"(\\s|>)(?!\\/)/i', '$1$2$3', $m[2] );
            $m[2] = preg_replace( '/([a-z0-9]=)\'([^\'\\s=]+)\'\\//i', '$1$2 /', $m[2] );
            $m[2] = preg_replace( '/([a-z0-9]=)"([^"\\s=]+)"\\//i', '$1$2 /', $m[2] );
            $m[2] = preg_replace('/([a-z0-9])=[\'"][\'"]/i', '$1', $m[2]);
    simonmm

    (@simonmm)

    This update also appears to have broken the structured data that Woocommerce places on (some) single product pages.

    Viewing via https://search.google.com/structured-data/testing-tool gives
    JSON-LD Bad escape sequence in string.
    (example test URL is https://mindmachine.co.uk/product/cn459-60375-hp-assy-duplex-module )

    Unless HTML minify settings: is disabled.

    The above change to HTML.php does not seem to help.

    • This reply was modified 10 months ago by simonmm. Reason: Added example URL
    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @simonmm,

    We are looking into this. This will be resolved when the fix is released.

    W3TC 0.9.7.2 has not fixed the minification of Woocommerce structured data issue.

    Create a Woocommerce product description containing just x<br />x

    Without minification, this is fetched by the browser as
    <script type="application/ld+json">{......"description":"x<br \/>x".....</script>

    With minification, this is fetched by the browser as
    <script type="application/ld+json">{......"description":"x<br \>x".....</script>
    i.e. minification has removed the forward slash, which is OK, but it has left the preceding backslash, which then escapes the following “>” and causes a JSON-LD error.

    (Just for completeness: WordPress 4.9.9, WooCommerce 3.5.4, PHP 7.2.14)

    • This reply was modified 9 months, 3 weeks ago by simonmm. Reason: Added vsn info

    Same problem.
    Starting from W3TC 0.9.7 HTML Minify breaks content in the ajax requests responses, popups, etc.

    Plugin Support Marko Vasiljevic

    (@vmarko)

    Hello @loyaltymanufaktur,

    We are aware of the issue and this will be fixed in the next release.

    The minification of Woocommerce structured data issue has been fixed by Woocommerce v3.5.6 (which removes HTML tags from the product description when preparing the JSON-LD structured data).

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Last update destroyed HTML minify settings’ is closed to new replies.