這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

BE Media from Production

外掛說明

When redesigning a website with a large uploads directory, you might not need all those uploads in your development
or staging environment, 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 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 your theme’s functions.php file, a core functionality 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 DB Pro

WP Migrate DB Pro is my preferred tool for pushing/pulling databases between environments. The Media addon allows you 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.

使用者評論

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!
2020 年 5 月 14 日
This plugin is a great partner for WP Migrate DB Pro. Keeping the upload files in sync with production tends to be a time-consuming task. With this plugin, it will turn into a walk in the park. We use a slider that seems to not yet be noticed by the plugin, will see if I can add this by myself. Besides that my first check looks like it is working nicely. And I like that the code of the plugin is easy to read and quite compact. Focussed on the essentials - I like that a lot.
2020 年 4 月 30 日
Sites that heavily rely on media were painfully to maintain. Not only did I have to get the local database in sync on my development machine, but also the media to get a good picture of how the site will look after a new feature I added. With this plugin this becomes a breeze as I do not have to download all media to my local machine anymore. This saves time and diskspace. Thank you Bill for this awesome plugin.
2019 年 5 月 10 日
We are using the plugin from GitHub for quite some time. Now it will be even easier, great work!
閱讀全部 6 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈BE Media from Production〉的開發相關工作。

參與者

將〈BE Media from Production〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄