LW LMS drip and linear progression
Use the plugin's progression model and diagnostic command. Do not reproduce the schedule in frontend code.
Model
free: any accessible lesson can open in any order; stored drip rules are dormant.linear: the prior lesson must be complete, then course, section, and lesson time constraints are combined. The latest opening time wins.- Course delay supports
enrollmentmode. - Section and lesson rules support
none,enrollment, andprevious. - Units are
hour,day,week, andmonth; the integer delay is0..999. previouswith delay zero remains an active rule: open as soon as the prior prerequisite is complete.
The course outline places sectionless lessons first, then ordered sections and their lessons. Orphan lessons that name a missing section are omitted from the drip sequence until the assignment is corrected.
Configure from WP-CLI
wp lw-lms course set-drip 42 --progression=linear --delay=2 --unit=day
wp lw-lms lesson set-drip 101 --mode=enrollment --delay=1 --unit=week
wp lw-lms lesson set-drip 102 --mode=previous --delay=3 --unit=day
wp lw-lms lesson set-drip 103 --mode=none
A lesson rule saved on a free course stays dormant and the command warns about it. Switch the course to linear to enforce sequence and schedule.
Inspect one learner:
wp lw-lms drip status alice 42
wp lw-lms drip status alice 42 --format=json
The rows contain position, lesson_id, title, section, rule, state, reason, available_at, and completed_at.
Control the learner's course clock only for administrative correction or testing:
wp lw-lms drip set-start alice 42 --date="2026-09-01 09:00:00"
wp lw-lms drip set-start alice 42 --now
wp lw-lms drip set-start alice 42 --clear
Clearing means the next access creates a new clock. It does not restore an earlier grant timestamp manually removed from user meta.
Clock rules
The clock is stored in _lw_lms_course_start_{course_id}. The first grant wins. For an existing stored enrollment, LW LMS recovers the earliest grant time. Runtime-only subscription or membership access starts on first visit because no access row exists.
Do not reset this meta on a repeated grant. CourseStart::on_grant() intentionally preserves the first value.
REST contract
GET /lms/v1/courses/{id} adds:
- top-level
progression(freeorlinear); - each lesson row's
accessible; locked_reason:sequence,schedule, ornull;available_at: ISO 8601 time ornull.
While locked, lesson detail, progress writes, quiz submission, and protected downloads return:
{
"code": "lesson_locked",
"message": "This lesson is not available yet.",
"data": {
"status": 403,
"locked_reason": "schedule",
"available_at": "2026-10-01T09:00:00+02:00"
}
}
Render sequence as waiting for a prerequisite. Render schedule against the server-provided timestamp. Do not calculate a second client-side timetable.
Exemptions
LW LMS leaves a lesson open when it is already complete or marked preview. It skips all course locks for an open course, optional staff access, or a completed-course snapshot. Users without course entitlement are denied by access before pacing matters. Administrative force-complete and Site Manager progress operations can write past learner pacing.
Extending locks
The filter receives the complete map:
add_filter(
'lw_lms_lesson_locks',
static function ( array $locks, int $course_id, int $user_id ): array {
// Add or remove narrowly scoped entries.
return $locks;
},
10,
3
);
Each entry is keyed by lesson ID and contains reason and available_at (Unix timestamp or null). Returning a non-array becomes an empty map, which opens all lessons.
Verified 2.0.0 limitation
On a non-UTC WordPress timezone, a completion timestamp used by a previous rule is currently shifted by the site's UTC offset. A zero-delay next lesson can therefore remain schedule-locked for that offset. The 2.0.0 live test on Europe/Budapest returned an opening time two hours after the just-recorded completion. Treat exact previous-completion schedules as affected until the plugin fixes its site-local MySQL timestamp conversion.
Diagnostic workflow
- Confirm the course uses
linearprogression. - Run
wp lw-lms drip status <user> <course> --format=json. - Check course entitlement and Staff Access before changing rules.
- Check the stored course start and the earliest durable grant.
- Confirm the preceding lesson/section is actually complete.
- Compare server time, WordPress timezone,
completed_at, andavailable_atwhen a schedule appears offset. - Check preview and course-completion exemptions.
- Inspect
lw_lms_lesson_lockscallbacks last.
Cross-references
- Use
lw-lms-rest-frontendfor the complete learner REST shape. - Use
lw-lms-wp-cli-operationsfor the full command catalog. - Use
lw-lms-quiz-integrationwhen quiz pass controls completion. - Use
lw-lms-backend-extendfor access/progress repositories and hook contracts.
References
- Official repository: <https://github.com/lwplugins/lw-lms>
- Verified source paths:
includes/Drip/CourseStart.phpincludes/Drip/CoursePlan.phpincludes/Drip/LessonLocks.phpincludes/Drip/LessonScheduler.phpincludes/Drip/DripTime.phpincludes/Api/LessonLockError.phpincludes/CLI/DripStatusCommand.phpincludes/CLI/DripSetStartCommand.php