Title: ewww_image_optimizer_escapeshellarg windows &quot;bug&quot;
Last modified: August 21, 2016

---

# ewww_image_optimizer_escapeshellarg windows "bug"

 *  Resolved [Bjoern](https://wordpress.org/support/users/greencp/)
 * (@greencp)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/ewww_image_optimizer_escapeshellarg-windows-bug/)
 * Hi,
 * ewww_image_optimizer_escapeshellarg doesn’t work on Windows (in EWWW IO 1.9.0):
   It uses single quotes instead of (the required) double quotes. This results in
   no optimizations on Windows machines (the tool calls work, but they fail to find
   the images). As a quick fix I changed it to the following, and everythings works
   fine:
 *     ```
       function ewww_image_optimizer_escapeshellarg( $arg ) {
       	global $ewww_debug;
       	if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' ) {
       		$safe_arg = '"' . addcslashes( $arg, '\\"' ) . '"';
       	} else {
       		$safe_arg = "'" . str_replace("'", "'\"'\"'", $arg) . "'";
       	}
       	return $safe_arg;
       }
       ```
   
 * [https://wordpress.org/plugins/ewww-image-optimizer/](https://wordpress.org/plugins/ewww-image-optimizer/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/ewww_image_optimizer_escapeshellarg-windows-bug/#post-4885081)
 * thanks for reporting that, I’ll look into it!
 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/ewww_image_optimizer_escapeshellarg-windows-bug/#post-4885325)
 * simplified the fix a bit, it’s in ‘dev’ if you would like to try it out: [http://downloads.wordpress.org/plugin/ewww-image-optimizer.zip](http://downloads.wordpress.org/plugin/ewww-image-optimizer.zip)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘ewww_image_optimizer_escapeshellarg windows "bug"’ is closed to new replies.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/ewww_image_optimizer_escapeshellarg-windows-bug/#post-4885325)
 * Status: resolved