We looked into integration with wp-smush.it and EWWW Image Optimizer and here is what we found.
EWWW Image Optimizer
Version 1.7 incorporated a fix that was needed to make it work during image upload. So the latest version of EWWW Image Optimizer can do optimization / conversion during image upload.
wp-smush.it
Here is a patch that would make wp-smush.it 1.6.5.4 work with WP2Cloud 1.3.10:
--- a/wordpress/wp-content/plugins/wp-smushit/wp-smushit.php
+++ b/wordpress/wp-content/plugins/wp-smushit/wp-smushit.php
@@ -348,7 +348,7 @@ class WpSmushit {
// check that the file exists
if ( !file_exists( $file_path ) || !is_file( $file_path ) ) {
- return sprintf( __( "ERROR: Could not find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN ), $file_path );
+ // return sprintf( __( "ERROR: Could not find <span class='code'>%s</span>", WP_SMUSHIT_DOMAIN ), $file_path );
}
// check that the file is writable
@@ -356,9 +356,18 @@ class WpSmushit {
return sprintf( __("ERROR: <span class='code'>%s</span> is not writable", WP_SMUSHIT_DOMAIN ), dirname($file_path) );
}
- $file_size = filesize( $file_path );
- if ( $file_size > WP_SMUSHIT_MAX_BYTES ) {
- return sprintf(__('ERROR: <span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="https://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes($file_size));
+ if ( file_exists( $file_path ) && filesize( $file_path ) > WP_SMUSHIT_MAX_BYTES ) {
+ return sprintf(__('ERROR: <span style="color:#FF0000;">Skipped (%s) Unable to Smush due to Yahoo 1mb size limits. See <a href="https://developer.yahoo.com/yslow/smushit/faq.html#faq_restrict">FAQ</a></span>', WP_SMUSHIT_DOMAIN), $this->format_bytes(filesize( $file_path )));
+ }
+
+ $cloud_file = apply_filters( 'wp2cloud_get_file_url', $file_path );
+
+ if ( $cloud_file != $file_path ) {
+ $file_url = $cloud_file;
+ }
+
+ if ( strpos( $file_url, '//' ) === false ) {
+ $file_url = get_option( 'home' ) . $file_url; // fix root relative URLs
}
// local file check disabled 2013-09-05 - I don't see a point in checking this. We only use the URL of the file to Yahoo! and there is no gaurentee
Also the Enforce image URL is same as Home
option (Settings –> Media) should be unchecked.