Site Health Monitor Basics
The Site Health Monitor tracks your WordPress site’s health by logging errors, running automated health checks, and alerting you to critical issues. It captures PHP warnings, notices, and deprecations to your debug.log, runs daily system checks, and can push critical issues to the SEOvault backend for real-time alerts.
How it works
Section titled “How it works”The Site Health Monitor initializes when the plugin loads and:
- Registers a custom PHP error handler to capture warnings, notices, and deprecations
- Logs captured errors to your WordPress debug.log file
- Runs 7 automated health checks on your site configuration
- Provides REST API endpoints for accessing logs and health status
- Optionally installs an MU-plugin for fatal error capture
- Schedules daily log cleanup to prevent large log files
- Sends critical issues to the SEOvault backend webhook for alerts
Health checks
Section titled “Health checks”The monitor runs 7 automated health checks and returns an overall status:
Debug Mode
Section titled “Debug Mode”Checks if WP_DEBUG is enabled. Debug mode should be disabled on production sites for security and performance.
- Good — Debug mode is disabled
- Error — Debug mode is active (not recommended for production)
Issue Logging
Section titled “Issue Logging”Checks if WP_DEBUG_LOG is enabled. This is required for the monitor to capture errors.
- Good — Issue logging is enabled
- Error — Issue logging is disabled (enable WP_DEBUG_LOG to capture issues)
Log File
Section titled “Log File”Checks if the debug.log file exists and is writable.
- Good — Log file exists and is writable
- Warning — Log file exists but is not writable
- Error — Log file does not exist
PHP Version
Section titled “PHP Version”Checks your PHP version against recommended minimums.
- Good — PHP 8.0 or higher (recommended)
- Warning — PHP 7.4 (below recommended but functional)
- Error — PHP below 7.4 (below minimum required)
Memory Limit
Section titled “Memory Limit”Checks your PHP memory limit.
- Good — 256M or higher
- Warning — 128M to 256M (recommended 256M or higher)
- Error — Below 128M (minimum 128M required)
Active Plugins
Section titled “Active Plugins”Checks the number of active plugins.
- Good — 30 or fewer active plugins
- Warning — 31 to 60 active plugins (consider reducing for performance)
- Error — More than 60 active plugins (may impact performance)
Health Monitor Plugin
Section titled “Health Monitor Plugin”Checks if the optional MU-plugin for fatal error capture is installed.
- Good — Health monitor plugin is installed
- Error — Health monitor plugin is not installed
Overall status
Section titled “Overall status”The monitor returns an overall status based on all checks:
- Good — All checks pass
- Warning — One or more checks have warnings but no errors
- Error — One or more checks have errors
Error logging
Section titled “Error logging”The error handler captures PHP errors that would otherwise be ignored:
- Warnings — Runtime warnings that don’t halt execution
- Notices — Minor issues that don’t prevent code from running
- Deprecations — Use of deprecated functions or syntax
These are logged to your debug.log file with timestamps and context, making it easier to diagnose issues before they become critical.
Log cleanup
Section titled “Log cleanup”The monitor schedules a daily cron event to:
- Archive large debug.log files (when they exceed a size threshold)
- Clean up old archives beyond the retention period
- Prevent log files from growing indefinitely and consuming disk space
The cron is automatically unscheduled when the plugin is deactivated.
MU-plugin for fatal errors
Section titled “MU-plugin for fatal errors”The monitor can install an optional must-use (MU) plugin that captures fatal errors even when WordPress is completely broken. This MU-plugin:
- Loads before regular plugins, so it can catch fatal errors during plugin initialization
- Captures fatal errors and writes them to a dedicated log file
- Provides a recovery page when a fatal error breaks the site
Install the MU-plugin via the REST API endpoint POST /site-health/mu-plugin/install. Uninstall it with POST /site-health/mu-plugin/uninstall.
REST API endpoints
Section titled “REST API endpoints”The monitor provides REST API endpoints under seovaultai/v1/site-health:
- GET /summary — Get overall health status and summary
- GET /logs — Get debug.log entries with pagination and filtering
- GET /checks — Run all health checks and return results
- POST /clear — Clear all log entries
- GET /mu-plugin — Get MU-plugin installation status
- POST /mu-plugin/install — Install the fatal error capture MU-plugin
- POST /mu-plugin/uninstall — Uninstall the MU-plugin
All endpoints require site key authentication.
Error reporting
Section titled “Error reporting”The monitor can push critical issues to the SEOvault backend webhook for real-time alerts. This uses:
- Per-error rate limiting to prevent spam
- Global rate limiting across all errors
- WordPress transients for rate limit tracking
Critical errors that trigger alerts include fatal errors and certain high-severity warnings.
Requirements
Section titled “Requirements”For the Site Health Monitor to work:
WP_DEBUG_LOGmust be enabled in wp-config.php- The debug.log file must be writable by the web server
- The plugin must be active and connected to the SEOvault backend (for webhook alerts)