roots/wp-stage-switcher
Composer 安装命令:
composer require roots/wp-stage-switcher
包简介
WordPress plugin that allows you to switch between different environments from the admin bar
关键字:
README 文档
README
A WordPress plugin that allows you to switch between different environments from the admin bar.
Support us
Roots is an independent open source org, supported only by developers like you. Your sponsorship funds WP Packages and the entire Roots ecosystem, and keeps them independent. Support us by purchasing Radicle or sponsoring us on GitHub — sponsors get access to our private Discord.
Requirements
You'll need to have ENVIRONMENTS and WP_ENV defined in your WordPress config.
The ENVIRONMENTS constant must be an array of 'environment' => 'url' elements:
$envs = [ 'development' => 'http://example.dev', 'staging' => 'http://staging.example.com', 'production' => 'http://example.com' ]; Config::define('ENVIRONMENTS', $envs);
WP_ENV must be defined as the current environment:
Config::define('WP_ENV', 'development');
If you use Bedrock, WP_ENV is already defined in the config.
Installation
This plugin must be installed via Composer. Add wp-stage-switcher to your project's dependencies:
composer require roots/wp-stage-switcher
Filters
bedrock/stage_switcher_colors
Customize the background colors for each environment in the admin bar menu. Returns an array of 'environment' => 'color' pairs.
Default colors:
[ 'development' => 'firebrick', 'staging' => 'chocolate', 'production' => 'transparent', ]
Example usage:
add_filter('bedrock/stage_switcher_colors', function ($colors) { return [ 'development' => '#dc2626', 'staging' => '#ea580c', 'production' => '#10b981', ]; });
bedrock/stage_switcher_visibility
Control who can see the stage switcher in the admin bar. Defaults to is_super_admin().
Example usage:
add_filter('bedrock/stage_switcher_visibility', function ($visible) { return current_user_can('manage_options'); });
Community
Keep track of development and community news.
- Join us on Discord by sponsoring us on GitHub
- Join us on Roots Discourse
- Follow @rootswp on Twitter
- Follow the Roots Blog
- Subscribe to the Roots Newsletter
roots/wp-stage-switcher 适用场景与选型建议
roots/wp-stage-switcher 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 467.49k 次下载、GitHub Stars 达 373, 最近一次更新时间为 2014 年 01 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「wordpress」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 roots/wp-stage-switcher 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 roots/wp-stage-switcher 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 roots/wp-stage-switcher 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Must-use plugin integrating WordPress with the Upsun platform: environment awareness, router-cache friendliness, safe preview clones, deploy migrations, Site Health checks, and a wp upsun CLI command.
Inertia.js server-side adapter for PHP. Handles full visits, Inertia XHR visits, asset-version 409 handshakes and partial reloads. Framework-agnostic, with transparent WordPress integration.
Adds Cache-Tag HTTP response headers for singular WordPress content and purges Cloudflare by tag when content changes.
AI Chatbot & Helpdesk Agent for WooCommerce. Connects your store to Egentify for AI-powered chat, order tracking, email, and ticketing.
MIDDAG's reference architecture for a WordPress plugin — composes the OSS framework/wordpress/ui libraries end to end.
Assets helper package for the Hybrid Core framework.
统计信息
- 总下载量: 467.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 382
- 点击次数: 35
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-01-13