Archives

Articles tagged ‘minify’

WP-Minify’s new version vanished WordPress’ HTTP requests issue

While working with WordPress we always stuck with the HTTP requests issue caused by plugins that appends external JavaScript or CSS files to our page body thus causing more http requests and downgrading our performance benchmark tests and company job standards.

Content minification is a well-known best-practice for bandwidth reduction (saves client’s money) thus giving better page load time (gives client a good smile). Since it removes all unnecessary code (like comments, extra spaces, tabs etc) and join files together, the total of KBs saved even in bandwidth and browser rendering.

Here we always implemented the Minify PHP5 tool from Steve Clay and Ryan Grove because it always worked like a charm and the results are quite amazing.

In wordpress we got problems implementing this because plugins added their own js and css files at will. WP-Minify from Thaya Kareeson came to save our souls but we got some misbehaving plugins that still adding link and script tags by echoing to the page.

Fortunately, this new version preprocesses the output thus gathering any inline style/script reference and adding it to a temporary file that is included in the minification process.

I got tricked there because voting badges and other stuff uses inline script tags to generate the badge. WP-Minify’s preprocessing fufreaked me up because this script tag depended on the_permalink() function from WordPress thus not generating the correct output on the temporary file created. Before I started freaking out I realized that the plugin’s configuration page had an script (and style) blacklist. Just added the src url (without the querystring) and everything worked like a charm!

Nice job Thaya!