myrk
Enterprise feature flags for WordPress.
No external dependencies.
Register in code. Evaluate anywhere.
Myrk::register( 'checkout_v2_flow', [
'label' => 'Checkout V2 Flow',
'description' => 'Redesigned checkout with saved payment methods',
'default' => false,
'group' => 'Checkout Redesign',
'tags' => [ 'checkout', 'payments' ],
] );
if ( Myrk::is_enabled( 'checkout_v2_flow', wp_get_current_user() ) ) {
return new Checkout_V2();
}
return new Checkout_Legacy();
// State is bootstrapped from PHP automatically, no extra request.
if ( myrkIsEnabled( 'checkout_v2_flow' ) ) {
document.body.classList.add( 'checkout-v2' );
} else {
document.body.classList.add( 'checkout-legacy' );
}
Built for how you already ship
Code-registered flags
Flags are declared in PHP and committed to your repo, so they go through the same review as everything else. No dashboard-only toggles nobody remembers adding.
Per-environment state
Myrk reads wp_get_environment_type() and applies the matching default automatically. Staging and production diverge without extra config.
Percentage rollout
Rollout is enforced with deterministic CRC32 hashing on the user ID. The same user gets the same result every time — no cookies, no sessions.
User targeting
Target by role, capability, specific user ID, or email domain, and combine conditions to scope a flag to exactly who needs to see it.
Circuit breaker
Wrap risky code in Myrk::attempt() and it falls back automatically on failure, tripping off for future requests until you reset it.
Stale flag detection
Flags with no state change in 90+ days are flagged automatically. Filter for them from WP-CLI (wp myrk flags list --stale) or the REST API, before they calcify into permanent branches in your code.
Full REST API
Every flag operation is exposed over REST. It's what powers the admin UI, and what your deploy pipeline can call directly.
WP-CLI
List, toggle, and inspect flags from the command line — wp myrk flags list, wp myrk flags enable, wp myrk flags get.
How it works
Register in code
Define the flag, its default, and its environment behavior in a plugin or theme. Commit it, review it, ship it with the release.
Control from database
Once deployed, toggle state from the admin UI, the REST API, or WP-CLI — no redeploy required to flip a flag.
Ship safely
Roll out by percentage, target specific users, and fall back automatically if something breaks downstream.