Available Commands
WpMVC provides a set of powerful commands to streamline your development workflow, from initial setup to production builds and localization.
Project Lifecycle
These commands are used for initializing the project and preparing it for distribution.
composer setup
The primary command for initializing a new project. It installs dependencies, handles namespace isolation (PHPScoper), and sets appropriate file permissions.
composer setupcomposer build
Prepares the PHP dependencies for production by installing them without development tools and optimizing the autoloader.
composer buildpnpm build
A comprehensive build command that orchestrates the entire production build process, including PHP dependencies, asset minification (JS/CSS), i18n JSON generation, and final compression.
pnpm buildDevelopment & Quality
Commands used during active development to run local servers and ensure code quality.
pnpm start
Starts the WordPress scripts development server for assets.
pnpm startpnpm start:hot
Starts the development server with Hot Module Replacement (HMR) enabled.
pnpm start:hotpnpm format
Automatically formats JavaScript and CSS files using WordPress coding standards.
pnpm formatcomposer format
Automatically fixes PHP coding standard violations using PHP CodeSniffer Beautifier (PHPCBF).
composer formatcomposer phpcs
Runs PHP CodeSniffer to check for coding standard violations without fixing them.
composer phpcsLocalization (i18n)
WpMVC simplifies the process of making your plugin translation-ready.
composer i18n
Generates the .pot and .po files by scanning the project for translatable strings in PHP and JS files.
composer i18ncomposer i18n:build
Generates the localization JSON files required for WordPress to load translations in JavaScript.
composer i18n:buildpnpm fixtextdomain
A utility to ensure all translatable strings have the correct text domain.
pnpm fixtextdomainTesting
Tools for ensuring your plugin’s reliability through automated tests.
composer test:setup
Sets up the local WordPress testing environment (database and core files).
composer test:setupcomposer test
Executes the PHPUnit test suite.
composer testInternal Utilities
These commands are typically called by other scripts but can be run manually if needed.
| Command | Description |
|---|---|
composer add-prefix | Runs PHPScoper to isolate dependencies and regenerates the autoloader. |
composer permission | Sets executable permissions for framework binaries (phpcs, phpcbf, phpunit). |
pnpm minify | Triggers the production asset build process using @wordpress/scripts. |
pnpm compress | Compresses assets into a distribution-ready zip file. |