[WordPress] 外掛分享: Smart Media Replacement

首頁外掛目錄 › Smart Media Replacement
WordPress 外掛 Smart Media Replacement 的封面圖片
全新外掛
安裝啟用
尚無評分
13 天前
最後更新
問題解決
WordPress 6.6+ PHP 7.4+ v1.2.1 上架:2025-11-16

內容簡介

總結:Smart Media Replacement 是一個 WordPress 外掛,可讓您替換媒體檔案,同時保留原始的 URL 和 metadata。這對於更新 PDF、圖片或其他文件,尤其在按年月組織媒體時,非常有用,可以避免破壞現有的連結。

問題與回答:
1. Smart Media Replacement 外掛的特點有哪些?
- 可替換媒體檔案並保留原始 URL
- 保留所有現有的連結(內部和外部)
- 保持檔案 metadata 和關係
- 在 WordPress 媒體庫中提供簡單直觀的介面
- 支援 WordPress 支援的所有檔案類型
- 驗證檔名以防止意外 URL 變化
- 強制圖片的尺寸相符,以防止版面問題
- 自動處理 WordPress 縮放圖片
- 驗證檔案類型匹配以確保一致性
- 使用 AJAX 進行替換並具有錯誤處理功能

2. 使用 Smart Media Replacement 外掛時,哪些重要要求需要注意?
- 檔名匹配:新檔案的檔名必須與原始檔案完全相同
- 圖片尺寸:對於圖片,替換檔案必須具有相同的尺寸(寬度 × 高度)
- 檔案類型:替換檔案必須與原始檔案具有相同的檔案類型,外掛將驗證 MIME 類型以確保一致性
- 隱私:這個外掛沒有收集或傳送任何用戶數據,不使用 cookie,在您的伺服器上僅處理檔案,也不與外部服務通訊

3. 如何使用 Smart Media Replacement 外掛?
- 前往 WordPress 媒體庫
- 找到需要替換的檔案
- 點擊檔案查看詳細資料
- 在附件詳細資料中尋找“替換檔案”按鈕
- 點擊“替換檔案”,選擇新的文件
- 替換將自動進行

外掛標籤

開發者團隊

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

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

原文外掛簡介

Ever updated a PDF and realized half your site links to the old version? Or replaced a hero image and watched your carefully-tuned page layout collapse? Smart Media Replacement solves both problems — and adds a safety net you’ll wish you had earlier.
Replace the file, keep the URL. When you swap an attachment with this plugin, the file’s URL never changes. Every existing link, every email that points to it, every page that embeds it, every SEO ranking — all of it keeps working. No 404s, no broken references, no scrambling to update old content.
Full revision history, one-click restore. Every replacement automatically snapshots the previous version. Made a mistake? Roll back instantly. Want to see what the file looked like three months ago? Download it. Each revision is timestamped, attributed to the user who made it, and can carry an optional note describing what changed.
Works where you work. Replace from the Media Library, or from inside any block’s Replace toolbar in the block editor — image, cover, video, audio, file, gallery, and more. The editor refreshes in place, no page reload, no lost work.
Safe by default. The plugin validates filenames, file types, and image dimensions to keep your URLs intact and your layouts unbroken. WordPress’s auto-scaled images are handled transparently. Revisions land in a database table that’s self-healing on every admin load, and the plugin’s settings page gives you control over how many revisions to keep, how long to retain them, and which file types are tracked.
Use cases

Monthly reports and newsletters — Update PDFs linked from past emails without breaking any of those links.
Brand refreshes — Replace logos, headers, and brand imagery once; everywhere they’re used updates automatically.
Legal documents — Keep current versions of terms of service, privacy policy, and contracts live, with older versions preserved as revisions for compliance.
Image updates — Refresh product photos, blog hero images, and marketing assets without breaking responsive sizes or SEO.
Typo fixes in published assets — Fix errors in infographics, downloadable guides, or e-books without scrambling to update references across your site.
Versioned downloads — White papers, e-books, technical docs that need to stay at a stable URL while preserving older versions on demand.

Features
Replacement and URL preservation

Replace any media file while keeping its URL, ID, and metadata intact
Existing internal and external links keep working — no 404s, no SEO impact
Automatic regeneration of image size variants (thumbnails, medium, large, etc.)
Transparent handling of WordPress’s -scaled large images

Revision history

Every replacement automatically snapshots the previous file
Major/minor version numbering (e.g. v1.0 → v1.1 → v2.0)
Optional replacement note per revision, attributed to the user
One-click restore of any past version
Download individual revisions, or download a ZIP archive of an attachment’s full history
Configurable: maximum revisions per file, age-based retention with daily cleanup, per-file-type opt-in

Block editor integration

“Update existing file” in every block’s Replace toolbar dropdown (image, cover, video, audio, file, gallery, media-text, post-featured-image)
In-place editor refresh after replacement — no page reload, no lost work
Accessibility-friendly notifications via WordPress’s native screen reader announcements

Validation safeguards

Filename matching to keep URLs stable
Image dimension matching to prevent layout breakage
MIME-type matching to prevent file corruption
Clear, actionable error messages when something doesn’t match

Built-in admin

Settings page at Media → Replacement Settings
Storage stats: total revisions, total disk usage, database table status
Optional deactivation cleanup (files and/or database)

Multisite-ready

Network-activate only on multisite — one consistent configuration across every site
Settings live at Network Admin → Settings → Media Replacement and apply network-wide
Revisions are stored per-site under each site’s uploads directory; metadata lives in a single shared network table
Daily retention cleanup runs across every site in the network
Automatic row and file cleanup when a site is deleted
Single-site installs work exactly as before — settings and storage stay per-site, no network behavior involved

WP-CLI

wp smr db check — verify the revisions table exists (non-zero exit code if missing, safe for CI pipelines)
wp smr db repair — recreate the table if missing; idempotent, safe to run when the table already exists
wp smr db status — revision counts and storage usage; --network for a per-site breakdown on multisite
wp smr db cleanup — delete expired revisions immediately, with --dry-run to preview and --network for all sites

Other

Self-healing database table via configurable scheduled check (hourly, daily, weekly, or disabled); use wp smr db repair for on-demand recovery
Developer hooks throughout for custom integrations

Privacy
This plugin is fully self-contained and respects your privacy:

Does not collect or transmit any user data
Does not use cookies or third-party tracking
Only processes files locally on your server
Does not communicate with external services or APIs

Usage
From the Media Library

Navigate to the WordPress Media Library
Open the file you want to replace (click on it, or use the row actions in list view)
Click Replace File
Choose your new file — if revisions are enabled, you’ll be prompted for an optional note and version type (minor/major)
The replacement happens immediately, preserving the file’s URL

From the block editor

Click on any media block (image, cover, video, audio, file, gallery, etc.)
Open the Replace toolbar dropdown
Choose Update existing file
Pick your new file — the editor refreshes in place

Viewing and managing revisions

In the Media Library list view, the Revisions row action opens the full revision history for that file
On the attachment edit screen, the View Revisions button opens the same panel
From either, you can download any past version individually or as a ZIP, and restore any revision with one click

延伸相關外掛

文章
Filter
Apply Filters
Mastodon