このプラグインは WordPress の最新3回のメジャーリリースに対してテストされていません。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress で使用した場合は互換性の問題が発生する可能性があります。

BE Media from Production

説明

When spinning up a staging or local development environment, you might not need the full uploads directory, but you also don’t want to see broken images throughout the site.

This plugin lets you use the production server for missing media. Define the production URL using a wp-config.php constant BE_MEDIA_FROM_PRODUCTION_URL or filter be_media_from_production_url.

In all cases, if a local file exists, it will be used in preference to the remote file.

インストール

Once the plugin is installed, add the following constant to wp-config.php with your production URL.

define( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https://www.billerickson.net' );

Alternatively, you can use the filter in a Code Snippets plugin or a mu-plugin:

add_filter( 'be_media_from_production_url', function() {
    return 'https://www.billerickson.net';
});

Installation via WP-CLI and constants

wp plugin install --activate be-media-from-production
wp config set BE_MEDIA_FROM_PRODUCTION_URL https://www.billerickson.net --type=constant

Using with WP Migrate

WP Migrate is my preferred tool for pushing/pulling databases between environments. The media files functionality allows you to transfer media between environments along with the database.

When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.

Set up a “push” profile to push your local database to the development server. Make sure “Media Files” is checked and select “Compare, then upload”.

Set up a “pull” profile to pull the development database locally. Do not include media in your pull. Any missing media will be handled by BE Media from Production.

評価

2024年6月26日
I absolutely love this plugin. I install it on every local website I work on. It’s so helpful to develop locally without downloading all of my client’s media uploads. Some of my clients have hundreds of gigabytes. I can’t work without it now. Thank you for sharing it!
2022年11月8日
I’ve used this plugin from Github for maybe 7 years now. It’s nice to finally see it in the Wordpress plugin directory This is a must use on my local
2022年11月2日
Exceptionally clean plugin with an intuitive and developer-friendly setup that can easily be included through your site’s wp-config.php file or with a wp-cli command like, wp config set BE_MEDIA_FROM_PRODUCTION_URL 'your-prod-website-url'. No more setting up confusing apache redirect rules in htaccess or jumping into nginx configuration files.
2020年10月1日
Incredibly useful plugin when doing local development work on sites with huge media libraries, when you don’t want to fill up your local hard drive with or spend time syncing with your remote site.
2020年9月18日
This plugin works. It makes getting a WP install up and running easy – without having to download a client’s 10GB+ uploads folder. So nice! Thanks!
2020年6月21日
Just a really great complement to localhost development, especially since pretty much every backup/export utility allows excluding certain directories, like wp-content/uploads Many thanks!
9件のレビューをすべて表示

貢献者と開発者

BE Media from Production はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“BE Media from Production” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。