Support » Plugin: EWWW Image Optimizer » Something wrong. Invalid argument and cannot modify header

  • Resolved flamenko


    Can someone help me with this? This is what is happening when I try to compress an image.

    Warning: Invalid argument supplied for foreach() in /home/XXXXX/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php on line 1096

    Warning: Cannot modify header information – headers already sent by (output started at /home/XXXXX/public_html/wp-content/plugins/ewww-image-optimizer/ewww-image-optimizer.php:1096) in /home/thessd5/public_html/wp-includes/pluggable.php on line 881

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author nosilver4u


    Just to be clear, you clicked the ‘optimize’ link next to an image, and go this error, right? Based on the error you’re getting, my best guess is that you double-clicked the optimize link, causing it to try and resend the headers, and also resulting in some invalid data being thrown around from concurrent optimizations. Try it again, and make sure you are only single-clicking.
    If you still have trouble, post the contents of your debug block (settings page), what kind of image you are trying to process (PNG, JPG, GIF), the filesize, and which settings you have relevant to that image type.

    Plugin Author nosilver4u


    someone else is having a similar error, I’ve reproduced it on my 2nd test server (but not the primary oddly), so I’ll see what I can find out.

    Plugin Author nosilver4u


    turns out, it’s not really an ‘error’, but a variable I forgot to initialize. Unfortunately, it trickles down and breaks the output that is supposed to show up when you upload an image. I’ll have 1.2.2 out today.

    Plugin Author nosilver4u


    should have mentioned that you can also get rid of this error by turning off WP_DEBUG in your wp-config.php
    i’m working on one more quirk for 1.2.2 but hopefully I’ll still get it out the door today.

    Any news on when an update will be out?

    Unfortunately it also prevents regenerating thumbnails :-/

    Regenerate Thumbnails
    All done! 0 image(s) were successfully resized in 5 seconds and there were 1 failure(s). To try regenerating the failed images again, click here. To go back to the previous page, click here.

    Please be patient while the thumbnails are regenerated. This can take a while if your server is slow (inexpensive hosting) or if you have many images. Do not navigate away from this page until this script is done or the thumbnails will not be resized. You will be notified via this page when the regenerating is completed.

    Debugging Information

    Total Images: 1
    Images Resized: 0
    Resize Failures: 1

    function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this}

    Thanks for your great work!



    Forgot to say that WP Debug already is off, which doesn’t prevent the Invalid Argument statement.

    * For developers: WordPress debugging mode.
    * Change this to true to enable the display of notices during development.
    * It is strongly recommended that plugin and theme developers use WP_DEBUG
    * in their development environments.
    define(‘WP_DEBUG’, false);

    Plugin Author nosilver4u


    odd, I didn’t ever see the warnings until I turned ON debug mode (which I should have had on while I was testing…)

    Anyway, I ran out of time to do testing, so I’ll be wrapping that up today and releasing it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Something wrong. Invalid argument and cannot modify header’ is closed to new replies.