← All releases

wp-content/plugins/pennant/pennant.php

Pennant

Feature flags for WordPress, evaluated server-side and safe to cache.

== Description ==

Shipping a risky change behind a flag turns a rollback into a toggle. Pennant evaluates flags in PHP, supports percentage rollouts and role targeting, and exposes each flag’s state to the block editor so a feature can be previewed before it is on.

Flag state is cached in the object cache with a short TTL, so evaluating twenty flags on a page costs one lookup rather than twenty option reads.

Every flag has a kill switch that bypasses the cache entirely, because the one time you need a flag off immediately is the one time you cannot wait for a TTL.

== Screenshots ==

Numbered the way they ship in /assets/. Click any one to see it full width.

== Installation ==

  • Install and activate the plugin.
  • Define flags under Tools → Flags, or in a config file for version control.
  • Guard your code with pennant( 'flag-name' ).

Percentage rollouts vary the page, so add the flag state to your cache key. The readme shows how for four caches.

== Frequently asked questions ==

Client-side flags?

Exposed to the editor and to a REST endpoint. Evaluation stays on the server so a flag cannot be flipped from a console.

Stale flags?

A report lists flags not evaluated in 90 days, which is how you find the ones to delete.

== Changelog ==

= 1.4.0 =

  • Kill switch bypassing the cache.
  • Stale flag report.

= 1.2.0 =

  • Percentage rollouts with a stable per-visitor assignment.