Improvement: Add "Bypass Maintenance IPs Allow List" to Maintenance Mode Feature
Description
This is an improvement of an existing feature in the WritePoetry plugin that allows the admin to set the website in maintenance mode from the admin panel.
New Feature: Bypass Maintenance IPs Allow List
-
Add an admin field named: Bypass maintenance IPs allow list.
- The field will accept a comma-separated list of IPs.
- Users with IPs listed in this field will be able to access the website even if it is under maintenance mode.
-
Sanitization:
- Implement an ad-hoc sanitization process for the admin field to ensure only valid IP addresses are accepted.
-
Field Visibility:
- Evaluate the option to hide the field when the maintenance mode is not enabled in order to improve the user experience and avoid confusion.
Additional Notes:
- Suggested field name:
{$this->prefix}_maintenance_allowed_ip.
- A method to get the current user's IP (
Utils::get_user_ip()) has already been developed and should be used for this feature.
References:
Acceptance Criteria:
- The admin can add a comma-separated list of IPs in the new "Bypass maintenance IPs allow list" field.
- IPs listed in the field should bypass the maintenance mode and access the website.
- The field is sanitized to ensure only valid IP addresses are allowed.
- The field is hidden if the maintenance mode is not enabled.
- Existing method
Utils::get_user_ip() is utilized to identify the user's IP.
Improvement: Add "Bypass Maintenance IPs Allow List" to Maintenance Mode Feature
Description
This is an improvement of an existing feature in the WritePoetry plugin that allows the admin to set the website in maintenance mode from the admin panel.
New Feature: Bypass Maintenance IPs Allow List
Add an admin field named:
Bypass maintenance IPs allow list.Sanitization:
Field Visibility:
Additional Notes:
{$this->prefix}_maintenance_allowed_ip.Utils::get_user_ip()) has already been developed and should be used for this feature.References:
enable_maintenance_modefilterAcceptance Criteria:
Utils::get_user_ip()is utilized to identify the user's IP.