PHP SDK

Scheduling, for the curious

One due-check behind two triggers. A daily WP-Cron event (plugie_insights_cron, scoped per plugin id) and an admin_init-registered shutdown callback both ask the scheduler whether a snapshot is due; the first to find it due takes a transient lock and sends. Counters flush at shutdown priority 0 and the tick runs at 100, so the snapshot reads this request’s increments rather than last interval’s. Nothing is registered on a front-end hook — admin_init not firing on the front end is the mechanism, and a test fires shutdown without it and asserts silence.