Simple WordPress health check endpoint
composer require frosty-media/wp-health-checkComposer autoloading should be including in application's bootstrap, in this case the wp-config.php file.
If running Nginx, add the following to your sites conf rules:
rewrite ^/meta/health-check/?$ /vendor/frosty-media/wp-health-check/src/check.php last;If running Apache, add the following to your .htaccess file (before any WordPress rules):
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^meta/health-check/?$ /vendor/frosty-media/wp-health-check/src/check.php [L]
</IfModule>If you would like to include the MU Plugin (which creates the internal REST API route wp-json/health/check?)
Update your scripts.post-update-cmd, or run
composer config scripts.post-update-cmd.0 "FrostyMedia\\WpHealthCheck\\Composer\\Scripts::postUpdate"
{
"scripts": {
"post-update-cmd": [
"FrostyMedia\\WpHealthCheck\\Composer\\Scripts::postUpdate"
]
}
}