We just noticed that WP-HTML-Compression is stripping https from external links. We’ve confirmed that disabling the plugin resolves the issue so I wanted to report it so that it can hopefully be corrected. I found an old post with the same issue but have not found a fix yet.
This is the external link we’re trying https://roc.uwctc.org/tiki/tiki-index.php?page=roc-public-home
As of now, their non-https does not work so when it’s stripped it causes an issue.
]]>Instead of crafting a plugin of my own, I decided to use this one in hopes to remove the whitespace between my html tags.
Why would I want to do this?
Well, besides compressing my HTML even further, I wanted to get rid of the space between inline-block elements on my page which end up adding a visual gap between elements.
Now, I know that there are css workarounds to get rid of this and none of them are truly bulletproof, including negative margins, etc. But, really the root of the problem was the space character, and getting rid of it fixes the problem absolutely. And, in my circumstance, I only wanted to clean up the HTML; I didn’t need to clean up my inline scripts, styles or comments.
I noticed that the readme states that it attempts to preserve *rendered* whitespace, but for me this wasn’t necessary.
After a couple minutes of looking at the innards of the plugin, I simply added one small line of code to the html-minify.php file after the entire foreach ($matches as $token) { ... }
statement, just before the return $html;
line.
This is what I added
$html = preg_replace('/>\s+</', '><', $html);
RegExp Explained
What it does is it looks for the end of a tag at the “>” character, including as many as possibly whitespace characters, up to the beginning of the next tag at the “<” character. Then it just replaces any instances of that search with a collapsed no-space version: “><“.
This works out perfectly for me, I hope this helps anyone else as well.
]]>the plugin works marvellous, but it would be nice if it didnt shorten the url’s in the rss feeds. Rss feeds need full uri’s, including domain name, or they’re invalid.
is there a way to globally fix this, or am i doing something wrong?
]]>The plugin is great, but i have a problem.
I have some comments with /* <![CDATA[ */ and some sliders doesn’t work. Also, some JS files from the same area dissapear.
It would be great if i can minify comments (like you minify HTML) instead removing them.
In this way, all sliders will run and the page will pass Google PageSpeed test, even i keep the comments in the source code.
thanks
Andrei
Hi,
I had some problems with Facebook Like Box, then I disabled WP-HTML-Compression and now it works.
Code without compression:
<div class="fb-like-box" data-href="https://www.facebook.com/my_page" data-colorscheme="light" data-show-faces="true" data-header="false" data-width="320" data-stream="false" data-show-border="true"></div>
Code with compression:
<div class="fb-like-box" data-href="//www.facebook.com/my_page" data-colorscheme="light" data-show-faces="true" data-header="false" data-width="320" data-stream="false" data-show-border="true"></div>
The only attribute changed is data-href.
Thanks,
Gregorio
Hi, great plugin! I am using your plugin in combination with the Autoptimize plugin with amazing results without any specific cache. (I am using cloudflare as a cdn instead). Though I may try all this in combo with the new Gator Cache.
But, I am having a problem with the SEO Facebook Comments plugin which is printing this error “href URL is not properly formatted” to the screen now and no longer works.
Is there an easy answer or do I have to consider using a different comment plugin?
]]>With qTranslate it completely breaks the site! ??
It works only on the default language pages, without the “Pre-Path URL”.All the translated (with new path url) pages are completely broken and you cannot come back to default language using the flag link.
…any suggestion?
I have gravity forms but the css and js is not being minified.
How do I add gravity forms so that it it gets minified too?
]]>Hi, I would like to know how to make ignore my custom html comments from removing…
thanks.
]]>What is the current status of this plugin? Reviews indicate mixed. Are there still issues as described in the the reviews?
]]>Hi,
How to disable Absolute-to-Relative URLs function ?
thanks
]]>Hi everyone,
This is currently not compatible with the All-in-one Event Calendar plugin as far as I can tell. https://www.ads-software.com/support/plugin/all-in-one-event-calendar
Steps to replicate from fresh install:
1.) Install All-in-one Event Calendar v1.10.1 and WP-HTML compression v0.5.8.
2.) Follow the setup for All-in-one Event Calendar.
3.) Browse to the Event calendar.
4.) Try clicking on any button, switch to agenda view for example. Nothing will work.
5.) Disable WP-HTML Compression and try the calendar again. It will work as expected.
Any tips on how to get this to work with All-in-one Event Calendar would be appreciated.
Many thanks,
-Tim
Hi
I have noticed that in pages/posts where Post Tabs is in use the plugin does not work. Viewing into source there is no any change with/ without plugin.
Do somebody have any idea how to solve it?
Hello!
I have a page who’s content area is being populated by AJAX. There are some form elements and depending on what’s clicked, the content area changes.
When I am returning content via AJAX like this:
<a href="/this-awesome-link">This awesome link</a>
It is rendered on the page like this when wp-html-compression is active:
<a href="this-awesome-link">This awesome link</a>
If I deactivate wp-html-compression it works as expected and my AJAX returns this:
<a href="/this-awesome-link">This awesome link</a>
For now, I’m using <!–wp-html-compression no compression–> comments around my content being sent via AJAX and that’s fixing my problem for now.
Thanks for reading,
-Tim
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>No bug
Just wanted to say that it’s not WordPress that does the best it can to correct badly done markup, it’s the browser that does that.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>I switched some SVG images on my site to use data URIs instead of loading the images directly. WP-HTML-Compression was inserting a slash in front of the MIME type, causing the images not to display.
So instead of:
data:image/svg+xml;base64,mZiIvPjwvZz…
I got:
data:/image/svg+xml;base64,mZiIvPjwvZz…
I worked around it with “no compression” comments, but it would be great if your plugin could sniff out data: URIs and leave them alone.
Thanks!
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data. is the error I am getting on a lot of my posts with this plugin installed. I took me a few hours before I found what the problem was. I deactivated the plugin and my website works normal again. All post visible but clicking on them to open them ‘ completly’ gave me the error 324
any idea what to do? I am not using the plugin on the moment, thats one way ofcause ??
cheers Rob
camper-verhuur-nieuwzeeland.nl is the site I am talking about
I read in the FAQ this slow WordPress installation. Why? If it minifies the code, doesn’t it open even faster?
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Hi,
there is a possibility to disable parent links in the Appearance->Menu bu using Custom Links with “#” sign. But this function doesn’t work properly if WP-HTML-Compression plugin is activated. When you click on the disabled menu item it reloads current page. When plugin is switched off then nothing is reloaded and menu items are not clickable.
Is it possible to solve this somehow?
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Hello,
the removal of the http: before the links often brings problems with other plugins or special situations like the web-app-mode of the iPhone.
Which line of the code do I have to change or comment out, that the http: is not removed before external links?
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Hey,
unfortunately your plugin destroys my outbound events. It comes from the Google analytics Plugin. There is a option to capture outbound links as events. But with the compression turned on it doesn’t work.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>This disables MAXCDN via W3 total cache for me. Any ideas?
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>1) your plugin remove all value=”” in the code, but it is very important param and it make some forms not work.
2) your plugin broke facebook comments widget.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Hi, The plugin is working fine but I would like to know that why a single white space is kept left between tags?
sample:
</script> </div> </div> </body> </html>
Wouldn’t be nice even eliminating these spaces between tags…
thanks.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Hi,
Not sure how long this has been happening as we’ve only just noticed it, but everytime you include a https link on a page HTML Compression strips it, leaving only the //. This has broken a few links, disabling the plugin fixes it.
Cheers,
Ed
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Thank you for your work on this plug. I hope it will eliminate our text compression problem. After installation, when I try to activate the plugin WordPress returns error message: “The plugin does not have a valid header.”
Please advise.
Seastnan
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>The relative link-format does not work for iframes.
For exeample a code like
<iframe src="https://youtube-nocookie.com/embed/IeTybKL1pM4?rel=0" frameborder="0" height="301" width="535"></iframe>
becomes
<iframe src="//youtube-nocookie.com/embed/IeTybKL1pM4?rel=0" frameborder="0" height="301" width="535"></iframe>
Which results in a Google “URL not found” message displayed in the iframe and not the video.
URLs in iframe tags should not be changed.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>Just noticed, that external links to https:// are wrong! They look like:
<link rel="profile" href="//gmpg.org/xfn/11"/>
href="//itunes.apple.com/de/podcast/"
https://
becomes //
This does not happen with https://
Those links are correct. Only https:// gets messed up.
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>hello,
wp html Compression and platium seo pack does not work properly with
wp html compression activate platium seo pack rel= canonical distorted
sample;
wp html compression activate problem; https://postimage.org/image/wpa3i7l9l/
wp html compression deactivate no problem; https://postimage.org/image/o6p7l27hh/
thanks
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>[28-Jul-2012 00:35:02] PHP Catchable fatal error: Method WP_HTML_Compression::__toString() must return a string value in /home/<username>/public_html/<domain>/wp-includes/functions.php on line 3250
how to fix the problem? if you said to “just deactivated the plugin” it is irrelevant coz’ I need using the plugin
https://www.ads-software.com/extend/plugins/wp-html-compression/
]]>