Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# WordPress Courses
# WordPress Learn App

A personal study helper for [Learn WordPress](https://learn.wordpress.org/) courses. It runs as a WpApp at `/wordpress-courses/` and stores each student's course plans in WordPress.
A personal study helper for [Learn WordPress](https://learn.wordpress.org/) 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](https://github.com/akirk/wp-app), 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](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/akirk/wordpress-courses/refs/heads/main/blueprint.json)
[Test the prototype in WordPress Playground](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/akirk/learn-app/refs/heads/main/blueprint.json)

## 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.** `/wordpress-courses/` shows all active course plans when the user has more than one. If the user has one course, that course opens directly.
- **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.
Expand All @@ -24,20 +24,20 @@ Built on the [WpApp framework](https://github.com/akirk/wp-app), so the app live

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

Activate **WordPress Courses** in WordPress and visit `/wordpress-courses/`.
Activate **WordPress Learn** in WordPress and visit `/learn-app/`.

## Usage

| URL | Page |
| --- | --- |
| `/wordpress-courses/` | Course search, active-course overview, or the single active course |
| `/wordpress-courses/?course_search=credits` | Full-page Learn WordPress course search |
| `/wordpress-courses/?plan_id={id}` | One course plan with lesson checklist and sidebar progress |
| `/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

Expand Down Expand Up @@ -71,23 +71,17 @@ The Learn WordPress REST index advertises Application Passwords, but authenticat
## Architecture

```
wordpress-courses.php Plugin bootstrap
src/App.php WpApp setup, course-plan CPT, Learn API client, AJAX progress saves
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.

## Standards

```bash
php -l wordpress-courses.php
php -l src/App.php
php -l templates/index.php
```

## License

GPL-2.0-or-later
8 changes: 4 additions & 4 deletions blueprint.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"meta": {
"title": "WordPress Courses",
"title": "WordPress Learn",
"description": "A personal study helper for Learn WordPress courses with course plans, lesson checklists, dates, and progress tracking.",
"author": "Alex Kirk",
"categories": [
"Apps",
"Education"
]
},
"landingPage": "/wordpress-courses/",
"landingPage": "/learn-app/",
"steps": [
{
"step": "installPlugin",
"pluginData": {
"resource": "git:directory",
"url": "https://github.com/akirk/wordpress-courses",
"url": "https://github.com/akirk/learn-app",
"ref": "dist/main",
"refType": "branch"
},
"options": {
"activate": true,
"targetFolderName": "wordpress-courses"
"targetFolderName": "learn-app"
}
}
]
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordpress-courses/wordpress-courses",
"description": "Wordpress Courses - A WordPress app powered by WpApp",
"name": "akirk/learn-app",
"description": "WordPress Learn - A WordPress app powered by WpApp",
"type": "wordpress-plugin",
"license": "GPL-2.0-or-later",
"require": {
Expand Down
4 changes: 2 additions & 2 deletions wordpress-courses.php → learn-app.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/**
* Plugin Name: WordPress Courses
* Plugin Name: WordPress Learn
* Description: A WordPress app powered by WpApp.
* Version: 1.0.0
* Author: Alex Kirk
* Text Domain: wordpress-courses
* Text Domain: learn-app
* Requires PHP: 7.4
*/

Expand Down
Loading
Loading