A high-performance, strictly-typed TypeScript rewriting of the official legacy WordPress theme-check tool.
Engineered with Bun, this modern command-line interface audits WordPress themes (both Classic and Full-Site Editing/Block themes) automatically, ensuring they conform to the exact WordPress Coding Standards (WPCS) required by heavy-duty hosting platforms and theme repositories.
- 100% Dynamic Engine: Operates over 65 dedicated inspection classes evaluating everything from raw file structures, FSE
theme.jsonschemas, escaping logic, and more. - Intelligent Routing: Automatically detects whether it is reading an old Classic Theme (with
.phpwrappers) or a modern Block Theme (withtemplates/index.html), gracefully skipping irrelevant tests without throwing false positives. - JSON Streaming Support: Unlike the old
theme-checkplugin which trapped results inside the WordPress wp-admin interface, this utility can trigger via headless CI/CD runners using standard structured JSON format strings. - Blazing Fast: Refactored into static
Buncompilation outperforming standard Node.
Make sure your machine supports npm and bun, then install the node module directory globally.
git clone https://github.com/bhubbard/wp-theme-check-cli.git
cd wp-theme-check-cli
bun install
npm linkSince the project binds to your local alias environment natively, drop the command into any shell directory path pointing at your specific WordPress theme structure.
# General Output
wp-theme-check --path /path/to/my-theme
# Structured Output (CI/CD / JQ Compatible)
wp-theme-check --path /path/to/my-theme --format json--path <directory>: Specify the location of the WordPress folder root you wish to scan. Defaults to the current active directory.--format <type>: Standard text strings orjson.-h, --help: Displays the default interface help menu.
Thanks to the router design in /src/runner.ts, creating custom policies takes mere seconds.
- Build a new
YourCheckClass.ts - Save it directly to the
/src/checks/folder hierarchy. - Automatically maps! Zero array registration dependencies.
Features popular requested constraints that never officially merged into WordPress core plugins.
- Block hardcoded string outputs of
current_user_can('administrator')ensuring native UX capabilities are mapped natively. - Flags un-dismissible custom admin notice injections.
- Traps raw jQuery queues, enforcing functional Vanilla Javascript configurations.
- Automatically rejects bloated artifact directories (such as
__MACOSX,.vscode,src/) from distribution folders.