WP Manifestindependent plugin directory
manifest / utilities / wp-monitor-key

WP Monitor Key

WordPress Plugin for use with monitoring applications like Uptime Robot. It as a unique key to the footer source code as a HTML comment which can be added to monitoring software to monitor instead of standard HTTP codes as HTTP codes can often be incorrect.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/zacdreyer/wp-monitor-key/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

WP Monitor Key Logo

WP Monitor Key is a WordPress plugin that injects a unique 25-character marker key into frontend HTML as a footer comment. Monitoring platforms can check page source for that marker to verify full render behavior, rather than relying only on HTTP status codes.

Quick Facts

  • Option name: wpm_monitor_key
  • Key format: 25 alphanumeric characters
  • Marker format: ``
  • Settings location: Tools > Monitor Key
  • Target: WordPress 6.x

Features

  • Auto-generate key on activation if missing
  • Editable key in admin UI
  • One-click key regeneration
  • Frontend footer comment injection
  • Key change log (action, user, old/new key, timestamp)
  • Automated unit tests for core plugin logic

Documentation Index

Core documentation:

Agent guidance:

Implementation files:

Test and tooling files:

Installation

  1. Clone or copy this directory into WordPress plugins:
/wp-content/plugins/wp-monitor-key/
  1. Activate WP Monitor Key from WordPress Admin > Plugins.
  2. Go to WordPress Admin > Tools > Monitor Key.

Usage

  1. Open Tools > Monitor Key.
  2. Copy current key, edit it manually, or generate a new one.
  3. Add a page-source check in your monitoring tool.

Regex example:

<!-- WP Monitor Key: [a-z0-9]{25} -->

Exact-match example:

<!-- WP Monitor Key: abcde12345fghij67890klmno -->

How It Works

  1. On activation, plugin creates a key if one is not present.
  2. Plugin injects marker comment into frontend output via wp_footer.
  3. Monitoring system checks source for the marker.
  4. Admin actions for edit/regenerate are logged.

Security and Behavior Notes

  • This is not an authentication key and is intentionally visible in source.
  • Admin writes require manage_options capability.
  • Admin writes require valid nonce.
  • Inputs are sanitized and outputs are escaped.

Testing

Automated tests use PHPUnit + Brain Monkey.

Run locally:

composer install
composer test

If composer is not installed on your machine, install Composer first, then rerun the commands above.

Detailed testing instructions are in TESTING.md.

Troubleshooting

Marker not present:

  1. Verify plugin is active.
  2. Verify key exists in Tools > Monitor Key.
  3. Check frontend page source (not admin pages).
  4. Search source for WP Monitor Key.

Monitoring does not match marker:

  1. Confirm monitor is checking full HTML response body.
  2. Confirm regex pattern is correct.
  3. Confirm URL being checked is the intended frontend route.

Support

Issues and feature requests:

License

GPL v2 or later.