Description
Since WordPress 5.3, every uploaded image larger than the “big image” threshold (2560 px by default) is stored twice: the untouched original and a smaller “-scaled” copy that the site actually displays. The original is never shown on the site — it is only used as a source when thumbnails are regenerated — yet it often takes several megabytes per image and most of the disk space of the uploads folder.
This plugin gives you tools to inspect and repair image files in the Media Library, with optional backups before every change.
How this plugin is different: this is not a thumbnail regeneration plugin. It works only on the original (full-size, uploaded) image files, which are often many megabytes because their quality is far higher than any website needs. The plugin shrinks or removes them, and it never touches thumbnails or the files used in content, so everything that already refers to your images keeps working. Every change can be backed up first, and every backed-up change can be restored.
Shrink originals
- Scans the library and marks originals larger than a chosen maximum size.
- Shrinks the original in place (same file name), keeping the aspect ratio, with a chosen quality.
- Optional backup of every file before it is changed. Existing backups are never overwritten.
Remove originals
- Deletes the original file and removes it from the attachment metadata, leaving the “-scaled” file as the only full-size image.
- Optionally regenerates the “-scaled” file from the real original first (shrink it if it is too big, or rebuild it if it is too small).
- Every write is verified by reading the file back; on any mismatch the change is rolled back.
Cleanup
- Unused files: files in an attachment’s folder that are variants of its name, are not registered in its metadata and are not referenced in posts, custom fields or options.
- Image editor backups: copies kept by the built-in WordPress image editor (“Restore original image”).
- Plugin backups: undo operations made with a backup — files and the changed attachment metadata are restored exactly as they were — and browse or delete backup copies.
- Scan cache: clear the stored dimensions of originals.
Diagnostics
- Inspect one image: all files of an attachment, what WordPress functions return for it, and its raw metadata.
- Environment check: real write/read/delete test of the database, the backup folder and uploads.
- Missing images: find image URLs used on the site whose files do not exist, or that point to another domain (e.g. an old domain of the site), and files registered in attachment metadata that are missing on disk. Missing files can be recreated under their original names; URLs pointing to another domain can be replaced with this site’s URL (serialized data is handled safely).
Settings
- Built-in image sizes, disabling sizes added by the theme or plugins, the “-scaled” threshold (with the value actually in effect after all plugins), shrinking images right on upload, and one backup folder for the whole plugin.
The plugin works only in the admin area (Tools Naprawa zdjęć), only for users who can manage options, and never changes files unless you start an action.
The interface is currently in Polish.
Installation
- Upload the
niebagatelni-original-image-repairfolder to/wp-content/plugins/, or install the plugin from the Plugins screen. - Activate the plugin.
- Go to Tools Naprawa zdjęć.
- Before changing files, check the backup folder in the Settings tab and run the environment check.
FAQ
-
Is the original image shown on my site?
-
No. WordPress displays the “-scaled” file as the full size and uses thumbnails in content. The original is only a source for regenerating thumbnails.
-
Where do backups go?
-
To one backup folder set in the Settings tab (a subfolder of the uploads directory, by default
wp-content/uploads/niebagatelni-original-image-repair). Backups are never deleted automatically — you can review and remove them in Cleanup Plugin backups. -
Where do files named like “photo-scaled-1200×800.jpg” come from?
-
Not from WordPress on upload, and not from this plugin. Thumbnail regeneration plugins create them when the attachment metadata no longer points to the original, so thumbnails are generated from the “-scaled” file. Use “Recreate” in Diagnostics Missing images to restore missing thumbnails under the names stored in the attachment metadata, instead of regenerating them with another plugin.
-
Can I undo changes?
-
Only operations made with the backup option enabled. Each such operation is recorded for the image, and Cleanup Plugin backups can undo it: the files and the changed attachment metadata (dimensions and size of the “full” file, the original image entry) are restored exactly as they were. Only the newest operation of an image can be undone, one step at a time, and only if the image has not been changed since.
-
What happens when I delete the plugin?
-
By default the plugin removes its settings, scan cache and operation log from the database (this can be turned off in Settings). Backup copies of images are never deleted — the oldest copy of each file keeps its real name and can be restored manually.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“Repair of original images” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “Repair of original images” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.2
- Plugin display name changed to “Repair of original images”.
- Internal code cleanup.
1.0.0
- First release.
