Download the PHP package kernl/wp-feature-flags without Composer
On this page you can find all versions of the php package kernl/wp-feature-flags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kernl/wp-feature-flags
More information about kernl/wp-feature-flags
Files in kernl/wp-feature-flags
Download kernl/wp-feature-flags
More information about kernl/wp-feature-flags
Files in kernl/wp-feature-flags
Please rate this library. Is it a good library?
Informations about the package wp-feature-flags
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.
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 = '[email protected]';
$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.
All versions of wp-feature-flags with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
The package kernl/wp-feature-flags contains the following files
Loading the files please wait ....