learn-app

A personal study helper for Learn WordPress courses with course plans, lesson checklists, dates, and progress tracking

1
1
1
PHP
public

Learn WordPress App

A personal study helper for Learn WordPress courses. It runs as a WpApp at /learn-app/ and stores each student’s course plans in WordPress.

The prototype is aimed at WordPress Credits students who need more structure than a plain course page: selected courses, start/end dates, progress, and a clear checklist of lessons to complete.

Built on the WpApp framework, so the app lives outside the active theme while still using WordPress users, capabilities, post storage, transients, nonces, and AJAX.

Test the prototype in WordPress Playground

Features

  • Learn WordPress course search. Reads public Learn WordPress REST API course data from https://learn.wordpress.org/wp-json/.
  • Course plans as posts. Each active course is a published wp_course_plan custom post authored by the current user. Trashing the post removes the course from the active list.
  • Multiple active courses. /learn-app/ shows all active course plans when the user has more than one. If the user has one course, that course opens directly.
  • Course view. ?plan_id={id} opens one course plan with a module/lesson checklist loaded from Learn WordPress Sensei course structure.
  • Autosaved progress. Checking or unchecking lessons saves immediately through authenticated WordPress AJAX and updates the course progress summary in the sidebar.
  • Dates and pacing. New course plans default to a start date of the day the plan was created and an end date 30 days later. The user can edit dates from the course sidebar.
  • Progress summaries. Course cards show completion percentage, lessons left, and days left until the target end date.
  • Undo remove. Removing a course trashes the plan post and shows an undo action on the next page.
  • No Learn auth required. The current useful flow reads public Learn WordPress content and stores personalization locally.

Install

cd wp-content/plugins
git clone <this-repo> learn-app
cd learn-app
composer install

Activate Learn WordPress in WordPress and visit /learn-app/.

Usage

URL Page
/learn-app/ Course search, active-course overview, or the single active course
/learn-app/?course_search=credits Full-page Learn WordPress course search
/learn-app/?plan_id={id} One course plan with lesson checklist and sidebar progress

Storage

Course plans are stored as wp_course_plan posts:

  • post_author: the student/user who owns the plan
  • post_status=publish: active course
  • post_status=trash: removed course
  • _wordpress_courses_course_id: Learn WordPress course ID
  • _wordpress_courses_completed_lesson_ids: completed Learn lesson IDs
  • _wordpress_courses_start_date: Y-m-d
  • _wordpress_courses_end_date: Y-m-d

Learn API responses are cached with WordPress transients to avoid hitting Learn WordPress on every request.

Learn WordPress API Notes

Useful public endpoints discovered during prototyping:

  • wp/v2/courses
  • wp/v2/lessons
  • sensei-internal/v1/course-structure/{course_id}
  • wp/v2/course-category
  • wp/v2/audience
  • wp/v2/level
  • wp/v2/topic
  • wp/v2/learning-pathway

The Learn WordPress REST index advertises Application Passwords, but authenticated student capabilities still need validation. The prototype intentionally does not depend on Learn WordPress authentication.

Architecture

learn-app.php          Plugin bootstrap
src/App.php            WpApp setup, hooks, AJAX progress saves
src/CoursePlans.php    Course-plan CPT, post meta, dates, and progress storage
src/LearnApi.php       Learn WordPress REST client and response normalization
templates/index.php    Main app view, course search, overview, course checklist, sidebar

Playground

The included blueprint.json installs the plugin from the repository’s dist/main branch, matching the dist branch generated by the GitHub workflow.

License

GPL-2.0-or-later

v0.3.3[beta]