=== Smart Content Scheduler – Schedule Content by Date, Time & Roles === Contributors: pravin1996 Tags: smart content, content scheduler, schedule content, content visibility, gutenberg block Requires at least: 6.4 Tested up to: 7.1 Requires PHP: 7.4 Stable tag: 1.1.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html The smartest way to schedule and automate smart content visibility by dates, times, days, and user roles with blocks and shortcodes. == Description == **Smart Content Scheduler** allows you to schedule and control smart content visibility on your WordPress site using a visual Gutenberg block or clean shortcode. Perfect for limited-time offers, flash sales, support business hours, seasonal announcements, and member-exclusive deals. ### 🌟 Key Features * **Visual Gutenberg Block:** Add a "Scheduled Content" container block directly in the Block Editor with full sidebar controls. * **Live Running Server Clocks:** Real-time ticking digital clocks in admin settings for accurate scheduling verification. * **Date-Based Scheduling:** Set start and end dates (e.g. `2026-03-01` to `2026-03-15`). * **Daily Time Windows:** Show content only during specific hours (e.g. `09:00` to `17:00`). Supports overnight spans (e.g. `22:00` to `02:00`). * **Day-of-Week Targeting:** Show content on specific days like `mon,wed,fri`, `weekdays`, or `weekends`. * **User Role Restrictions:** Restrict visibility to `administrator`, `subscriber`, `customer`, `logged_in`, or `guest`. * **Fallback Content Support:** Display an alternative message or banner when the condition is not active. * **Automatic Site Timezone:** Defaults to your WordPress site timezone (`wp_timezone()`), with optional custom timezone override per shortcode or block. * **100% Lightweight:** 0 database queries, zero footprint, and high-performance execution. * **WordPress 7.1 & PHP 8.3+ Ready:** Strictly typed, fully sanitized, and compliant with WordPress Coding Standards (WPCS). == Installation == 1. Upload the plugin files to `/wp-content/plugins/pravin-smart-content-scheduler/` or install via the WordPress Plugins screen. 2. Activate the plugin through the **Plugins** screen in WordPress. 3. Visit **Settings → Content Scheduler** for documentation, parameters guide, and live time tester. == Frequently Asked Questions == = How do I use the Gutenberg Block? = In the WordPress block editor, click **+**, search for **Scheduled Content**, add any inner blocks inside it, and set your dates, times, days, and user roles from the right-hand sidebar inspector. = How do I use this plugin with shortcodes? = Wrap any content inside the `[pscs_schedule_content]` shortcode: `[pscs_schedule_content start_date="2026-03-01" end_date="2026-03-15"]Special Launch Deal![/pscs_schedule_content]` = How do I show content only during business hours? = `[pscs_schedule_content days="weekdays" start_time="09:00" end_time="17:00" fallback="We are closed."]Call us live now![/pscs_schedule_content]` = Can I show content only to guests / logged-out users? = Yes! Use `roles="guest"`: `[pscs_schedule_content roles="guest"]Sign up today for 10% off![/pscs_schedule_content]` = What timezone does it use? = By default, it uses your WordPress site's timezone configured in **Settings → General**. You can also override it in individual shortcodes or blocks using `timezone="Asia/Kolkata"` or `timezone="America/New_York"`. == Screenshots == 1. Plugin Backend settings. 2. Backend Shortcode settings. 3. Backend Block settings. 4. Frontend shortcode result. == Changelog == = 1.1.0 = * **Timezone Selection Option:** Added dedicated Timezone dropdown with major world timezones and live preview. * **Live Status Indicator:** Real-time visual ACTIVE (Green) / HIDDEN (Red) indicator in the Block Editor. * **Gutenberg Block Support:** Added visual "Scheduled Content" container block with inspector controls. * **Real-time Live Clocks:** Server time clocks in admin settings now tick live every second. * **WordPress 7.1 Compatibility:** Full support for WordPress 7.1 and PHP 8.0 - 8.3+. * **New Feature:** Added `days` attribute (`weekdays`, `weekends`, `mon,tue,...`). * **New Feature:** Added `fallback` attribute to display custom messages when inactive. * **New Feature:** Added support for `roles="guest"` and `roles="logged_in"`. * **Improvement:** Fixed daily recurring time window filtering when paired with date ranges. * **Improvement:** Default timezone now automatically inherits WordPress site timezone (`wp_timezone()`). * **UI:** Redesigned Settings & Documentation page with live clocks and one-click copy button. * **Code Quality:** Modernized to strict types, complete input sanitization, and output escaping. = 1.0.0 = * Initial release.