Skip to main content

benecaster_license_grace_expired

Action Premium

Fires once, on the daily pass that crosses day 30 of an unrecovered payment-failed grace window. It is the backwards-compatible twin of benecaster_license_payment_grace_hard_cutoff, which fires immediately before it and carries a more useful payload. New code should hook the hard-cutoff action instead; this one is retained for listeners written before the cutoff was introduced.

What happens on that pass matters more than the hook. Every active subscriber token is bulk-revoked with a grace_timeout reason, the cutoff marker is stamped, and the feed caches are flushed. Subscriber feed URLs stop serving the private show — subscribers are not moved onto public episodes in their place. See benecaster_license_payment_grace_hard_cutoff, which carries the note about master’s current redirect behaviour and why not to build against it.

Use it to drive alerting, or to tell the podcaster plainly what has just happened to their subscribers.

Parameters

Name Type Default Description
$started_at int — Unix timestamp when the grace window was originally opened — subtract from `time()` to get the full length of the window that just ended (30 days, give or take when the cron actually ran)

Examples

Alert an external service when the cutoff lands

add_action( 'benecaster_license_grace_expired', function ( int $started_at ): void {
    wp_remote_post( MY_ALERT_ENDPOINT, [
        'body' => wp_json_encode( [
            'event'      => 'license_grace_expired',
            'started_at' => $started_at,
            'site'       => home_url(),
        ] ),
    ] );
} );

Notes

Fires at most once per grace cycle. The daily cron returns early on every later tick because the hard-cutoff marker is already set, so callbacks do not need to guard against repeat firing — and a callback written to de-duplicate a daily action will simply never see a second call.

Prefer benecaster_license_payment_grace_hard_cutoff in new code: it fires at the same moment and additionally carries the number of tokens revoked, which is the figure that makes an alert actionable.

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