devuri / advanced-custom-site-status
Adds a custom health check endpoint with rate limiting to your WordPress site. Supports a customizable endpoint slug through a constant.
Installs: 159
Dependents: 2
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 2
Type:wordpress-plugin
Requires
- php: ^7.3 || ^7.4 || ^8.0 || ^8.1
- ext-curl: *
- ext-json: *
Requires (Dev)
- ergebnis/composer-normalize: ^2.42
- fakerphp/faker: ^1.23
- phpstan/phpstan: ^1.10
- symfony/var-dumper: ^5.4
- szepeviktor/phpstan-wordpress: ^1.3
- yoast/phpunit-polyfills: ^2.0
This package is auto-updated.
Last update: 2024-12-02 02:27:14 UTC
README
Advanced Custom Site Status is a WordPress plugin that adds a custom health check endpoint with rate limiting to your WordPress site. This endpoint is specifically designed to check database connectivity, ensuring your WordPress site's database is accessible and responsive. The plugin supports a customizable endpoint slug through a constant, allowing for personalized integration into your WordPress environment.
Features
- Custom Health Check Endpoint: Provides a dedicated URL to check the site's health, focusing on database connectivity.
- Rate Limiting: Protects your site from potential abuse by limiting the number of health check requests within a specific time frame.
- Customizable Endpoint Slug: Allows the setting of a custom slug for the health check endpoint through a WordPress constant.
Requirements
- WordPress 5.3.0 or higher
- PHP 7.3.5 or higher
Installation
Via Composer
To install the plugin using Composer, run the following command:
composer require devuri/advanced-custom-site-status
Replace your-vendor
with your actual vendor name on Packagist if you have submitted the plugin there.
Manual Installation
- Download the plugin files from the GitHub repository.
- Upload the
advanced-custom-site-status
directory to your WordPress site'swp-content/plugins/
directory. - Activate the plugin through the 'Plugins' menu in WordPress.
Configuration
To customize the endpoint slug, define the CUSTOM_HEALTH_CHECK_SLUG
constant in your wp-config.php
file like so:
define('CUSTOM_HEALTH_CHECK_SLUG', 'my-custom-health-endpoint');
If the constant is not defined, the plugin will default to using health-check-site-status
as the endpoint slug.
Usage
After installation and activation, the health check can be accessed via the configured slug (or the default slug if not configured). For example:
https://yourdomain.com/my-custom-health-endpoint
This URL will return a JSON response indicating the health status of your WordPress site's database.
Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues to improve the plugin.
License
The plugin is licensed under the GPLv2. For more details, see the License URI.