benecaster_license_invalid
Fires when daily validation reaches the license server successfully but the server explicitly rejects the license — returning a status of "invalid". This is distinct from a connectivity failure: the server is reachable and has actively rejected the key. The full response array, including any error detail fields, is passed to the callback.
After this hook fires, premium features are restricted immediately — there is no grace period for an explicit rejection. Use this hook for immediate-restriction integrations such as alerting, logging, or external CRM updates.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$response |
array |
— | Response array from the license server — includes `status: "invalid"` and any error detail fields |
Examples
Alert a Slack channel on license rejection
add_action( 'benecaster_license_invalid', function( array $response ): void {
wp_remote_post( MY_SLACK_WEBHOOK, [
'body' => json_encode([
'text' => sprintf(
':warning: Benecaster license rejected on %s — check benecaster.com account.',
home_url()
),
]),
'headers' => [ 'Content-Type' => 'application/json' ],
] );
} );
Notes
Distinct from benecaster_validation_failure, which fires when the server is unreachable. This hook fires only when the server responds with a clear invalid status. Premium restrictions apply immediately with no grace period. Related: benecaster_license_hard_limit_reached fires after 30 days of server-unreachable failures (a different failure mode from explicit rejection).