renakdup/colorize-wp-adminpanel-for-environments 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

renakdup/colorize-wp-adminpanel-for-environments

最新稳定版本:1.0.2

Composer 安装命令:

composer require renakdup/colorize-wp-adminpanel-for-environments

包简介

WordPress script to colorize admin-bar for different environments. Developers, Content Managers, and others will never confuse the environment where they work.

README 文档

README

Total Downloads PHP Version Require Latest Stable Version License

Confusing development environments is easy, especially when working under deadline pressure, on multiple projects simultaneously, or simply due to human error.

One effective way to solve this problem is by visually distinguishing the WordPress admin panel with different colors depending on the development environment. This approach not only increases the developers’ level of attentiveness but also facilitates faster and more intuitive differentiation between environments, reducing the likelihood of errors.

development.png

Read more in the article

Installation

  1. Specify your current environment.
    On each environment (local, development, qa, stage, production), you will need to add the WP_ENVIRONMENT_TYPE constant with its value to wp-config.php.
    Choose the necessary one and add it into your config:
    define( 'WP_ENVIRONMENT_TYPE', 'local' );
    define( 'WP_ENVIRONMENT_TYPE', 'development' );
    define( 'WP_ENVIRONMENT_TYPE', 'staging' );
    define( 'WP_ENVIRONMENT_TYPE', 'production' );
  2. Install via Composer
    composer require renakdup/colorize-wp-adminpanel-for-environments

Note

If you don't use Composer copy this file here /wp-content/mu-plugins/ https://gist.github.com/renakdup/36f4a8474d0cb13ecadf0393811d5330
! There are no need additional steps anymore.

  1. Add the file /wp-content/mu-plugins/colorize-adminpanel-for-environments.php
<?php

if ( ! class_exists( Renakdup\AdminpanelEnvColor\AdminpanelEnvColor::class ) ) {
	return;
}

Renakdup\AdminpanelEnvColor\AdminpanelEnvColor::init();

That's it!

Features

The right corner of admin-bar will be displayed current environment
env.png

Other colors

Development:
env.png

Staging:
env.png

Production:
env.png

Change colors

By the default we use next colors:

  • production: red
  • staging: orange
  • development: blue
  • local: default black

You can change it and add your new envs as well

add_filter( 'renakdup/adminpanel_env_color/colors', function ( $defaults ) {
	return array_merge( 
		$defaults, 
		[
			'local' => 'green',
			'custom-env' => '#CCC'
		]
	);
}, 10, 1 );

统计信息

  • 总下载量: 6.73k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-31