Skip to main content

benecaster_license_plan_changed

Action Free

Fires when a licence validation cycle changes the locally cached plan. It does not fire when a validation confirms the plan already held, so a handler runs on transitions only and needs no diffing of its own.

$from is '' on the first successful validation of a fresh install. $to is '' when the licence goes invalid or its site token is revoked — so a consumer that lit an upgrade call-to-action can clear it again when the licence lapses. It fires from all three cron paths that write the plan.

The cached options are already updated when this fires, so a handler can call benecaster_get_license_plan() and get $to.

Free, not Premium. Unlike most of the benecaster_license_* family this is not gated, because an unlicensed install transitioning '''starter' is precisely one of the transitions worth hearing about.

Parameters

Name Type Default Description
$from string Previous plan slug. Empty string when none was cached.
$to string New plan slug. Empty string when the licence is no longer valid.

Notes

This cannot suppress or customise a plan-change email, and it will be read that way if the page does not say so. Those emails are sent by benecaster.com from the licence server's own cron, before the site hears about the change at all. By the time this action fires the message has already gone. There is no plugin-side hook in front of it because there is no plugin-side send.

It does not fire when the licence server is unreachable. Validation is fail-open: an unreachable server leaves the cached plan alone, which is deliberate — a network problem must not look like a downgrade. It also does not fire on a first 401 strike.

It is not how you ask whether a downgrade is available. downgrade_eligible already ships on /validate and is a server signal to read, not a transition to infer. Watching this hook to reconstruct it will be wrong on exactly the installs where it matters.

What it is good for: clearing a cached capability set, re-rendering an upgrade prompt, telling your own service that the site's plan moved, or resetting a dismissed notice so it can be shown again on the new plan.

Need this built rather than just documented? See our services →