Skip to content

Add IP-Based Bypass for Maintenance Mode #5

@giacomo-secchi

Description

@giacomo-secchi

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

  1. 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.
  2. Sanitization:

    • Implement an ad-hoc sanitization process for the admin field to ensure only valid IP addresses are accepted.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions