{"id":1372,"date":"2009-08-23T21:26:55","date_gmt":"2009-08-23T21:26:55","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-html-compression\/"},"modified":"2013-04-23T19:46:36","modified_gmt":"2013-04-23T19:46:36","slug":"wp-html-compression","status":"publish","type":"plugin","link":"https:\/\/twd.wordpress.org\/plugins\/wp-html-compression\/","author":1345092,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.5.8","stable_tag":"trunk","tested":"3.5.2","requires":"3.2","requires_php":"","requires_plugins":"","header_name":"WP-HTML-Compression","header_author":"Steven Vachon","header_description":"","assets_banners_color":"","last_updated":"2017-11-28 16:48:21","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.svachon.com\/blog\/html-minify\/","header_author_uri":"http:\/\/www.svachon.com\/","rating":3.4,"author_block_rating":0,"active_installs":1000,"downloads":108046,"num_ratings":14,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":"4","2":"1","3":"1","4":"2","5":"6"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.3","0.4","0.5","0.5.1","0.5.2","0.5.3","0.5.4","0.5.4.1","0.5.4.2","0.5.5","0.5.5.1","0.5.6","0.5.7","0.5.8"],"block_files":[],"assets_screenshots":{"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1777090","resolution":"2","location":"plugin"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1777090","resolution":"3","location":"plugin"},"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1777090","resolution":"1","location":"plugin"}},"screenshots":{"1":"This is what the XHTML looks like after being compressed with WP-HTML-Compression.","2":"This is what the same XHTML from the above screenshot looked like prior to compression.","3":"This is an example of how to use the compression override."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1757,2927,131,107,3868],"plugin_category":[44,52,54],"plugin_contributors":[79256],"plugin_business_model":[],"class_list":["post-1372","plugin","type-plugin","status-publish","hentry","plugin_tags-absolute","plugin_tags-bandwidth","plugin_tags-comment","plugin_tags-comments","plugin_tags-compress","plugin_category-discussion-and-community","plugin_category-performance","plugin_category-security-and-spam-protection","plugin_contributors-prometh","plugin_committers-prometh"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-html-compression.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-html-compression\/trunk\/screenshot-1.png?rev=1777090","caption":"This is what the XHTML looks like after being compressed with WP-HTML-Compression."},{"src":"https:\/\/ps.w.org\/wp-html-compression\/trunk\/screenshot-2.png?rev=1777090","caption":"This is what the same XHTML from the above screenshot looked like prior to compression."},{"src":"https:\/\/ps.w.org\/wp-html-compression\/trunk\/screenshot-3.png?rev=1777090","caption":"This is an example of how to use the compression override."}],"raw_content":"<!--section=description-->\n<p>Combining HTML \"minification\" with cache and HTTP compression (<strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-super-cache\/\">WP Super Cache<\/a><\/strong>, or similar) will cut down your bandwidth and ensure near-immediate content delivery while increasing your Google rankings.<\/p>\n\n<p>This plugin will compress your HTML by shortening <strong>URLs<\/strong> and removing <strong>standard comments<\/strong> and <strong>whitespace<\/strong>; including new lines, carriage returns, tabs and excess spaces. Most importantly, by ignoring <code>&lt;pre&gt;<\/code>, <code>&lt;textarea&gt;<\/code>, <code>&lt;script&gt;<\/code> and Explorer\u00ae <code>conditional comment<\/code> tags, <strong><em>presentation will not be affected<\/em><\/strong>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Download the plugin (zip file).<\/li>\n<li>Upload and activate the plugin through the \"Plugins\" menu in the WordPress admin.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>Download the plugin (zip file).<\/li>\n<li>Upload and activate the plugin through the \"Plugins\" menu in the WordPress admin.<\/li>\n<\/ol><\/dd>\n<dt>Will this plugin slow down my page load times?<\/dt>\n<dd><p>Yes, slightly. While you should be using <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-super-cache\/\">WP Super Cache<\/a><\/strong> anyway, it will correct the issue.<\/p><\/dd>\n<dt>Will Internet Explorer conditional comments be removed?<\/dt>\n<dd><p>No.<\/p><\/dd>\n<dt>Is this plugin HTML5-compatible?<\/dt>\n<dd><p>Yes.<\/p><\/dd>\n<dt>Will having invalid HTML cause an issue?<\/dt>\n<dd><p>Probably, however WordPress does a pretty good job of correcting invalid markup. But honestly, it's your job to make sure that your code doesn't suck.<\/p><\/dd>\n<dt>Will this plugin interfere with my hash-based JavaScript navigation?<\/dt>\n<dd><p>If the links in your HTML are <em>not<\/em> hard-coded as hashes without the use of a script, an issue could occur with URL shortening. If so, setting <code>$shorten_urls<\/code> on line <code>21<\/code> of <em>libs\/html-minify.php<\/em> to <code>false<\/code> will fix that.<\/p><\/dd>\n<dt>My URLs have the \"http:\" and\/or \"https:\" stripped??<\/dt>\n<dd><p>This is totally fine and actually intentional. It's standard and will not cause 404s nor get in the way of your SEO, but it <em>will<\/em> lower file size! You might be interested in reading more about this technique, called <strong><a href=\"http:\/\/paulirish.com\/2010\/the-protocol-relative-url\/\">scheme-relative URLs<\/a><\/strong>.<\/p><\/dd>\n<dt>Why does my compressed HTML have a space between most tags?<\/dt>\n<dd><p>To preserve <em>rendered<\/em> whitespace. One or more line breaks in your markup are rendered as a single space in a web browser. Visual discrepancies would occur if those line breaks were not converted to at least one space.<\/p><\/dd>\n<dt>How do I mark areas that should not be compressed?<\/dt>\n<dd><p>While &lt;pre&gt;, &lt;textarea&gt; and &lt;script&gt; tags are automatically left uncompressed, you can designate any code to be exempted from compression. Simply drop your content between a pair of <code>&lt;!--wp-html-compression no compression--&gt;<\/code> comment tags. A picture is worth a thousand words; so, check the <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/wp-html-compression\/screenshots\/\">screenshots<\/a><\/strong>.<\/p><\/dd>\n<dt>How do I compress the contents of &lt;script&gt; tags?<\/dt>\n<dd><p>Until a settings page is created, you'll have to edit the file from the \"Plugins\" menu in the WordPress admin. Set <code>$compress_js<\/code> on line <code>21<\/code> of <em>libs\/html-minify.php<\/em> to <code>true<\/code>. <strong>This is not recommended<\/strong> as this plugin is not yet ready to <em>properly<\/em> compress inline scripts.<\/p><\/dd>\n<dt>Are you or have you thought of using HTML Tidy?<\/dt>\n<dd><p>Since not every WordPress server supports the installation of PHP extensions, this plugin does not currently make use of HTML Tidy. However, future releases may do so.<\/p><\/dd>\n<dt>Will this plugin work for WordPress version x.x.x?<\/dt>\n<dd><p>This plugin has only been tested with versions of WordPress as early as 3.2. For anything older, you'll have to see for yourself.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.5.8<\/h4>\n\n<ul>\n<li>URLs within <code>&lt;script&gt;<\/code> and <code>&lt;style&gt;<\/code> tags are no longer shortened unless compression on such tags has been enabled<\/li>\n<\/ul>\n\n<h4>0.5.7<\/h4>\n\n<ul>\n<li>Upgraded to <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> v0.3.4<\/li>\n<li>Empty, hash-only anchors (<code>\"#\"<\/code>) are no longer invalidated by the URL shortener<\/li>\n<li>Bypasses compression for <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/humanstxt\/\">Humans TXT<\/a><\/strong> output<\/li>\n<\/ul>\n\n<h4>0.5.6<\/h4>\n\n<ul>\n<li>Upgraded to <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> v0.3.3<\/li>\n<li>Javascript URIs (<code>\"javascript:\"<\/code>) are no longer invalidated by the URL shortener<\/li>\n<li>Minor cleanup<\/li>\n<\/ul>\n\n<h4>0.5.5.1<\/h4>\n\n<ul>\n<li>Oops, minor slip-up<\/li>\n<\/ul>\n\n<h4>0.5.5<\/h4>\n\n<ul>\n<li>Upgraded to <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> v0.3.2<\/li>\n<li>Data URIs (<code>\"data:\"<\/code>) are no longer invalidated by the URL shortener<\/li>\n<li>URL shortener now applied to <code>data<\/code> attribute values (common to <code>&lt;object&gt;<\/code>)<\/li>\n<li>Minor bug prevention<\/li>\n<\/ul>\n\n<h4>0.5.4.2<\/h4>\n\n<ul>\n<li>PHP errors hidden if\/when plugin file is accessed directly<\/li>\n<\/ul>\n\n<h4>0.5.4.1<\/h4>\n\n<ul>\n<li>Fixed typo on variable<\/li>\n<\/ul>\n\n<h4>0.5.4<\/h4>\n\n<ul>\n<li>Plugin should always load now, even for installations that seem to skip the execution of <code>template_redirect<\/code> (?)<\/li>\n<li>Converted for use in standard PHP as <strong><a href=\"http:\/\/www.svachon.com\/blog\/html-minify\/\">HTML Minify<\/a><\/strong>, for which this plugin now simply wraps<\/li>\n<li>Compression statistics comment disabled by default<\/li>\n<\/ul>\n\n<h4>0.5.3<\/h4>\n\n<ul>\n<li>Bypasses compression for robots.txt<\/li>\n<li>Corrected \"invalid plugin header\" issue when activating from install screen<\/li>\n<\/ul>\n\n<h4>0.5.2<\/h4>\n\n<ul>\n<li>Upgraded to <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> v0.3.1<\/li>\n<\/ul>\n\n<h4>0.5.1<\/h4>\n\n<ul>\n<li>Upgraded to <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> v0.3<\/li>\n<li>JavaScript library references with scheme-relative URLs (<code>\/\/domain.com\/<\/code>) are no longer broken<\/li>\n<li>Canonical URL no longer shortened<\/li>\n<li>Minor bug fixes<\/li>\n<\/ul>\n\n<h4>0.5<\/h4>\n\n<ul>\n<li>Includes <strong><a href=\"http:\/\/wordpress.org\/extend\/plugins\/absolute-to-relative-urls\/\">Absolute-to-Relative URLs<\/a><\/strong> for <code>action<\/code>, <code>href<\/code>, <code>src<\/code> attributes<\/li>\n<li>Bypasses compression for RSS\/Atom feeds<\/li>\n<li>Bypasses compression on admin\/dashboard pages to free up resources for other tools\/plugins<\/li>\n<li>Compresses themes that don't make use of a header.php file (previously did not)<\/li>\n<li>Removes any empty attributes using single-quote encapsulation (previously supported only double-quotes)<\/li>\n<li>Removes excess spacing within opening and closing tags (previously supported only self-closing tags)<\/li>\n<li>Converts new lines to spaces so that <em>rendered<\/em> whitespace is preserved<\/li>\n<li>Simplified compression statistics comment<\/li>\n<li>PHP errors hidden if\/when plugin file is accessed directly<\/li>\n<li>Speed optimizations<\/li>\n<\/ul>\n\n<h4>0.4<\/h4>\n\n<ul>\n<li>Removes empty attributes except <code>action<\/code>, <code>alt<\/code>, <code>content<\/code>, <code>src<\/code><\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>Comments in &lt;textarea&gt; are no longer removed. Browsers seem to display such text<\/li>\n<li>Removes excess spacing within self-closing tags<\/li>\n<li>Speed optimizations<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Fixed compression override<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Reduce file size by shortening URLs and safely removing all standard comments and unnecessary whitespace from an HTML document.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/1372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=1372"}],"author":[{"embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/prometh"}],"wp:attachment":[{"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=1372"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=1372"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=1372"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=1372"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=1372"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/twd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=1372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}