How to keep WP from recompressing Full Size images

Using a filter for jpg_quality will hellp you to set your quality for uplaoded images. add_filter(‘jpeg_quality’, create_function(‘$n’, ‘return 70;’)); In most good implementations of Image Optimization you can find a various usae of ImageOptimization tools such as optimng/jpegtran etc, there a lot of plugins that help you to do that.

How to change compression of WordPress uploads including original image

For compressing the uploaded image I wrote a simple code snippet that immediately overwrites a newly uploaded file with an image whose quality can be specified: function wt_handle_upload_callback( $data ) { $image_quality = 30; // Change this according to your needs $file_path = $data[‘file’]; $image = false; switch ( $data[‘type’] ) { case ‘image/jpeg’: { … Read more

Minify HTML, CSS, JS with PHPWee?

There is little ‘bug’ in PHPWee. It should use <?php instead of <?: <? namespace PHPWee; require_once(“src/CssMin/CssMin.php”); require_once(“src/HtmlMin/HtmlMin.php”); require_once(“src/JsMin/JsMin.php”); // Open-source (BSD) PHP inline minifier functions for HTML, XHTML, HTML5, CSS 1-3 and Javascript. // BSD Licensed – https://github.com/searchturbine/phpwee-php-minifier/blob/master/LICENSE // // Usage // $output = \PHPWee\Minify::html($any_html); // $output = \PHPWee\Minify::css($any_css); // $output = \PHPWee\Minify::js($any_js);