[WordPress] 外掛分享: Upload Janitor

首頁外掛目錄 › Upload Janitor
50+
安裝啟用
★★★★
4/5 分(4 則評價)
5888 天前
最後更新
問題解決
WordPress 2.6+ v0.2 上架:2010-01-15

內容簡介

透過刪除不再使用的舊上傳檔案,恢復磁碟空間並清理上傳資料夾。

此外掛可識別上傳資料夾中未使用的檔案,並讓您選擇備份後刪除其中部分或全部檔案。

在採取任何行動之前, Upload Janitor 會自動建立一個包含所有要刪除檔案的「tar」檔案,包括原始路徑,以便必要時可還原。

如何運作?

此外掛會檢查上傳資料夾內的每個檔案。對於每個檔案,它都會搜尋參考該檔案的頁面或文章。也就是說,該外掛會搜尋每個檔案路徑中上傳資料夾之後的路徑部分,例如「2010/01/my great but forgotten image.jpg」。

該路徑會按原樣、含有「%20」的 URL 編碼,以及使用「+」代替空格的 URL編碼(即 2010/01/my+great+but+forgotten+image.jpg)。該外掛還會搜尋所有這些的 HTML entity 編碼形式。

如果沒有找到任何匹配項目,則該檔案被視為未使用。

請注意,該外掛是安全的,並且不區分舊的文章/頁面修訂版和當前版本。如果對某個修訂版所做的引用存在,則引用的檔案將被視為正在使用中。

還原

如果出現問題,您總是可以還原。如果您可以存取網站的 shell,這很簡單。只需登錄,瀏覽到您的的 wp-content/plugins 目錄,然後找到 Upload Janitor 備份檔案,它看起來像 upload_janitor_archive_YYYY-mm-dd.tar.gz。然後輸入:

tar zxf <archive name> .

這會還原彙總檔案中的所有檔案。

如果您不能存取網站的 shell,您將需要下載彙總檔案,解壓縮並將其內容上傳回您的網站。該彙總檔案將可在 http://your-blog.com/wp-content/uploads/upload_janitor_archive_YYYY-mm-dd.tar.gz 取得。

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.2) 或搜尋安裝

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

原文外掛簡介

Reclaim disk space and clean up your uploads folder by deleting old uploads you are no longer linking to.
This plugin will identify unused files within your uploads folder, and give you the option of archiving then deleting
some or all of these files.
Before any action is taken, Upload Janitor will automatically make a ‘tar’ archive of all files to be
erased, including their original paths, so you can restore if necessary.
How does it work?
This plugin inspects every file within the uploads folder. For each file, it searches pages or posts that
reference the file. That is, the plugin searches for the part of each file’s path that comes after the path
to the uploads folder, such as 2010/01/my great but forgotten image.jpg.
The path is searched as-is, as well as URL-encoded with ‘%20’ for spaces, and the same with ‘+’ for spaces –
2010/01/my%20great%20but%20forgotten%20image.jpg and 2010/01/my+great+but+forgotten+image.jpg. HTML entity-encoded
forms of all of these are also searched.
If no matches are found, then the file is considered unused.
Note that this plugin plays it safe, and does not distinguish between older post/page revisions and the current version
of a post/page. If a revision references a file, the file will be considered still in use.
Restoring
If something goes wrong, you can always restore. If you have shell access to your site, this is easy. Simply log in,
navigate to your wp-content/plugins directory, and locate the Upload Janitor archive – it will look like
upload_janitor_archive_YYYY-mm-dd.tar.gz. Then, type:
tar zxf .

This will restore all files within the archive.
If you do not have shell access to your server, you will have to download the archive, extract it, then upload the
contents back to your server. The archive will be accessible at http://your-blog.com/wp-content/uploads/upload_janitor_archive_YYYY-mm-dd.tar.gz

延伸相關外掛

文章
Filter
Apply Filters
Mastodon