PHPackages                             vigilant/healthchecks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vigilant/healthchecks

ActiveWordpress-plugin[Utility &amp; Helpers](/categories/utility)

vigilant/healthchecks
=====================

WordPress plugin providing a health check endpoint.

1.0.4(4mo ago)00PHPPHP ^8.2CI passing

Since Dec 11Pushed 4mo agoCompare

[ Source](https://github.com/govigilant/wordpress-healthchecks)[ Packagist](https://packagist.org/packages/vigilant/healthchecks)[ RSS](/packages/vigilant-healthchecks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (5)Versions (6)Used By (0)

[ ![Banner](https://raw.githubusercontent.com/govigilant/wordpress-healthchecks/main/art/banner.png)](https://github.com/govigilant/vigilant "Vigilant")Vigilant WordPress Healthchecks
===============================

[](#vigilant-wordpress-healthchecks)

 [![Tests](https://camo.githubusercontent.com/0c2b30e9e056052d072bb1accc9849f2c14d8cb9b5c796f7fddbab3bd39ea49e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f766967696c616e742f776f726470726573732d6865616c7468636865636b732f74657374732e796d6c3f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/govigilant/wordpress-healthchecks) [![Analysis](https://camo.githubusercontent.com/de99fc528d75e46e186ab03ce7121285fd49d8ed730ededd3a802fad2c5f88d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f676f766967696c616e742f776f726470726573732d6865616c7468636865636b732f616e616c7973652e796d6c3f6c6162656c3d616e616c79736973267374796c653d666c61742d737175617265)](https://github.com/govigilant/wordpress-healthchecks)

A WordPress plugin that provides a healthcheck endpoint for any site and integrates seamlessly with [Vigilant](https://github.com/govigilant/vigilant).

Features
--------

[](#features)

- Secure REST endpoint (`/wp-json/vigilant/v1/health`) protected by a bearer token.
- Built-in scheduler heartbeat that verifies WP-Cron is running and reports failures back to Vigilant.
- Extensible registry so you can add your own checks or metrics alongside the built-in catalogue.

Configuration
-------------

[](#configuration)

### API token

[](#api-token)

- Navigate to **Settings → Vigilant Healthchecks** and paste the token generated by Vigilant or use your own if you do not use Vigilant.
- Every request to the health endpoint must send `Authorization: Bearer `.

### Checks and metrics

[](#checks-and-metrics)

- The settings page lists all available checks and metrics; toggle anything you do not need.
- Disabled checks are never instantiated, reducing overhead on constrained installs.

### Scheduler heartbeat

[](#scheduler-heartbeat)

- The plugin registers `vigilant_healthchecks_cron_monitor`, which is scheduled every minute.
- When WP-Cron runs, the last heartbeat timestamp is stored and surfaced through the Cron check.
- Adjust the allowed delay via the `vigilant_healthchecks_cron_threshold` filter (default 5 minutes).
- If you disable WP-Cron, ensure a system cron invokes `wp cron event run --due-now` so the monitor continues to run.

Usage
-----

[](#usage)

### REST endpoint

[](#rest-endpoint)

The health payload is exposed via the WordPress REST API:

```
POST /wp-json/vigilant/v1/health

```

Example request:

```
curl -X POST "https://example.com/wp-json/vigilant/v1/health" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json"
```

A `401 Unauthorized` response indicates the token has not been configured or is invalid.

### Registering custom checks and metrics

[](#registering-custom-checks-and-metrics)

Hook into `vigilant_healthchecks_prepare` to register additional checks or metrics before the payload is assembled:

```
use Vigilant\HealthChecksBase\Checks\Metric;
use Vigilant\WordpressHealthchecks\HealthCheckRegistry;

add_action('vigilant_healthchecks_prepare', function (HealthCheckRegistry $registry): void {
    $registry->registerCheck(MyCustomCheck::make());
    $registry->registerMetric(MyCustomMetric::make());
});
```

Custom checks must extend `Vigilant\HealthChecksBase\Checks\Check`, while metrics extend `Vigilant\HealthChecksBase\Checks\Metric`.

### Check availability

[](#check-availability)

Each check self-reports whether it can run (for example, the Redis check requires the PHP Redis extension). Inapplicable checks are skipped automatically so they do not produce noise in Vigilant.

Available Checks
----------------

[](#available-checks)

CheckDescription**DatabaseCheck**Verifies the WordPress database connection and executes a simple query.**SiteHealthCheck**Surfaces critical issues reported by WordPress Site Health.**CoreVersionCheck**Compares the installed core version against the latest release.**RedisCheck**Connects to the Redis instance defined by `WP_REDIS_*` constants and performs a `PING`.**PluginUpdatesCheck**Counts plugins with pending updates via `wp_update_plugins`.**CronCheck**Confirms WP-Cron has run within the configured threshold.Available Metrics
-----------------

[](#available-metrics)

MetricDescription**MemoryUsageMetric**Reports current system memory usage percentage.**DiskUsageMetric**Reports disk utilisation percentage.**CpuLoadMetric**Emits the 1-minute CPU load average.**DatabaseSizeMetric**Measures the total size of WordPress tables in megabytes (cached by default for 5 minutes).Events &amp; Filters
--------------------

[](#events--filters)

- `vigilant_healthchecks_prepare` - add or remove checks and metrics programmatically.
- `vigilant_healthchecks_cron_threshold` - override the maximum seconds between cron heartbeats.
- `vigilant_healthchecks_database_size_cache_ttl` - change the TTL (seconds) for cached database size calculations.
- `vigilant_healthchecks_force_core_update_check` / `vigilant_healthchecks_force_plugin_update_check` - force WordPress to refresh update metadata before running the respective checks.

Development Environment
-----------------------

[](#development-environment)

A ready-to-use Docker setup lives in `devenv/`.

1. Ensure Docker is running.
2. Start the stack: ```
    docker compose -f devenv/docker-compose.yml up --build
    ```
3. Visit  (WordPress admin: `admin` / `secret`).
4. The plugin is mounted from your working copy and activated automatically; configure the token from the settings page and test the endpoint locally: ```
    curl -X POST "http://localhost:8000/wp-json/vigilant/v1/health" \
      -H "Authorization: Bearer YOUR_TOKEN" \
      -H "Content-Type: application/json"
    ```

Quality
-------

[](#quality)

Install dependencies and run the existing toolchain:

```
composer install
./vendor/bin/phpunit
./vendor/bin/phpstan analyse
```

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) for details on how to report vulnerabilities.

Credits
-------

[](#credits)

- [Vincent Boon](https://github.com/VincentBean)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance74

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f21e3a721fc25c880371c5d3af4925fe83e4b9d425bf50a2cbce18ee1af45931?d=identicon)[vincentbean](/maintainers/vincentbean)

---

Top Contributors

[![VincentBean](https://avatars.githubusercontent.com/u/3906942?v=4)](https://github.com/VincentBean "VincentBean (12 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/vigilant-healthchecks/health.svg)

```
[![Health](https://phpackages.com/badges/vigilant-healthchecks/health.svg)](https://phpackages.com/packages/vigilant-healthchecks)
```

###  Alternatives

[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[codefog/contao-news_categories

News Categories bundle for Contao Open Source CMS

3183.3k6](/packages/codefog-contao-news-categories)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
