Mirror (or header to) uploaded files from a remote production Bedrock-flavored WordPress site or multisite on your local development copy. Saves the trouble of downloading a giant uploads directory without sacrificing the images that accompany content.
- Add the following snippet above the
"type": "composer"entry within the"repositories":section of yourcomposer.jsonfile:
{
"type": "vcs",
"url": "[email protected]:UTCWeb/bedrock-file-proxy.git"
},- Install via composer using
--devso it only installs on non-production deployments:
composer require UTCWeb/bedrock-file-proxy:"*" --dev- Clone this repository into your
plugins/directory. - If using version control, delete the
.git/directory to prevent issues within parent Git history.
Bedrock File Proxy runs when WordPress is serving a 404 response for a request to the web/app/uploads or wp-uploads directory.
There are four options for this plugin, though only two are currently available via the UI. WP-CLI can be used to tweak the setting though, such as adjusting the mode to header.
wp option update sfp_mode header-
sfp_mode: The method used to retrieve the remote image. Default isheader. One of: -
sfp_url: The absolute URL to the uploads directory on the source site. -
sfp_local_dir: The name of the directory in the parent theme where images are stored forlocalmode.