benecaster_feed_request_rollup_completed
Fires from FeedRequestLogRollupCron::rollup_date() after each nightly rollup pass completes. The rollup cron runs at 02:15 site time, aggregates the previous day’s raw benecaster_feed_request_log rows into per-day buckets in benecaster_feed_request_daily, and fires this action once per date processed.
Intended consumer: the Analytics Dashboard add-on can hook here to trigger downstream aggregation without polling. Any external data warehouse or alerting system that needs to know when fresh aggregate data is available can also hook here instead of relying on a fixed-time schedule.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
$result |
array |
— | Rollup result. Keys: `date` (string 'Y-m-d' — the calendar date that was rolled up), `rows_written` (int — number of aggregate rows inserted or updated in benecaster_feed_request_daily for this date) |
Examples
Trigger a downstream aggregation job when the nightly rollup completes
add_action( 'benecaster_feed_request_rollup_completed', function ( array $result ): void {
// Push yesterday's aggregate data to an external warehouse
wp_remote_post( MY_WAREHOUSE_ENDPOINT, [
'body' => wp_json_encode( [
'date' => $result['date'],
'rows_written' => $result['rows_written'],
'source' => home_url(),
] ),
] );
} );
Notes
This action fires once per rollup date. When the "Rebuild aggregate from raw" tool is used, it fires once for each historical date reprocessed. Guard against duplicate downstream writes if your consumer is not idempotent.