FSWP DevOps Engineer
Prefer the lightest tool that proves the claim. Any check you cannot run here is reported NOT RUN with the command the user can run (fswp-qa-engineer).
Local environments
| Need | Tool |
|---|---|
| Full WordPress in Docker, PHP tests, multiple plugins/themes mounted | @wordpress/env (wp-env) |
| Instant throwaway site in the browser or via Node, smoke tests, shareable demos | WordPress Playground, configured with a Blueprint |
| Existing local stack the user already runs | Use theirs; do not add a second |
wp-env (needs Docker and Node): from the project root run npx @wordpress/env start. Configure with .wp-env.json:
{
"core": null,
"phpVersion": "8.2",
"plugins": [ "." ],
"themes": [],
"config": { "WP_DEBUG": true, "WP_DEBUG_LOG": true }
}
Useful commands: npx @wordpress/env run cli wp plugin list, ... stop, ... clean, ... destroy. Use it to verify activation, deactivation, uninstall, and upgrade paths that fswp-qa-engineer cannot check statically.
Playground: a Blueprint is JSON that describes the site:
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "/wp-admin/",
"preferredVersions": { "php": "8.3", "wp": "latest" },
"steps": [ { "step": "login" } ]
}
Add steps such as installing a plugin or theme, writing files, and setting options; read the current step names in the Playground documentation before authoring. Playground is fast but is not a full server: do not use it as evidence for cron, mail, or filesystem-heavy behavior.
Step lists, resource types, and the full command table: references/blueprints-and-cli.md.
Command-line operations (WP-CLI)
Site operations from a shell: wp plugin install|activate|deactivate|delete, wp theme ..., wp option get|update, wp post ..., wp user ..., wp cron event list|run, wp db export|import, wp search-replace old new --dry-run, wp eval-file, wp scaffold plugin-tests <plugin>, wp i18n make-pot. Rules: take wp db export before any destructive command; always --dry-run a search-replace first; use --skip-plugins --skip-themes when debugging load errors; run as the web user or with --allow-root only in disposable environments. (WP-CLI is a WordPress Foundation project; this plugin refers to it descriptively.)
Coding standards (PHPCS)
Install with Composer: wp-coding-standards/wpcs, dealerdirect/phpcodesniffer-composer-installer, phpcompatibility/phpcompatibility-wp. Minimal .phpcs.xml.dist:
<?xml version="1.0"?>
<ruleset name="Project">
<file>.</file>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>node_modules/*</exclude-pattern>
<rule ref="WordPress-Extra"/>
<rule ref="WordPress.WP.I18n"><properties><property name="text_domain" value="my-text-domain"/></properties></rule>
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"><properties><property name="prefixes" type="array"><element value="myprefix"/></properties></property></rule>
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibilityWP"/>
</ruleset>
phpcs reports; phpcbf fixes what it safely can (review the diff). fswp-qa-engineer/scripts/setup_toolchain.sh installs PHPCS and PHPStan without Composer for environments that lack it.
Static analysis (PHPStan)
phpstan.neon with php-stubs/wordpress-stubs as a bootstrap (or the szepeviktor/phpstan-wordpress extension), level 5 as the gate, higher for new code. Stub project constants that WordPress or the plugin defines at runtime. A baseline file is acceptable for legacy code, never for new code.
Tests
- PHP unit and integration tests:
wp-phpunit/wp-phpunitwithyoast/phpunit-polyfills, generated bywp scaffold plugin-tests; run in wp-env. UseWP_UnitTestCasefor tests that need WordPress. - JavaScript:
@wordpress/scripts(wp-scripts build,start,lint-js,lint-style,test-unit-js,test-e2e). - End-to-end: Playwright with the WordPress e2e helpers against wp-env, for flows that matter (settings save, block insert, checkout path).
CI outline (reserved for GitHub work)
The order a pipeline should follow: install, PHPCS, PHPStan, PHP tests on min and max PHP, JS lint/build/test, package, upload artifact. Do not create workflow files until the GitHub integration is switched on (fswp-developer/references/github-foundation.md).