Skip to content

0.22.0 - Site-health monitoring

Choose a tag to compare

@github-actions github-actions released this 17 Jul 23:52
· 46 commits to master since this release
f3a0e7a

Site-health monitoring

See when a site's background machinery breaks — WP-Cron, email, disk, fatals, scheduled posts, SSL — without logging into each site. Surfaced both as a pollable endpoint and on WordPress's native Site Health screen.

🩺 New /health endpoint

GET /wp-json/wphaven-connect/v1/health returns a top-level ok (for a monitor to assert on) plus per-signal detail from pluggable collectors:

  • WP-Cron — a stalled/backed-up cron (the RunCloud + Acorn/Sage failure)
  • Outbound email — silently failing wp_mail() sends
  • Disk usage — before the volume fills
  • PHP fatals — plugins/themes WordPress auto-paused after a fatal
  • Missed scheduled posts — the client-visible face of a dead cron
  • SSL certificate — before the cert expires

/cron-health and the cron-health CLI command are preserved for compatibility; adds wp wphaven health.

🖥️ Site Health integration

The same signals show at Tools → Site Health — a status check per signal (red ones roll into WordPress's "critical issues" count) plus a metrics section on the Info tab.

🔒 Per-site bearer token auth

The monitoring endpoints now accept Authorization: Bearer <secret> (via the WPHAVEN_CONNECT_SECRET constant or wphaven_connect_secret option) in addition to the IP allowlist — works cleanly behind Cloudflare/CDNs.

👁️ Environment indicator for editors

The admin-bar environment badge (Staging/Development) now shows to all content editors (edit_posts), not just WP Haven staff — so a client editing on staging can tell they're not on production. Filterable via wphaven_connect_environment_indicator_capability.


Using it now (before WP Haven integration)

  • Uptime Kuma: set a per-site secret, then an HTTP monitor on /health with an Authorization: Bearer … header and a JSON query asserting $.ok == true.
  • Ad hoc: wp wphaven health, or Tools → Site Health.

Notes

  • Signals are removable/extendable per site via the wphaven_connect_health_collectors filter.
  • Heads-up: the environment badge is intentionally visible to more users now (any content editor).

Closes the RunCloud WP-Cron monitoring work (868k7hv6k).