PHPackages                             humanmade/wp-flags - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. humanmade/wp-flags

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

humanmade/wp-flags
==================

Lightweight WordPress plugin to enable exposing feature flags to end-users, based on code-based ( or admin UI in the future ) criteria.

0.1(8mo ago)3553.5k↓13.3%2[10 issues](https://github.com/humanmade/wp-flags/issues)[2 PRs](https://github.com/humanmade/wp-flags/pulls)MITPHPPHP &gt;=7.2

Since Mar 15Pushed 8mo ago21 watchersCompare

[ Source](https://github.com/humanmade/wp-flags)[ Packagist](https://packagist.org/packages/humanmade/wp-flags)[ RSS](/packages/humanmade-wp-flags/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (17)Used By (0)

   **Flags**
 Lightweight WordPress plugin to enable exposing feature flags to end-users, based on code-based ( or admin UI in the future ) criteria.       A **[Human Made](https://hmn.md/)** project.   [![](https://camo.githubusercontent.com/a81f1d1a9e412bc24fee8e5aa9b4a41efbc9e4c83e32ddd13c5874c274c45c04/68747470733a2f2f68756d616e6d6164652e636f6d2f75706c6f6164732f323032352f30312f484d2d7265642d7371756172652e737667)](https://camo.githubusercontent.com/a81f1d1a9e412bc24fee8e5aa9b4a41efbc9e4c83e32ddd13c5874c274c45c04/68747470733a2f2f68756d616e6d6164652e636f6d2f75706c6f6164732f323032352f30312f484d2d7265642d7371756172652e737667)  **NOTE**: This is a work-in-progress plugin.

Installation
============

[](#installation)

#### Using Composer

[](#using-composer)

- Require the package in your project

`composer require humanmade/wp-flags`

#### Using submodules

[](#using-submodules)

- Add the plugin as a submodule ( adjust the path as necessary )

`git submodule add git@github.com:humanmade/wp-flags.git content/plugins/wp-flags`

Usage
=====

[](#usage)

```
use HumanMade\Flags\Flags;

add_action( 'init', function() {
    Flags::add( 'new-flag', 'New Flag', [
        // Is the flag exposed to users ?
        'available' => function() {
            return current_user_can( 'manage_options' );
        },
        // At what level the flag can be set. One of `user` or `site`
        'scope' => 'user',
        // Default flag status
        'active' => true,
        // Is the flag controllable by users ?
        'optin' => true,
        // Custom icon ? ( dashicon-compatible )
        'icon' => 'dashboard',
        // Custom attribute ?
        'some_custom_meta_key' => 'some_value',
    ] );

    // OR just..
    $flag = Flags::add( 'another-flag', 'Another flag' );
    $flag->on( 'active', function( $active, $flag ) {
        // do something based on active status change
    } );

    // Execute logic based on flag status
    if ( Flags::get( 'new-flag' )->active ) {
        show_the_new_sidebar();
    } );
} );

```

Scope of Setting a Flag
=======================

[](#scope-of-setting-a-flag)

A flag can be set at either the `user` or `site` scope, which determines how a flag is controlled. A `user`-scoped flag can be turned on or off by each user for that user only on a site, whereas a `site`-scoped flag is turned on or off for every user and is controlled in the site settings.

Credits
=======

[](#credits)

Written and maintained by [Shady Sharaf](https://github.com/shadyvb). Thanks to all our [contributors](https://github.com/humanmade/wp-flags/graphs/contributors).

Interested in joining in on the fun? [Join us, and become human!](https://hmn.md/is/hiring/)

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance53

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~294 days

Recently: every ~483 days

Total

9

Last Release

264d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2ab6e5ec0121a66dd5df39c4a63e3740e5a966abe99e04079df5b7d4cdd5b00?d=identicon)[shadyvb](/maintainers/shadyvb)

---

Top Contributors

[![shadyvb](https://avatars.githubusercontent.com/u/451892?v=4)](https://github.com/shadyvb "shadyvb (34 commits)")[![mikeselander](https://avatars.githubusercontent.com/u/3021494?v=4)](https://github.com/mikeselander "mikeselander (20 commits)")[![tomjn](https://avatars.githubusercontent.com/u/58855?v=4)](https://github.com/tomjn "tomjn (15 commits)")[![goldenapples](https://avatars.githubusercontent.com/u/665992?v=4)](https://github.com/goldenapples "goldenapples (6 commits)")[![abhishek-kaushik](https://avatars.githubusercontent.com/u/1883835?v=4)](https://github.com/abhishek-kaushik "abhishek-kaushik (2 commits)")[![paulshryock](https://avatars.githubusercontent.com/u/7530507?v=4)](https://github.com/paulshryock "paulshryock (2 commits)")

### Embed Badge

![Health badge](/badges/humanmade-wp-flags/health.svg)

```
[![Health](https://phpackages.com/badges/humanmade-wp-flags/health.svg)](https://phpackages.com/packages/humanmade-wp-flags)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
