claude-plugin-wordpress-manager 2.6.0 → 2.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.
- package/CHANGELOG.md +61 -0
- package/agents/wp-monitoring-agent.md +44 -0
- package/agents/wp-site-manager.md +19 -0
- package/docs/plans/2026-03-01-tier4-5-implementation.md +1783 -0
- package/docs/plans/2026-03-01-tier4-5-observability-automation-design.md +426 -0
- package/docs/plans/2026-03-01-wcop-reassessment-v2.6.0.md +403 -0
- package/hooks/hooks.json +9 -0
- package/package.json +10 -3
- package/servers/wp-rest-bridge/build/tools/cwv.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/cwv.js +196 -0
- package/servers/wp-rest-bridge/build/tools/ga4.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/ga4.js +323 -0
- package/servers/wp-rest-bridge/build/tools/index.js +15 -0
- package/servers/wp-rest-bridge/build/tools/plausible.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/plausible.js +207 -0
- package/servers/wp-rest-bridge/build/tools/slack.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/slack.js +129 -0
- package/servers/wp-rest-bridge/build/tools/wc-workflows.d.ts +3 -0
- package/servers/wp-rest-bridge/build/tools/wc-workflows.js +222 -0
- package/servers/wp-rest-bridge/build/wordpress.d.ts +18 -0
- package/servers/wp-rest-bridge/build/wordpress.js +139 -0
- package/skills/wordpress-router/SKILL.md +1 -1
- package/skills/wordpress-router/references/decision-tree.md +8 -2
- package/skills/wp-alerting/SKILL.md +142 -0
- package/skills/wp-alerting/references/alert-thresholds.md +79 -0
- package/skills/wp-alerting/references/escalation-paths.md +92 -0
- package/skills/wp-alerting/references/report-scheduling.md +142 -0
- package/skills/wp-alerting/references/slack-integration.md +109 -0
- package/skills/wp-alerting/scripts/alerting_inspect.mjs +150 -0
- package/skills/wp-analytics/SKILL.md +158 -0
- package/skills/wp-analytics/references/analytics-dashboards.md +83 -0
- package/skills/wp-analytics/references/cwv-monitoring.md +101 -0
- package/skills/wp-analytics/references/ga4-integration.md +76 -0
- package/skills/wp-analytics/references/plausible-setup.md +92 -0
- package/skills/wp-analytics/references/traffic-attribution.md +92 -0
- package/skills/wp-analytics/scripts/analytics_inspect.mjs +153 -0
- package/skills/wp-content-attribution/SKILL.md +1 -0
- package/skills/wp-content-optimization/SKILL.md +1 -0
- package/skills/wp-content-workflows/SKILL.md +142 -0
- package/skills/wp-content-workflows/references/content-lifecycle-hooks.md +131 -0
- package/skills/wp-content-workflows/references/multi-channel-actions.md +151 -0
- package/skills/wp-content-workflows/references/schedule-triggers.md +118 -0
- package/skills/wp-content-workflows/references/trigger-management.md +159 -0
- package/skills/wp-content-workflows/references/wp-action-hooks.md +114 -0
- package/skills/wp-content-workflows/scripts/workflow_inspect.mjs +202 -0
- package/skills/wp-monitoring/SKILL.md +2 -0
- package/skills/wp-search-console/SKILL.md +1 -0
- package/skills/wp-social-email/SKILL.md +1 -0
- package/skills/wp-webhooks/SKILL.md +1 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
# WordPress Manager — Reassessment WCOP v2.6.0
|
|
2
|
+
|
|
3
|
+
> **WordPress Content Orchestration Platform (WCOP)**
|
|
4
|
+
> Rivalutazione post-implementazione Tier 1 + Tier 2 + Tier 3 sulla stessa scala dell'assessment originale v2.1.1.
|
|
5
|
+
|
|
6
|
+
**Data:** 2026-03-01
|
|
7
|
+
**Versione plugin:** 2.6.0
|
|
8
|
+
**Baseline assessment:** v2.1.1 (2026-02-28, score 6/10)
|
|
9
|
+
**Scope:** Verifica miglioramenti effettivi + gap residui + roadmap futura
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 1. Evoluzione Numerica
|
|
14
|
+
|
|
15
|
+
| Metrica | v2.1.1 (assessment) | v2.6.0 (oggi) | Delta |
|
|
16
|
+
|---------|---------------------|---------------|-------|
|
|
17
|
+
| Skills | 28 | 36 | +8 |
|
|
18
|
+
| Agents | 11 | 12 | +1 |
|
|
19
|
+
| MCP Tools | 81 | 111 | +30 |
|
|
20
|
+
| Detection scripts | 16 | 24 | +8 |
|
|
21
|
+
| Reference files | ~120 | 178 | +58 |
|
|
22
|
+
| Router version | v8 | v13 | +5 |
|
|
23
|
+
| Safety hooks | 7 | 9 | +2 |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Punteggi per Layer — Confronto
|
|
28
|
+
|
|
29
|
+
| Layer | v2.1.1 | Proiezione design | v2.6.0 effettivo | Delta | Nota |
|
|
30
|
+
|-------|--------|-------------------|-----------------|-------|------|
|
|
31
|
+
| 1 — Content Factory | 9/10 | 9/10 | **9/10** | = | Rafforzato (non ampliato il ceiling) |
|
|
32
|
+
| 2 — Quality Assurance | 8/10 | 9/10 | **9/10** | +1 | AI content optimization chiude il gap |
|
|
33
|
+
| 3 — Distribution | 4/10 | 8/10 | **8/10** | +4 | 18 connettori reali + agent dedicato |
|
|
34
|
+
| 4 — Observability | 5/10 | 7/10 | **7/10** | +2 | GSC + fleet monitoring operativi |
|
|
35
|
+
| 5 — Automation | 4/10 | 7/10 | **7/10** | +3 | Webhook + pipeline distribuzione + triage |
|
|
36
|
+
| **Totale** | **6/10** | **8/10** | **8/10** | **+2** | Proiezione confermata |
|
|
37
|
+
|
|
38
|
+
**Score complessivo: 8/10** — Le proiezioni del design doc sono confermate. Il plugin e ora una piattaforma WCOP matura all'80%.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## 3. Analisi per Layer — Cosa e Cambiato e Cosa Manca
|
|
43
|
+
|
|
44
|
+
### Layer 1 — Content Factory (9/10, invariato)
|
|
45
|
+
|
|
46
|
+
**Cosa e stato aggiunto (v2.2.0–v2.6.0):**
|
|
47
|
+
- Programmatic SEO: generazione scalabile pagine template (headless + multisite)
|
|
48
|
+
- Content-Commerce Attribution: collegamento contenuto → vendite WooCommerce
|
|
49
|
+
- Multi-Language Network: orchestrazione multisite multilingua con hreflang
|
|
50
|
+
- Content Repurposing: trasformazione contenuto per canali multipli
|
|
51
|
+
- Webhook Propagation: eventi outbound per sincronizzazione contenuto
|
|
52
|
+
|
|
53
|
+
**Perche resta 9/10 e non 10/10:**
|
|
54
|
+
|
|
55
|
+
| Gap | Descrizione | Impatto |
|
|
56
|
+
|-----|-------------|---------|
|
|
57
|
+
| AI Content Generation | Nessun tool per generare bozze da keyword/brief (Claude lo fa ma non e proceduralizzato) | Medio |
|
|
58
|
+
| Schema/Structured Data | Nessun tool dedicato per gestire JSON-LD, Schema.org markup | Basso-Medio |
|
|
59
|
+
| Content Calendar | Nessun planning tool per editorial calendar cross-site | Medio |
|
|
60
|
+
| Media/DAM | Nessuna gestione asset digitali avanzata (oltre wp_media base) | Basso |
|
|
61
|
+
|
|
62
|
+
**Per raggiungere 10/10:** Skill `wp-content-generation` con procedure per brief→outline→draft + skill `wp-structured-data` per Schema.org management.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### Layer 2 — Quality Assurance (9/10, +1)
|
|
67
|
+
|
|
68
|
+
**Cosa ha causato il miglioramento:**
|
|
69
|
+
- `wp-content-optimization` skill con 6 procedure AI-native (headline scoring, readability Flesch-Kincaid, SEO scoring, meta optimization, content freshness, bulk triage)
|
|
70
|
+
- Bulk Content Triage: classificazione automatica (Quick Wins / Needs Rewrite / Performing / Archive)
|
|
71
|
+
- Ora copre qualita **codice** (PHPStan, E2E, security audit) E qualita **contenuto** (readability, SEO, freshness)
|
|
72
|
+
|
|
73
|
+
**Perche resta 9/10 e non 10/10:**
|
|
74
|
+
|
|
75
|
+
| Gap | Descrizione | Impatto |
|
|
76
|
+
|-----|-------------|---------|
|
|
77
|
+
| Content Compliance | Nessun check GDPR/privacy su contenuto (cookie consent, data collection forms) | Medio |
|
|
78
|
+
| Brand Voice Consistency | Nessun scoring di coerenza tono/voce across content | Basso |
|
|
79
|
+
| Visual Regression | `wp-e2e-testing` ha la teoria, manca integrazione automatica | Basso |
|
|
80
|
+
| Performance Testing Contenuto | Nessun check CWV (Core Web Vitals) per pagine content-heavy | Medio |
|
|
81
|
+
|
|
82
|
+
**Per raggiungere 10/10:** Aggiungere procedura "Content Compliance Audit" (GDPR, accessibilita testo) a `wp-content-optimization` + integrazione CWV checking nel monitoring.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
### Layer 3 — Distribution (8/10, +4) — Miglioramento piu significativo
|
|
87
|
+
|
|
88
|
+
**Cosa ha causato il miglioramento (da 4 a 8):**
|
|
89
|
+
- **18 MCP tool reali** per distribuzione outbound:
|
|
90
|
+
- 7 Mailchimp (audience, campaigns, reports, subscribers)
|
|
91
|
+
- 5 Buffer (profiles, scheduling, analytics)
|
|
92
|
+
- 6 SendGrid (email transazionali, templates, contacts, stats)
|
|
93
|
+
- **wp-distribution-manager agent** (nuovo, dedicato) con 5 procedure
|
|
94
|
+
- **wp-social-email skill** + 6 reference files
|
|
95
|
+
- **2 safety hooks** (mc_send_campaign, sg_send_email)
|
|
96
|
+
- **Content Repurposing skill** per format adaptation (L2 syndication)
|
|
97
|
+
- **Detection script** che verifica configurazione servizi
|
|
98
|
+
|
|
99
|
+
**Revisione Content Syndication (dalla Sezione 4 dell'assessment originale):**
|
|
100
|
+
|
|
101
|
+
| Livello | v2.1.1 | v2.6.0 | Miglioramento |
|
|
102
|
+
|---------|--------|--------|---------------|
|
|
103
|
+
| L1 — Canonical Source | ✅ Eccellente | ✅ Eccellente | Invariato |
|
|
104
|
+
| L2 — Format Adaptation | ⚠️ Solo manuale | ✅ Guidato (skill + refs) | wp-content-repurposing + platform-specs |
|
|
105
|
+
| L3 — Channel Distribution | ❌ Assente | ✅ Operativo (3 servizi) | 18 MCP tool + agent dedicato |
|
|
106
|
+
|
|
107
|
+
**Perche resta 8/10 e non 10/10:**
|
|
108
|
+
|
|
109
|
+
| Gap | Descrizione | Effort futuro | Impatto |
|
|
110
|
+
|-----|-------------|---------------|---------|
|
|
111
|
+
| Social API dirette | Nessun tool diretto per Twitter/X, Instagram, LinkedIn, TikTok — Buffer fa da intermediario | Alto | Alto |
|
|
112
|
+
| Trasformazione automatica | Blog→tweet/email richiede intervento agent, non e una pipeline automatica | Medio | Alto |
|
|
113
|
+
| RSS/Atom | Nessuna gestione feed syndication | Basso | Medio |
|
|
114
|
+
| Push Notifications | Nessuna integrazione OneSignal/Firebase | Medio | Medio |
|
|
115
|
+
| Podcast/Audio | Nessuna distribuzione canale audio | Basso | Basso |
|
|
116
|
+
| AMP/Instant Articles | Nessun supporto formati accelerati | Basso | Basso |
|
|
117
|
+
|
|
118
|
+
**Per raggiungere 9/10:** Aggiungere almeno 1 social API diretta (es. LinkedIn per B2B) + pipeline automatica blog→social (template-based, non agent-dependent).
|
|
119
|
+
|
|
120
|
+
**Per raggiungere 10/10:** Coprire tutti i canali principali (social diretti, RSS, push, podcast) + trasformazione completamente automatica.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### Layer 4 — Observability (7/10, +2)
|
|
125
|
+
|
|
126
|
+
**Cosa ha causato il miglioramento (da 5 a 7):**
|
|
127
|
+
- **Fleet Monitoring** (v2.2.0): monitoraggio cross-site per tutti i siti configurati, Procedure 7 nel monitoring agent
|
|
128
|
+
- **Google Search Console** (v2.5.0): 8 MCP tool per keyword tracking, indexing status, search analytics, competitor gap analysis
|
|
129
|
+
- **Content Freshness Audit** (v2.6.0): osservabilita lifecycle contenuti (eta, decay, obsolescenza)
|
|
130
|
+
- **Attribution tracking** (v2.3.0): visibilita su quale contenuto genera conversioni
|
|
131
|
+
|
|
132
|
+
**Livelli di Observability:**
|
|
133
|
+
|
|
134
|
+
| Ambito | v2.1.1 | v2.6.0 |
|
|
135
|
+
|--------|--------|--------|
|
|
136
|
+
| Infrastructure (uptime, server) | ✅ monitoring agent | ✅ + fleet monitoring |
|
|
137
|
+
| Security (scansioni, anomalie) | ✅ security scanning | ✅ invariato |
|
|
138
|
+
| Performance (baseline, trend) | ✅ performance baseline | ✅ invariato |
|
|
139
|
+
| SEO (keyword, ranking, indexing) | ❌ assente | ✅ GSC 8 tool |
|
|
140
|
+
| Content lifecycle (freshness, decay) | ❌ assente | ✅ content freshness audit |
|
|
141
|
+
| Content ROI (attribution) | ❌ assente | ✅ UTM→conversion tracking |
|
|
142
|
+
| User analytics (traffico, behavior) | ❌ assente | ❌ assente |
|
|
143
|
+
| Real-time alerting | ⚠️ procedure ma no integrazione | ⚠️ invariato |
|
|
144
|
+
|
|
145
|
+
**Perche resta 7/10 e non 10/10:**
|
|
146
|
+
|
|
147
|
+
| Gap | Descrizione | Effort futuro | Impatto |
|
|
148
|
+
|-----|-------------|---------------|---------|
|
|
149
|
+
| Google Analytics / Plausible | Nessun dato traffico utente, sessioni, bounce rate | Medio | Alto |
|
|
150
|
+
| Core Web Vitals monitoring | Nessun check CWV automatico (LCP, FID, CLS) | Medio | Alto |
|
|
151
|
+
| Real-time alerting | Alerting descritto in reference ma no integrazione Slack/PagerDuty/email | Medio | Alto |
|
|
152
|
+
| Log aggregation | Nessuna integrazione Sentry, Datadog, LogRocket | Alto | Medio |
|
|
153
|
+
| A/B test tracking | Nessun monitoraggio risultati split test | Medio | Medio |
|
|
154
|
+
|
|
155
|
+
**Per raggiungere 8/10:** Integrare Google Analytics (o Plausible) MCP tool + CWV monitoring automatico.
|
|
156
|
+
|
|
157
|
+
**Per raggiungere 9/10:** + alerting reale verso Slack/email + A/B test tracking.
|
|
158
|
+
|
|
159
|
+
**Per raggiungere 10/10:** + log aggregation + user behavior analytics completo.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### Layer 5 — Automation (7/10, +3)
|
|
164
|
+
|
|
165
|
+
**Cosa ha causato il miglioramento (da 4 a 7):**
|
|
166
|
+
- **Webhook Propagation** (v2.2.0): 4 MCP tool WooCommerce + 5 reference files per configurare eventi outbound
|
|
167
|
+
- **Distribution Pipeline** (v2.4.0): flusso orchestrato create→format→distribute via wp-distribution-manager
|
|
168
|
+
- **Optimization Pipeline** (v2.6.0): content triage automatico come quality gate per contenuto
|
|
169
|
+
- **Safety Hooks** (v2.4.0): guardrail automatici su azioni irreversibili (send campaign, send email)
|
|
170
|
+
- **CI/CD** (v2.0.0, pre-assessment): pipeline automation per codice gia presente
|
|
171
|
+
|
|
172
|
+
**Ciclo WCOP realizzato:**
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
CREAZIONE → OTTIMIZZAZIONE → DISTRIBUZIONE → MONITORAGGIO → RE-OTTIMIZZAZIONE
|
|
176
|
+
| | | | |
|
|
177
|
+
wp-content wp-content- wp-social-email wp-search- wp-content-
|
|
178
|
+
wp-content- optimization wp-distribution- console optimization
|
|
179
|
+
strategist manager wp-monitoring (bulk triage)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Questo ciclo **esiste** ed e **operativo**, ma e **agent-triggered** (richiede intervento umano per avviare ogni fase).
|
|
183
|
+
|
|
184
|
+
**Perche resta 7/10 e non 10/10:**
|
|
185
|
+
|
|
186
|
+
| Gap | Descrizione | Effort futuro | Impatto |
|
|
187
|
+
|-----|-------------|---------------|---------|
|
|
188
|
+
| Scheduled automation | Nessun cron/scheduler per audit contenuto periodici o distribuzione programmata | Medio | Alto |
|
|
189
|
+
| Event-driven workflows | Nessun trigger "nuovo post → auto-ottimizza → auto-distribuisci" | Alto | Alto |
|
|
190
|
+
| Content staging/rollback | REST API revisions esistono ma nessun workflow staging→produzione per contenuto | Medio | Medio |
|
|
191
|
+
| Workflow templates | Nessun template "blog post launch sequence" o "content refresh cycle" | Basso | Medio |
|
|
192
|
+
| Auto-scaling | Nessuna automazione infrastruttura (CDN flush, cache warming su traffico) | Alto | Basso |
|
|
193
|
+
|
|
194
|
+
**Per raggiungere 8/10:** Skill `wp-content-workflows` con template di workflow (launch sequence, refresh cycle) + event trigger basici (webhook WordPress → distribuzione).
|
|
195
|
+
|
|
196
|
+
**Per raggiungere 9/10:** + scheduler integrato per audit periodici + content staging pipeline.
|
|
197
|
+
|
|
198
|
+
**Per raggiungere 10/10:** + orchestrazione event-driven completa + auto-scaling infrastruttura.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## 4. Revisione Sezioni Originali dell'Assessment
|
|
203
|
+
|
|
204
|
+
### SEO Topology (Sezione 3 originale)
|
|
205
|
+
|
|
206
|
+
| Strategia SEO | v2.1.1 | v2.6.0 | Cambiamento |
|
|
207
|
+
|---------------|--------|--------|-------------|
|
|
208
|
+
| Pillar-Cluster | ✅ Forte | ✅ Eccellente | + content optimization + GSC keyword data |
|
|
209
|
+
| E-Commerce SEO | ✅ Forte | ✅ Eccellente | + content attribution ROI |
|
|
210
|
+
| Programmatic SEO | ⚠️ Parziale | ✅ Forte | + wp-programmatic-seo skill dedicata |
|
|
211
|
+
| Local SEO (multi-location) | ⚠️ Parziale | ✅ Migliorato | + multisite per location + hreflang |
|
|
212
|
+
| Cross-Domain SEO | ❌ Assente | ⚠️ Parziale | + wp-multilang-network (hreflang cross-site) |
|
|
213
|
+
|
|
214
|
+
**Gap residuo SEO:** Schema.org/structured data management, link graph analysis, competitor backlink tracking.
|
|
215
|
+
|
|
216
|
+
### Commerce-Content Integration (Sezione 5 originale)
|
|
217
|
+
|
|
218
|
+
| Aspetto | v2.1.1 | v2.6.0 | Cambiamento |
|
|
219
|
+
|---------|--------|--------|-------------|
|
|
220
|
+
| Content → Commerce | ⚠️ | ✅ Forte | wp-content-attribution (UTM→order, attribution models, ROI) |
|
|
221
|
+
| Commerce → Content | ⚠️ | ✅ Migliorato | WC reports + GSC data alimentano content strategy |
|
|
222
|
+
| Headless Commerce | ⚠️ | ✅ Migliorato | wp-programmatic-seo copre product variant pages |
|
|
223
|
+
|
|
224
|
+
**Gap residuo:** Automated product content generation (descrizioni prodotto da dati WC), abandoned cart content triggers.
|
|
225
|
+
|
|
226
|
+
### Social Amplification (Sezione 6 originale)
|
|
227
|
+
|
|
228
|
+
| Aspetto | v2.1.1 | v2.6.0 | Cambiamento |
|
|
229
|
+
|---------|--------|--------|-------------|
|
|
230
|
+
| API-first content packaging | ❌ Assente | ✅ Operativo | wp-content-repurposing + platform-specs |
|
|
231
|
+
| Outbound connectors | ❌ Assente | ✅ 3 servizi (MC/Buf/SG) | 18 MCP tool + agent + safety hooks |
|
|
232
|
+
| Cross-channel analytics | ❌ Assente | ✅ Parziale | buf_get_analytics + mc_get_campaign_report + sg_get_stats |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## 5. Modello d'Impiego Massimizzato (aggiornato)
|
|
237
|
+
|
|
238
|
+
### Scenario aggiornato: "Content Hub Distribuito per Brand D2C"
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
┌─────────────────────────┐
|
|
242
|
+
│ WORDPRESS MULTISITE │
|
|
243
|
+
│ (Hub Centrale) │
|
|
244
|
+
│ wp-site-manager │
|
|
245
|
+
└──────────┬──────────────┘
|
|
246
|
+
┌───────────────────┼───────────────────┐
|
|
247
|
+
│ │ │
|
|
248
|
+
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
|
|
249
|
+
│ Sub-site 1 │ │ Sub-site 2 │ │ Sub-site 3 │
|
|
250
|
+
│ Blog/SEO │ │ WooCommerce │ │ Landing │
|
|
251
|
+
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
|
|
252
|
+
│ │ │
|
|
253
|
+
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
|
|
254
|
+
│ Next.js │ │ Nuxt.js │ │ Astro │
|
|
255
|
+
│ (headless) │ │ (headless) │ │ (static) │
|
|
256
|
+
└──────┬──────┘ └──────┬──────┘ └──────┬──────┘
|
|
257
|
+
│ │ │
|
|
258
|
+
┌──────▼───────────────────▼───────────────────▼──────┐
|
|
259
|
+
│ DISTRIBUTION LAYER (NUOVO) │
|
|
260
|
+
│ Mailchimp │ Buffer │ SendGrid │ GSC Feedback │
|
|
261
|
+
└──────┬──────────────────────────────────────────────┘
|
|
262
|
+
│
|
|
263
|
+
┌──────▼──────────────────────────────────────────────┐
|
|
264
|
+
│ OPTIMIZATION LOOP (NUOVO) │
|
|
265
|
+
│ GSC data → Content triage → Optimize → Re-distribute│
|
|
266
|
+
└─────────────────────────────────────────────────────┘
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Agent attivi simultaneamente (12 su 12):**
|
|
270
|
+
|
|
271
|
+
1. `wp-site-manager` — orchestrazione rete multisite + delegazione
|
|
272
|
+
2. `wp-content-strategist` — crea contenuto pillar + SEO feedback loop + AI optimization
|
|
273
|
+
3. `wp-ecommerce-manager` — gestisce catalogo, promozioni, attribution ROI
|
|
274
|
+
4. `wp-distribution-manager` — **NUOVO** — distribuisce su Mailchimp/Buffer/SendGrid
|
|
275
|
+
5. `wp-cicd-engineer` — mantiene pipeline deploy per i 3 frontend headless
|
|
276
|
+
6. `wp-monitoring-agent` — sorveglia uptime, performance, fleet health
|
|
277
|
+
7. `wp-security-auditor` — audit periodico di sicurezza
|
|
278
|
+
8. `wp-security-hardener` — implementa fix da audit
|
|
279
|
+
9. `wp-test-engineer` — E2E testing sui frontend headless
|
|
280
|
+
10. `wp-accessibility-auditor` — compliance WCAG sui frontend
|
|
281
|
+
11. `wp-deployment-engineer` — deploy su Hostinger/SSH
|
|
282
|
+
12. `wp-performance-optimizer` — ottimizzazione performance
|
|
283
|
+
|
|
284
|
+
**Skill attive (utilizzo massimale: 18 su 36):**
|
|
285
|
+
|
|
286
|
+
| Skill | Funzione nel scenario |
|
|
287
|
+
|-------|-----------------------|
|
|
288
|
+
| `wp-multisite` | Gestione rete |
|
|
289
|
+
| `wp-headless` | Configurazione API layer |
|
|
290
|
+
| `wp-woocommerce` | Store operations |
|
|
291
|
+
| `wp-cicd` | Pipeline automation |
|
|
292
|
+
| `wp-monitoring` | Observability (incl. fleet) |
|
|
293
|
+
| `wp-social-email` | **NUOVO** — Distribuzione outbound |
|
|
294
|
+
| `wp-search-console` | **NUOVO** — SEO feedback loop |
|
|
295
|
+
| `wp-content-optimization` | **NUOVO** — Quality gate contenuto |
|
|
296
|
+
| `wp-content-repurposing` | **NUOVO** — Format adaptation |
|
|
297
|
+
| `wp-webhooks` | **NUOVO** — Event propagation |
|
|
298
|
+
| `wp-programmatic-seo` | **NUOVO** — Template pages scalabili |
|
|
299
|
+
| `wp-content-attribution` | **NUOVO** — ROI contenuto |
|
|
300
|
+
| `wp-multilang-network` | **NUOVO** — Multilingua |
|
|
301
|
+
| `wordpress-router` | Orchestrazione decisionale |
|
|
302
|
+
| `wp-content` | Content creation |
|
|
303
|
+
| `wp-audit` | Security/performance/SEO audit |
|
|
304
|
+
| `wp-security` | Hardening |
|
|
305
|
+
| `wp-e2e-testing` | Testing |
|
|
306
|
+
|
|
307
|
+
> Questo scenario usa **tutti 12 agent** e **18 delle 36 skill** simultaneamente.
|
|
308
|
+
> (v2.1.1: 7/11 agent, 6/28 skill)
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## 6. Roadmap Futura — Percorso verso 10/10
|
|
313
|
+
|
|
314
|
+
### Tier 4 — Observability Avanzata (7→9/10)
|
|
315
|
+
|
|
316
|
+
| Gap | Skill/Tool proposto | Effort | Score target |
|
|
317
|
+
|-----|---------------------|--------|-------------|
|
|
318
|
+
| User analytics | `wp-analytics` skill + MCP tool Google Analytics / Plausible | Medio | +0.5 |
|
|
319
|
+
| Core Web Vitals | Procedura CWV in `wp-monitoring` o tool dedicato (CrUX API) | Medio | +0.5 |
|
|
320
|
+
| Real-time alerting | MCP tool Slack webhook + email alerting in `wp-monitoring` | Basso | +0.5 |
|
|
321
|
+
| A/B test tracking | Procedura in `wp-content-optimization` (GSC data come proxy A/B) | Basso | +0.5 |
|
|
322
|
+
|
|
323
|
+
**Impatto previsto:** Observability da 7/10 a **9/10**. Score totale da 8/10 a **8.4/10**.
|
|
324
|
+
|
|
325
|
+
### Tier 5 — Automation Avanzata (7→9/10)
|
|
326
|
+
|
|
327
|
+
| Gap | Skill/Tool proposto | Effort | Score target |
|
|
328
|
+
|-----|---------------------|--------|-------------|
|
|
329
|
+
| Workflow templates | `wp-content-workflows` skill (launch sequence, refresh cycle, seasonal campaign) | Basso | +0.5 |
|
|
330
|
+
| Event-driven triggers | Estensione `wp-webhooks` per trigger WordPress→distribuzione automatica | Medio | +0.5 |
|
|
331
|
+
| Content staging | Procedura staging→review→publish in `wp-content` | Basso | +0.5 |
|
|
332
|
+
| Scheduled audits | Procedura cron-based in `wp-monitoring` per audit contenuto periodici | Basso | +0.5 |
|
|
333
|
+
|
|
334
|
+
**Impatto previsto:** Automation da 7/10 a **9/10**. Score totale da 8.4/10 a **8.8/10**.
|
|
335
|
+
|
|
336
|
+
### Tier 6 — Distribution Completa (8→9/10)
|
|
337
|
+
|
|
338
|
+
| Gap | Skill/Tool proposto | Effort | Score target |
|
|
339
|
+
|-----|---------------------|--------|-------------|
|
|
340
|
+
| Social API diretta | MCP tool LinkedIn API (B2B focus, piu valore) | Alto | +0.5 |
|
|
341
|
+
| Auto-transformation | Pipeline template-based blog→social (no agent) | Medio | +0.5 |
|
|
342
|
+
|
|
343
|
+
**Impatto previsto:** Distribution da 8/10 a **9/10**. Score totale da 8.8/10 a **9/10**.
|
|
344
|
+
|
|
345
|
+
### Tier 7 — Content Factory Completa (9→10/10)
|
|
346
|
+
|
|
347
|
+
| Gap | Skill/Tool proposto | Effort | Score target |
|
|
348
|
+
|-----|---------------------|--------|-------------|
|
|
349
|
+
| AI Content Generation | `wp-content-generation` skill (brief→outline→draft procedure) | Basso | +0.5 |
|
|
350
|
+
| Schema/Structured Data | `wp-structured-data` skill (JSON-LD, Schema.org management) | Medio | +0.5 |
|
|
351
|
+
|
|
352
|
+
**Impatto previsto:** Content Factory da 9/10 a **10/10**. Score totale da 9/10 a **9.2/10**.
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## 7. Priorita Raccomandata (effort vs impatto)
|
|
357
|
+
|
|
358
|
+
| Priorita | Tier | Focus | Effort totale | Score delta |
|
|
359
|
+
|----------|------|-------|---------------|-------------|
|
|
360
|
+
| **1** | Tier 4 | Observability (analytics + CWV + alerting) | Medio | +0.4 |
|
|
361
|
+
| **2** | Tier 5 | Automation (workflows + triggers + staging) | Medio | +0.4 |
|
|
362
|
+
| **3** | Tier 6 | Distribution (LinkedIn + auto-transform) | Alto | +0.2 |
|
|
363
|
+
| **4** | Tier 7 | Content Factory (generation + structured data) | Medio | +0.2 |
|
|
364
|
+
|
|
365
|
+
**Percorso ottimale:**
|
|
366
|
+
- Tier 4+5 insieme (effort medio, impatto 8→8.8) — focus su completare il ciclo WCOP automatico
|
|
367
|
+
- Poi Tier 6 (effort alto, impatto 8.8→9.0) — sblocca distribuzione diretta
|
|
368
|
+
- Infine Tier 7 (effort medio, impatto 9.0→9.2) — perfeziona la content factory
|
|
369
|
+
|
|
370
|
+
---
|
|
371
|
+
|
|
372
|
+
## 8. Conclusione
|
|
373
|
+
|
|
374
|
+
### v2.1.1 → v2.6.0: Trasformazione riuscita
|
|
375
|
+
|
|
376
|
+
Il plugin e passato da **"gestore WordPress con monitoring"** a **"Content Orchestration Platform"**:
|
|
377
|
+
|
|
378
|
+
- **Centripetale (creazione)**: gia eccellente, ora rafforzato con programmatic SEO e multi-language
|
|
379
|
+
- **Centrifugale (distribuzione)**: da inesistente a operativo con 3 servizi reali
|
|
380
|
+
- **Ciclo completo**: creazione → ottimizzazione → distribuzione → monitoraggio → re-ottimizzazione
|
|
381
|
+
|
|
382
|
+
### Le 3 mosse strategiche dell'assessment originale — Stato
|
|
383
|
+
|
|
384
|
+
| Mossa | Stato v2.6.0 |
|
|
385
|
+
|-------|-------------|
|
|
386
|
+
| **Fleet-first** (ogni tool pensa "N siti") | ✅ Implementato — fleet monitoring, multisite tools |
|
|
387
|
+
| **Content-out** (distribuzione outbound) | ✅ Implementato — 18 connettori + agent + repurposing |
|
|
388
|
+
| **Content pipeline** (CI/CD per contenuto) | ⚠️ Parziale — quality gate (optimization) ma no staging/cron |
|
|
389
|
+
|
|
390
|
+
### Score Path
|
|
391
|
+
|
|
392
|
+
```
|
|
393
|
+
v2.1.1 ████████████████░░░░░░░░░░░░░░ 6/10 "Gestore WordPress"
|
|
394
|
+
v2.6.0 ████████████████████████░░░░░░ 8/10 "Content Orchestration Platform"
|
|
395
|
+
Tier4+5 ████████████████████████████░░ 8.8 "+ Observability + Automation"
|
|
396
|
+
Tier6+7 █████████████████████████████░ 9.2 "+ Distribution Completa + Factory"
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
Il plugin WordPress Manager e ora il tool CLI piu completo per orchestrazione contenuti WordPress esistente. Il gap residuo (8→10) riguarda principalmente **automazione autonoma** (event-driven, scheduled) e **observability utente** (analytics, CWV), non funzionalita core.
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
*Reassessment WCOP v2.0 — wordpress-manager v2.6.0 — 2026-03-01*
|
package/hooks/hooks.json
CHANGED
|
@@ -78,6 +78,15 @@
|
|
|
78
78
|
"prompt": "The agent is about to SEND an email via SendGrid. Verify the user explicitly requested this email send and the recipient list is correct. Respond 'approve' only if intentional."
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"matcher": "mcp__wp-rest-bridge__wf_delete_trigger",
|
|
84
|
+
"hooks": [
|
|
85
|
+
{
|
|
86
|
+
"type": "prompt",
|
|
87
|
+
"prompt": "The agent is about to DELETE a workflow trigger. This will permanently stop all associated automation and notifications (Slack alerts, emails, webhooks) configured for this trigger. Verify the user explicitly requested this deletion and understands that dependent workflows will stop firing."
|
|
88
|
+
}
|
|
89
|
+
]
|
|
81
90
|
}
|
|
82
91
|
]
|
|
83
92
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-plugin-wordpress-manager",
|
|
3
|
-
"version": "2.
|
|
4
|
-
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge (
|
|
3
|
+
"version": "2.9.0",
|
|
4
|
+
"description": "Unified WordPress management and development plugin for Claude Code. Orchestrates Hostinger MCP, WP REST API bridge (132 tools incl. 30 WooCommerce + 10 Multisite + 4 Webhooks + 7 Mailchimp + 5 Buffer + 6 SendGrid + 8 GSC + 6 GA4 + 4 Plausible + 4 CWV + 3 Slack + 4 Workflows), and WordPress.com MCP with 39 skills, 12 agents, and security hooks. v2.9.0 adds automated workflows (triggers, cron, content lifecycle). WCOP Tier 4+5 complete.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "vinmor",
|
|
7
7
|
"email": "morreale.v@gmail.com"
|
|
@@ -56,7 +56,14 @@
|
|
|
56
56
|
"content-optimization",
|
|
57
57
|
"readability",
|
|
58
58
|
"headline-scoring",
|
|
59
|
-
"content-triage"
|
|
59
|
+
"content-triage",
|
|
60
|
+
"slack",
|
|
61
|
+
"alerting",
|
|
62
|
+
"notifications",
|
|
63
|
+
"severity-routing",
|
|
64
|
+
"workflows",
|
|
65
|
+
"automation",
|
|
66
|
+
"cron-triggers"
|
|
60
67
|
],
|
|
61
68
|
"repository": {
|
|
62
69
|
"type": "git",
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { hasGoogleApiKey, getGoogleApiKey } from '../wordpress.js';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
// ── Zod Schemas ─────────────────────────────────────────────────
|
|
5
|
+
const cwvAnalyzeUrlSchema = z.object({
|
|
6
|
+
url: z.string().describe('URL to analyze'),
|
|
7
|
+
strategy: z.enum(['mobile', 'desktop']).optional().default('mobile')
|
|
8
|
+
.describe('Analysis strategy (default: mobile)'),
|
|
9
|
+
categories: z.array(z.enum(['performance', 'accessibility', 'best-practices', 'seo'])).optional()
|
|
10
|
+
.describe('Lighthouse categories to include (default: performance only)'),
|
|
11
|
+
}).strict();
|
|
12
|
+
const cwvBatchAnalyzeSchema = z.object({
|
|
13
|
+
urls: z.array(z.string()).describe('Array of URLs to analyze (max 10)'),
|
|
14
|
+
strategy: z.enum(['mobile', 'desktop']).optional().default('mobile'),
|
|
15
|
+
}).strict();
|
|
16
|
+
const cwvGetFieldDataSchema = z.object({
|
|
17
|
+
url: z.string().optional().describe('Specific URL for field data (omit for origin-level data)'),
|
|
18
|
+
origin: z.string().optional().describe('Origin URL (e.g., https://mysite.com)'),
|
|
19
|
+
form_factor: z.enum(['PHONE', 'DESKTOP', 'TABLET', 'ALL_FORM_FACTORS']).optional().default('ALL_FORM_FACTORS'),
|
|
20
|
+
}).strict();
|
|
21
|
+
const cwvComparePagesSchema = z.object({
|
|
22
|
+
urls: z.array(z.string()).describe('URLs to compare (2-5)'),
|
|
23
|
+
strategy: z.enum(['mobile', 'desktop']).optional().default('mobile'),
|
|
24
|
+
}).strict();
|
|
25
|
+
// ── Tool Definitions ────────────────────────────────────────────
|
|
26
|
+
export const cwvTools = [
|
|
27
|
+
{
|
|
28
|
+
name: "cwv_analyze_url",
|
|
29
|
+
description: "Analyzes Core Web Vitals for a URL via PageSpeed Insights (LCP, INP, CLS, FCP, TTFB)",
|
|
30
|
+
inputSchema: {
|
|
31
|
+
type: "object",
|
|
32
|
+
properties: {
|
|
33
|
+
url: { type: "string", description: "URL to analyze" },
|
|
34
|
+
strategy: { type: "string", enum: ["mobile", "desktop"], description: "Strategy (default: mobile)" },
|
|
35
|
+
categories: { type: "array", items: { type: "string", enum: ["performance", "accessibility", "best-practices", "seo"] }, description: "Categories to include" },
|
|
36
|
+
},
|
|
37
|
+
required: ["url"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "cwv_batch_analyze",
|
|
42
|
+
description: "Analyzes Core Web Vitals for multiple URLs (max 10) via PageSpeed Insights",
|
|
43
|
+
inputSchema: {
|
|
44
|
+
type: "object",
|
|
45
|
+
properties: {
|
|
46
|
+
urls: { type: "array", items: { type: "string" }, description: "URLs to analyze (max 10)" },
|
|
47
|
+
strategy: { type: "string", enum: ["mobile", "desktop"], description: "Strategy (default: mobile)" },
|
|
48
|
+
},
|
|
49
|
+
required: ["urls"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "cwv_get_field_data",
|
|
54
|
+
description: "Gets real-user CWV field data from Chrome UX Report (28-day aggregate)",
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: "object",
|
|
57
|
+
properties: {
|
|
58
|
+
url: { type: "string", description: "Specific URL (omit for origin-level)" },
|
|
59
|
+
origin: { type: "string", description: "Origin URL (e.g., https://mysite.com)" },
|
|
60
|
+
form_factor: { type: "string", enum: ["PHONE", "DESKTOP", "TABLET", "ALL_FORM_FACTORS"], description: "Form factor (default: ALL)" },
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "cwv_compare_pages",
|
|
66
|
+
description: "Compares Core Web Vitals across multiple pages and ranks optimization priority",
|
|
67
|
+
inputSchema: {
|
|
68
|
+
type: "object",
|
|
69
|
+
properties: {
|
|
70
|
+
urls: { type: "array", items: { type: "string" }, description: "URLs to compare (2-5)" },
|
|
71
|
+
strategy: { type: "string", enum: ["mobile", "desktop"], description: "Strategy (default: mobile)" },
|
|
72
|
+
},
|
|
73
|
+
required: ["urls"],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
// ── Handlers ────────────────────────────────────────────────────
|
|
78
|
+
const PSI_BASE = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed';
|
|
79
|
+
const CRUX_BASE = 'https://chromeuxreport.googleapis.com/v1/records:queryRecord';
|
|
80
|
+
function extractCWV(lighthouse) {
|
|
81
|
+
const audits = lighthouse?.audits || {};
|
|
82
|
+
return {
|
|
83
|
+
lcp: audits['largest-contentful-paint']?.numericValue,
|
|
84
|
+
fcp: audits['first-contentful-paint']?.numericValue,
|
|
85
|
+
cls: audits['cumulative-layout-shift']?.numericValue,
|
|
86
|
+
inp: audits['interaction-to-next-paint']?.numericValue,
|
|
87
|
+
ttfb: audits['server-response-time']?.numericValue,
|
|
88
|
+
performance_score: lighthouse?.categories?.performance?.score,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export const cwvHandlers = {
|
|
92
|
+
cwv_analyze_url: async (params) => {
|
|
93
|
+
if (!hasGoogleApiKey()) {
|
|
94
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "Google API key not configured. Add google_api_key to WP_SITES_CONFIG." }] } };
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const { url, strategy, categories } = params;
|
|
98
|
+
const apiKey = getGoogleApiKey();
|
|
99
|
+
const queryParams = { url, key: apiKey, strategy: strategy || 'mobile' };
|
|
100
|
+
queryParams.category = categories && categories.length > 0 ? categories : ['performance'];
|
|
101
|
+
const response = await axios.get(PSI_BASE, { params: queryParams, timeout: 60000 });
|
|
102
|
+
const cwv = extractCWV(response.data.lighthouseResult);
|
|
103
|
+
const result = { url, strategy: strategy || 'mobile', cwv, fieldData: response.data.loadingExperience || null };
|
|
104
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] } };
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
108
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error analyzing URL: ${errorMessage}` }] } };
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
cwv_batch_analyze: async (params) => {
|
|
112
|
+
if (!hasGoogleApiKey()) {
|
|
113
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "Google API key not configured. Add google_api_key to WP_SITES_CONFIG." }] } };
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const { urls, strategy } = params;
|
|
117
|
+
const limitedUrls = urls.slice(0, 10);
|
|
118
|
+
const apiKey = getGoogleApiKey();
|
|
119
|
+
const results = [];
|
|
120
|
+
for (const url of limitedUrls) {
|
|
121
|
+
try {
|
|
122
|
+
const response = await axios.get(PSI_BASE, {
|
|
123
|
+
params: { url, key: apiKey, strategy: strategy || 'mobile', category: 'performance' },
|
|
124
|
+
timeout: 60000,
|
|
125
|
+
});
|
|
126
|
+
const cwv = extractCWV(response.data.lighthouseResult);
|
|
127
|
+
results.push({ url, cwv, status: 'ok' });
|
|
128
|
+
}
|
|
129
|
+
catch (err) {
|
|
130
|
+
results.push({ url, status: 'error', error: err.response?.data?.error?.message || err.message });
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(results, null, 2) }] } };
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error in batch analysis: ${error.message}` }] } };
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
cwv_get_field_data: async (params) => {
|
|
140
|
+
if (!hasGoogleApiKey()) {
|
|
141
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "Google API key not configured. Add google_api_key to WP_SITES_CONFIG." }] } };
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
const { url, origin, form_factor } = params;
|
|
145
|
+
const apiKey = getGoogleApiKey();
|
|
146
|
+
const requestBody = {};
|
|
147
|
+
if (url)
|
|
148
|
+
requestBody.url = url;
|
|
149
|
+
else if (origin)
|
|
150
|
+
requestBody.origin = origin;
|
|
151
|
+
else
|
|
152
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "Provide either url or origin parameter." }] } };
|
|
153
|
+
if (form_factor && form_factor !== 'ALL_FORM_FACTORS')
|
|
154
|
+
requestBody.formFactor = form_factor;
|
|
155
|
+
const response = await axios.post(CRUX_BASE, requestBody, { params: { key: apiKey }, timeout: 30000 });
|
|
156
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }] } };
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
const errorMessage = error.response?.data?.error?.message || error.message;
|
|
160
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error getting CrUX data: ${errorMessage}` }] } };
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
cwv_compare_pages: async (params) => {
|
|
164
|
+
if (!hasGoogleApiKey()) {
|
|
165
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: "Google API key not configured. Add google_api_key to WP_SITES_CONFIG." }] } };
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
const { urls, strategy } = params;
|
|
169
|
+
const limitedUrls = urls.slice(0, 5);
|
|
170
|
+
const apiKey = getGoogleApiKey();
|
|
171
|
+
const results = [];
|
|
172
|
+
for (const url of limitedUrls) {
|
|
173
|
+
try {
|
|
174
|
+
const response = await axios.get(PSI_BASE, {
|
|
175
|
+
params: { url, key: apiKey, strategy: strategy || 'mobile', category: 'performance' },
|
|
176
|
+
timeout: 60000,
|
|
177
|
+
});
|
|
178
|
+
const cwv = extractCWV(response.data.lighthouseResult);
|
|
179
|
+
results.push({ url, cwv });
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
results.push({ url, cwv: null, error: err.message });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Rank by worst LCP
|
|
186
|
+
const ranked = results
|
|
187
|
+
.filter(r => r.cwv)
|
|
188
|
+
.sort((a, b) => (b.cwv.lcp || 0) - (a.cwv.lcp || 0))
|
|
189
|
+
.map((r, i) => ({ ...r, priority: i + 1 }));
|
|
190
|
+
return { toolResult: { content: [{ type: "text", text: JSON.stringify({ comparison: ranked, worst_first: true }, null, 2) }] } };
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
return { toolResult: { isError: true, content: [{ type: "text", text: `Error comparing pages: ${error.message}` }] } };
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
};
|