testing-wp-runtime

Guidelines for running wp-now to validate WordPress plugins and themes at runtime

npx skills add https://github.com/automattic/studio --skill testing-wp-runtime

When to use me

Use this skill when you need to verify that a WordPress plugin or theme loads correctly at runtime. Do not use this skill for static linting — use testing-php or testing-js for that.

Step 1: Determine the project mode

wp-now requires a --mode flag based on the project type:

  • Plugin project (main PHP file has a Plugin Name: header): use --mode=plugin
  • Theme project (contains style.css with Theme Name: header): use --mode=theme

Check the project root to determine which mode to use:

head -20 *.php style.css 2>/dev/null

Step 2: Start wp-now

Start wp-now in the background on an available port:

wp-now start --mode=<plugin|theme> --port=8881 &

Wait a few seconds for the server to initialize, then verify it is running:

curl -s -o /dev/null -w "%{http_code}" http://localhost:8881/
  • HTTP 200 or 302 = server is running and WordPress loaded successfully.
  • HTTP 500 = a fatal PHP error occurred — check debug log.
  • Connection refused = server failed to start.

Step 3: Check for PHP errors

After the server starts, check the WordPress debug log for errors:

find /tmp -name "debug.log" -path "*/wp-content/*" 2>/dev/null | head -1 | xargs tail -50 2>/dev/null

Look for:

  • Fatal errors: Plugin or theme could not load — must be fixed.
  • Warnings/Notices: Non-fatal but should be reported.
  • Deprecation notices: Report but do not fix.

Step 4: Validate HTTP responses

Test key endpoints to verify the project works:

# Homepage
curl -s -o /dev/null -w "%{http_code}" http://localhost:8881/

# wp-admin (should redirect to login)
curl -s -o /dev/null -w "%{http_code}" http://localhost:8881/wp-admin/

For plugins, also check if the plugin is active:

curl -s http://localhost:8881/ | grep -c "<plugin-specific-identifier>"

Step 5: Clean up

Always stop wp-now when done testing:

kill $(lsof -t -i:8881) 2>/dev/null

Rules

  • Always clean up: Never leave wp-now running after testing is complete.
  • Port 8881: Always use port 8881 to avoid conflicts.
  • Timeout: If wp-now does not respond within 15 seconds of starting, consider it failed and kill the process.
  • Never modify business logic: Only report issues found during runtime validation. Do not change how the code works.
  • Report format: After testing, report results as:
    • PASS: Server started, HTTP 200, no fatal errors in debug log
    • FAIL: List specific errors (HTTP status, debug log entries, failed endpoints)

Más skills de automattic

wp-phpstan
automattic
Úsalo al configurar, ejecutar o corregir el análisis estático de PHPStan en proyectos de WordPress (plugins/temas/sitios): configuración de phpstan.neon, líneas base,…
official
wp-playground
automattic
Usar para flujos de trabajo de WordPress Playground: instancias rápidas y desechables de WP en el navegador o localmente mediante @wp-playground/cli (server, run-blueprint, build-snapshot),…
official
wp-plugin-development
automattic
Úsese al desarrollar plugins de WordPress: arquitectura y hooks, activación/desactivación/desinstalación, interfaz de administración y API de Settings, almacenamiento de datos, cron/tareas, seguridad…
official
wp-project-triage
automattic
Úselo cuando necesite una inspección determinista de un repositorio de WordPress (plugin/tema/tema de bloque/WP core/Gutenberg/sitio completo) incluyendo herramientas/pruebas/versión…
official
wp-rest-api
automattic
Úsalo al construir, extender o depurar endpoints/rutas de la API REST de WordPress: register_rest_route, clases WP_REST_Controller/controller, esquema/argumentos…
official
wp-wpcli-and-ops
automattic
Úsalo al trabajar con WP-CLI (wp) para operaciones de WordPress: búsqueda y reemplazo seguros, exportación/importación de base de datos, gestión de plugins/temas/usuarios/contenido, cron, vaciado de caché,…
official
wpds
automattic
Úsalo al construir interfaces de usuario que aprovechen el Sistema de Diseño de WordPress (WPDS) y sus componentes, tokens, patrones, etc.
official
woocommerce-finalize
automattic
Auditoría de salud de código y trazabilidad previa al lanzamiento para plugins de WooCommerce. Se ejecuta después de la revisión de código — se enfoca en código muerto, duplicación, complejidad estructural y…
official