跳到内容

Divine Apparitions Uploads Proxy

v0.11.1

philltran · 2026年7月1日 上架

Proxy missing media to a production origin so staging and local environments don't need a full copy of the uploads directory.

正在使用
10 以下
评分
暂无
累计下载
318
最近更新
2026年7月1日
需要 WordPress 6.5+已测试到 7.0.9PHP 8.2+

贡献者

When you pull a production database into a staging or local environment, every media URL points at a file you didn’t copy — pages render with broken images and dead file links. Divine Apparitions Uploads Proxy intercepts the request for any missing uploads file and resolves it against a configured production Origin, so pages render with real media without syncing the entire uploads directory.

Because it works at the request level — hooking template_redirect when the web server routes a missing file to index.php (nginx try_files, used by DDEV, Lando, and Pantheon) — it catches every missing upload, including images embedded directly in post content, size derivatives, and srcset candidates, not just the URLs WordPress generates for attachments.

It resolves a missing file in one of two modes:

  • Download mode (default): streams the file from the Origin, saves it into the local uploads directory, and serves it. Every later request is served by the web server, so your local site accumulates exactly the subset of media your tests actually touch — never the whole uploads folder.
  • Hotlink mode (opt-in): issues a temporary redirect to the file on the Origin, writing nothing locally.

Configuration lives in wp-config constants / environment variables (with a database-option fallback), so it survives every database pull and configures itself hands-free in CI. The plugin is inert on production and stays off until an Origin is configured.

Features:

  • Request-level interception — resolves content-embedded images, derivatives, and srcset, not just attachment URLs.
  • Download or Hotlink mode, chosen per environment.
  • Optional Basic Auth for fetching from a locked Test/Dev Origin.
  • Negative cache so a file genuinely missing on the Origin stops re-hitting it, while transient errors (5xx/timeout) retry on the next request.
  • Write hardening: executable file types are refused and paths are contained to the uploads directory.
  • Diagnostics settings page showing the effective config and its source, the counters, and a “test Origin connection” button.
  • wp uploads-proxy WP-CLI command (status / clear-cache) for scripting setup and reset in CI.
  • Inert on production; off until an Origin is configured.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums