=== Content Time Lock ===
Contributors: wpmakedev
Tags: drip content, content schedule, timed content, restrict by date, course drip
Requires at least: 5.5
Tested up to: 6.9
Stable tag: 1.1.2
Requires PHP: 7.4
License: GPLv2
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Lock WordPress posts until a scheduled date or until N days after each user registers. Drip course lessons automatically — no membership plugin needed.

== Description ==

Students who can access your entire course on day one will binge it. By week three they are stuck, overwhelmed, or gone — and asking for refunds. You built the course as a week-by-week journey, but your delivery system does not enforce that pace.

Content Time Lock fixes this without a $179-per-year membership plugin. Choose between two unlock modes: set a fixed calendar date that applies to everyone, or set a number of days after each user registers so every student gets their own personal drip schedule. Until the content unlocks, students see a message you write. When the time arrives, the content unlocks automatically — no manual steps, no developer help required.

**What you can do with it:**

* **Lock any post, page, or custom post type until a date and time you pick.** Set the unlock date right inside the post editor, one field, one click. Works with standard posts, pages, and any custom post type.
* **Drip content relative to each user's registration date.** Instead of a fixed date, set a number of days after signup — Lesson 2 unlocks 7 days after each student registers, Lesson 3 unlocks 14 days after, and so on. Every student gets their own personal schedule automatically.
* **Show students a live countdown timer.** While the content is locked, students see a ticking timer — "Unlocks in 3 days, 4 hours, 12 minutes." Three display styles to choose from: simple text, flip-card, or circular. When the countdown hits zero, the page tells them the content just unlocked and prompts a refresh.
* **Restrict by user role.** Choose whether to lock content for all logged-in users, specific roles only, or guest visitors. Administrators always see everything regardless of lock settings.
* **Write your own locked-state message.** Replace the default placeholder text with whatever you want students to see — HTML supported. Set a global default and override it per post when you need different messages for different lessons.
* **Add a call-to-action button on the locked screen.** Point students somewhere useful while they wait — a prerequisite lesson, a community forum, or a welcome page. Custom label and URL, toggled per post.

**What this plugin does not do:** Content Time Lock has no payment processing, no email opt-in gates, and no membership tiers — it locks and unlocks content by date or registration offset and user role, nothing else.

== Installation ==

1. Upload the `content-time-lock` folder to `/wp-content/plugins/` or install through **Plugins → Add New**.
2. Activate the plugin.
3. Go to **Time Locker → Settings** to set your global defaults — lock message, countdown style, and custom CSS class.
4. Open any post or page, find the **Time Lock Content** metabox, check **Enable Time Lock**, choose who to restrict, select a lock mode (fixed date or days after registration), fill in the unlock value, and save.
5. That is it. The content is now hidden until the date or registration offset you set.

== Frequently Asked Questions ==

= Do my students need an account? =

Yes, for most setups. The plugin restricts content by user role — so to keep lessons away from everyone except paying students, those students need a WordPress user account with the right role. You can create accounts manually, let students register themselves, or connect any plugin that assigns roles on signup or purchase (WooCommerce + User Role Editor, for example). Guest lockout is also available if you want to block unregistered visitors entirely.

= Will this work with my theme? =

Almost certainly yes. The plugin hooks into `the_content` filter — the standard WordPress mechanism that every well-built theme uses to output post content. It also has specific compatibility handling for Elementor, Beaver Builder, and SiteOrigin Page Builder. If you hit an issue with a particular theme or builder, open a support thread with the theme name and we will take a look.

= Can I drip content based on when someone registers? =

Yes. Set the lock mode to "Unlock X days after user registers" and enter the number of days. Each logged-in user's unlock time is calculated from their individual account creation date — so a student who registers today and one who registered last month each get their own personal schedule. Guest visitors always see the locked state when this mode is active since they have no registration date.

= What is the difference between the two lock modes? =

**Unlock on specific date** — one fixed calendar date and time applies to all visitors equally. Use this for cohort-based courses where everyone starts together (e.g. a live workshop launching on 1 June).

**Unlock X days after user registers** — each user gets a personal unlock time calculated as their registration date plus however many days you set. Use this for self-paced courses where students can enrol at any time and still follow the same relative schedule.

= Does this work with WooCommerce? =

Yes, indirectly. Content Time Lock does not connect to WooCommerce orders or subscriptions directly — it does not know when someone purchased. What it does do is restrict content by WordPress user role. If you use WooCommerce with a role-assigning plugin (like WooCommerce Memberships or the free User Role Editor), customers who buy get a specific role, and you can lock your lessons to that role. Use the fixed-date mode for cohort launches or the days-after-registration mode for self-paced access. WooCommerce decides who has access; this plugin decides when they get it.

== Screenshots ==

1. The Time Lock metabox inside the post editor — choose a lock mode, set an unlock date or registration offset, pick a role restriction, and optionally override the global message.
2. The locked content placeholder as a student sees it, with the countdown timer running.
3. The three countdown timer styles: text, flip-card, and circular.
4. The global settings page under Time Locker → Settings.
5. The All Time Locks admin list — every locked post with its unlock date (or registration offset) and current status.

== Changelog ==

= 1.1.2 – 19/05/2026 =
* Feature - Added "Days after registration" lock mode as an alternative to the fixed unlock date. Content unlocks individually for each user based on their account creation date plus a configurable number of days.
* Feature - New "Lock Mode" radio group in the Time Lock metabox lets you switch between "Unlock on specific date" (existing) and "Unlock X days after user registers" (new).

= 1.1.1 – 21/04/2024  =
* Fix   - Metabox design.

= 1.1.0 – 21/04/2024  =
* Lock any post, page, or custom post type until a specific date and time.
* Role-based restrictions: lock content for all logged-in users, specific roles, or guests.
* Live countdown timer in three display styles: text, flip-card, and circular SVG.
* Per-post settings override global defaults for lock message, countdown visibility, timer style, and CTA button.
* Call-to-action button with custom label and URL on the locked-content screen.
* Administrators always bypass all locks.
* Page builder compatibility for Elementor, Beaver Builder, and SiteOrigin.
* Global settings page under Content Time Lock admin menu.
* All Time Locks admin list with status badges and unlock-date sorting.

= 1.0.0 - 07/14/2025 =
* Initial release.
