Skip to main content
Cookbook Maintenance Robin Image Optimizer

Fix Images That Failed to Optimize in Robin with AI

Failed images found and grouped by cause, each fix explained, and only the ones you pick retried or set aside.

Difficulty Beginner
Time ~10 min

Prerequisites

A site connected to WPVibe running Robin Image Optimizer 2.1 or newer (tested on 2.1.2, free) on WordPress 6.9 or newer, with an administrator account.

The prompt
My WordPress site uses Robin Image Optimizer. Find the images that failed to optimize, tell me why, and help me fix them.

1. Run discover_abilities with category robin-image-optimizer. If the abilities this needs are not there, stop and tell me to install or update the free Robin Image Optimizer plugin (2.1 or newer, on WordPress 6.9 or newer).
2. Run robin/get-stats with scope media-library. If failures.total is 0 and stats.error is 0, tell me nothing has failed and stop. If stats.error is above 0 but failures.total is 0, tell me Robin is still preparing its failure list, to ask again later, and stop.
3. For each group in failures.groups, tell me its title, how many images and its hint in plain words. If a group has retrying true, tell me Robin tries those again on its own (the next try is at failures.next_retry) and that there is nothing to do for them. If every group is retrying, tell me there is nothing to do now and stop.
4. For each other group, run robin/get-failures with scope media-library and group set to the group's key. While next is not empty and items is not empty, run it again with after set to next (at most 5 pages per group; say so if you stopped early). List each image by file_name with its url (the edit link).
5. Ask me which images I have fixed or replaced in place, and which I want to leave as they are. If I uploaded a new copy as a new media item instead, the old one would only fail again: offer to set the old one aside. Then tell me which images you will retry and which you will set aside, and wait for my yes.
6. For the images I fixed (at most 20 at a time): run robin/get-optimization-policy. If backup_originals is false, tell me the retry won't keep a backup of the original and ask whether to go on. Then run robin/optimize-media with media_ids set to those images and profile set to the policy's compression_mode. While done is false, run it again with the same input and the returned cursor. If it returns an error (for example, the backup folder can't be written), tell me its message and stop. Report each image's status, saved_percent and error.
7. For the images I want to leave as they are, run robin/update-media-options with media_ids set to those images and exclude true. Tell me automatic and bulk runs skip them from now on, that they leave the failures list and Robin's counts, and that it is undone with exclude false. If an image's group was about its WebP or AVIF copy only (the third part of the group's key, after the second |, is webp or avif), tell me setting it aside makes automatic and bulk runs skip the image entirely, compression included, not only its WebP or AVIF copy, and ask before doing it.
8. Run robin/get-stats again and tell me how many failures are left. List each change so I can spot-check it.
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Fix Images That Failed to Optimize in Robin with AI” recipe from the WPVibe cookbook on my connected site.

Some images never get smaller. A file that is damaged, missing or one Robin can’t convert fails quietly and sits on Robin’s Failures list, unoptimized. Robin tries some failures again on its own, but not a damaged file. Working out which images they are and why takes a trip through the plugin’s failure list, one row at a time.

The AI reads Robin Image Optimizer’s failures grouped by reason, lists the images in each group with a link to edit them, and explains the fix in plain words. It tells you which ones Robin retries on its own. After your yes, it tries again only the images you fixed, and sets aside the ones you want left alone, so they leave the failures list and Robin’s counts.

Nothing is retried or set aside without your yes, and every retry keeps a backup of the original when Robin’s backups are on. Setting an image aside is the same as Ignore on Robin’s Failures section: automatic and bulk runs skip it from then on, and it is undone by unticking Exclude from optimization in the image’s details. For a full check of Robin first, use this recipe.

Outcome

You know which images failed and why; the ones you fixed are optimized and the ones you chose to leave are off the failures list and skipped by automatic and bulk runs.