benecaster_validation_failure
Fires every day the Benecaster license server is unreachable due to a transport error — connection refused, timeout, or a 5xx response. The $failure_days counter increments by one each day the server remains unreachable and resets to zero on the next successful validation. The hook fires once per daily validation cycle for as long as the server is down.
This hook fires for network problems, not for explicit license rejections. For server-side rejections where the server responds and rejects the license, use benecaster_license_invalid instead. Grace period behavior: during days 1–14, premium features continue normally. On days 15–29, a random alert appears in the Benecaster admin dashboard. At 30 consecutive failure days, benecaster_license_hard_limit_reached fires and premium features are restricted. Premium only: not registered when no valid license is active.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$failure_days |
int |
— | Number of consecutive days the server has been unreachable |
Examples
Slack alert on 7-day intervals
add_action( 'benecaster_validation_failure', function( int $failure_days ): void {
if ( $failure_days < 7 || $failure_days % 7 !== 0 ) {
return; // Only alert on multiples of 7 days.
}
wp_remote_post( MY_SLACK_WEBHOOK, [
'body' => json_encode([
'text' => sprintf(
':red_circle: Benecaster license server unreachable for %d consecutive days on %s.',
$failure_days,
home_url()
),
]),
'headers' => [ 'Content-Type' => 'application/json' ],
] );
} );
Notes
Premium only: not registered when no valid license is active. The grace period provides up to 30 days before features are restricted: days 1–14 silent, days 15–29 intermittent admin alerts, day 30 triggers benecaster_license_hard_limit_reached.