claude-plugin-wordpress-manager 1.4.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +7 -3
- package/CHANGELOG.md +111 -0
- package/README.md +10 -3
- package/agents/wp-accessibility-auditor.md +206 -0
- package/agents/wp-content-strategist.md +18 -0
- package/agents/wp-deployment-engineer.md +34 -2
- package/agents/wp-performance-optimizer.md +12 -0
- package/agents/wp-security-auditor.md +20 -0
- package/agents/wp-security-hardener.md +266 -0
- package/agents/wp-site-manager.md +14 -0
- package/agents/wp-test-engineer.md +207 -0
- package/docs/GUIDE.md +68 -15
- package/docs/guides/INDEX.md +46 -0
- package/docs/guides/wp-blog.md +590 -0
- package/docs/guides/wp-design-system.md +976 -0
- package/docs/guides/wp-ecommerce.md +786 -0
- package/docs/guides/wp-landing-page.md +762 -0
- package/docs/guides/wp-portfolio.md +713 -0
- package/docs/plans/2026-02-27-design-system-guide-design.md +30 -0
- package/docs/plans/2026-02-27-local-dev-tools-assessment.md +332 -0
- package/docs/plans/2026-02-27-local-env-design.md +179 -0
- package/docs/plans/2026-02-27-site-type-guides-design.md +44 -0
- package/package.json +7 -3
- package/skills/wordpress-router/SKILL.md +25 -5
- package/skills/wordpress-router/references/decision-tree.md +59 -3
- package/skills/wp-accessibility/SKILL.md +170 -0
- package/skills/wp-accessibility/references/a11y-audit-tools.md +248 -0
- package/skills/wp-accessibility/references/a11y-testing.md +222 -0
- package/skills/wp-accessibility/references/block-a11y.md +247 -0
- package/skills/wp-accessibility/references/interactive-a11y.md +272 -0
- package/skills/wp-accessibility/references/media-a11y.md +254 -0
- package/skills/wp-accessibility/references/theme-a11y.md +309 -0
- package/skills/wp-audit/SKILL.md +4 -0
- package/skills/wp-block-development/SKILL.md +5 -0
- package/skills/wp-block-themes/SKILL.md +4 -0
- package/skills/wp-deploy/SKILL.md +12 -0
- package/skills/wp-e2e-testing/SKILL.md +186 -0
- package/skills/wp-e2e-testing/references/ci-integration.md +174 -0
- package/skills/wp-e2e-testing/references/jest-wordpress.md +114 -0
- package/skills/wp-e2e-testing/references/phpunit-wordpress.md +141 -0
- package/skills/wp-e2e-testing/references/playwright-wordpress.md +108 -0
- package/skills/wp-e2e-testing/references/test-data-generation.md +127 -0
- package/skills/wp-e2e-testing/references/visual-regression.md +107 -0
- package/skills/wp-e2e-testing/references/wp-env-setup.md +97 -0
- package/skills/wp-e2e-testing/scripts/test_inspect.mjs +375 -0
- package/skills/wp-headless/SKILL.md +168 -0
- package/skills/wp-headless/references/api-layer-choice.md +160 -0
- package/skills/wp-headless/references/cors-config.md +245 -0
- package/skills/wp-headless/references/frontend-integration.md +331 -0
- package/skills/wp-headless/references/headless-auth.md +286 -0
- package/skills/wp-headless/references/webhooks.md +277 -0
- package/skills/wp-headless/references/wpgraphql.md +331 -0
- package/skills/wp-headless/scripts/headless_inspect.mjs +321 -0
- package/skills/wp-i18n/SKILL.md +170 -0
- package/skills/wp-i18n/references/js-i18n.md +201 -0
- package/skills/wp-i18n/references/multilingual-setup.md +219 -0
- package/skills/wp-i18n/references/php-i18n.md +196 -0
- package/skills/wp-i18n/references/rtl-support.md +206 -0
- package/skills/wp-i18n/references/translation-workflow.md +178 -0
- package/skills/wp-i18n/references/wpcli-i18n.md +177 -0
- package/skills/wp-i18n/scripts/i18n_inspect.mjs +330 -0
- package/skills/wp-interactivity-api/SKILL.md +4 -0
- package/skills/wp-local-env/SKILL.md +233 -0
- package/skills/wp-local-env/references/localwp-adapter.md +156 -0
- package/skills/wp-local-env/references/mcp-adapter-setup.md +153 -0
- package/skills/wp-local-env/references/studio-adapter.md +127 -0
- package/skills/wp-local-env/references/wpenv-adapter.md +121 -0
- package/skills/wp-local-env/scripts/detect_local_env.mjs +404 -0
- package/skills/wp-playground/SKILL.md +13 -1
- package/skills/wp-plugin-development/SKILL.md +6 -0
- package/skills/wp-rest-api/SKILL.md +4 -0
- package/skills/wp-security/SKILL.md +179 -0
- package/skills/wp-security/references/api-restriction.md +147 -0
- package/skills/wp-security/references/authentication-hardening.md +105 -0
- package/skills/wp-security/references/filesystem-hardening.md +105 -0
- package/skills/wp-security/references/http-headers.md +105 -0
- package/skills/wp-security/references/incident-response.md +144 -0
- package/skills/wp-security/references/user-capabilities.md +115 -0
- package/skills/wp-security/references/wp-config-security.md +129 -0
- package/skills/wp-security/scripts/security_inspect.mjs +393 -0
- package/skills/wp-wpcli-and-ops/SKILL.md +6 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: wp-local-env
|
|
3
|
+
description: "Use when the user wants to work with a local WordPress development environment
|
|
4
|
+
— WordPress Studio, LocalWP, or wp-env. Handles environment detection, site lifecycle,
|
|
5
|
+
WP-CLI proxy, REST API access, symlink workflows, database operations, and preview/share."
|
|
6
|
+
compatibility: "Cross-platform (Linux, macOS, Windows). WordPress Studio requires the desktop app + CLI enabled. LocalWP requires the desktop app. wp-env requires Docker + Node.js."
|
|
7
|
+
version: 1.0.0
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Local WordPress Environment
|
|
11
|
+
|
|
12
|
+
## When to use
|
|
13
|
+
|
|
14
|
+
Use this skill when the task involves local WordPress development environments:
|
|
15
|
+
|
|
16
|
+
- Detecting which local dev tool is installed (Studio, LocalWP, wp-env)
|
|
17
|
+
- Creating, starting, stopping, or deleting local WordPress sites
|
|
18
|
+
- Running WP-CLI commands against a local site
|
|
19
|
+
- Setting up plugin/theme development via symlinks
|
|
20
|
+
- Accessing the local REST API or database
|
|
21
|
+
- Switching PHP/WordPress versions for testing
|
|
22
|
+
- Previewing or sharing a local site externally
|
|
23
|
+
- Preparing a local site for deployment to production
|
|
24
|
+
|
|
25
|
+
## Inputs required
|
|
26
|
+
|
|
27
|
+
- Whether the user has WordPress Studio, LocalWP, or wp-env (auto-detected)
|
|
28
|
+
- The site to operate on (name, path, or auto-detected from current directory)
|
|
29
|
+
- The desired operation (lifecycle, development, testing, deploy prep)
|
|
30
|
+
|
|
31
|
+
## Procedure
|
|
32
|
+
|
|
33
|
+
### 0) Detect local environments
|
|
34
|
+
|
|
35
|
+
Run the detection script to discover installed tools and sites:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
node skills/wp-local-env/scripts/detect_local_env.mjs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The script outputs JSON with:
|
|
42
|
+
- `environments[]` — each tool found with its sites
|
|
43
|
+
- `recommended` — which tool to prefer for automation
|
|
44
|
+
- `wpCli` — how to invoke WP-CLI for each tool
|
|
45
|
+
|
|
46
|
+
If no environment is found, suggest installation:
|
|
47
|
+
- **WordPress Studio** (lightweight, fast): https://developer.wordpress.com/studio/
|
|
48
|
+
- **LocalWP** (production-parity): https://localwp.com/
|
|
49
|
+
- **wp-env** (Docker-based, for contributors): `npm -g install @wordpress/env`
|
|
50
|
+
|
|
51
|
+
### 1) Site lifecycle
|
|
52
|
+
|
|
53
|
+
#### Create a new local site
|
|
54
|
+
|
|
55
|
+
**WordPress Studio:**
|
|
56
|
+
```bash
|
|
57
|
+
studio site create --path ~/Studio/my-site
|
|
58
|
+
# Optional flags: --php-version=8.2 --domain=mysite.wp.local --https
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**LocalWP:** Site creation is GUI-only. Guide the user through:
|
|
62
|
+
1. Open LocalWP → "Create a new site"
|
|
63
|
+
2. Choose site name, PHP version, web server (NGINX/Apache)
|
|
64
|
+
3. Set WordPress admin credentials
|
|
65
|
+
|
|
66
|
+
**wp-env:** Create `.wp-env.json` in the project root:
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"core": "WordPress/WordPress#6.9",
|
|
70
|
+
"plugins": ["./my-plugin"],
|
|
71
|
+
"themes": ["./my-theme"]
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
Then: `npx wp-env start`
|
|
75
|
+
|
|
76
|
+
#### Start / stop / delete
|
|
77
|
+
|
|
78
|
+
| Operation | Studio | LocalWP | wp-env |
|
|
79
|
+
|-----------|--------|---------|--------|
|
|
80
|
+
| Start | `studio site start --path=<path>` | GUI only | `npx wp-env start` |
|
|
81
|
+
| Stop | `studio site stop --path=<path>` | GUI only | `npx wp-env stop` |
|
|
82
|
+
| Delete | `studio site delete --path=<path>` | GUI only | `npx wp-env destroy` |
|
|
83
|
+
| Status | `studio site status --path=<path>` | Parse `sites.json` | `npx wp-env run cli wp option get siteurl` |
|
|
84
|
+
|
|
85
|
+
### 2) WP-CLI operations
|
|
86
|
+
|
|
87
|
+
WP-CLI is the primary automation interface for all local tools. Each tool has a different invocation method:
|
|
88
|
+
|
|
89
|
+
**WordPress Studio** (no separate WP-CLI install needed):
|
|
90
|
+
```bash
|
|
91
|
+
studio wp <command> --path=<site-path>
|
|
92
|
+
# Examples:
|
|
93
|
+
studio wp plugin list --path=~/Studio/my-site
|
|
94
|
+
studio wp scaffold plugin my-plugin --path=~/Studio/my-site
|
|
95
|
+
studio wp db export backup.sql --path=~/Studio/my-site
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**LocalWP** (uses bundled WP-CLI binary):
|
|
99
|
+
```bash
|
|
100
|
+
# Find the binary from detect_local_env.mjs output, then:
|
|
101
|
+
<wp-cli-bin> --path=<site-root> <command>
|
|
102
|
+
# Typical path on Linux:
|
|
103
|
+
~/.config/Local/lightning-services/wp-cli-*/bin/wp --path="~/Local Sites/my-site/app/public" plugin list
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**wp-env** (Docker-wrapped):
|
|
107
|
+
```bash
|
|
108
|
+
npx wp-env run cli wp <command>
|
|
109
|
+
# Examples:
|
|
110
|
+
npx wp-env run cli wp plugin list
|
|
111
|
+
npx wp-env run cli wp scaffold block my-block --plugin=my-plugin
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Read: `references/studio-adapter.md`, `references/localwp-adapter.md`, `references/wpenv-adapter.md`
|
|
115
|
+
|
|
116
|
+
### 3) Development workflow (symlink pattern)
|
|
117
|
+
|
|
118
|
+
For active plugin/theme development, symlink your project into the local site:
|
|
119
|
+
|
|
120
|
+
**WordPress Studio:**
|
|
121
|
+
```bash
|
|
122
|
+
ln -s /path/to/my-plugin ~/Studio/my-site/wp-content/plugins/my-plugin
|
|
123
|
+
studio wp plugin activate my-plugin --path=~/Studio/my-site
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**LocalWP:**
|
|
127
|
+
```bash
|
|
128
|
+
ln -s /path/to/my-plugin ~/Local\ Sites/my-site/app/public/wp-content/plugins/my-plugin
|
|
129
|
+
<wp-cli-bin> --path="~/Local Sites/my-site/app/public" plugin activate my-plugin
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**wp-env:** Map in `.wp-env.json` instead of symlinking:
|
|
133
|
+
```json
|
|
134
|
+
{ "plugins": ["./my-plugin", "/absolute/path/to/other-plugin"] }
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 4) REST API access
|
|
138
|
+
|
|
139
|
+
All local tools expose the WordPress REST API:
|
|
140
|
+
|
|
141
|
+
| Tool | URL pattern |
|
|
142
|
+
|------|-------------|
|
|
143
|
+
| Studio | `http://localhost:888x/wp-json/wp/v2/` |
|
|
144
|
+
| LocalWP | `http://<name>.local/wp-json/wp/v2/` or `http://127.0.0.1:<port>/wp-json/wp/v2/` |
|
|
145
|
+
| wp-env | `http://localhost:8888/wp-json/wp/v2/` |
|
|
146
|
+
|
|
147
|
+
For authenticated requests, create an Application Password:
|
|
148
|
+
```bash
|
|
149
|
+
studio wp user application-password create admin "claude-code" --path=<site>
|
|
150
|
+
# or via the WP-CLI equivalent for LocalWP / wp-env
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
The existing `wp-rest-bridge` MCP server can connect to local sites by configuring `WP_SITES_CONFIG` with the local URL.
|
|
154
|
+
|
|
155
|
+
### 5) Database operations
|
|
156
|
+
|
|
157
|
+
**Studio (SQLite):**
|
|
158
|
+
```bash
|
|
159
|
+
# Export as SQL (MySQL-compatible):
|
|
160
|
+
studio wp db export backup.sql --path=<site>
|
|
161
|
+
# Direct SQLite access:
|
|
162
|
+
sqlite3 ~/Studio/<site>/wp-content/database/.ht.sqlite
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
**LocalWP (MySQL):**
|
|
166
|
+
```bash
|
|
167
|
+
# Via WP-CLI:
|
|
168
|
+
<wp-cli-bin> --path=<site-root> db export backup.sql
|
|
169
|
+
# Direct MySQL access (credentials: root/root, db: local):
|
|
170
|
+
mysql --socket=~/.config/Local/run/<site-id>/mysql/mysqld.sock -u root -proot local
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**wp-env (MySQL in Docker):**
|
|
174
|
+
```bash
|
|
175
|
+
npx wp-env run cli wp db export /tmp/backup.sql
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 6) Testing and version switching
|
|
179
|
+
|
|
180
|
+
**Switch PHP version:**
|
|
181
|
+
- Studio: `studio site set --php-version=8.2 --path=<site>`
|
|
182
|
+
- LocalWP: GUI → Site Settings → PHP Version
|
|
183
|
+
- wp-env: Set `"phpVersion": "8.2"` in `.wp-env.json`, then `npx wp-env start --update`
|
|
184
|
+
|
|
185
|
+
**Switch WordPress version:**
|
|
186
|
+
- Studio: `studio site set --wp-version=6.8 --path=<site>` (if supported) or `studio wp core update --version=6.8`
|
|
187
|
+
- LocalWP: `<wp-cli-bin> --path=<site-root> core update --version=6.8`
|
|
188
|
+
- wp-env: Set `"core": "WordPress/WordPress#6.8"` in `.wp-env.json`
|
|
189
|
+
|
|
190
|
+
### 7) Preview and share
|
|
191
|
+
|
|
192
|
+
**Studio:** Built-in preview deployment to WordPress.com:
|
|
193
|
+
```bash
|
|
194
|
+
studio preview create --path=<site>
|
|
195
|
+
# Returns a public URL like https://<hash>.wp.build
|
|
196
|
+
studio preview update <host> --path=<site>
|
|
197
|
+
studio preview delete <host>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
**LocalWP:** Live Links feature (GUI only). Alternative:
|
|
201
|
+
```bash
|
|
202
|
+
# Use ngrok or cloudflared for tunneling:
|
|
203
|
+
ngrok http <port>
|
|
204
|
+
cloudflared tunnel --url http://localhost:<port>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**wp-env:** No built-in sharing. Use ngrok against port 8888.
|
|
208
|
+
|
|
209
|
+
### 8) MCP integration (optional)
|
|
210
|
+
|
|
211
|
+
For deeper AI integration, consider setting up the WordPress MCP Adapter plugin (WordPress 6.9+). This turns any local WordPress site into an MCP server.
|
|
212
|
+
|
|
213
|
+
Read: `references/mcp-adapter-setup.md`
|
|
214
|
+
|
|
215
|
+
## Verification
|
|
216
|
+
|
|
217
|
+
- Re-run `detect_local_env.mjs` after installing/removing tools or creating/deleting sites.
|
|
218
|
+
- Verify WP-CLI access: run `wp option get siteurl` via the tool-specific method.
|
|
219
|
+
- Verify REST API: `curl <site-url>/wp-json/wp/v2/` should return the API index.
|
|
220
|
+
|
|
221
|
+
## Failure modes / debugging
|
|
222
|
+
|
|
223
|
+
- **Studio CLI not found**: Enable CLI in Studio → Settings → toggle CLI.
|
|
224
|
+
- **LocalWP sites.json missing**: LocalWP may not be installed, or is a very old version.
|
|
225
|
+
- **LocalWP WP-CLI fails**: The MySQL server for that site must be running (start via GUI).
|
|
226
|
+
- **wp-env fails to start**: Check Docker is running (`docker info`).
|
|
227
|
+
- **Port conflicts**: Studio uses 8881+, LocalWP uses 10000+, wp-env uses 8888. If conflict, check `lsof -i :<port>`.
|
|
228
|
+
|
|
229
|
+
## Escalation
|
|
230
|
+
|
|
231
|
+
- If the user needs features not available in their tool (e.g., multisite on Studio, Xdebug on Studio), recommend switching to LocalWP or wp-env.
|
|
232
|
+
- If no local tool is installed and Docker is not available, fall back to `wp-playground` (ephemeral WASM-based).
|
|
233
|
+
- For production-parity testing, always recommend LocalWP (MySQL + native PHP).
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# LocalWP Adapter
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
- LocalWP desktop app installed (https://localwp.com/)
|
|
6
|
+
- Site must be started via GUI before WP-CLI or REST API access
|
|
7
|
+
|
|
8
|
+
## Site discovery
|
|
9
|
+
|
|
10
|
+
LocalWP stores all site metadata in a JSON file:
|
|
11
|
+
|
|
12
|
+
| Platform | Path |
|
|
13
|
+
|----------|------|
|
|
14
|
+
| Linux | `~/.config/Local/sites.json` |
|
|
15
|
+
| macOS | `~/Library/Application Support/Local/sites.json` |
|
|
16
|
+
| Windows | `%APPDATA%\Local\sites.json` |
|
|
17
|
+
|
|
18
|
+
### sites.json schema (per site)
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"<site-id>": {
|
|
23
|
+
"id": "<uuid>",
|
|
24
|
+
"name": "My Site",
|
|
25
|
+
"domain": "my-site.local",
|
|
26
|
+
"path": "/home/user/Local Sites/my-site",
|
|
27
|
+
"services": {
|
|
28
|
+
"nginx": { "port": 10006, "sslPort": 10007 },
|
|
29
|
+
"mysql": { "port": 10008 },
|
|
30
|
+
"php": { "version": "8.2.10" }
|
|
31
|
+
},
|
|
32
|
+
"url": "http://my-site.local",
|
|
33
|
+
"sslUrl": "https://my-site.local"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Directory structure
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
~/Local Sites/<site-name>/
|
|
42
|
+
├── app/
|
|
43
|
+
│ └── public/ ← WordPress root (document root)
|
|
44
|
+
│ ├── wp-content/
|
|
45
|
+
│ │ ├── themes/
|
|
46
|
+
│ │ ├── plugins/
|
|
47
|
+
│ │ └── uploads/
|
|
48
|
+
│ ├── wp-config.php
|
|
49
|
+
│ └── ...
|
|
50
|
+
├── conf/
|
|
51
|
+
│ ├── nginx/site.conf
|
|
52
|
+
│ ├── php/php.ini
|
|
53
|
+
│ └── mysql/my.cnf
|
|
54
|
+
└── logs/
|
|
55
|
+
├── nginx/{error.log, access.log}
|
|
56
|
+
├── php/error.log
|
|
57
|
+
└── mysql/error.log
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## WP-CLI access
|
|
61
|
+
|
|
62
|
+
LocalWP bundles WP-CLI. Find the binary at:
|
|
63
|
+
|
|
64
|
+
| Platform | Path |
|
|
65
|
+
|----------|------|
|
|
66
|
+
| Linux | `~/.config/Local/lightning-services/wp-cli-<version>/bin/wp` |
|
|
67
|
+
| macOS | `~/Library/Application Support/Local/lightning-services/wp-cli-<version>/bin/wp` |
|
|
68
|
+
| Windows | `%APPDATA%\Local\lightning-services\wp-cli-<version>\bin\wp.bat` |
|
|
69
|
+
|
|
70
|
+
Usage:
|
|
71
|
+
```bash
|
|
72
|
+
<wp-cli-bin> --path="~/Local Sites/my-site/app/public" <command>
|
|
73
|
+
|
|
74
|
+
# Examples:
|
|
75
|
+
<wp-cli-bin> --path="$HOME/Local Sites/my-site/app/public" plugin list
|
|
76
|
+
<wp-cli-bin> --path="$HOME/Local Sites/my-site/app/public" db export backup.sql
|
|
77
|
+
<wp-cli-bin> --path="$HOME/Local Sites/my-site/app/public" scaffold plugin my-plugin
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Important**: The site's MySQL server must be running (started via GUI) for WP-CLI to work.
|
|
81
|
+
|
|
82
|
+
## MySQL access
|
|
83
|
+
|
|
84
|
+
Default credentials for all LocalWP sites:
|
|
85
|
+
- **User**: `root`
|
|
86
|
+
- **Password**: `root`
|
|
87
|
+
- **Database**: `local`
|
|
88
|
+
|
|
89
|
+
### Via socket
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Find socket path from sites.json site id:
|
|
93
|
+
mysql --socket=~/.config/Local/run/<site-id>/mysql/mysqld.sock -u root -proot local
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Via TCP
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Port from sites.json → services.mysql.port:
|
|
100
|
+
mysql -h 127.0.0.1 -P <port> -u root -proot local
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## REST API
|
|
104
|
+
|
|
105
|
+
Accessible when site is running:
|
|
106
|
+
```bash
|
|
107
|
+
# Via custom domain (requires hosts file entry, managed by LocalWP):
|
|
108
|
+
curl http://my-site.local/wp-json/wp/v2/posts
|
|
109
|
+
|
|
110
|
+
# Via port directly:
|
|
111
|
+
curl http://127.0.0.1:<nginx-port>/wp-json/wp/v2/posts
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Blueprints
|
|
115
|
+
|
|
116
|
+
LocalWP supports site blueprints (templates):
|
|
117
|
+
|
|
118
|
+
| Platform | Path |
|
|
119
|
+
|----------|------|
|
|
120
|
+
| Linux | `~/.config/Local/blueprints/` |
|
|
121
|
+
| macOS | `~/Library/Application Support/Local/blueprints/` |
|
|
122
|
+
|
|
123
|
+
Create: Right-click site → "Save as Blueprint"
|
|
124
|
+
Use: New site → select Blueprint during creation
|
|
125
|
+
|
|
126
|
+
## Symlink workflow
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
ln -s /path/to/my-plugin "$HOME/Local Sites/my-site/app/public/wp-content/plugins/my-plugin"
|
|
130
|
+
<wp-cli-bin> --path="$HOME/Local Sites/my-site/app/public" plugin activate my-plugin
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Logs
|
|
134
|
+
|
|
135
|
+
Direct access to web server, PHP, and MySQL logs:
|
|
136
|
+
```bash
|
|
137
|
+
tail -f ~/Local\ Sites/my-site/logs/nginx/error.log
|
|
138
|
+
tail -f ~/Local\ Sites/my-site/logs/php/error.log
|
|
139
|
+
tail -f ~/Local\ Sites/my-site/logs/mysql/error.log
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Known limitations
|
|
143
|
+
|
|
144
|
+
- **No CLI for site creation/start/stop** — GUI only
|
|
145
|
+
- **Live Links** — GUI only (not scriptable)
|
|
146
|
+
- **Heavy resource usage** — runs native NGINX + PHP-FPM + MySQL processes per site
|
|
147
|
+
- **PHP version changes** — GUI only
|
|
148
|
+
|
|
149
|
+
## Strengths over Studio
|
|
150
|
+
|
|
151
|
+
- **Full MySQL** — production parity, no SQLite compatibility issues
|
|
152
|
+
- **Multisite** — WordPress network fully supported
|
|
153
|
+
- **Xdebug** — available via add-on
|
|
154
|
+
- **MailHog** — email testing built-in
|
|
155
|
+
- **NGINX or Apache** — choose per site
|
|
156
|
+
- **Native PHP extensions** — full set available
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# WordPress MCP Adapter Setup
|
|
2
|
+
|
|
3
|
+
## What is the MCP Adapter?
|
|
4
|
+
|
|
5
|
+
The MCP Adapter is a WordPress plugin (available from WordPress 6.9+) that turns any WordPress installation into an MCP (Model Context Protocol) server. This allows AI agents like Claude Code to interact with WordPress through a standardized protocol.
|
|
6
|
+
|
|
7
|
+
**Source**: https://github.com/WordPress/mcp-adapter
|
|
8
|
+
|
|
9
|
+
## Transport modes
|
|
10
|
+
|
|
11
|
+
### STDIO (for local sites via WP-CLI)
|
|
12
|
+
|
|
13
|
+
The STDIO transport runs the MCP server as a WP-CLI command. Best for local development sites.
|
|
14
|
+
|
|
15
|
+
**Requirements:**
|
|
16
|
+
- WP-CLI available (via Studio, LocalWP bundled, or system install)
|
|
17
|
+
- MCP Adapter plugin installed and activated on the local site
|
|
18
|
+
- A WordPress user with sufficient permissions
|
|
19
|
+
|
|
20
|
+
### HTTP (for remote sites)
|
|
21
|
+
|
|
22
|
+
The HTTP transport exposes an MCP endpoint via the WordPress REST API. Best for remote or staging sites.
|
|
23
|
+
|
|
24
|
+
**Requirements:**
|
|
25
|
+
- MCP Adapter plugin installed and activated
|
|
26
|
+
- Application Password for authentication
|
|
27
|
+
- Site accessible via HTTPS (recommended)
|
|
28
|
+
|
|
29
|
+
## Setup: STDIO with WordPress Studio
|
|
30
|
+
|
|
31
|
+
1. Install the MCP Adapter plugin:
|
|
32
|
+
```bash
|
|
33
|
+
studio wp plugin install mcp-adapter --activate --path=~/Studio/my-site
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
2. Add to `.mcp.json`:
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"wp-local-mcp": {
|
|
41
|
+
"command": "studio",
|
|
42
|
+
"args": [
|
|
43
|
+
"wp", "mcp-adapter", "serve",
|
|
44
|
+
"--server=mcp-adapter-default-server",
|
|
45
|
+
"--user=admin",
|
|
46
|
+
"--path=/home/user/Studio/my-site"
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Setup: STDIO with LocalWP
|
|
54
|
+
|
|
55
|
+
1. Find the WP-CLI binary (from `detect_local_env.mjs` output or manually):
|
|
56
|
+
```bash
|
|
57
|
+
WP_CLI=~/.config/Local/lightning-services/wp-cli-*/bin/wp
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
2. Install the MCP Adapter plugin:
|
|
61
|
+
```bash
|
|
62
|
+
$WP_CLI --path="$HOME/Local Sites/my-site/app/public" plugin install mcp-adapter --activate
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. Add to `.mcp.json`:
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"mcpServers": {
|
|
69
|
+
"wp-local-mcp": {
|
|
70
|
+
"command": "/home/user/.config/Local/lightning-services/wp-cli-2.11.0/bin/wp",
|
|
71
|
+
"args": [
|
|
72
|
+
"--path=/home/user/Local Sites/my-site/app/public",
|
|
73
|
+
"mcp-adapter", "serve",
|
|
74
|
+
"--server=mcp-adapter-default-server",
|
|
75
|
+
"--user=admin"
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Note**: The LocalWP site must be started (via GUI) for the MySQL connection to work.
|
|
83
|
+
|
|
84
|
+
## Setup: STDIO with wp-env
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"mcpServers": {
|
|
89
|
+
"wp-local-mcp": {
|
|
90
|
+
"command": "npx",
|
|
91
|
+
"args": [
|
|
92
|
+
"wp-env", "run", "cli", "wp",
|
|
93
|
+
"mcp-adapter", "serve",
|
|
94
|
+
"--server=mcp-adapter-default-server",
|
|
95
|
+
"--user=admin"
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Setup: HTTP (remote sites)
|
|
103
|
+
|
|
104
|
+
1. Install and activate the MCP Adapter plugin on the remote site.
|
|
105
|
+
|
|
106
|
+
2. Create an Application Password for the user (WP Admin → Users → Profile).
|
|
107
|
+
|
|
108
|
+
3. Use the remote MCP client:
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"wp-remote-mcp": {
|
|
113
|
+
"command": "npx",
|
|
114
|
+
"args": ["-y", "@automattic/mcp-wordpress-remote@latest"],
|
|
115
|
+
"env": {
|
|
116
|
+
"WP_API_URL": "https://example.com/wp-json/mcp/mcp-adapter-default-server",
|
|
117
|
+
"WP_API_USERNAME": "admin",
|
|
118
|
+
"WP_API_PASSWORD": "<application-password>"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Studio MCP Server (alternative)
|
|
126
|
+
|
|
127
|
+
Automattic also publishes a dedicated Studio MCP server in the `wordpress-agent-skills` repo. This provides site management tools without requiring the MCP Adapter plugin.
|
|
128
|
+
|
|
129
|
+
Setup:
|
|
130
|
+
```bash
|
|
131
|
+
git clone https://github.com/Automattic/wordpress-agent-skills.git
|
|
132
|
+
cd wordpress-agent-skills/studio-mcp && npm install && npm run build
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"mcpServers": {
|
|
138
|
+
"studio-mcp": {
|
|
139
|
+
"command": "node",
|
|
140
|
+
"args": ["/path/to/wordpress-agent-skills/studio-mcp/dist/index.js"]
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Which approach to choose?
|
|
147
|
+
|
|
148
|
+
| Scenario | Recommended |
|
|
149
|
+
|----------|-------------|
|
|
150
|
+
| Quick local dev with Studio | Studio MCP Server |
|
|
151
|
+
| Full WP operations on local site | MCP Adapter (STDIO) |
|
|
152
|
+
| Remote/staging site | MCP Adapter (HTTP) via `@automattic/mcp-wordpress-remote` |
|
|
153
|
+
| Existing wp-rest-bridge setup | Point `WP_SITES_CONFIG` at `localhost:<port>` |
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# WordPress Studio Adapter
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
- WordPress Studio desktop app installed and running
|
|
6
|
+
- CLI enabled: Studio → Settings → toggle "Enable CLI"
|
|
7
|
+
- The `studio` command must be available in PATH
|
|
8
|
+
|
|
9
|
+
## CLI reference
|
|
10
|
+
|
|
11
|
+
### Site lifecycle
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Create a new site
|
|
15
|
+
studio site create --path ~/Studio/my-site
|
|
16
|
+
studio site create --path ~/Studio/my-site --php-version=8.2 --https --domain=mysite.wp.local
|
|
17
|
+
|
|
18
|
+
# List all sites
|
|
19
|
+
studio site list
|
|
20
|
+
|
|
21
|
+
# Site status
|
|
22
|
+
studio site status --path=~/Studio/my-site
|
|
23
|
+
|
|
24
|
+
# Start / stop
|
|
25
|
+
studio site start --path=~/Studio/my-site
|
|
26
|
+
studio site stop --path=~/Studio/my-site
|
|
27
|
+
|
|
28
|
+
# Delete (--files removes files on disk)
|
|
29
|
+
studio site delete --path=~/Studio/my-site
|
|
30
|
+
studio site delete --path=~/Studio/my-site --files
|
|
31
|
+
|
|
32
|
+
# Configure
|
|
33
|
+
studio site set --php-version=8.3 --path=~/Studio/my-site
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### WP-CLI proxy
|
|
37
|
+
|
|
38
|
+
No separate WP-CLI installation needed. Studio bundles and configures it automatically.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
studio wp <command> --path=<site-path>
|
|
42
|
+
|
|
43
|
+
# Common operations:
|
|
44
|
+
studio wp plugin list --path=~/Studio/my-site
|
|
45
|
+
studio wp plugin install woocommerce --activate --path=~/Studio/my-site
|
|
46
|
+
studio wp theme activate twentytwentyfive --path=~/Studio/my-site
|
|
47
|
+
studio wp scaffold plugin my-plugin --path=~/Studio/my-site
|
|
48
|
+
studio wp scaffold block my-block --plugin=my-plugin --path=~/Studio/my-site
|
|
49
|
+
studio wp user create testuser test@example.com --role=editor --path=~/Studio/my-site
|
|
50
|
+
studio wp db export backup.sql --path=~/Studio/my-site
|
|
51
|
+
studio wp eval 'echo get_bloginfo("name");' --path=~/Studio/my-site
|
|
52
|
+
studio wp option update blogname "My Site" --path=~/Studio/my-site
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Preview (WordPress.com deployment)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
studio preview create --path=~/Studio/my-site
|
|
59
|
+
studio preview list
|
|
60
|
+
studio preview update <host> --path=~/Studio/my-site
|
|
61
|
+
studio preview delete <host>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Authentication
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
studio auth login # OAuth browser flow to WordPress.com
|
|
68
|
+
studio auth status
|
|
69
|
+
studio auth logout
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Path conventions
|
|
73
|
+
|
|
74
|
+
| Item | Path |
|
|
75
|
+
|------|------|
|
|
76
|
+
| Sites root | `~/Studio/` |
|
|
77
|
+
| WordPress root | `~/Studio/<site-name>/` |
|
|
78
|
+
| Plugins | `~/Studio/<site-name>/wp-content/plugins/` |
|
|
79
|
+
| Themes | `~/Studio/<site-name>/wp-content/themes/` |
|
|
80
|
+
| Uploads | `~/Studio/<site-name>/wp-content/uploads/` |
|
|
81
|
+
| SQLite DB | `~/Studio/<site-name>/wp-content/database/.ht.sqlite` |
|
|
82
|
+
| App config (Linux) | `~/.config/WordPressStudio/` |
|
|
83
|
+
| App config (macOS) | `~/Library/Application Support/WordPressStudio/` |
|
|
84
|
+
|
|
85
|
+
## Ports
|
|
86
|
+
|
|
87
|
+
Sites are assigned ports sequentially starting at **8881**:
|
|
88
|
+
- First site: `http://localhost:8881`
|
|
89
|
+
- Second site: `http://localhost:8882`
|
|
90
|
+
|
|
91
|
+
Custom domains with HTTPS are supported via `--domain` and `--https` flags.
|
|
92
|
+
|
|
93
|
+
## Database (SQLite)
|
|
94
|
+
|
|
95
|
+
Studio uses SQLite instead of MySQL. The database file is at:
|
|
96
|
+
```
|
|
97
|
+
<site-root>/wp-content/database/.ht.sqlite
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Direct access:
|
|
101
|
+
```bash
|
|
102
|
+
sqlite3 ~/Studio/my-site/wp-content/database/.ht.sqlite
|
|
103
|
+
sqlite> .tables
|
|
104
|
+
sqlite> SELECT * FROM wp_options WHERE option_name = 'siteurl';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**SQLite limitations:**
|
|
108
|
+
- No stored procedures or complex triggers
|
|
109
|
+
- Some plugins with complex MySQL-specific queries may break (notably WooCommerce complex queries)
|
|
110
|
+
- SQLite dumps are NOT directly compatible with MySQL — use `wp db export` for MySQL-compatible `.sql` files
|
|
111
|
+
|
|
112
|
+
## Symlink workflow
|
|
113
|
+
|
|
114
|
+
For development, symlink your project repo into the site:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
ln -s /home/user/projects/my-plugin ~/Studio/my-site/wp-content/plugins/my-plugin
|
|
118
|
+
studio wp plugin activate my-plugin --path=~/Studio/my-site
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Known limitations
|
|
122
|
+
|
|
123
|
+
- **No multisite / WordPress network**
|
|
124
|
+
- **No Xdebug** (WASM runtime does not support it)
|
|
125
|
+
- **Limited PHP extensions** (only those compiled to WASM)
|
|
126
|
+
- **Linux**: may require building from source (no official package)
|
|
127
|
+
- **Requires Studio app running** for CLI to work (IPC communication)
|