=== EffortLess Maintenance Mode ===

Contributors:      	domclic
Donate link: https://id7.dev/donate/?plugin=effortless-maintenance-mode
Stable tag: 		1.1.8
Requires at least: 6.2
Tested up to:      	7.1
Requires PHP: 7.4
License: 		GPLv2 or later
License URI: 		https://www.gnu.org/licenses/gpl-2.0.html
Tags:              	effortless, maintenance, mode, wp

Easily enable and customize a maintenance page for your WordPress site.

== Description ==

EffortLess Maintenance Mode allows you to easily enable and customize a maintenance page while your site is under development or maintenance. This plugin provides a simple interface for adding custom HTML content to your maintenance page, ensuring that visitors know your site is temporarily unavailable. The maintenance page will show if the current user is not logged in or does not have admin capabilities.

== Installation ==

= Installation from within WordPress =

1. Visit **Plugins > Add New**.
2. Search for **EffortLess Maintenance Mode**.
3. Click **Install Now**, then **Activate**.

= Manual installation =

1. Upload the entire `effortless-maintenance-mode` folder to the `/wp-content/plugins/` directory.
2. Visit **Plugins**.
3. Activate **EffortLess Maintenance Mode**.

= Setting it up =

1. Go to **Settings > Maintenance Mode**.
2. Write the message visitors should see in the editor, or press one of the three template buttons to start from a ready-made one. Leaving it empty shows a built-in default notice.
3. Choose the response code: **503 Service Unavailable** tells search engines the outage is temporary and is the right choice for a planned window; **200 OK** suits a "coming soon" page on a site that is not published yet.
4. Under **Access**, optionally list IP addresses that should always reach the site, tick roles that may bypass the page, and tick any pages that must stay reachable (a contact or status page, for instance).
5. Flip the switch at the top of the screen to turn maintenance mode on. It saves immediately, without submitting the form.

Administrators always see the real site with a small banner reminding them maintenance mode is on, so you can check your work while visitors see the notice.

= On a multisite network =

The switch, the message and everything under Access are **network-wide**: one setting covers every site on the network, and only a network administrator can change them. Manage them under **Network Admin > Settings > Maintenance Mode**. An administrator of an individual site sees the same screen read-only under Settings > Maintenance Mode.

**Allowed pages are the exception.** Page IDs only mean something on the site they belong to, so each site keeps its own list and a site administrator can edit it. Choose the allowed pages for a site from that site's own Settings > Maintenance Mode screen, not from Network Admin.

== Frequently Asked Questions ==

= How do I customize the maintenance page? =

Go to **Settings > Maintenance Mode** and edit the content in the editor. On a multisite network, use **Network Admin > Settings > Maintenance Mode** instead — the message is shared by the whole network.

= Which pages can I keep reachable during maintenance? =

Any published Page can be ticked in the **Allowed pages** list, and it will load normally while the rest of the site shows the maintenance notice. Two limits are worth knowing: only Pages appear in the list (posts and custom post types do not), and a Page you have assigned as the **Posts page** under Settings > Reading cannot be used, because WordPress treats that address as the blog index rather than as that Page.

= Can I use custom HTML for the maintenance page? =

Yes! The plugin allows you to enter any HTML code to create a personalized maintenance message.

= Will the plugin affect the site's performance? =

No, this plugin is lightweight and will not significantly impact your site's performance. It is designed to be efficient and effective.

= How do I deactivate the maintenance mode? =

To deactivate maintenance mode, simply go back to Settings > Maintenance Mode and uncheck the "Enable Maintenance Mode" option, then save your changes.

== Changelog ==

= 1.1.8 =
* Fix: on a multisite network with a persistent object cache, switching maintenance mode on or off only took effect on the site it was switched from. Every other site carried on with the previous state for up to an hour — leaving the network reachable during a maintenance window, or sites stuck showing the maintenance page after it was switched off. The plugin's cached values are now shared across the network as they always should have been.
* Fix: an administrator of a single site could change the maintenance message, schedule, response code, IP list and role bypasses for **every** site on the network. Those settings are network-wide, so on multisite only a network administrator can change them now. The screen still opens for a site administrator, showing the network settings read-only alongside the allowed-pages list, which stays theirs to manage.
* Fix: a page allowed through during maintenance still loaded the maintenance stylesheet, which applies a global spacing reset and sizes `.wrapper` to the full window — so the one page meant to stay usable often rendered broken. The stylesheet is now loaded only for visitors actually seeing the maintenance page. The same fix applies to whitelisted IP addresses, bypass roles and administrators browsing the site.
* Fix: uninstalling the plugin left the allowed-pages setting behind on every site, so reinstalling silently restored old page bypasses. It is now removed, and on multisite the cleanup runs across all sites rather than only the one the plugin was deleted from.
* Fix: the bundled donate-notice class had no plugin prefix, so a second plugin shipping its own copy could win the name and break this one's settings page. It is now `ELMMP_Donate_Notice`.
* Fix: the installation instructions described a different plugin entirely, and pointed at a "Tools" menu the plugin does not use. Rewritten, with the settings actually documented — including which settings are network-wide on multisite and which are per-site.
* Change: added the minimum WordPress version to the plugin header. It was declared in readme.txt but missing from the plugin file itself.

= 1.1.7 =
* Change: tested against WordPress 7.1 and the "Tested up to" header updated to 7.1. No functional changes.
* Change: the donate notice's outbound link no longer includes the site address as a query parameter. It still identifies the plugin and version so support requests can be matched to a release, but not which installation was viewing it.

= 1.1.6 =
* Feature: Allowed pages — pick specific Pages that stay accessible to visitors while maintenance mode is active.

= 1.1.5 =
* Fix: maintenance page now intercepts 404s and redirect-candidate URLs by running at template_redirect priority 1, before WordPress canonical redirect processing.

= 1.1.4 =
* Fix: update plugin name casing to EffortLess; add plugin identifier to donate link.

= 1.1.3 =
* Fix: settings page now registers in every subsite admin on multisite, not only in the Network Admin — resolves "not allowed" error when clicking the admin-bar link from any frontend page or subsite.

= 1.1.2 =
* Fix: admin-bar indicator now updates live when the toggle is switched (no page reload required).
* Feature: maintenance toggle replaced by a CSS toggle switch for a cleaner settings page UI.

= 1.1.1 =
* Feature: admin-bar indicator shows Maintenance ON/OFF on every admin and frontend screen.
* Feature: TinyMCE rich-text editor replaces raw HTML textarea.
* Feature: three starter templates (Maintenance, Coming Soon, Under Construction).
* Feature: IP whitelist — configured IPs always see the live site during maintenance.
* Feature: role bypass — selected roles bypass the maintenance page.
* Feature: scheduled activation window with start/end datetime (site timezone).
* Feature: REST API — GET /wp-json/elmmp/v1/status and POST /wp-json/elmmp/v1/toggle.
* Feature: coming-soon mode — serve HTTP 200 instead of 503 for SEO-friendly pages.
* Feature: background image uploader for the maintenance page.
* Fix: uninstall.php now correctly removes all elmmp_* options.
* Refactor: internal prefix renamed from emmp_ to elmmp_ throughout the codebase.

= 1.0.34 =
* Feature: admin-bar indicator shows Maintenance ON/OFF on every screen.
* Feature: TinyMCE rich-text editor replaces raw HTML textarea.
* Feature: three starter templates (Maintenance, Coming Soon, Under Construction).
* Feature: IP whitelist — configured IPs always see the live site.
* Feature: role bypass — selected roles bypass the maintenance page.
* Feature: scheduled activation window (start/end datetime, site timezone).
* Feature: REST API GET /wp-json/elmmp/v1/status and POST /wp-json/elmmp/v1/toggle.
* Feature: coming-soon mode — serve HTTP 200 instead of 503.
* Fix: uninstall.php now removes all elmmp_* options correctly.
* Feature: background image uploader for the maintenance page.
* Refactor: renamed all internal prefixes from emmp_ to elmmp_ for consistency.

= 1.1.0 =
* Improvement: New versioning for new version

= 1.0.33 =
* Feature: "Enable Maintenance Mode" checkbox now auto-saves via AJAX on click — no page reload required.
* Feature: "Save Changes" button renamed to "Save custom HTML" and only persists the custom HTML textarea.

= 1.0.32 =
* Feature: donate notice now renders inline at the top of the settings page (below the title) instead of in the generic admin-notice area.

= 1.0.31 =
* Fix: PHPCS — correct file comment style in index.php stubs; add docblock header to scripts.js; end all inline JS comments with full stops.

= 1.0.30 =
* Fix: donate notice now also hooks network_admin_notices so it appears on Network Admin pages (multisite).

= 1.0.29 =
* Feature: multisite network support — one toggle now controls all sites; settings stored as network options.
* Feature: menu moved from Tools to Settings (single site) and Network Admin > Settings (multisite).
* Fix: object-cache layer now correctly distinguishes a cache miss from a stored falsy value using the $found parameter.
* Fix: cache is now invalidated immediately on save — the Settings API was bypassing the cache wrapper on every option update.
* Fix: wp_cache_flush() replaced with targeted key deletion to avoid evicting other plugins' cached data.
* Fix: admin JS now loads only on the plugin's own settings page, not on every admin screen.
* Fix: REST API, XML-RPC, and WP-Cron requests now bypass the maintenance page so background jobs and authenticated tooling are not disrupted.
* Fix: removed redundant unverified nonce field; settings form now uses a single nonce verified manually.
* Code: removed dead functions emmp_enqueue_styles(), emmp_update_cached_option(), emmp_clear_cache() and unused EMMP_COMPANY constant.

= 1.0.28 =
* Improvement: added dismissible donate notice on the plugin settings screen.
* Improvement: added Donate link header field and includes/class-donate-notice.php.

= 1.0.27 =

* Fix: Remove deprecated load_plugin_textdomain() call (not needed for wordpress.org-hosted plugins since WP 4.6)
* Fix: Add Requires PHP header to plugin file to match readme.txt
* Fix: Prefix global variables in uninstall.php with emmp_ to meet naming conventions

= 1.0.25 =

* Minor update

= 1.0.24 =

* Fix some issues

= 1.0.22 =

* Update cache fonctionnality 

= 1.0.21 =

* Not showing maintenance page if you're logged as administrator
* Add a notice for logged administrator

= 1.0.20 =

* Add cache purge after change

= 1.0.19 =

* Optimize the css file
* Fix the alert message not working

= 1.0.18 =

* Changes emm_ to emmp_ to comply wordpress.org advice

= 1.0.17 =

* Fix minor bugs 

= 1.0.16 =

* Add languages Italian and Portuguese

= 1.0.16 =

* Add default maintenance message if the textarea is empty

= 1.0.15 =

* Improved Naming Consistency: Renamed get_cached_option() to cmm_get_cached_option() for better consistency and conflict prevention.
* Escaping and Sanitization: Used esc_html__(), esc_textarea(), and esc_js() functions more consistently.
* Commenting: Added comments before each function for clarity.
* Spacing and Alignment: Reformatted spacing and alignment to match WordPress coding standards, such as placing spaces before function parameters and between operators.

= 1.0.14 =

* Fix uninstall.php

= 1.0.13 =

* Add company variable
* Fix issue with variables

= 1.0.12 =

* New versioning

== Upgrade Notice ==

= 1.0.25 =

* Minor update

== Screenshots ==

1. Screenshot of the settings page.
2. Example of the maintenance page.

== Reviews ==

We appreciate your feedback! Please leave a review.


