# Wp Performance

Use when investigating or improving WordPress performance (backend-only agent)...

- Repository: https://github.com/WordPress/agent-skills (2319 stars)
- Category: Data and ML
- License: see repository
- Last updated: 2026-10-26
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add WordPress/agent-skills --skill wp-performance -g -a claude-code -y`
Codex: `npx skills add WordPress/agent-skills --skill wp-performance -g -a codex -y`
Cursor: `npx skills add WordPress/agent-skills --skill wp-performance -g -a cursor -y`
Gemini CLI: `npx skills add WordPress/agent-skills --skill wp-performance -g -a gemini-cli -y`

## Description

Use when investigating or improving WordPress performance (backend-only agent): profiling and measurement (WP-CLI profile/doctor, Server-Timing, Query Monitor via REST headers), database/query optimization, autoloaded options, object caching, cron, HTTP API calls, and safe verification.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# WP Performance (backend-only)

## When to use

Use this skill when:

- a WordPress site/page/endpoint is slow (frontend TTFB, admin, REST, WP-Cron)
- you need a profiling plan and tooling recommendations (WP-CLI profile/doctor, Query Monitor, Xdebug/XHProf, APMs)
- you’re optimizing DB queries, autoloaded options, object caching, cron tasks, or remote HTTP calls

This skill assumes the agent cannot use a browser UI. Prefer WP-CLI, logs, and HTTP requests.

## Inputs required

- Environment and safety: dev/staging/prod, any restrictions (no writes, no plugin installs).
- How to target the install:
  - WP root `--path=<path>`
  - (multisite/site targeting) `--url=<url>`
- The performance symptom and scope:
  - which URL/REST route/admin screen
  - when it happens (always vs sporadic; logged-in vs logged-out)

## Procedure

### 0) Guardrails: measure first, avoid risky ops

1. Confirm whether you may run write operations (plugin installs, config changes, cache flush).
2. Pick a reproducible target (URL or REST route) and capture a baseline:
   - TTFB/time with `curl` if possible
   - WP-CLI profiling if available

Read:
- `references/measurement.md`

### 1) Generate a backend-only performance report (deterministic)

Run:

- `node skills/wp-performance/scripts/perf_inspect.mjs --path=<path> [--url=<url>]`

This detects:

- WP-CLI availability and core version
- whether `wp doctor` / `wp profile` are available
- autoloaded options size (if possible)
- object-cache drop-in presence

### 2) Fast wins: run diagnostics before deep profiling

If you have WP-CLI access, prefer:

- `wp doctor check --all` (add `--spotlight` to show only warnings and errors)
- or name the checks for a perf-focused run: `wp doctor check autoload-options-size constant-savequeries-falsy constant-wp-debug-falsy`

`wp doctor check` with no check names and no `--all` exits with an error instead of running anything.

The rest: https://github.com/WordPress/agent-skills/blob/HEAD/skills/wp-performance/SKILL.md
