LW LMS
Lightweight LMS plugin for WordPress - courses, lessons, and progress tracking without the bloat.
Overview
| Requires WordPress | 6.0+ |
| Requires PHP | 8.1+ |
| Tested up to | 6.7 |
| License | GPL-2.0-or-later |
| GitHub | lwplugins/lw-lms |
Installation
composer require lwplugins/lw-lmsOr upload the lw-lms folder to /wp-content/plugins/ and activate through the Plugins menu.
Requirements
- PHP 8.1 or higher
- WordPress 6.0 or higher
- WooCommerce (optional, for paid courses)
- WooCommerce Subscriptions (optional, for subscription-based access)
Features
Course Management
- Custom post type for courses with Gutenberg support
- Course sections for organizing lessons
- Multiple access types: open, free (login required), paid (WooCommerce)
- Course attachments and downloads
- Course categories, tags, and difficulty levels
- Instructor field per course
Lesson Management
- Custom post type for lessons with Gutenberg support
- Video support (YouTube, Vimeo, Wistia, self-hosted)
- Lesson attachments and downloads
- Automatic video provider detection
Progress Tracking
- Track user progress through courses
- Mark lessons as completed
- Course completion percentage
- Per-user progress storage
WooCommerce Integration
- Link courses to WooCommerce products
- WooCommerce Subscriptions support
- Automatic access control based on purchases
- Time-limited course access (per-product duration)
Admin Interface
- Intuitive course content builder
- Drag-and-drop lesson ordering
- Section management
- Access control settings
- Manual course enrollment on user profile pages
- Enrollment table with course name, source, granted date, and expiry
Settings
Configure under LW Plugins > LMS. Manage courses under Courses > Add New and lessons under their respective courses.
REST API
LW LMS provides a full REST API for headless implementations at /wp-json/lms/v1/.
| Endpoint | Description |
|---|---|
| Course endpoints | List and retrieve courses |
| Lesson endpoints | List and retrieve lessons |
| Progress endpoints | Track and update user progress |
| Download endpoints | Protected file downloads |
WP-CLI Commands
# Migrate from LearnDash
wp lw-lms migrate-learndash
wp lw-lms migrate-learndash --dry-run --verboseThe migration command supports --dry-run and --verbose flags and migrates courses, lessons, sections, and lesson order from LearnDash.
AI Abilities
When used with LW Site Manager, the following abilities are available for AI agents. All abilities are registered under the lms category.
lw-lms/list-courses (readonly)
List all published courses with basic metadata.
Permission: can_edit_posts
Input:
| Field | Type | Required | Description |
|---|---|---|---|
per_page | integer | no | Courses per page (default: 20) |
page | integer | no | Page number (default: 1) |
Output:
{
"success": true,
"courses": [
{
"id": 42,
"title": "Intro to PHP",
"status": "publish",
"url": "https://example.com/course/intro-to-php",
"access_type": "free",
"duration": "2h",
"instructor": "Jane Doe"
}
],
"total": 5
}lw-lms/get-course (readonly)
Get full course details including lessons and sections.
Permission: can_edit_posts
Input:
| Field | Type | Required | Description |
|---|---|---|---|
course_id | integer | yes | Course post ID |
Output:
{
"success": true,
"course": {
"id": 42,
"title": "Intro to PHP",
"status": "publish",
"url": "https://example.com/course/intro-to-php",
"access_type": "free",
"duration": "2h",
"instructor": "Jane Doe",
"content": "<p>Course description...</p>",
"excerpt": "Learn PHP from scratch.",
"sections": [
{ "id": "sec-1", "title": "Getting Started", "order": 1 }
],
"lessons": [
{
"id": 55,
"title": "Hello World",
"section_id": "sec-1",
"order": 1,
"duration": "10m"
}
]
}
}lw-lms/get-progress (readonly)
Get user progress for a course, including per-lesson completion status.
Permission: can_edit_posts
Input:
| Field | Type | Required | Description |
|---|---|---|---|
user_id | integer | yes | WordPress user ID |
course_id | integer | yes | Course post ID |
Output:
{
"success": true,
"progress": {
"user_id": 7,
"course_id": 42,
"percentage": 50,
"completed_lessons": 2,
"total_lessons": 4,
"is_completed": false,
"lessons": {
"55": { "status": "completed", "completed_at": "2025-03-10 14:22:00" },
"56": { "status": "completed", "completed_at": "2025-03-11 09:05:00" },
"57": { "status": "in_progress", "completed_at": null }
}
}
}lw-lms/set-progress (write)
Update lesson completion status for a user. Upserts the progress record.
Permission: can_edit_posts
Input:
| Field | Type | Required | Description |
|---|---|---|---|
user_id | integer | yes | WordPress user ID |
course_id | integer | yes | Course post ID |
lesson_id | integer | yes | Lesson post ID |
status | string | yes | completed, in_progress, or not_started |
Output:
{
"success": true,
"message": "Progress updated."
}lw-lms/get-options (readonly)
Get global LW LMS plugin settings.
Permission: can_manage_options
Input: none
Output:
{
"success": true,
"options": {
"courses_per_page": 10,
"show_progress_bar": true,
"enable_preview_lessons": true,
"default_access_type": "free",
"woo_enabled": true,
"delete_data_on_uninstall": false
}
}Error Responses
All abilities return a WP_Error on failure. Common error codes:
| Code | Status | Description |
|---|---|---|
missing_course_id | 400 | course_id not provided |
missing_params | 400 | Required fields missing |
invalid_status | 400 | Status value not in allowed list |
not_found | 404 | Course not found |
course_not_found | 404 | Course not found (in progress endpoints) |
user_not_found | 404 | User not found |
lesson_not_found | 404 | Lesson not found or wrong post type |
save_failed | 500 | Database write failed |
FAQ
Do I need WooCommerce?
No, WooCommerce is only required if you want to sell courses. Open and free courses work without WooCommerce.
Can I use this with a headless frontend?
Yes, LW LMS provides a full REST API at /wp-json/lms/v1/ for headless implementations.
How do I create a course?
Go to Courses > Add New in your WordPress admin. Use the Gutenberg editor for course content, then use the metaboxes to add sections, lessons, and configure access settings.
How do I track user progress?
User progress is automatically tracked when users complete lessons via the REST API. You can view progress in the admin or query it via the API.