Wp-rocket: 3.6.2 Encoding issues with DOM Module for Non-Latin Characters causing broken layouts

Created on 9 Jul 2020  路  19Comments  路  Source: wp-media/wp-rocket

DOMDocument encoding sets the <meta> tag but not the overall HTML encoding. When creating the DOM and saving it back to a string, the UTF-8 encoding is not respected. As such, it creates encoded entities and in some cases can break the layout.

dom bug

All 19 comments

Fixed in PR 6 of the DOM Module repo https://github.com/wp-media/module-dom/pull/6

This ticket might be this problem...maybe https://secure.helpscout.net/conversation/1219841185/179108

I just want to highlight I have run into this issue as well on many sites. The temporary fix I have stumbled across was to turn off the optimize css delivery option.

Hey @ScottTravisHartley, could you try the PR on one of your sites to see if it resolves the problem for you with Optimize CSS delivery option turned on?

Sure thing will do

Thanks @ScottTravisHartley 馃帀 Really appreciate it.

Well, I am not getting any odd characters but with the optimize critical css feature the page layout is still very much broken. Granted this could be an issue with how I implemented the update.

I went to plugins/wp-rocket/inc/Engine/DOM -> replaced the contents of HTMLDocument.php with https://raw.githubusercontent.com/wp-media/module-dom/master/HTMLDocument.php

Page outputs like:
image

The issue does go away when I roll back to 3.5.5.1 (which I just did on the site)

That's interesting. Hey @ScottTravisHartley, could I work with you on it to discovery the root cause? If yes, could you create a Support Ticket where we can talk in private and you can share credentials with me?

Sure thing

Thanks @ScottTravisHartley. Once the ticket comes in, I'll assign to myself and ping you.

Sent it in!

Not really sure why but the name it auto responded with was -> Bassel Enab

I saw that. Replying to you now.

We're facing the same issue, on one site we rolled back to 3.5.5.1 and the issue was solved and on the other one we disabled the optimize css delivery and the issue is solved also.

Closing as the DOM Module has moved out of Rocket.

Was this page helpful?
0 / 5 - 0 ratings