{"id":103408,"date":"2019-05-09T20:53:43","date_gmt":"2019-05-09T20:53:43","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/be-media-from-production\/"},"modified":"2023-11-28T13:23:08","modified_gmt":"2023-11-28T13:23:08","slug":"be-media-from-production","status":"closed","type":"plugin","link":"https:\/\/sk.wordpress.org\/plugins\/be-media-from-production\/","author":903215,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.7.0","stable_tag":"1.7.0","tested":"6.3.8","requires":"4.3","requires_php":"","requires_plugins":null,"header_name":"BE Media from Production","header_author":"CultivateWP","header_description":"Uses local media when it's available, and uses the production server for rest.","assets_banners_color":"dde3fc","last_updated":"2023-11-28 13:23:08","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/cultivatewp.com\/our-plugins\/be-media-from-production\/","header_author_uri":"http:\/\/cultivatewp.com","rating":5,"author_block_rating":0,"active_installs":2000,"downloads":15873,"num_ratings":9,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":{"1.4.0":{"tag":"1.4.0","author":"billerickson","date":"2019-05-09 20:53:13"},"1.5.0":{"tag":"1.5.0","author":"billerickson","date":"2020-03-25 16:06:02"},"1.6.0":{"tag":"1.6.0","author":"billerickson","date":"2022-09-22 14:18:19"},"1.7.0":{"tag":"1.7.0","author":"billerickson","date":"2023-11-28 13:23:08"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":9},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":2940960,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":2940960,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":2940960,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":2940960,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.4.0","1.5.0","1.6.0","1.7.0"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[133,163,1120,84,19979],"plugin_category":[50],"plugin_contributors":[78145,221439],"plugin_business_model":[],"class_list":["post-103408","plugin","type-plugin","status-closed","hentry","plugin_tags-image","plugin_tags-images","plugin_tags-local","plugin_tags-media","plugin_tags-staging","plugin_category-media","plugin_contributors-billerickson","plugin_contributors-cultivatewp","plugin_committers-billerickson"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/be-media-from-production_dde3fc.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>When spinning up a staging or local development environment, you might not need the full uploads directory, but you also don\u2019t want to see broken images throughout the site.<\/p>\n\n<p>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.<\/p>\n\n<p>In all cases, if a local file exists, it will be used in preference to the remote file.<\/p>\n\n<!--section=installation-->\n<p>Once the plugin is installed, add the following constant to wp-config.php with your production URL.<\/p>\n\n<pre><code>define( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https:\/\/www.billerickson.net' );\n<\/code><\/pre>\n\n<p>Alternatively, you can use the filter in a Code Snippets plugin or a mu-plugin:<\/p>\n\n<pre><code>add_filter( 'be_media_from_production_url', function() {\n    return 'https:\/\/www.billerickson.net';\n});\n<\/code><\/pre>\n\n<p><strong>Installation via WP-CLI and constants<\/strong><\/p>\n\n<pre><code>wp plugin install --activate be-media-from-production\nwp config set BE_MEDIA_FROM_PRODUCTION_URL https:\/\/www.billerickson.net --type=constant\n<\/code><\/pre>\n\n<p><strong>Using with WP Migrate<\/strong><\/p>\n\n<p><a href=\"https:\/\/deliciousbrains.com\/wp-migrate-db-pro\/\">WP Migrate<\/a> 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.<\/p>\n\n<p>When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.<\/p>\n\n<p>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\".<\/p>\n\n<p>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.<\/p>","raw_excerpt":"For developers - Uses local media when available, and uses the production server for the rest.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/103408","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=103408"}],"author":[{"embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/billerickson"}],"wp:attachment":[{"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=103408"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=103408"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=103408"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=103408"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=103408"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=103408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}