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.
Same thing: HTML minification is broken. Temporarily disable.
Jim
(@digitalredefined)
Same here. Disabling HTML minification didn’t fix either.
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.
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]);
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 7 years, 4 months ago by
simonmm. Reason: Added example URL
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 7 years, 4 months 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.
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).