YOOanvil Documentation
Overview
YOOanvil is a WordPress plugin with a working YOOtheme Pro element you can adapt to fill gaps in the builder. Activate it and a Starter Card appears in the element library. Open the folder in your editor: it’s plain PHP and JSON, with no Composer, npm or build step. Edit a file and refresh the builder.
It’s for developers building their first YOOtheme element, agencies rebuilding the same custom block, and anyone working with an AI assistant. The folder ships an AGENTS.md that tells Claude Code, Cursor, Codex and Copilot how YOOtheme elements work, and a check.php that catches the mistakes the builder never reports.
YOOanvil is free with a YOOfoundry account, GPL v2, and yours to rename and sell.
Requirements
| Requirement | Version |
|---|---|
| WordPress | 6.1 or newer |
| PHP | 8.0 or newer |
| YOOtheme Pro | 5.0 or newer, active as the site theme or as the parent of your child theme |
| Editor | Any. VS Code is recommended and the folder ships its extension recommendations |
| PHP on the command line | Optional, 8.1 or newer, for php check.php |
YOOtheme Pro 5 is required. The Starter Card’s margin controls use the margin_top and margin_bottom field names that Pro 5.0 introduced, so on Pro 4 those two controls would be missing. YOOanvil reads the theme’s version, from the parent theme when a child theme is active, and below 5.0 it does not load the Starter Card at all. wp-admin shows a notice instead, saying YOOanvil needs YOOtheme Pro 5.0.0 or newer and naming the version the site runs.
WordPress only. YOOtheme Pro also runs on Joomla, and this is a WordPress plugin. With YOOtheme Pro absent, YOOanvil stays inert: no error, no notice, nothing in the element library.
Setup
Installing the plugin
- Download the YOOanvil zip from your YOOfoundry account.
- In wp-admin go to Plugins > Add New > Upload Plugin, choose the zip, install, and activate.
- Open any page in the YOOtheme builder and add an element. At the bottom of the library there is a new group, Custom, holding Starter Card.
There’s no license key to enter or validate.
Opening the folder
- In your editor, open
wp-content/plugins/yooanvil. - VS Code will offer to install two recommended extensions (PHP language support and EditorConfig). Accept; the prompt comes from the folder’s own
.vscodesettings. - Read
README.mdfor the file map, thenAGENTS.mdfor the conventions.
Working on a remote site over SFTP is fine. Edit locally and upload the plugin folder on save.
Your first edit
- Open
modules/element/elements/starter_card/element.json. - Change
"title": "Starter Card"to"title": "My Card"and save. - Refresh the builder. On Windows, nothing changes. YOOtheme compiles
element.jsoninto a cache and does not notice the edit. On Linux and macOS hosts it usually does. - On the Plugins screen, deactivate and reactivate YOOanvil. Both hooks clear that cache.
- Refresh the builder. It now reads My Card.
If an element.json edit doesn’t show up, deactivate and reactivate. Edits to element.php and the templates show on plain refresh.
Features
The Starter Card element
Where: YOOtheme builder > add element > group Custom > Starter Card.
It renders a UIkit card with a title, rich text content and an optional link, so it picks up the styling your site already has. The panel has three tabs.
| Tab | What is on it |
|---|---|
| Content | Title, Content (rich text), Link |
| Settings | A Card group with Style (Default, Primary, Secondary) and Padding (None, Small, Default, Large), then the full General group: position with its left, right, top and bottom offsets and z-index, blend, top and bottom margins, max width and breakpoint, block alignment, text alignment, animation, parallax, visibility |
| Advanced | All eight controls: Name, Status, Dynamic Content, ID, Class, Attributes, CSS, Transform Element |
None of the General or Advanced controls are reimplemented. They reference YOOtheme’s own shared field definitions by name, and YOOtheme’s render pipeline applies them. The template’s only job is to pass $attrs to the root element.
The Title, Content, Link and CSS fields have dynamic content bindings, shown by the database icon in the panel. Each can use a custom field, a post property or any other source on the site.
The link accepts the addresses WordPress allows, such as http, https, mailto and tel. Anything else, for example a javascript: address arriving from a dynamic source, is dropped, and the title shows without a link.
A new card shows placeholder title and content until you type. Clearing both makes the card render nothing, just like core elements.
When the page is saved, the card also writes its title, content and link into the post without layout, where site search, excerpts and feeds read it. That copy is made from the values in the panel, so a field filled by a dynamic source is empty in it.
The files
| File | Job |
|---|---|
yooanvil.php |
The plugin header WordPress reads, four constants, and the activation and deactivation hooks that clear YOOtheme’s cache |
load-modules.php |
The WordPress to YOOtheme handshake. Waits for YOOtheme, checks it is 5.0 or newer, registers the path aliases, loads every modules/*/bootstrap.php. Read this one first |
classes/Helper.php |
Clears the compiled element cache |
modules/element/bootstrap.php |
Registers every elements/*/element.json with the builder |
.../starter_card/element.json |
The element: name, icon, fields, defaults, the panel layout |
.../starter_card/element.php |
The transform that runs before both templates. It checks the link, and skips the card when title and content are both empty |
.../starter_card/templates/template.php |
The HTML |
.../starter_card/templates/content.php |
The same text without layout, saved into the post for search and excerpts |
AGENTS.md |
The briefing an AI assistant reads |
CLAUDE.md |
One line that imports AGENTS.md, because Claude Code reads CLAUDE.md |
check.php |
The checker. See below |
uninstall.php |
Empty on purpose, and says why |
WordPress loads the plugin, which waits for after_setup_theme, checks that YOOtheme Pro 5.0 or newer is there, and hands its module to YOOtheme’s app container, which registers every element.json it finds with the builder.
The compiled cache
YOOtheme compiles each element.json into wp-content/themes/yootheme/cache/ and serves that copy until the file’s change time says the source is newer. Linux and macOS update that stamp on every save. Windows reports the file’s creation time instead, so on LocalWP, Laragon or XAMPP on Windows the compiled copy is served until something deletes it.
Two things delete it: deactivating and reactivating the plugin, or YOOtheme Pro > Settings > Advanced > Cache.
Only element.json is compiled. element.php and the templates are read fresh on every request.
check.php
Where: a terminal in the plugin folder. Run php check.php. It finds YOOtheme Pro in the same site’s wp-content/themes/yootheme; if the theme is anywhere else, name it: php check.php /path/to/wp-content/themes/yootheme. It needs PHP 8.1 or newer on the command line.
The checker is one file with no dependencies. It checks issues the builder doesn’t report:
- Every
element.jsonparses as strict JSON, with no comments and no trailing commas, and has an object at its root. - Every
${builder.*}reference names a field the installed theme actually defines. A dead reference renders as a missing control with no error. The list is read from everypackages/*/config/builder.phpin the theme, following each@import, and an@importthat points at a missing file is reported too. - Every name in the panel layout is a declared field, and every declared field is on a tab.
- An Advanced tab declares every name it lists: all eight for
${builder.advanced}, and the six a child item uses for${builder.advancedItem}(name, status, source, id, class, attributes). - Every element has a
name, no two elements in the plugin share one, and none takes the name of one of the theme’s core elements. - Both templates,
renderandcontent, are declared, and both files exist. - Every PHP file passes
php -l.
When it finds YOOtheme Pro, it first prints the version and folder. It then ends in one of three ways:
| Last line | Exit code | What it means |
|---|---|---|
Clean. |
0 | Every check ran and passed. |
A count, such as 2 problem(s). |
1 | One line per problem above it, each with the file and the key. |
No problems found, but 1 check(s) did not run. Not clean. |
2 | At least one check could not run. A Skipped: line above it names each one. |
Two things skip a check. With no YOOtheme Pro found, the reference and core name checks cannot run: pass the theme’s path. With exec disabled in the command line PHP, the syntax check cannot run. An incomplete run never says Clean. Run it after every edit.
The AI briefing
AGENTS.md is a plain markdown file that AI coding assistants read when they work in a folder. It covers the boot chain, compiled cache, location of the theme’s field definitions, changes between Pro 4 and Pro 5, and twelve conventions that fail silently. It also explains template class syntax, escaping rules, cloning elements and renaming the plugin, with recipes for a container with child items, an element’s own CSS or JavaScript and a dynamic content source.
Point your assistant at the folder and ask for a subtitle field or a pricing table element. These rules give it a documented guide to the API. CLAUDE.md is one line, @AGENTS.md, so Claude Code reads the same file Codex, Cursor and Copilot do.
Renaming the plugin
The plugin is designed to be renamed.
- Deactivate YOOanvil on the Plugins screen first. Renaming an active plugin’s folder makes WordPress force-deactivate it and show a harmless notice.
- Rename the
yooanvilfolder to your plugin’s slug, and renameyooanvil.phpinside it to match. - Use case-sensitive find and replace across the folder for the four name forms below. The forms differ in more than case: folder names may contain hyphens, but PHP names may not.
- Rename the
starter_cardfolder. In itselement.jsonchangename(lowercase with underscores),title, and the placeholder text. Change theStarterCardpart of the namespace inelement.php. - Rewrite or delete
CHANGELOG.md. - Activate. Your element is in the builder under your name.
For a plugin called Acme Cards:
| Find | Replace with | What it is |
|---|---|---|
yooanvil |
acme-cards |
The slug: the folder, the main file, the text domain and the two path aliases |
Yooanvil |
AcmeCards |
The PHP namespace and class prefix, letters and digits only |
YOOANVIL |
ACME_CARDS |
The constant prefix, upper case with underscores |
YOOanvil |
Acme Cards |
The display name in the plugin header, the docblocks and the README |
A one-word name such as Acme gives acme, Acme, ACME and Acme. A two-word name is where the four forms differ.
Renaming name orphans any Starter Cards already placed on pages. They stop rendering. Finish experimenting before you rename.
Settings
YOOanvil has no settings page, options or license key. The constants and plugin header are described below.
Constants
| Constant | Value |
|---|---|
YOOANVIL_VERSION |
The plugin version. Bump it to bust the cache on any stylesheet you register |
YOOANVIL_FILE |
The main plugin file’s path |
YOOANVIL_PATH |
The plugin folder, with a trailing slash |
YOOANVIL_URL |
The plugin folder’s URL |
The path and URL are also registered with YOOtheme as the aliases ~yooanvil and ~yooanvil_url. Use the URL alias for assets: it survives a symlinked plugin folder, which YOOtheme’s own path-to-URL mapping does not.
Plugin header
| Header | Value | Why |
|---|---|---|
Update URI |
false |
YOOanvil never updates itself because an update would overwrite your edited files with a fresh copy. Download new scaffolds from your account for new projects |
Requires at least |
6.1 | The floor YOOtheme Pro 5 sets |
Requires PHP |
8.0 | The same floor as every YOOfoundry plugin. check.php runs on the command line, outside WordPress, and needs 8.1 or newer there |
Text Domain |
yooanvil |
Unused by the element. Panel strings are translated by YOOtheme, not WordPress. It is there for a settings page you might add later |
Element defaults
| Field | Default |
|---|---|
| Style | Default |
| Padding | Default |
| Margin top | Default |
| Margin bottom | Default |
| Panel width | 500 px |
The defaults block in element.json does two jobs: it preselects what the editor sees, and YOOtheme merges it into every saved instance at load, so a field you add today gets its default on every card placed last year.
FAQ
Yes. GPL v2, no paid tier, no feature held back, no license check anywhere in the code. It asks for an account so we know who is building on it and have somewhere to send the next guide.
Some. If you can read a function and recognise an if statement, the files will make sense. They’re short, with comments explaining the less obvious parts. You don’t need experience with WordPress plugin development or YOOtheme internals, and there’s no Composer or build tooling.
Yes, with no conditions and no revenue share. It’s GPL v2, like YOOtheme Pro.
The compiled cache. Deactivate and reactivate the plugin, or clear the cache under YOOtheme Pro > Settings > Advanced. This happens on every edit on Windows and rarely on Linux hosts. Edits to element.php and the templates never need it.
Three causes, in order: the field is declared in fields but not listed in a fieldset tab; its ${builder.*} reference names a key the theme does not define; or the cache was not cleared. php check.php reports the first two, the second only when it finds the theme.
A fatal PHP error, never the cache. Usually it is a syntax error, sometimes a runtime one. php check.php catches a syntax error. For either kind, set WP_DEBUG and WP_DEBUG_LOG to true in wp-config.php and read wp-content/debug.log, which names the file and the line.
At least one check could not run, and a Skipped: line names each one. Usually it could not find YOOtheme Pro: run php check.php /path/to/wp-content/themes/yootheme. The other cause is a command line PHP with exec disabled, which stops the syntax check. Either way it exits with code 2, so a script never mistakes an incomplete run for a clean one.
No. The header carries Update URI: false and there is no update client. An update would overwrite the files you are editing. Download a fresh copy from your account when you start a new project.
Copy the renamed folder into wp-content/plugins on each site and activate it. Distributing fixes to those sites needs a release host and an update channel, which are outside YOOanvil’s scope.
YOOtheme’s starter plugin builds a distributable zip and an update manifest, and needs Composer, Node, npm and the Task runner installed first. YOOanvil has no build step and no dependencies, ships the full Settings and Advanced panels, and carries the AI briefing. They serve different purposes, and you can use both.
Its code covers elements only: no settings pages, custom post types or JavaScript beyond UIkit. AGENTS.md describes how a dynamic content source is registered so your assistant can build one when asked, but the scaffold does not ship one.
Nothing. No license check, no update check, no telemetry. It registers no REST endpoints, creates no tables and stores no options. Deleting it leaves nothing behind.
No to both. The margin controls use field names Pro 5.0 introduced, so on Pro 4 YOOanvil does not load the Starter Card and shows a notice in wp-admin naming the version it found. And this is a WordPress plugin.