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
28 changes: 28 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Files and folders excluded from the distributable plugin zip.
# Patterns are rsync --exclude-from compatible.

.git/
.github/
.gitignore
.gitattributes
.distignore
.vscode/
.editorconfig
.DS_Store

node_modules/
tests/
coverage/
docs/

phpcs.xml
phpunit.xml.dist
vitest.config.js
webpack.config.js
tsconfig.json
package-lock.json
composer.lock

CHANGELOG.md
fix-step2.php
fix-tour2.php
61 changes: 61 additions & 0 deletions .github/workflows/manually-build-zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Manually build plugin zip

on:
workflow_dispatch:
inputs:
tag:
description: "Existing tag/release to attach the zip to (e.g. 0.5.0)"
required: true

permissions:
contents: write

env:
PLUGIN_SLUG: admin-coach-tours
PLUGIN_ZIP: admin-coach-tours.zip

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout tag
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag }}

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install JS dependencies and build assets
run: |
npm ci
npm run build

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer

- name: Install production Composer dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction

- name: Verify updater dependency is bundled
run: |
test -d vendor/yahnis-elsts/plugin-update-checker \
|| { echo "Missing yahnis-elsts/plugin-update-checker in vendor/"; exit 1; }

- name: Build plugin zip
run: |
mkdir -p "/tmp/${PLUGIN_SLUG}"
rsync -a --exclude-from=.distignore --exclude='.git' ./ "/tmp/${PLUGIN_SLUG}/"
( cd /tmp && zip -rq "${GITHUB_WORKSPACE}/${PLUGIN_ZIP}" "${PLUGIN_SLUG}" )

- name: Attach zip to release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.tag }}
files: ${{ env.PLUGIN_ZIP }}
55 changes: 55 additions & 0 deletions .github/workflows/on-release-add.zip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build and attach release zip

on:
release:
types: [published]

permissions:
contents: write

env:
PLUGIN_SLUG: admin-coach-tours
PLUGIN_ZIP: admin-coach-tours.zip

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install JS dependencies and build assets
run: |
npm ci
npm run build

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer

- name: Install production Composer dependencies
run: composer install --no-dev --optimize-autoloader --no-interaction

- name: Verify updater dependency is bundled
run: |
test -d vendor/yahnis-elsts/plugin-update-checker \
|| { echo "Missing yahnis-elsts/plugin-update-checker in vendor/"; exit 1; }

- name: Build plugin zip
run: |
mkdir -p "/tmp/${PLUGIN_SLUG}"
rsync -a --exclude-from=.distignore --exclude='.git' ./ "/tmp/${PLUGIN_SLUG}/"
( cd /tmp && zip -rq "${GITHUB_WORKSPACE}/${PLUGIN_ZIP}" "${PLUGIN_SLUG}" )

- name: Attach zip to release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.PLUGIN_ZIP }}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.0] - 2026-07-24

### Changed

- Reworked the AI layer to use the WordPress 7 AI Connector (`wp_get_connectors` / `wp_ai_client_prompt`); removed the bundled OpenAI/Azure/Anthropic providers and API-key encryption. **Now requires WordPress 7.0+ and at least one configured AI provider connector.**
- Refactored the AI tour-generation flow into deep modules (`TourRequest`, `TourGenerator`, `TourSchema`); the REST controller is now a thin adapter.
- Slimmed the settings page to connector status, an enable toggle, and an optional provider/model override.
- Reordered task categories (Text first) and expanded the task list: added Paragraph, plus Code, Separator, Details, Audio, File, Group, Spacer, and Embed-from-URL.

### Added

- Self-updates from GitHub releases via the WordPress Plugin GitHub Updater, plus GitHub Actions workflows to build and attach the release zip.
- Coach panel shows the `/command` as a header above the instruction.
- Refocus the current block when a tour closes.
- Finish the tour by clicking the highlighted block on the last step.
- Hide the launcher when the editor is in code editor mode.
- Stop the tour with a clear message when a different block than expected is inserted.

### Fixed

- `generate-tour` REST route rejected `null` `editorContext`/`failureContext` (400 `rest_invalid_param`).
- `wpBlock: "selected"` now falls back to the last-selected block so multi-step tours don't fail on confirmation steps.
- Removed the arrow "Next" button that let users skip ahead before a block existed.
- Tour copy no longer uses positional words ("below"/"above").

## [0.4.1] - 2026-02-03

### Added
Expand Down
62 changes: 36 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Admin Coach Tours

[![Version](https://img.shields.io/badge/version-0.3.6-blue.svg)](https://github.com/soderlind/admin-coach-tours)
[![WordPress](https://img.shields.io/badge/WordPress-6.8%2B-blue.svg)](https://wordpress.org)
[![WordPress](https://img.shields.io/badge/WordPress-7.0%2B-blue.svg)](https://wordpress.org)
[![PHP](https://img.shields.io/badge/PHP-8.3%2B-purple.svg)](https://php.net)
[![License](https://img.shields.io/badge/license-GPL--2.0--or--later-green.svg)](https://www.gnu.org/licenses/gpl-2.0.html)

Expand All @@ -16,36 +16,51 @@ Admin Coach Tours helps WordPress users learn the block editor through AI-genera
## Features

- **AI-Generated Tours** — On-demand tutorials created by AI based on your request
- **12 Predefined Tasks** — Common tasks like adding images, videos, headings, and more
- **Ready-made Task Library** — 20+ common tasks like adding images, videos, headings, paragraphs, and more
- **Freeform Questions** — Ask anything about the block editor
- **Interactive Overlay** — Visual highlighting guides you through each step
- **Smart Block Targeting** — Accurately identifies and highlights the correct elements
- **Automatic Progression** — Tours advance when you complete each action

## Requirements

- WordPress 6.8+
- WordPress 7.0+
- PHP 8.3+
- sodium extension (for API key encryption)
- AI provider API key (OpenAI, Azure OpenAI, or Anthropic)
- At least one WordPress AI provider connector configured

## Installation

1. Upload `admin-coach-tours` to `/wp-content/plugins/`
2. Activate the plugin
3. Go to **Tools → Coach Tours** to configure AI
### From a release zip (recommended)

1. Download `admin-coach-tours.zip` from the [latest release](https://github.com/soderlind/admin-coach-tours/releases/latest).
2. In wp-admin, go to **Plugins → Add New → Upload Plugin**, choose the zip, and click **Install Now**.
3. Activate the plugin.
4. Go to **Tools → Coach Tours** to enable AI.

### From source

```bash
git clone https://github.com/soderlind/admin-coach-tours.git
cd admin-coach-tours
composer install --no-dev
npm ci && npm run build
```

Copy the folder into `wp-content/plugins/` and activate it.

### Updates

The plugin updates itself from GitHub releases — new versions show up under **Plugins** and **Dashboard → Updates** like any other plugin (checked roughly every 6 hours).

## Setup

### Configure AI Provider

1. Navigate to **Tours → Settings**
2. Enable AI Features
3. Select your provider:
- **OpenAI** — Add your API key
- **Azure OpenAI** — Add your API key and endpoint URL
- **Anthropic** — Add your API key
4. Save settings
1. Configure at least one WordPress AI provider connector
2. Navigate to **Tools → Coach Tours**
3. Enable AI Features
4. Optionally choose a preferred provider and model override
5. Save settings

## Usage

Expand All @@ -58,22 +73,17 @@ Admin Coach Tours helps WordPress users learn the block editor through AI-genera
**Common Tasks:**
| Category | Tasks |
|----------|-------|
| Media | Add image, Add video, Create gallery, Add cover |
| Text | Add heading, Create list, Add quote, Create table |
| Design | Add button, Create columns |
| Embed | Embed YouTube |
| Text | Add paragraph, heading, list, quote, table; format text; code, separator, details |
| Media | Add image, video, gallery, cover, audio, file |
| Design | Add button, columns, group, spacer |
| Embed | Embed YouTube, embed from URL |

**Or Ask a Question:**
Type any question about the block editor and press Enter.

4. Follow the highlighted steps to complete the task
5. Each step auto-advances when you perform the action

### Tour Controls

- **Previous/Next** — Navigate between steps
- **Skip** — Skip a step you already know
- **Stop** — Exit the tour at any time

## How It Works

Expand Down Expand Up @@ -150,7 +160,7 @@ npm run lint # JavaScript (ESLint)

## Security

- API keys encrypted with libsodium
- API keys are owned by the WordPress AI connector (not stored by this plugin)
- All endpoints require authentication
- Capability checks on all operations
- Input sanitization and output escaping
Expand All @@ -162,5 +172,5 @@ GPL v2 or later — see [LICENSE](LICENSE) for details.
## Credits

- Built with [@wordpress/scripts](https://www.npmjs.com/package/@wordpress/scripts) and [@wordpress/data](https://www.npmjs.com/package/@wordpress/data)
- AI integration supports OpenAI, Azure OpenAI, and Anthropic
- AI generation via the WordPress 7 AI Connector (`wp_get_connectors` / `wp_ai_client_prompt`)
- RAG knowledge base includes pedagogical content from [Learn WordPress](https://learn.wordpress.org/learning-pathway/user/) courses
Loading
Loading