[WordPress] 外掛分享: Image Cleanup

首頁外掛目錄 › Image Cleanup
WordPress 外掛 Image Cleanup 的封面圖片
1,000+
安裝啟用
★★★☆☆
3.5/5 分(63 則評價)
3031 天前
最後更新
問題解決
WordPress 3.0.1+ v1.9.2 上架:2013-10-11

內容簡介

你曾在WordPress中縮放或裁剪上傳的圖片嗎?你曾經試過不同的圖像生成外掛嗎?你曾經更改或添加過各種媒體圖像大小嗎?如果是,你的內容文件夾可能充滿了未使用和未引用的圖像。這些圖像殘留物將一直佔用你的內容文件夾直到永遠。

圖像清理將索引這些(以及更多)未引用的圖像。未引用的圖像未在WordPress數據庫中索引,也未被文章、腳本或備份還原元數據使用。請注意,具有有效數據庫元數據但未在文章中使用的圖像此時不會被索引。這超出了此外掛的範圍。

圖像清理還可以查找沒有元數據和有錯誤元數據的圖像。

節約佔用未引用/備份圖像的空間!
修復不正確的元數據(大小)
批量修復/刪除功能
極大數據集的分頁
日誌選項卡易於查看!
日誌選項卡中有詳細信息!
完全還原功能!
特別適用於開發人員!
以類的形式編寫以避免任何衝突!
高度可配置以避免某些設置上的內存和/或超時

在我一個月大的網站(50個文件和250個附件大小變體)上,此外掛找到了95個未參照的圖像,我可以不受任何衝突地刪除它們。

有報告稱,此外掛在一個網站上索引並刪除了超過23,000張圖像。有關詳細信息,請參見論壇/評論。

圖像清理工作流詳細信息

從數據庫檢索所有附件圖像(包括大小變體);
查找wp-content文件夾中的所有圖片;
從實際找到的圖像中減去附件(和大小變體);

上述將導致一個列表包含無效圖像,這些圖像未被數據庫引用。

文章將被搜索圖像,找到的圖像將從無效文件中減去(如果有);
wp-content中的腳本將被搜索圖像,它們將從無效文件中減去(如果有);
還原尺寸比例後的備份圖像將從無效圖像中減去;
已找到的未引用文件將與元數據進行檢查,以查看數據庫元條目是否仍然存在;

這導致各種圖像列表,其中圖像可以進行審核、修復或刪除。

索引後

索引後,你可以(暫時)將圖像移動到備份文件夾中,以在wp-content文件夾中檢查不帶圖像的站點。你也可以檢查../wp-content/uploads/image-cleanup/ID/logs文件夾中的日誌,以獲取有關索引的完整信息。

如果發現任何問題,可以通過將圖像還原到其原始位置來撤消圖像移動。

若在移動圖像至其他位置後未發現任何問題,則可能永久刪除圖像。

未來計劃新增內容

索引未使用的有效圖像
索引缺失的圖像大小(和生成缺失圖像的選項)
索引在文章中使用但遺漏的圖像

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.9.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Image Cleanup」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Did you ever scale or crop uploaded images in wordpress? Did you ever try various image generating plugins? Did you ever change or add various media image sizes? If yes, chances are that your content folder is full of unused and unreferenced images. These image leftovers will remain cluttering your content folder until the end of days.
Image Cleanup will index these (and many more) unreferenced images. Unreferenced images are not indexed in the wordpress database and also not used by posts, scripts or backup restore meta data. Please note that images which have valid database metadata but are not used in posts are not indexed at this time. This is beyond the scope of this plugin.
Image Cleanup will also find images without meta data and images with incorrect meta data.

Save space taken up by unreferenced/backup images!
Fix incorrect metadata (sizes)
Bulk repair/delete functionality
Pagination for extremely large result sets
Logs tabs easily visible for reviewing!
Detailed information in log tabs!
Full restore functionality!
Especially useful for developers!
Written as class to avoid any conflicts!
Highly configurable to avoid memory and/or timeouts on some setups

On my one month old website with 50 files (and 250 attachment size variants) this plugin found 95 unreferenced images which I could remove without any conflicts.
There has been a reported case where this plugin indexed and removed over 23.000 images on a website. See forum/review for details
Image Cleanup workflow details

Retrieves all attachment images from the database (including size variants);
Finds all images in the wp-content folder;
Subtracts the attachment (and size variants) from physical found images;

The above will result in an list of invalid images which are not referenced by the database

Posts will be searched for images and found images will be subtracted from the invalid files (if any);
Scripts in wp-content will be searched for images and they will be subtracted from the invalid files (if any);
Backup images (for restoring images after scale/crop) will be subtracted from the invalid images;
Found unreferenced files will be checked against the meta data to see if the database meta entry still exist;

This results in various image lists in which the images can be reviewed, repaired or removed.
After indexing
After indexing you are able to (temporary) move the images to a backup folder to check the site without the images in the wp-content folder. You could also check the logs in the ../wp-content/uploads/image-cleanup/ID/logs folder for full information about the index.
If any problems are found you can revert the move of images by restoring them to their original locations.
When no problems arrise after moving the images to another location it is possible to permanently remove the images.
Future planned additions

Index unused valid images
Index missing image sizes (and option to generate missing images)
Index missing images which are used in posts

延伸相關外掛

文章
Filter
Apply Filters
Mastodon