=== Smart Maintenance Scheduler ===
Contributors: shyamkariya  
Tags: maintenance, scheduler, maintenance mode, downtime, auto maintenance  
Requires at least: 5.0  
Tested up to: 7.1  
Requires PHP: 7.4  
Stable tag: 1.2  
License: GPLv2 or later  
License URI: https://www.gnu.org/licenses/gpl-2.0.html  

Easily schedule and automate WordPress maintenance mode with custom messages, start/end times, and full control.

== Description ==

**Smart Maintenance Scheduler** helps you schedule and automate maintenance mode on your WordPress site. Whether you're pushing updates or fixing bugs, this plugin makes it easy to inform your visitors with a clean, customizable message during planned downtime.

**Features:**

- Schedule start and end time for maintenance mode
- Custom maintenance message with HTML support
- Works with WordPress timezones
- Optionally allow logged-in users to bypass maintenance screen
- Lightweight, no bloat

Perfect for developers, site maintainers, or agencies handling client updates.

== Installation ==

1. Upload the plugin folder `smart-maintenance-scheduler` to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **Settings > Maintenance Scheduler** and configure your maintenance schedule.

== Frequently Asked Questions ==

= Can logged-in users see the site during maintenance? =  
Yes! By default, logged-in users (e.g., admins) will bypass the maintenance screen.

= What format should I use for the date and time? =  
Use `YYYY-MM-DD HH:MM`, for example: `2025-04-25 13:00`. It uses the WordPress site timezone setting.

= Can I customize the message? =  
Yes, you can use plain text or HTML to display any message to your visitors using the built-in rich text editor.

== Screenshots ==

1. Settings page where you can schedule maintenance
2. Example of maintenance message shown to visitors

== Changelog ==

= 1.2 =
* Feature: Added rich text WYSIWYG editor (`wp_editor`) for custom HTML maintenance messages.
* Security: Implemented standard WordPress sanitization callbacks (`rest_sanitize_boolean`, `sanitize_text_field`, `wp_kses_post`).
* Fix: Fixed timezone offset calculation by utilizing `wp_timezone()`, `date_create()`, and `current_datetime()`.
* Optimization: Restricted `datetimepicker.js` admin script enqueue to the plugin settings page only.

= 1.1 =
* Initial release: schedule-based maintenance mode with customizable messages

== Upgrade Notice ==

= 1.2 =
Upgrade to v1.2 for customizable HTML maintenance messages, timezone accuracy fixes, and security enhancements.

= 1.1 =
Initial version. No upgrade steps required.

== License ==

This plugin is free software licensed under the GPL v2 or later.
