定制 kernl/wp-feature-flags 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

kernl/wp-feature-flags

Composer 安装命令:

composer create-project kernl/wp-feature-flags

包简介

Feature flagging for WordPress.

README 文档

README

This is the WordPress client library for Kernl feature flags. It makes using feature flags easy and adds some WordPress specific performance optimizations.

Installation

The best way to install the library is with Composer.

composer require kernl/wp-feature-flags

Usage

require __DIR__ . '/vendor/autoload.php';

// The feature flag product key.  This can be found in the Kernl web app
// in the "Feature Flags" menu.
$kernlFeatureFlagProductKey = '58cb023bc9689c1fe811615d';

// The user identifier is how Kernl identifies the user requesting flags.
// This should be unique for every user.
$userIdentifier = 'jack@kernl.us';

$kff = new kernl\WPFeatureFlags($kernlFeatureFlagProductKey, $userIdentifier);

// This says "For the product defined above, does this flag exists,
// and if so, is it active for the given user?".
if ($kff->active('GITHUB_ON_OFF')) {
    add_action('admin_notices', 'feature_flag_active');
}

function feature_flag_active() {
    ?>
    <div class="notice notice-success is-dismissible">
        <p>Great work!  The feature flag is active.</p>
    </div>
    <?php
}

Performance Optimizations

This library makes some small performance optimizations by storing flag data for users as transients. The default time length is 5 minutes, so your flag state will become eventually consistent.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固