承接 lukasbesch/bedrock-plugin-disabler 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

lukasbesch/bedrock-plugin-disabler

最新稳定版本:v1.4.0

Composer 安装命令:

composer require lukasbesch/bedrock-plugin-disabler

包简介

Disable certain plugins in non-production environments using PHP constants.

README 文档

README

Packagist Supported PHP Versions GitHub Repository Size Build Status Downloads

Define an array of plugins that deactivate automatically in certain environments (e.g. caching plugins in development).

Inspired by this blog post by Kamil Grzegorczyk. Uses a fork of the DisablePlugins class written by Mark Jaquith.

Installation

This plugin is designed to work with Bedrock based sites, and will not work with a Standard WordPress installation.

$ composer require lukasbesch/bedrock-plugin-disabler

It will be installed as a wordpress-muplugin.
If you try to activate it as a regular plugin, the plugin will deactivate itself with a notice.

Manual Installation (not recommended)

Download the latest release and place it in your web/app/mu-plugins folder.

Usage

Define the constant DISABLED_PLUGINS with an array of the plugins main files you want to deactivate in your preferred environment configuration, for example config/environments/development.php:

Config::define('DISABLED_PLUGINS', [
    'autoptimize/autoptimize.php',
    'updraftplus/updraftplus.php',
    'wp-super-cache/wp-cache.php',
    'w3-total-cache/w3-total-cache.php',
]);

If you have an older Bedrock installation (< 1.9.0) you have to define the constant using the regular define() function:

if (! defined('DISABLED_PLUGINS')
    define('DISABLED_PLUGINS', [
        'autoptimize/autoptimize.php',
    ]);
}

PHP 5.6+ can store arrays in constants, but you can also provide serialized data:

Config::define('DISABLED_PLUGINS', serialize([
    'autoptimize/autoptimize.php',
]));

统计信息

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

GitHub 信息

  • Stars: 55
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-11-26