{"id":19107770,"url":"https://github.com/alleyinteractive/wp-environment-switcher","last_synced_at":"2025-04-30T18:49:30.273Z","repository":{"id":179260791,"uuid":"663211918","full_name":"alleyinteractive/wp-environment-switcher","owner":"alleyinteractive","description":"Easily switch between hosting environments in WordPress.","archived":false,"fork":false,"pushed_at":"2024-12-02T10:17:56.000Z","size":1819,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":20,"default_branch":"develop","last_synced_at":"2025-04-30T18:49:28.770Z","etag":null,"topics":["wordpress","wordpress-plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alleyinteractive.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,"zenodo":null}},"created_at":"2023-07-06T20:00:09.000Z","updated_at":"2025-04-11T05:19:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"4e670601-2942-44ac-b8fc-6be311ec2cf3","html_url":"https://github.com/alleyinteractive/wp-environment-switcher","commit_stats":null,"previous_names":["alleyinteractive/wp-environment-switcher"],"tags_count":3,"template":false,"template_full_name":"alleyinteractive/create-wordpress-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Fwp-environment-switcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Fwp-environment-switcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Fwp-environment-switcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alleyinteractive%2Fwp-environment-switcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alleyinteractive","download_url":"https://codeload.github.com/alleyinteractive/wp-environment-switcher/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251765617,"owners_count":21640212,"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":["wordpress","wordpress-plugin"],"created_at":"2024-11-09T04:13:54.407Z","updated_at":"2025-04-30T18:49:30.261Z","avatar_url":"https://github.com/alleyinteractive.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress Environment Switcher\n\n[![Coding Standards](https://github.com/alleyinteractive/wp-environment-switcher/actions/workflows/coding-standards.yml/badge.svg)](https://github.com/alleyinteractive/wp-environment-switcher/actions/workflows/coding-standards.yml)\n\nEasily switch between different site environments from the WordPress admin bar.\n\n\u003e Props to [WordPress Stage Switcher](https://github.com/roots/wp-stage-switcher) for the inspiration.\n\n## Installation\n\nYou can install the package via Composer:\n\n```bash\ncomposer require alleyinteractive/wp-environment-switcher\n```\n\n## Usage\n\nActivate the plugin in WordPress and you will see the switcher appear in the top right admin bar:\n\n![Screenshot of plugin](https://github.com/alleyinteractive/wp-environment-switcher/assets/346399/83684c99-4f74-4969-b302-a0c617c17190)\n\nThe plugin reads the current WordPress environment from the current hosting\nprovider (Pantheon and WordPress VIP supported) and falls back to\n`wp_get_environment_type()` which can be set by defining `WP_ENVIRONMENT_TYPE`\nin your `wp-config.php` file. You can override the current environment by\nusing the `wp_environment_switcher_current_environment` filter:\n\n```php\nadd_filter(\n\t'wp_environment_switcher_current_environment',\n\tfn () =\u003e 'my-custom-environment'\n);\n```\n\nYou can define the available environments by using the\n`wp_environment_switcher_environments` filter:\n\n```php\nadd_filter(\n\t'wp_environment_switcher_environments',\n\tfn () =\u003e [\n\t\t'production' =\u003e 'https://example.org',\n\t\t'staging'    =\u003e 'https://staging.example.org',\n\t\t'local'      =\u003e 'https://example.test',\n\t]\n);\n```\n\nThe plugin will automatically detect the current environment and highlight it in\nthe switcher. By default, the plugin will show the switcher to anybody with the\n`manage_options` capability. You can change this by modifying the capability\nmapped to the `view_environment_switcher` capability with `map_meta_cap`.\n\n## Testing\n\nRun `composer test` to run tests against PHPStan/PHPCS.\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\nThis project is actively maintained by [Alley\nInteractive](https://github.com/alleyinteractive). Like what you see? [Come work\nwith us](https://alley.com/careers/).\n\n- [Sean Fisher](https://github.com/srtfisher)\n- [All Contributors](../../contributors)\n\n## License\n\nThe GNU General Public License (GPL) license. Please see [License File](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleyinteractive%2Fwp-environment-switcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falleyinteractive%2Fwp-environment-switcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falleyinteractive%2Fwp-environment-switcher/lists"}