benecaster_license_validated
Fires when the daily license validation cron receives a valid response from the Benecaster license server. This hook fires once per day under normal operating conditions, after the validation failure streak counter has been reset to zero.
“Valid” encompasses more than a clean active license — it includes grace period and expired statuses, as long as the server was reachable and returned a usable response. Use benecaster_license_invalid for explicit server-side rejections. Use this hook to detect plan changes, refresh cached license data in add-ons, or confirm daily connectivity.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$license_id |
int |
— | License record ID |
Examples
Detect plan change and clear add-on cache
add_action( 'benecaster_license_validated', function( array $response ): void {
$stored_plan = get_option( 'my_addon_cached_plan', '' );
if ( $stored_plan && $response['plan'] !== $stored_plan ) {
// Plan changed — clear add-on-specific cache
delete_transient( 'my_addon_plan_features' );
}
update_option( 'my_addon_cached_plan', $response['plan'] );
} );