This plugin provides an Oh Dear Application Health checker for Craft CMS.
This plugin performs the following health checks and provides a JSON feed at /application-health.json
for Oh Dear.
The response is cached for 5 minutes.
Checks if updates are available for Craft CMS and installed plugins, including critical ones.
Monitors the number of jobs in the queue and detects failed, reserved, or delayed jobs using configurable thresholds.
Verifies if there are any unapplied database migrations.
Counts recent errors in today’s log files (web.log
, queue.log
, console.log
).
Checks if a .git
repository exists and whether there are uncommitted changes.
Fetches site headers and verifies the presence of key security headers (e.g., CSP, HSTS, X-Frame-Options).
Confirms if the project configuration is fully synchronized.
Reports the active PHP version running on the server and verifies it against a minimum required version.
Lists all admin users and flags users who haven’t logged in for a configurable period.
Monitors disk space usage and flags if usage exceeds a configurable threshold.
(Disabled by default to avoid noise on shared servers.)
This plugin requires Craft CMS 4.0.0+ or 5.0.0+.
You can install this plugin from the Plugin Store or with Composer.
Go to the Plugin Store in your project’s Control Panel and search for “Oh Dear Application Health”. Then click on the “Install” button in its modal window.
Open your terminal and run the following commands:
# Go to the project directory
cd /path/to/my-project.test
# Tell Composer to load the plugin
composer require perfectwebteam/craft-ohdear-application-health
# Tell Craft to install the plugin
./craft plugin/install ohdear-application-health
Once Oh Dear Application Health is installed:
- Go to your site in Oh Dear and activate the Application health check.
- Set the Health Report URL to
https://www.yourdomain.com/application-health.json
. - Copy the Health Report Secret value and set it as value for
OH_DEAR_HEALTH_REPORT_SECRET=
in your.env
file. - Optionally add a
config/ohdear-application-health.php
configuration file in which you can override the default settings.
Example configuration:
<?php
return [
'checks' => [
'addUpdateCheck' => true,
'addQueueCheck' => true,
'addPendingMigrationsCheck' => true,
'addProjectConfigCheck' => true,
'addErrorLogCheck' => true,
'addGitChangesCheck' => true,
'addSecurityHeadersCheck' => true,
'addPhpVersionCheck' => true,
'addAdminUsersCheck' => true,
'addDiskUsageCheck' => false,
],
'oldestUpdateWarningDays' => 30,
'minimumPhpVersion' => '8.1.0',
'requiredSecurityHeaders' => [
'Content-Security-Policy',
'X-Frame-Options',
'Strict-Transport-Security',
'X-Content-Type-Options',
'Referrer-Policy',
'Permissions-Policy',
],
'inactiveAdminThreshold' => '-1 year',
'gitRepoPath' => '@root',
'queueTotalThreshold' => 10,
'queueFailedThreshold' => 2,
'diskUsagePath' => '/',
'diskUsageThreshold' => 90,
];
Brought to you by Perfect Web Team