2017 © Pedro Peláez
 

project wp-feature-flags

Feature flagging for WordPress.

image

kernl/wp-feature-flags

Feature flagging for WordPress.

  • Sunday, December 3, 2017
  • by kernl
  • Repository
  • 0 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

WP Feature Flags by Kernl.us

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

Installation

The best way to install the library is with Composer., (*2)

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., (*3)

The Versions

03/12 2017

dev-master

9999999-dev

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

03/12 2017

v1.0.5

1.0.5.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

20/05 2017

v1.0.4

1.0.4.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

20/05 2017

v1.0.3

1.0.3.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

20/05 2017

v1.0.2

1.0.2.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

20/05 2017

1.0.0

1.0.0.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl

20/05 2017

v1.0.1

1.0.1.0

Feature flagging for WordPress.

  Sources   Download

MIT

The Requires

  • php >=5.4

 

by Jack Slingerland

flags feature flags kernl