PHPackages                             codeb/wp-feature-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. codeb/wp-feature-flags

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

codeb/wp-feature-flags
======================

Allows developers to enable / disable features based on flags.

v0.4.0(1y ago)13[8 PRs](https://github.com/codebtech/wp-feature-flags/pulls)MITTypeScriptPHP &gt;=8.1CI passing

Since Feb 28Pushed 8mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (6)Versions (21)Used By (0)

WordPress Feature Flags
=======================

[](#wordpress-feature-flags)

[![PHP lint & test](https://github.com/codebtech/wp-feature-flags/actions/workflows/php.yml/badge.svg)](https://github.com/codebtech/wp-feature-flags/actions/workflows/php.yml)[![JS lint & test](https://github.com/codebtech/wp-feature-flags/actions/workflows/js.yml/badge.svg)](https://github.com/codebtech/wp-feature-flags/actions/workflows/js.yml)[![E2E Tests](https://github.com/codebtech/wp-feature-flags/actions/workflows/e2e.yml/badge.svg)](https://github.com/codebtech/wp-feature-flags/actions/workflows/e2e.yml)[![codecov](https://camo.githubusercontent.com/c57cebb24f46a52aad6d5627a6b09b6361ea9335f8c7de682763b5fea10ed586/68747470733a2f2f636f6465636f762e696f2f6769746875622f636f646562746563682f77702d666561747572652d666c6167732f67726170682f62616467652e7376673f746f6b656e3d514e55574743524a4752)](https://codecov.io/github/codebtech/wp-feature-flags)

Stable tag: 0.3.2 Requires at least: 6.2 Tested up to: 6.8 Requires PHP: 8.1

WordPress Feature flags plugin allow developers to configure features in plugins/themes behind the feature flags on both the server (PHP) and client (JS/TS) side.

Installation
------------

[](#installation)

`composer require codeb/wp-feature-flags`

Packagist:

Hooks
-----

[](#hooks)

### PHP filters

[](#php-filters)

#### `codeb_feature_flags_max_allowed`

[](#codeb_feature_flags_max_allowed)

Filter to define the maximum number of allowed flags. It is recommended to keep this to default value, which is 20.

Example usage:

```
add_filter(
	'codeb_feature_flags_max_allowed',
	static function () {
		return 10;
	}
);
```

### JS filters

[](#js-filters)

##### `codebFeatureFlags.newFlag.defaultStatus`

[](#codebfeatureflagsnewflagdefaultstatus)

The filter controls whether the new flag is enabled by default or not. Default `true`

Example usage:

```
addFilter(
	'codebFeatureFlags.newFlag.defaultStatus',
	'codeb-feature-flags',
	() => {
		return false;
	}
);
```

Development setup
-----------------

[](#development-setup)

To build the plugin

PHP setup

- `composer install`

JS setup

- `yarn install`
- `yarn build` to create the build
- `yarn start` to start the watch mode

### wp-env

[](#wp-env)

This plugin uses `wp-env` setup to for local environment.

- `wp-env start` to start the containers
- `wp-env stop` to stop the containers

More details on how to access local environment can be found [here](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#quick-tldr-instructions).

Linting and formatting
----------------------

[](#linting-and-formatting)

PHP

- `composer lint`
- `composer lint:fix` to auto fix PHP linting errors.

JS

- `yarn lint:js`
- `yarn lint:js:fix` to auto fix JS linting errors.

CSS

- `yarn lint:css`
- `yarn lint:css:fix` to auto fix CSS linting errors.

Testing
-------

[](#testing)

### PHP

[](#php)

The WordPress unit and integration tests depends on `wp-env` setup. Ensure you run `yarn wp-env:coverage` before running the tests.

- To run unit tests `yarn php:unit`
- To run integrations tests `yarn php:integration`
- To run integrations tests as multisite `yarn php:multisite`

### JS

[](#js)

- Run `yarn test:js` to run all Jest and React Testing Library tests

### E2E

[](#e2e)

The E2E tests depends on `wp-env` setup. Ensure you run `wp-env start` before running the tests.

- Run `yarn test:e2e` to run all Playwright e2e tests.

Contributing
------------

[](#contributing)

Code contributions, feedback, issue reporting and feature suggestions are welcome. See [CONTRIBUTING.md](https://github.com/codebtech/wp-feature-flags/blob/main/CONTRIBUTING.md) for more details.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance49

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% of commits — single point of failure

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 ~41 days

Recently: every ~51 days

Total

6

Last Release

605d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44a340a50f8a16895033840e8cecbcd4ca91e04da023c59c8d289105e9c367d2?d=identicon)[m0hanraj](/maintainers/m0hanraj)

---

Top Contributors

[![mohanrajpac](https://avatars.githubusercontent.com/u/19469816?v=4)](https://github.com/mohanrajpac "mohanrajpac (261 commits)")[![m0hanraj](https://avatars.githubusercontent.com/u/36844205?v=4)](https://github.com/m0hanraj "m0hanraj (121 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (24 commits)")

---

Tags

block-editorwordpresswordpress-developmentwordpress-plugin

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[askedio/laravel-ratchet

A Ratchet Server built for Laravel

18728.2k2](/packages/askedio-laravel-ratchet)[laravel-frontend-presets/inertiajs

A Laravel frontend preset to get you up and running with Inertia.js

1454.5k](/packages/laravel-frontend-presets-inertiajs)[wdev-rs/laravel-datagrid

Laravel integration for Grid.js server side processing

548.4k](/packages/wdev-rs-laravel-datagrid)[elfsundae/laravel-gravatar

The easiest way to generate Gravatar avatar URL.

388.7k](/packages/elfsundae-laravel-gravatar)

PHPackages © 2026

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