Read the Analytics Dashboard feed health history
What Benecaster’s nightly check found in each show’s public feed, one entry per UTC day of the range, as the Feed health panel, its Export CSV and the PDF snapshot draw it. It takes show_id, date_from, date_to (inclusive UTC Y-m-d) and scope, with the same permission and 403 as the other Analytics Dashboard routes; a tier_slug is ignored, since the public feed has no tier. The add-on reads each show through benecaster_get_feed_health_history(), never the table.
state: 'unchecked'is a night the check did not run (WP-Cron needs a site visit). Every figure of that day isnull. Never draw it as valid or invalid, and never carry the day before into it.first_checkedis the first day with a record,nullfor none. History begins the night a site first ran the check, and Settings → Tools → Analytics data retention prunes it, so an unchecked start can be either; say both.syncsis whether any day of the range has sync figures. Without it,sync_runsandsync_failuresarenullon every day and intotals: the show does not sync from an external feed, which is not 0.first_error_codeis Benecaster’s untranslated code,compile_failedwhen the feed could not be built, ornullwhen valid.first_error_labeland each problem’slabelare the translated sentence; a code the add-on does not know readsThe feed failed a check (<code>)withknown: false.problemsgroups the invalid days by code, most days first.- With
scope=alleach show where the add-on is active is read on its own, one entry per show. - The filter’s
$argsareshow_ids,date_from,date_toandtier_slug(alwaysnull); a non-array return is ignored. It runs for the panel, the CSV, the PDF and the digest alike. - Digests. The weekly and monthly digests add a
feed_healthsection, titled Feed health, only when something went wrong in the period: an invalid day, or a failed sync run. On its own it makes a digest worth sending.benecaster_analytics_digest_data’sfeed_healthkey isnullotherwise, and always in the daily digest; when set it is{days, checked, invalid, unchecked, sync_runs, sync_failures, problem}.
Code
const url = window.benecasterAnalyticsDashboard.apiUrl + 'analytics/feed-health?show_id=12&date_from=2026-09-01&date_to=2026-09-14';
const health = await ( await fetch( url, { headers: { 'X-WP-Nonce': window.benecasterAdmin.nonce } } ) ).json();
// health.shows[0] → { show_id: 12, show_name: 'Night Shift', syncs: true, first_checked: '2026-09-01', last_checked: '2026-09-14',
// totals: { days: 14, checked: 11, valid: 7, invalid: 4, unchecked: 3, sync_runs: 43, sync_failures: 3 },
// problems: [ { code: 'item_duration_invalid', label: 'An episode’s duration is not written as hours, minutes and seconds', known: true, days: 2, last_day: '2026-09-05' }, … ],
// days: [ { date: '2026-09-01', state: 'valid', error_count: 0, first_error_code: null, first_error_label: null,
// episode_count: 12, feed_size_bytes: 48000, sync_runs: 4, sync_failures: 0, checked_at: '2026-09-02 00:15:00' }, … ] }
Hooks Used
Need this built rather than just documented? See our services →