tombonez / wp-uptime-monitor-rest-api-endpoint
A WordPress plugin for adding a non-cacheable REST API endpoint to your website that can be used to monitor its uptime.
Installs: 4 513
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 2
Type:wordpress-muplugin
Requires
- php: >=7.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- roave/security-advisories: dev-latest
- wp-coding-standards/wpcs: ^3.0
This package is auto-updated.
Last update: 2024-10-17 06:39:08 UTC
README
A WordPress plugin for adding a non-cacheable REST API endpoint to your website that can be used to monitor its uptime.
Installation
- Download and unzip the plugin files.
- Upload the
wp-uptime-monitor-rest-api-endpoint
directory to your/wp-content/mu-plugins/
directory. - The endpoint will now be live at
https://example.com/wp-json/uptime-monitor/v1/check
.
Usage
Send a GET request to https://example.com/wp-json/uptime-monitor/v1/check
to monitor the uptime of your website.
Response
On successful communication with your website and the underlying database, the REST API will respond with "status" set to "online" and the current datetime "timestamp". The datetime format will be reflective of your SQL server's NOW() function output format.
If the website's server is not reachable or the database is inaccessible, you will receive an error message with HTTP status 503.
License
The code is available under the MIT License.