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
1 change: 1 addition & 0 deletions .vibe/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ fuzzy_threshold = 0.9
permission = "ask"
allowlist = [
"cat",
"cd",
"echo",
"file",
"find",
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to Waygate will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.9.0] - 2026-05-25

### Added
- Themed text personalization: after the AI selects patterns, a second AI call rewrites all visible text content (headings, paragraphs, button labels) in each pattern's block markup to match the topic stated in the user's prompt; block comment markup, HTML tags, attributes, and CSS classes are preserved
- `AI_Integration::rewrite_pattern_texts( $slugs, $theme )` — sends all selected patterns' raw block content in one batched AI call and returns a `slug → rewritten_content` map; falls back gracefully (returns empty array) on any AI or parse failure
- `Pattern_Lab::get_pattern_content( $slug )` — fetches the raw block markup of a registered pattern from `WP_Block_Patterns_Registry`
- `Pattern_Lab::create_page_from_content( $title, $block_contents, $status )` — creates a page from pre-rendered block strings instead of `wp:pattern` references; used when text personalization is active
- `AI_Integration::generate_page()` now accepts a `bool $personalize_text = true` parameter; when `false`, the original single-call `wp:pattern` flow is used (faster, original placeholder text)
- **Text personalization** checkbox in the admin form (checked by default); description reads "uncheck for faster generation with original placeholder text" so the speed trade-off is clear
- `_waygate_personalized` post meta (`1`/`0`) stored on every generated page
- Result notice now shows "Personalized to your topic" or "Original pattern placeholders" alongside title and pattern count
- PHPUnit unit tests for `rewrite_pattern_texts()`, `get_pattern_content()`, and `create_page_from_content()` (18 new tests); `get_registered()` and `wp_kses_post()` stubs added to the test bootstrap

### Security
- AI-rewritten block content is now passed through `wp_kses_post()` in `create_page_from_content()` before insertion, stripping disallowed HTML (e.g. `<script>` tags) from AI responses

## [0.8.0] - 2026-05-25

### Added
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

Waygate lets you assemble WordPress pages from block patterns — manually or via a natural-language AI prompt powered by the WordPress AI Client (WordPress 7.0+). Works with any block theme; [Elayne](https://github.com/imagewize/elayne) is the primary supported theme.

> **Beta** — v0.8.0. Use on staging/development sites; not yet recommended for production.
> **Beta** — v0.9.0. Use on staging/development sites; not yet recommended for production.

---

## Features

- **Pattern catalog** — Browse registered block patterns with slug, title, and categories; filter by category
- **AI page generation** — Describe the page you want; the AI picks patterns and creates a draft
- **Themed text personalization** — A second AI call rewrites all headings, paragraphs, and button labels inside the selected patterns to match your topic; uncheck the option for a faster single-call result with original placeholder text
- **AI reasoning** — The AI's one-sentence explanation of its pattern choices is shown after generation and persisted as post meta on the created page
- **Developer debug info** — When `WP_ENV=development`, the page editor sidebar and the generation notice also show the ordered pattern slugs and generation timestamp
- **Prompt templates** — Six built-in page templates (Homepage, About, Services, Contact, Landing Page, Portfolio) pre-fill the AI prompt; extend via the `waygate_prompt_templates` filter
Expand Down Expand Up @@ -88,8 +89,10 @@ Waygate registers this provider manually since the library distribution excludes

1. Go to **Tools → Waygate** in the WordPress admin
2. Browse registered patterns in the catalog; use the category dropdown to filter
3. Optionally type a page description and click **Generate Page** to create an AI-assembled draft
4. Open the draft in the block editor, adjust as needed, and publish
3. Optionally pick a **Quick template** to pre-fill the description, then customise it
4. Check **Rewrite pattern text to match my description** (default: on) to have the AI personalize all headings, paragraphs, and button labels to your topic — uncheck for a faster single-call result with original placeholder text
5. Click **Generate Page** to create an AI-assembled draft
6. Open the draft in the block editor, adjust as needed, and publish

---

Expand Down
Loading
Loading