claude-plugin-wordpress-manager 1.8.0 → 1.9.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.
Files changed (28) hide show
  1. package/.claude-plugin/plugin.json +5 -3
  2. package/CHANGELOG.md +27 -0
  3. package/agents/wp-site-manager.md +26 -0
  4. package/docs/plans/2026-02-28-multisite-v1.9.0-design.md +258 -0
  5. package/docs/plans/2026-02-28-multisite-v1.9.0.md +1604 -0
  6. package/package.json +5 -3
  7. package/servers/wp-rest-bridge/build/tools/index.d.ts +260 -0
  8. package/servers/wp-rest-bridge/build/tools/index.js +6 -0
  9. package/servers/wp-rest-bridge/build/tools/multisite-network.d.ts +132 -0
  10. package/servers/wp-rest-bridge/build/tools/multisite-network.js +157 -0
  11. package/servers/wp-rest-bridge/build/tools/multisite-sites.d.ts +150 -0
  12. package/servers/wp-rest-bridge/build/tools/multisite-sites.js +160 -0
  13. package/servers/wp-rest-bridge/build/types.d.ts +13 -0
  14. package/servers/wp-rest-bridge/build/wordpress.d.ts +19 -0
  15. package/servers/wp-rest-bridge/build/wordpress.js +10 -0
  16. package/servers/wp-rest-bridge/build/wpcli.d.ts +23 -0
  17. package/servers/wp-rest-bridge/build/wpcli.js +72 -0
  18. package/skills/wordpress-router/references/decision-tree.md +4 -2
  19. package/skills/wp-multisite/SKILL.md +92 -0
  20. package/skills/wp-multisite/references/domain-mapping.md +70 -0
  21. package/skills/wp-multisite/references/migration-multisite.md +76 -0
  22. package/skills/wp-multisite/references/network-plugins.md +66 -0
  23. package/skills/wp-multisite/references/network-setup.md +69 -0
  24. package/skills/wp-multisite/references/site-management.md +67 -0
  25. package/skills/wp-multisite/references/user-roles.md +73 -0
  26. package/skills/wp-multisite/scripts/multisite_inspect.mjs +160 -0
  27. package/skills/wp-security/SKILL.md +4 -0
  28. package/skills/wp-wpcli-and-ops/SKILL.md +4 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wordpress-manager",
3
- "version": "1.8.0",
4
- "description": "Unified WordPress management plugin for Claude Code. Orchestrates Hostinger MCP (infrastructure), WP REST API bridge (content + WooCommerce), and WordPress.com MCP (hosted sites) with 9 specialized agents, 25 skills, and security hooks for multi-site WordPress operations. Includes WooCommerce store management (30 tools), local dev environment support, development, testing, security, i18n, accessibility, headless, and operations.",
3
+ "version": "1.9.0",
4
+ "description": "Unified WordPress management plugin for Claude Code. Orchestrates Hostinger MCP (infrastructure), WP REST API bridge (81 tools incl. WooCommerce + Multisite), and WordPress.com MCP (hosted sites) with 9 specialized agents, 26 skills, and security hooks. Includes WordPress Multisite network management (10 tools via WP-CLI), WooCommerce store management (30 tools), local dev environment support, development, testing, security, i18n, accessibility, headless, and operations.",
5
5
  "author": {
6
6
  "name": "vinmor",
7
7
  "email": "morreale.v@gmail.com"
@@ -19,7 +19,9 @@
19
19
  "localwp",
20
20
  "wp-env",
21
21
  "woocommerce",
22
- "ecommerce"
22
+ "ecommerce",
23
+ "multisite",
24
+ "network"
23
25
  ],
24
26
  "mcpServers": "./.mcp.json"
25
27
  }
package/CHANGELOG.md CHANGED
@@ -2,6 +2,33 @@
2
2
 
3
3
  All notable changes to the WordPress Manager plugin for Claude Code.
4
4
 
5
+ ## [1.9.0] - 2026-02-28
6
+
7
+ ### Added
8
+ - **WordPress Multisite support** — 10 new MCP tools for network management
9
+ - **WP-CLI execution module** (`wpcli.ts`) — local and SSH remote command execution
10
+ - **New skill**: `wp-multisite` with 6 reference files (network setup, site management, domain mapping, network plugins, user roles, migration)
11
+ - **Detection script**: `multisite_inspect.mjs` — detects multisite configuration
12
+ - **SiteConfig extended**: `wp_path`, `ssh_host`, `ssh_user`, `ssh_key`, `ssh_port`, `is_multisite` fields
13
+
14
+ ### New MCP Tools (10)
15
+ - `ms_list_sites` — List all sub-sites in the network
16
+ - `ms_get_site` — Get sub-site details
17
+ - `ms_create_site` — Create a new sub-site
18
+ - `ms_activate_site` — Activate or deactivate a sub-site
19
+ - `ms_delete_site` — Delete a sub-site (with safety gate)
20
+ - `ms_list_network_plugins` — List plugins with network activation status (REST)
21
+ - `ms_network_activate_plugin` — Network-activate a plugin (wp-cli)
22
+ - `ms_network_deactivate_plugin` — Network-deactivate a plugin (wp-cli)
23
+ - `ms_list_super_admins` — List Super Admin users (wp-cli)
24
+ - `ms_get_network_settings` — Get network-wide settings (wp-cli)
25
+
26
+ ### Changed
27
+ - `wp-site-manager` agent: added Multisite Network Management section
28
+ - Router decision-tree.md upgraded to v6 with multisite keywords
29
+ - `wp-wpcli-and-ops` and `wp-security` skills: added multisite cross-references
30
+ - WP REST Bridge: 71 → 81 total tools
31
+
5
32
  ## [1.8.0] - 2026-02-28
6
33
 
7
34
  ### Added
@@ -102,6 +102,31 @@ When asked about site status:
102
102
  - Always announce which site you're operating on
103
103
  - When comparing across sites, switch and collect data sequentially
104
104
 
105
+ ### Multisite Network Management
106
+ For WordPress Multisite networks (sites with `is_multisite: true` in WP_SITES_CONFIG):
107
+
108
+ **Prerequisites check:**
109
+ 1. Verify the site is multisite: `ms_list_sites` (will error if not multisite)
110
+ 2. Verify wp-cli access is configured (`wp_path` in config)
111
+
112
+ **Sub-site operations:**
113
+ - List sub-sites → `ms_list_sites`
114
+ - Create sub-site → `ms_create_site` (slug, title, admin email)
115
+ - Activate/deactivate → `ms_activate_site`
116
+ - Delete → `ms_delete_site` (requires `confirm: true`)
117
+
118
+ **Network administration:**
119
+ - List plugins with network status → `ms_list_network_plugins`
120
+ - Network-activate → `ms_network_activate_plugin`
121
+ - Network-deactivate → `ms_network_deactivate_plugin`
122
+ - List Super Admins → `ms_list_super_admins`
123
+ - Network settings → `ms_get_network_settings`
124
+
125
+ **Safety rules for multisite:**
126
+ - NEVER delete blog_id 1 (main site)
127
+ - ALWAYS confirm before network-activating plugins (affects ALL sites)
128
+ - Announce which network you're operating on when multiple multisite networks are configured
129
+
105
130
  ### Safety Rules
106
131
  - NEVER delete content without explicit user confirmation
107
132
  - NEVER deactivate plugins without listing dependencies first
@@ -122,3 +147,4 @@ For domain-specific tasks, delegate to specialized agents:
122
147
  | Content creation / SEO | `wp-content-strategist` | Content workflows and SEO |
123
148
  | Deploy to production | `wp-deployment-engineer` | Plugin, theme, site deployment |
124
149
  | WooCommerce store management | `wp-ecommerce-manager` | Products, orders, customers, coupons, analytics |
150
+ | Multisite network management | `wp-site-manager` (this agent) | Sub-sites, network plugins, Super Admin — see section above |
@@ -0,0 +1,258 @@
1
+ # v1.9.0 Multisite — Design Document
2
+
3
+ **Data:** 2026-02-28
4
+ **Stato:** Approvato
5
+ **Baseline:** v1.8.0 (25 skill, 9 agent, 71 MCP tools, 13 detection scripts)
6
+
7
+ ---
8
+
9
+ ## Contesto
10
+
11
+ WordPress Multisite permette di gestire un network di siti da una singola installazione. Le REST API standard di WordPress NON espongono endpoint per operazioni multisite (creazione/eliminazione sub-siti, network activation, Super Admin management). Per questo motivo, i tool MCP usano **WP-CLI** come backend di esecuzione.
12
+
13
+ ## Decisioni architetturali
14
+
15
+ | Decisione | Scelta | Motivazione |
16
+ |-----------|--------|-------------|
17
+ | Backend esecuzione | WP-CLI via child_process | WordPress REST API non ha endpoint multisite |
18
+ | Contesto esecuzione | Locale + SSH remoto | Copre sia ambienti dev che produzione |
19
+ | Approccio ibrido | REST dove disponibile, wp-cli per network-only | Minimizza dipendenza SSH, massima compatibilita |
20
+ | Agent | Estensione wp-site-manager (no nuovo agent) | Come da roadmap, multisite e gestione siti |
21
+ | Modulo wp-cli | Dedicato (wpcli.ts) | Riusabile per v2.0 CI/CD, DRY |
22
+
23
+ ---
24
+
25
+ ## Componenti
26
+
27
+ | Tipo | Nome | Descrizione |
28
+ |------|------|-------------|
29
+ | Modulo TS | `wpcli.ts` | Esecuzione wp-cli locale/SSH con auto-detection |
30
+ | MCP Tools | `multisite-sites.ts` (5) | CRUD sub-siti via wp-cli |
31
+ | MCP Tools | `multisite-network.ts` (5) | Network admin, misto REST + wp-cli |
32
+ | Skill | `wp-multisite` | SKILL.md + 6 reference files |
33
+ | Detection | `multisite_inspect.mjs` | Rileva multisite, sub-siti, domain mapping |
34
+ | Agent update | `wp-site-manager.md` | Nuova sezione Multisite Network Management |
35
+
36
+ ---
37
+
38
+ ## Architettura TypeScript
39
+
40
+ ### SiteConfig estesa (`types.ts`)
41
+
42
+ Nuovi campi opzionali aggiunti a SiteConfig:
43
+
44
+ ```typescript
45
+ // WP-CLI access (optional, for multisite and CLI operations)
46
+ wp_path?: string; // Local WP installation path (e.g., ~/Studio/mysite, /var/www/wordpress)
47
+ ssh_host?: string; // SSH hostname for remote wp-cli
48
+ ssh_user?: string; // SSH username
49
+ ssh_key?: string; // Path to SSH private key
50
+ ssh_port?: number; // SSH port (default: 22)
51
+ is_multisite?: boolean; // Flag: this site is a multisite network
52
+ ```
53
+
54
+ ### Nuovo tipo `WPNetworkSite`
55
+
56
+ ```typescript
57
+ interface WPNetworkSite {
58
+ blog_id: number;
59
+ url: string;
60
+ domain: string;
61
+ path: string;
62
+ registered: string;
63
+ last_updated: string;
64
+ public: boolean;
65
+ archived: boolean;
66
+ mature: boolean;
67
+ spam: boolean;
68
+ deleted: boolean;
69
+ }
70
+ ```
71
+
72
+ ### Nuovo modulo `wpcli.ts`
73
+
74
+ Funzioni esportate:
75
+
76
+ | Funzione | Firma | Scopo |
77
+ |----------|-------|-------|
78
+ | `executeWpCli` | `(command: string, siteId?: string) => Promise<string>` | Esegue wp-cli locale o SSH, restituisce stdout |
79
+ | `hasWpCli` | `(siteId?: string) => boolean` | Verifica se wp-cli e configurato |
80
+ | `isMultisite` | `(siteId?: string) => boolean` | Verifica flag is_multisite |
81
+
82
+ Logica `executeWpCli`:
83
+ 1. Risolve siteId (default: activeSiteId)
84
+ 2. Recupera SiteConfig
85
+ 3. Se `wp_path` presente e NO `ssh_host` → locale: `cd {wp_path} && wp {command} --format=json`
86
+ 4. Se `ssh_host` presente → SSH: `ssh -i {ssh_key} -p {ssh_port} {ssh_user}@{ssh_host} 'cd {wp_path} && wp {command} --format=json'`
87
+ 5. Se nessuno configurato → throw Error con messaggio chiaro
88
+ 6. Timeout: 30 secondi
89
+ 7. Parse stdout, gestione stderr per errori
90
+
91
+ ---
92
+
93
+ ## MCP Tools (10 totali)
94
+
95
+ ### `multisite-sites.ts` — 5 tool (tutti wp-cli)
96
+
97
+ | Tool | WP-CLI Command | Input | Output |
98
+ |------|---------------|-------|--------|
99
+ | `ms_list_sites` | `wp site list` | `site_id?` | Array WPNetworkSite |
100
+ | `ms_get_site` | `wp site list --blog_id={id}` | `blog_id, site_id?` | WPNetworkSite singolo |
101
+ | `ms_create_site` | `wp site create --slug --title --email` | `slug, title, email, site_id?` | blog_id creato |
102
+ | `ms_activate_site` | `wp site activate/deactivate {id}` | `blog_id, active: boolean, site_id?` | Conferma |
103
+ | `ms_delete_site` | `wp site delete {id} --yes` | `blog_id, confirm: true, site_id?` | Conferma |
104
+
105
+ ### `multisite-network.ts` — 5 tool (misto REST + wp-cli)
106
+
107
+ | Tool | Metodo | Input | Output |
108
+ |------|--------|-------|--------|
109
+ | `ms_list_network_plugins` | REST `list_plugins` | `site_id?` | Plugin con flag network_active |
110
+ | `ms_network_activate_plugin` | wp-cli `wp plugin activate --network` | `plugin_slug, site_id?` | Conferma |
111
+ | `ms_network_deactivate_plugin` | wp-cli `wp plugin deactivate --network` | `plugin_slug, site_id?` | Conferma |
112
+ | `ms_list_super_admins` | wp-cli `wp super-admin list` | `site_id?` | Array username |
113
+ | `ms_get_network_settings` | wp-cli `wp network meta list 1` | `site_id?` | Network settings object |
114
+
115
+ ### Safety gates
116
+
117
+ - Tutti i tool verificano `isMultisite(siteId)` — errore se non multisite
118
+ - `ms_delete_site` richiede `confirm: true` esplicito
119
+ - `ms_network_activate_plugin` e `ms_network_deactivate_plugin` loggano il plugin e il siteId
120
+ - Timeout 30s per ogni comando wp-cli
121
+
122
+ ---
123
+
124
+ ## Skill `wp-multisite`
125
+
126
+ ### Struttura
127
+
128
+ ```
129
+ skills/wp-multisite/
130
+ ├── SKILL.md
131
+ ├── references/
132
+ │ ├── network-setup.md
133
+ │ ├── site-management.md
134
+ │ ├── domain-mapping.md
135
+ │ ├── network-plugins.md
136
+ │ ├── user-roles.md
137
+ │ └── migration-multisite.md
138
+ └── scripts/
139
+ └── multisite_inspect.mjs
140
+ ```
141
+
142
+ ### SKILL.md — Contenuto
143
+
144
+ - Trigger phrases: multisite, network, sub-site, domain mapping, super admin
145
+ - Prerequisites: wp-cli, is_multisite flag, wp_path/ssh_host configurati
146
+ - Decision tree: 10 tool ms_* con condizioni
147
+ - Reference file links
148
+
149
+ ### Reference files (6)
150
+
151
+ | File | Contenuto |
152
+ |------|-----------|
153
+ | `network-setup.md` | Sub-directory vs sub-domain, wp-config.php constants, MULTISITE/SUBDOMAIN_INSTALL |
154
+ | `site-management.md` | CRUD sub-siti, bulk operations, template sites |
155
+ | `domain-mapping.md` | Domini custom per sub-siti, SSL, DNS CNAME, sunrise.php |
156
+ | `network-plugins.md` | Network-activated vs per-site, must-use plugins, conflict resolution |
157
+ | `user-roles.md` | Super Admin capabilities, site-level roles, add/remove super admin |
158
+ | `migration-multisite.md` | Single-site → multisite, multisite → single, database tables |
159
+
160
+ ### Detection script `multisite_inspect.mjs`
161
+
162
+ Controlla:
163
+ 1. `wp-config.php` per costanti `MULTISITE`, `SUBDOMAIN_INSTALL`, `DOMAIN_CURRENT_SITE`, `PATH_CURRENT_SITE`
164
+ 2. `WP_SITES_CONFIG` env var per flag `is_multisite`
165
+ 3. Presenza di `wp-content/sunrise.php` (domain mapping avanzato)
166
+ 4. `.htaccess` per rewrite rules multisite (sub-directory pattern)
167
+
168
+ ---
169
+
170
+ ## Agent update: `wp-site-manager.md`
171
+
172
+ Nuova sezione **"## Multisite Network Management"** (~25 righe):
173
+
174
+ - Prerequisiti: verifica `is_multisite` e wp-cli
175
+ - Procedure: lista sub-siti, crea sub-sito, gestione plugin network, domain mapping
176
+ - Tool reference: 10 tool `ms_*`
177
+ - Safety: conferma prima di delete, verificare Super Admin
178
+
179
+ ---
180
+
181
+ ## Router `decision-tree.md` (v6)
182
+
183
+ Step 0 — aggiunta keyword "multisite" e "network" alla categoria operations.
184
+
185
+ Step 2b (operations) — nuova entry:
186
+ ```
187
+ "multisite, network, sub-sito, sub-site, domain mapping, super admin, network activate"
188
+ → wp-multisite skill + wp-site-manager agent
189
+ ```
190
+
191
+ ---
192
+
193
+ ## Cross-references
194
+
195
+ | File | Aggiunta |
196
+ |------|----------|
197
+ | `wp-wpcli-and-ops/SKILL.md` | "Per operazioni multisite, vedi `wp-multisite` skill" |
198
+ | `wp-security/SKILL.md` | "Per Super Admin e capabilities multisite, vedi `wp-multisite` skill" |
199
+
200
+ ---
201
+
202
+ ## Config esempio
203
+
204
+ ```json
205
+ [
206
+ {
207
+ "id": "mynetwork",
208
+ "url": "https://network.example.com",
209
+ "username": "superadmin",
210
+ "password": "xxxx xxxx xxxx xxxx",
211
+ "wp_path": "/var/www/wordpress",
212
+ "ssh_host": "network.example.com",
213
+ "ssh_user": "deploy",
214
+ "ssh_key": "~/.ssh/id_rsa",
215
+ "is_multisite": true
216
+ },
217
+ {
218
+ "id": "local-multisite",
219
+ "url": "http://multisite.local",
220
+ "username": "admin",
221
+ "password": "yyyy yyyy yyyy yyyy",
222
+ "wp_path": "~/Studio/multisite",
223
+ "is_multisite": true
224
+ }
225
+ ]
226
+ ```
227
+
228
+ Primo sito: remoto via SSH. Secondo: locale senza SSH.
229
+
230
+ ---
231
+
232
+ ## Version bump
233
+
234
+ - `plugin.json` → v1.9.0, description aggiornata (26 skill, 9 agent)
235
+ - `package.json` → v1.9.0, keywords: +multisite, +network
236
+ - `CHANGELOG.md` → entry v1.9.0
237
+
238
+ ---
239
+
240
+ ## File da creare/modificare
241
+
242
+ | File | Azione | Note |
243
+ |------|--------|------|
244
+ | `servers/wp-rest-bridge/src/wpcli.ts` | **NUOVO** | Modulo WP-CLI execution |
245
+ | `servers/wp-rest-bridge/src/types.ts` | Modifica | +WPNetworkSite, +SiteConfig fields |
246
+ | `servers/wp-rest-bridge/src/tools/multisite-sites.ts` | **NUOVO** | 5 tool gestione sub-siti |
247
+ | `servers/wp-rest-bridge/src/tools/multisite-network.ts` | **NUOVO** | 5 tool network admin |
248
+ | `servers/wp-rest-bridge/src/tools/index.ts` | Modifica | Registrazione 10 nuovi tool |
249
+ | `skills/wp-multisite/SKILL.md` | **NUOVO** | Skill principale |
250
+ | `skills/wp-multisite/references/*.md` (6 file) | **NUOVO** | 6 reference files |
251
+ | `skills/wp-multisite/scripts/multisite_inspect.mjs` | **NUOVO** | Detection script |
252
+ | `agents/wp-site-manager.md` | Modifica | +sezione Multisite |
253
+ | `skills/wordpress-router/references/decision-tree.md` | Modifica | Router v6 |
254
+ | `skills/wp-wpcli-and-ops/SKILL.md` | Modifica | Cross-ref |
255
+ | `skills/wp-security/SKILL.md` | Modifica | Cross-ref |
256
+ | `.claude-plugin/plugin.json` | Modifica | Version bump |
257
+ | `package.json` | Modifica | Version bump |
258
+ | `CHANGELOG.md` | Modifica | Entry v1.9.0 |