benecaster_license_plan_upgraded
Fires immediately after a one-click plan upgrade (Settings → Account → Plan changes → Upgrade plan) is confirmed by the license server. It fires on the same request that confirmed the change, before the next daily LicenseValidationCron tick would otherwise surface it. Only fires when the plan actually changed; a confirmed call that returns the plan already held does not fire it.
This is a narrower, faster sibling of benecaster_license_plan_changed, which fires from the daily validation cron on any plan change, upgrade or otherwise. Use this hook when a listener needs to react the moment the customer confirms an upgrade in the dialog — a notice, an analytics event, an email — rather than waiting for the next cron cycle.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$old_plan |
string |
— | The plan slug immediately before this upgrade. |
$new_plan |
string |
— | The plan slug the license server just confirmed. |
Notes
Does not replace benecaster_license_plan_changed. A listener that needs to catch every plan transition regardless of cause (upgrade dialog, server-side change, downgrade signal) should still watch that hook; this one only ever fires from the one-click upgrade confirmation path.
Never fires on a refusal. A refused upgrade (interval mismatch after retry, payment method blocked, a network failure) surfaces as a WP_Error to the confirmation dialog and this hook does not fire — there is no "upgrade attempted but failed" action, only the successful transition.
Need this built rather than just documented? See our services →