Save checks
What Temper checks before it saves a file or publishes, and what each check catches.
Every file is checked before it's saved to the working copy, whether you save it, a starter creates it, or an AI changes it. A file with errors isn't saved, and each error points at its line. Warnings don't stop the save.
The same checks run again on every changed file when you publish. A publish with errors doesn't start.
Pro A pull from GitHub or GitLab brings files in even when they fail the checks, so you can fix them here, and lists them. They block publishing until they're fixed.
What's checked#
| File | Errors | Warnings |
|---|---|---|
.php | PHP syntax, with a full parse (the same check as php -l, without running a command) | |
.json | Invalid JSON | |
theme.json | Not an object; no "version": 2 or 3; settings or styles that isn't an object; an entry in customTemplates or templateParts without a name | Top-level keys WordPress doesn't know |
styles/*.json (style variations) | The same checks as theme.json, except version | Top-level keys WordPress doesn't know |
block.json | No name like my-theme/hero (lowercase, one slash); no title | |
.html templates and parts | Block comments that don't open and close in order; a closing comment with no opening one; a block that's never closed; attributes that aren't valid JSON | |
.css and .scss | Unbalanced braces | |
style.css in a theme | It no longer has a Theme Name: header | |
| The main plugin file | It no longer has a Plugin Name: header | |
patterns/*.php in a theme | No Slug: header, so WordPress skips the pattern | |
| Any file | Larger than 2 MB |
The theme.json shape checks apply to themes. In a plugin, theme.json and styles/ are checked as plain JSON.
While you type#
With Check files while typing on (in Settings › Appearance), the editor runs the checks a moment after you stop typing and marks problems on their lines before you save.
What the checks don't catch#
The checks look at syntax, not behaviour. A call to a function that doesn't exist, or a class that's missing, passes. That's what the health check on publish is for, and why the preview runs your working copy on the real site.
Checking from an AI assistant Pro#
AI assistants connected over MCP get the same checks on every write. They can also run them without writing, with the validate_file tool. See the MCP tool reference.