Why did an image fail to optimize?
2 min read · Last updated June 2026
Errors that need investigation
These three errors point to a problem with the file itself or the server's access to it — a retry alone won't fix them.
File appears to be corrupted.
The source file itself is damaged. The image header is invalid or the file was truncated during upload or transfer, so SlashImage can't decode it.
Re-export or re-download the image and upload a fresh copy. If you took it from a camera or editor, export it again from the original. A clean, complete file will usually process without issue.
File could not be read from disk.
The file exists on disk but the web server can't open it. The most common causes are wrong file permissions — for example, after a server migration or a storage change that left files owned by a different user — or a zero-byte file that WordPress accepted during upload.
This is a permanent failure; the plugin does not retry it automatically. Fix the underlying problem first: correct the file permissions so the web server can read the uploads folder, or delete and re-upload the file if it is empty. Once the file is accessible, a manual retry from the Media Library will pick it up.
An unexpected error occurred.
The plugin received a response it didn't anticipate — a catch-all for any error that doesn't match a known code.
Retry once; most occurrences resolve on the first attempt. If the same image keeps failing, try re-uploading the file. If the error persists across multiple images or comes back after a re-upload, contact support with the attachment ID so the cause can be investigated.
Errors on a single image
These messages appear next to an image in the Media Library or in the bulk queue.
| What you see | What it means and what to do |
|---|---|
You have used all your credits. Upgrade your plan to continue. | Monthly allowance exhausted. If a bulk run was active, it pauses here — waiting images are not lost and pick up once you upgrade or the allowance resets. See what happens when you hit your limit. |
API key is invalid or has been revoked. | Your key was deleted or regenerated, or the key is locked to specific domains and this site isn't on the allowed list — domain-lock failures show this same message. See How do I fix an invalid or revoked API key?. |
Optimization failed. Please try again. | A server-side error. The plugin retries automatically — wait for it, or press retry from the Media Library if the error persists. |
If the optimization service couldn't be reached at all, see Why can't SlashImage connect to the optimization service?.