Directory / plugin

Myrk Feature Flags

v1.0.1 · by Bjorn Holine

WordPress feature flags and feature toggles with progressive rollout, per-environment control, user targeting, and circuit breaker protection.

About this plugin

Test new features safely and roll out changes to a percentage of users without touching external services or setting up extra infrastructure. Everything runs inside WordPress. No third-party accounts, no Redis, no additional servers required.

Define flags in code. Control state from the admin.

Register feature flags directly in your plugin or theme so they are version controlled and reviewable in code. Enable, disable, or gradually deploy to users from the WordPress admin without pushing new code. Progressive rollout, user targeting, and gradual deployment are all built in.

Works well for teams using trunk-based development and continuous delivery. Merge to main and control what users see from the database rather than through separate deploys.

Coming from an external feature flag service?

Myrk takes a different approach. Your codebase is the source of truth. Flags are declared with Myrk::register() in PHP and committed to your repo, and they show up in the admin automatically. The admin controls state only and does not create flags. Your flag inventory stays version controlled and peer reviewed like everything else in your codebase.

Key features

  • Code-registered flags — declare with Myrk::register() in PHP, reviewed in Git
  • Per-environment state — reads wp_get_environment_type() automatically
  • Progressive rollout — deterministic percentage rollout, no cookies needed
  • User targeting — by role, capability, user ID, or email domain
  • A/B testing — deterministic hashing so the same user always sees the same variant
  • Circuit breaker — Myrk::attempt() wraps risky code with automatic fallback
  • Stale flag detection — visual badge for feature toggles inactive for 90 or more days
  • REST API — full CRUD that powers the admin UI and CI/CD pipeline automation
  • WP-CLI — manage feature flags from the command line
  • No external dependencies — no Redis, no Node, no third-party service

Source Code

The compiled JavaScript in build/ is generated from source files in assets/js/ using @wordpress/scripts (webpack). Both the source and compiled files are included in the plugin zip. To rebuild the compiled assets, install Node.js dependencies with pnpm install and run pnpm build.

Development

Plugin tags