{"id":13810278,"url":"https://github.com/billerickson/BE-Media-from-Production","last_synced_at":"2025-05-14T10:32:42.916Z","repository":{"id":45214109,"uuid":"50187881","full_name":"billerickson/BE-Media-from-Production","owner":"billerickson","description":"Uses local media when it's available, and uses the production server for rest.","archived":false,"fork":false,"pushed_at":"2025-04-23T15:17:42.000Z","size":162,"stargazers_count":221,"open_issues_count":3,"forks_count":27,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-23T16:27:48.113Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billerickson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-01-22T15:01:14.000Z","updated_at":"2025-04-23T15:17:46.000Z","dependencies_parsed_at":"2024-08-04T02:03:53.932Z","dependency_job_id":null,"html_url":"https://github.com/billerickson/BE-Media-from-Production","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billerickson%2FBE-Media-from-Production","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billerickson%2FBE-Media-from-Production/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billerickson%2FBE-Media-from-Production/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billerickson%2FBE-Media-from-Production/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billerickson","download_url":"https://codeload.github.com/billerickson/BE-Media-from-Production/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254121000,"owners_count":22018085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T02:00:49.806Z","updated_at":"2025-05-14T10:32:37.904Z","avatar_url":"https://github.com/billerickson.png","language":"PHP","funding_links":[],"categories":["WordPress Plugins"],"sub_categories":[],"readme":"# BE Media from Production\n\nContributors: billerickson,magicroundabout  \nRequires at least: 4.3\nTested up to: 6.6  \nStable tag: 1.8.0  \nLicense: GPLv2 or later  \nLicense URI: http://www.gnu.org/licenses/gpl-2.0.html  \n\nUses local media when available, and uses the production server for the rest.\n\n## Description\n\nWhen redesigning a website with a large uploads directory, you might not need all those uploads in your development\nor staging environment, but you also don't want to see broken images throughout the site.\n\nThis 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`.\n\nIn all cases, if a local file exists, it will be used in preference to the remote file.\n\n## Installation\n\nOnce the plugin is installed, add the following constant to wp-config.php with your production URL.\n\n```\ndefine( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https://www.billerickson.net' );\n```\n\nAlternatively, you can use the filter in your theme's functions.php file, a core functionality plugin, or a mu-plugin:\n\n```\nadd_filter( 'be_media_from_production_url', function() {\n\treturn 'https://www.billerickson.net';\n});\n```\n\n\n## Installation via WP-CLI and constants\n\n```\nwp plugin install https://github.com/billerickson/be-media-from-production/archive/master.zip --force --activate\nwp config set BE_MEDIA_FROM_PRODUCTION_URL https://www.billerickson.net --type=constant\n```\n\n## Using with WP Migrate\n\n[WP Migrate](https://deliciousbrains.com/wp-migrate-db-pro/) 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.\n\nWhen redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.\n\nSet up a \"push\" profile to push your local database to the development server. Make sure \"Media Files\" is checked and select \"Compare, then upload\".\n\nSet 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillerickson%2FBE-Media-from-Production","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillerickson%2FBE-Media-from-Production","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillerickson%2FBE-Media-from-Production/lists"}