Healthchecks

RunHealthcheckJob runs HealthcheckService::run() for each site. The service checks HTTP availability, SSL expiration, WordPress version, and pending plugin updates. It prefers data from the WP Hoster Agent health endpoint when available; otherwise falls back to WP-CLI.

Checks performed

  1. HTTP — GET https://{fqdn}, record status code and TTFB. If unreachable or 5xx, status = down, critical alert raised.
  2. SSLgetSslDaysLeft() via stream_socket_client and openssl_x509_parse. If < 14 days, warning alert.
  3. WordPress / plugins — If agent is enabled and token exists, fetchAgentHealthData() GETs /wp-json/wphoster/v1/health and uses wp_version, etc. Otherwise WP-CLI core version and plugin list --update=available --format=count (cached).

Key file

app/Services/Healthchecks/HealthcheckService.php

Scheduling

wphoster:run-healthchecks runs every 10 minutes (see routes/console.php).

Alerts

ConditionSeverity
Site unreachable or 5xxcritical
SSL expires in < 14 dayswarning
WP-CLI query failswarning