claude-plugin-wordpress-manager 1.5.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 +2 -2
- package/CHANGELOG.md +92 -0
- 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/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-site-type-guides-design.md +44 -0
- package/package.json +2 -2
- package/skills/wordpress-router/references/decision-tree.md +12 -2
- 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-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-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
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
# WordPress Blog — Guida Completa
|
|
2
|
+
|
|
3
|
+
**Tipologia:** Blog (personale, aziendale, magazine)
|
|
4
|
+
**Versione:** 1.0.0
|
|
5
|
+
**Ultima modifica:** 2026-02-27
|
|
6
|
+
**Skill correlate:** wp-block-themes, wp-local-env, wp-content, wp-deploy
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 1. Panoramica
|
|
11
|
+
|
|
12
|
+
### Cos'e un WordPress Blog
|
|
13
|
+
|
|
14
|
+
Un blog WordPress e un sito centrato sulla pubblicazione regolare di contenuti testuali (post), organizzati cronologicamente e classificati per categorie e tag. WordPress nasce come piattaforma blog ed e tuttora lo strumento piu potente per questo scopo.
|
|
15
|
+
|
|
16
|
+
### Quando scegliere un blog
|
|
17
|
+
|
|
18
|
+
- **Blog personale/developer journal**: pensieri, tutorial, note tecniche
|
|
19
|
+
- **Blog aziendale**: content marketing, thought leadership, SEO organico
|
|
20
|
+
- **Magazine/rivista online**: multi-autore, alto volume, categorie complesse
|
|
21
|
+
- **Blog + portfolio**: sezione articoli affiancata a una vetrina lavori
|
|
22
|
+
|
|
23
|
+
### Metriche chiave
|
|
24
|
+
|
|
25
|
+
| Metrica | Cosa misura | Tool |
|
|
26
|
+
|---------|-------------|------|
|
|
27
|
+
| Sessioni organiche | Traffico da ricerca | Google Search Console |
|
|
28
|
+
| Tempo medio sulla pagina | Qualita del contenuto | Google Analytics |
|
|
29
|
+
| Bounce rate | Pertinenza del contenuto | Google Analytics |
|
|
30
|
+
| Pagine per sessione | Engagement e interlinking | Google Analytics |
|
|
31
|
+
| Posizionamento keyword | Visibilita SEO | Rank tracker |
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## 2. Per l'Utente
|
|
36
|
+
|
|
37
|
+
Questa sezione copre la gestione operativa del blog tramite Claude Code e il plugin wordpress-manager.
|
|
38
|
+
|
|
39
|
+
### 2.1 Concept e Pianificazione
|
|
40
|
+
|
|
41
|
+
**Definisci l'identita del blog prima di scrivere codice.**
|
|
42
|
+
|
|
43
|
+
1. **Nicchia**: scegli un argomento specifico (es. "WordPress development" non "tecnologia")
|
|
44
|
+
2. **Naming**: nome breve, memorizzabile, disponibile come dominio
|
|
45
|
+
3. **Tone of voice**: formale vs conversazionale, tecnico vs divulgativo
|
|
46
|
+
4. **Palette colori**:
|
|
47
|
+
- Blog personale: toni scuri (developer) o neutri (minimalista)
|
|
48
|
+
- Blog aziendale: colori brand, alta leggibilita
|
|
49
|
+
- Magazine: contrasti forti, gerarchia visiva chiara
|
|
50
|
+
5. **Struttura pagine**:
|
|
51
|
+
- Homepage (ultimi post o post in evidenza)
|
|
52
|
+
- About (chi sei, perche scrivi)
|
|
53
|
+
- Contatti
|
|
54
|
+
- Archivio per categoria (opzionale)
|
|
55
|
+
|
|
56
|
+
### 2.2 Setup Ambiente Locale
|
|
57
|
+
|
|
58
|
+
**Creare un blog WordPress locale con wp-env:**
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# 1. Creare la directory del progetto
|
|
62
|
+
mkdir -p ~/projects/mio-blog
|
|
63
|
+
cd ~/projects/mio-blog
|
|
64
|
+
|
|
65
|
+
# 2. Creare .wp-env.json
|
|
66
|
+
cat > .wp-env.json << 'EOF'
|
|
67
|
+
{
|
|
68
|
+
"core": "WordPress/WordPress#master",
|
|
69
|
+
"themes": ["./themes/mio-tema"],
|
|
70
|
+
"plugins": [],
|
|
71
|
+
"config": {
|
|
72
|
+
"WP_DEBUG": true,
|
|
73
|
+
"WP_DEBUG_LOG": true,
|
|
74
|
+
"SCRIPT_DEBUG": true
|
|
75
|
+
},
|
|
76
|
+
"port": 8888
|
|
77
|
+
}
|
|
78
|
+
EOF
|
|
79
|
+
|
|
80
|
+
# 3. Creare la struttura del tema
|
|
81
|
+
mkdir -p themes/mio-tema/{templates,parts,patterns}
|
|
82
|
+
|
|
83
|
+
# 4. Avviare WordPress
|
|
84
|
+
npx wp-env start
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Con Claude Code (linguaggio naturale):**
|
|
88
|
+
|
|
89
|
+
> "Crea un nuovo progetto WordPress blog con wp-env, tema block dark con font monospace per i titoli, avvialo su localhost:8888"
|
|
90
|
+
|
|
91
|
+
Claude usera le skill `wp-local-env` e `wp-block-themes` per eseguire tutti i passi.
|
|
92
|
+
|
|
93
|
+
**Credenziali default wp-env:** `admin` / `password` su `http://localhost:8888/wp-admin/`
|
|
94
|
+
|
|
95
|
+
### 2.3 Struttura Contenuti
|
|
96
|
+
|
|
97
|
+
#### Tassonomia
|
|
98
|
+
|
|
99
|
+
Organizza i contenuti prima di scrivere:
|
|
100
|
+
|
|
101
|
+
| Elemento | Scopo | Esempio |
|
|
102
|
+
|----------|-------|---------|
|
|
103
|
+
| **Categorie** | Macro-argomenti (max 5-7) | Architecture, Debugging, Tools |
|
|
104
|
+
| **Tag** | Argomenti trasversali | javascript, wordpress, cli |
|
|
105
|
+
| **Formati** | Tipologia del post | How-to, Lista, Opinione, Case study |
|
|
106
|
+
|
|
107
|
+
**Regole pratiche:**
|
|
108
|
+
- Ogni post ha UNA categoria principale
|
|
109
|
+
- I tag sono opzionali, usali solo se ricorrenti (almeno 3 post per tag)
|
|
110
|
+
- Non creare categorie per un solo post
|
|
111
|
+
|
|
112
|
+
#### Piano Editoriale
|
|
113
|
+
|
|
114
|
+
Per un blog personale, 1-2 post a settimana e sostenibile. Per un blog aziendale, pianifica almeno un mese avanti.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Settimana 1: [How-to] Come configurare wp-env per sviluppo locale
|
|
118
|
+
Settimana 2: [Opinione] Perche i block theme sono il futuro
|
|
119
|
+
Settimana 3: [Lista] 5 plugin essenziali per ogni blog WordPress
|
|
120
|
+
Settimana 4: [Case study] Migrazione da tema classico a block theme
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### Formati dei Post
|
|
124
|
+
|
|
125
|
+
| Formato | Lunghezza | Quando usarlo |
|
|
126
|
+
|---------|-----------|---------------|
|
|
127
|
+
| How-to/tutorial | 1500-2500 parole | Insegnare un processo step-by-step |
|
|
128
|
+
| Lista (listicle) | 800-1500 parole | Raccogliere risorse o consigli |
|
|
129
|
+
| Opinione | 500-1000 parole | Prendere posizione su un tema |
|
|
130
|
+
| Case study | 1000-2000 parole | Raccontare un progetto reale |
|
|
131
|
+
| Quick tip | 300-500 parole | Condividere un trucco specifico |
|
|
132
|
+
|
|
133
|
+
### 2.4 Gestione Quotidiana
|
|
134
|
+
|
|
135
|
+
#### Creare un post via WP-CLI
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# Creare un post pubblicato
|
|
139
|
+
npx wp-env run cli wp post create \
|
|
140
|
+
--post_type=post \
|
|
141
|
+
--post_status=publish \
|
|
142
|
+
--post_title="Titolo del post" \
|
|
143
|
+
--post_category=2 \
|
|
144
|
+
--post_content='<!-- wp:paragraph -->
|
|
145
|
+
<p>Contenuto del post con markup Gutenberg.</p>
|
|
146
|
+
<!-- /wp:paragraph -->'
|
|
147
|
+
|
|
148
|
+
# Creare una bozza
|
|
149
|
+
npx wp-env run cli wp post create \
|
|
150
|
+
--post_type=post \
|
|
151
|
+
--post_status=draft \
|
|
152
|
+
--post_title="Bozza articolo"
|
|
153
|
+
|
|
154
|
+
# Programmare un post futuro
|
|
155
|
+
npx wp-env run cli wp post create \
|
|
156
|
+
--post_type=post \
|
|
157
|
+
--post_status=future \
|
|
158
|
+
--post_date="2026-03-15 09:00:00" \
|
|
159
|
+
--post_title="Post programmato"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### Gestire le revisioni
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Vedere le revisioni di un post
|
|
166
|
+
npx wp-env run cli wp post list --post_type=revision --post_parent=4
|
|
167
|
+
|
|
168
|
+
# Limitare il numero di revisioni (in wp-config.php)
|
|
169
|
+
npx wp-env run cli wp config set WP_POST_REVISIONS 5 --raw
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
#### Gestire i commenti
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Disabilitare commenti sui nuovi post
|
|
176
|
+
npx wp-env run cli wp option update default_comment_status closed
|
|
177
|
+
|
|
178
|
+
# Moderare commenti in attesa
|
|
179
|
+
npx wp-env run cli wp comment list --status=hold --fields=ID,comment_author,comment_content
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 2.5 SEO e Performance
|
|
183
|
+
|
|
184
|
+
#### Permalink
|
|
185
|
+
|
|
186
|
+
Usa la struttura `/%postname%/` — la migliore per SEO:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
npx wp-env run cli wp rewrite structure '/%postname%/'
|
|
190
|
+
npx wp-env run cli wp rewrite flush --hard
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### Titoli e Meta
|
|
194
|
+
|
|
195
|
+
- **Title tag**: keyword principale + brand (es. "Come usare wp-env | Developer Journal")
|
|
196
|
+
- **Meta description**: 150-160 caratteri, include CTA implicita
|
|
197
|
+
- **Heading hierarchy**: un solo H1 (titolo post), H2 per sezioni, H3 per sotto-sezioni
|
|
198
|
+
- **URL slug**: breve, senza stop words (es. `/guida-wp-env/` non `/come-usare-wp-env-per-sviluppo-locale/`)
|
|
199
|
+
|
|
200
|
+
#### Sitemap e Indicizzazione
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
# Verifica che la sitemap sia attiva (richiede plugin SEO)
|
|
204
|
+
curl -s http://localhost:8888/wp-sitemap.xml | head -5
|
|
205
|
+
|
|
206
|
+
# WordPress 5.5+ genera sitemap native
|
|
207
|
+
# Per sitemap avanzate, installare Yoast SEO o Rank Math
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
#### Performance Essenziale
|
|
211
|
+
|
|
212
|
+
| Azione | Impatto | Come |
|
|
213
|
+
|--------|---------|------|
|
|
214
|
+
| Caching pagine | Alto | Plugin: WP Super Cache, W3 Total Cache |
|
|
215
|
+
| Lazy loading immagini | Medio | Nativo da WP 5.5 (attributo `loading="lazy"`) |
|
|
216
|
+
| Ottimizzazione immagini | Alto | Plugin: ShortPixel, Imagify |
|
|
217
|
+
| Minificazione CSS/JS | Medio | Plugin: Autoptimize |
|
|
218
|
+
| CDN | Alto (traffico alto) | Cloudflare (free tier) |
|
|
219
|
+
|
|
220
|
+
### 2.6 Manutenzione e Backup
|
|
221
|
+
|
|
222
|
+
#### Backup Database
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
# Export completo
|
|
226
|
+
npx wp-env run cli wp db export - > backup_$(date +%Y%m%d).sql
|
|
227
|
+
|
|
228
|
+
# Export solo contenuti (post, pagine, commenti)
|
|
229
|
+
npx wp-env run cli wp export --dir=/tmp --post_type=post,page
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
#### Aggiornamenti
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
# Verificare aggiornamenti disponibili
|
|
236
|
+
npx wp-env run cli wp core check-update
|
|
237
|
+
npx wp-env run cli wp plugin list --update=available
|
|
238
|
+
npx wp-env run cli wp theme list --update=available
|
|
239
|
+
|
|
240
|
+
# Aggiornare tutto
|
|
241
|
+
npx wp-env run cli wp core update
|
|
242
|
+
npx wp-env run cli wp plugin update --all
|
|
243
|
+
npx wp-env run cli wp theme update --all
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
#### Monitoraggio
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
# Stato generale del sito
|
|
250
|
+
npx wp-env run cli wp cli info
|
|
251
|
+
npx wp-env run cli wp option get siteurl
|
|
252
|
+
npx wp-env run cli wp option get blogname
|
|
253
|
+
|
|
254
|
+
# Controllo database
|
|
255
|
+
npx wp-env run cli wp db check
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## 3. Per lo Sviluppatore
|
|
261
|
+
|
|
262
|
+
Questa sezione copre l'architettura tecnica e le best practice per sviluppare un block theme per blog.
|
|
263
|
+
|
|
264
|
+
### 3.1 Architettura Theme
|
|
265
|
+
|
|
266
|
+
Un block theme per blog necessita di questi template e parts:
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
themes/mio-blog-theme/
|
|
270
|
+
├── style.css # Header theme (metadata)
|
|
271
|
+
├── theme.json # Design tokens e stili globali
|
|
272
|
+
├── functions.php # Enqueue fonts, setup theme (opzionale)
|
|
273
|
+
├── templates/
|
|
274
|
+
│ ├── index.html # Fallback + homepage (query loop)
|
|
275
|
+
│ ├── single.html # Singolo post
|
|
276
|
+
│ ├── page.html # Pagina statica
|
|
277
|
+
│ ├── archive.html # Archivio per categoria/tag/data
|
|
278
|
+
│ ├── search.html # Risultati ricerca
|
|
279
|
+
│ └── 404.html # Pagina non trovata
|
|
280
|
+
├── parts/
|
|
281
|
+
│ ├── header.html # Header con site title + navigazione
|
|
282
|
+
│ └── footer.html # Footer con copyright + link
|
|
283
|
+
└── patterns/ # Block patterns opzionali
|
|
284
|
+
├── hero-post.php
|
|
285
|
+
└── newsletter-cta.php
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
**Template hierarchy per blog:**
|
|
289
|
+
La gerarchia dei template WordPress determina quale file viene usato:
|
|
290
|
+
- Post singolo: `single-{post_type}.html` → `single.html` → `index.html`
|
|
291
|
+
- Archivio categoria: `category-{slug}.html` → `category.html` → `archive.html` → `index.html`
|
|
292
|
+
- Pagina: `page-{slug}.html` → `page.html` → `index.html`
|
|
293
|
+
|
|
294
|
+
### 3.2 theme.json — Design Tokens
|
|
295
|
+
|
|
296
|
+
#### Palette per Blog
|
|
297
|
+
|
|
298
|
+
Un blog richiede alta leggibilita per testo lungo. Regole:
|
|
299
|
+
|
|
300
|
+
- **Contrasto**: minimo 7:1 per body text (WCAG AAA)
|
|
301
|
+
- **Colori limitati**: 5-7 colori massimo (base, contrast, accent, surface, muted, border)
|
|
302
|
+
- **Accent color**: usato per link e CTA, deve risaltare senza stancare
|
|
303
|
+
|
|
304
|
+
```json
|
|
305
|
+
{
|
|
306
|
+
"settings": {
|
|
307
|
+
"color": {
|
|
308
|
+
"palette": [
|
|
309
|
+
{ "slug": "base", "color": "#0f172a", "name": "Base" },
|
|
310
|
+
{ "slug": "contrast", "color": "#f8fafc", "name": "Contrast" },
|
|
311
|
+
{ "slug": "accent", "color": "#6366f1", "name": "Accent" },
|
|
312
|
+
{ "slug": "surface", "color": "#1e293b", "name": "Surface" },
|
|
313
|
+
{ "slug": "muted", "color": "#94a3b8", "name": "Muted" }
|
|
314
|
+
]
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
#### Typography Scale per Long-Form
|
|
321
|
+
|
|
322
|
+
```json
|
|
323
|
+
{
|
|
324
|
+
"settings": {
|
|
325
|
+
"typography": {
|
|
326
|
+
"fontFamilies": [
|
|
327
|
+
{
|
|
328
|
+
"fontFamily": "'JetBrains Mono', monospace",
|
|
329
|
+
"slug": "heading",
|
|
330
|
+
"name": "Heading"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"fontFamily": "'Inter', sans-serif",
|
|
334
|
+
"slug": "body",
|
|
335
|
+
"name": "Body"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"fontSizes": [
|
|
339
|
+
{ "slug": "small", "size": "0.875rem" },
|
|
340
|
+
{ "slug": "medium", "size": "1rem" },
|
|
341
|
+
{ "slug": "large", "size": "1.25rem" },
|
|
342
|
+
{ "slug": "x-large", "size": "1.75rem" },
|
|
343
|
+
{ "slug": "xx-large", "size": "2.5rem" }
|
|
344
|
+
]
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
**Nota:** `line-height: 1.7` per body text e ottimale per la lettura di articoli lunghi. Per i titoli, `1.2` mantiene compattezza.
|
|
351
|
+
|
|
352
|
+
#### Layout
|
|
353
|
+
|
|
354
|
+
```json
|
|
355
|
+
{
|
|
356
|
+
"settings": {
|
|
357
|
+
"layout": {
|
|
358
|
+
"contentSize": "720px",
|
|
359
|
+
"wideSize": "1100px"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
- **720px content**: larghezza ottimale per leggibilita (65-75 caratteri per riga)
|
|
366
|
+
- **1100px wide**: per immagini, code block, tabelle che necessitano piu spazio
|
|
367
|
+
|
|
368
|
+
### 3.3 Templates e Parts
|
|
369
|
+
|
|
370
|
+
#### index.html — Homepage con Query Loop
|
|
371
|
+
|
|
372
|
+
Il template principale del blog usa il blocco `core/query` per elencare i post:
|
|
373
|
+
|
|
374
|
+
```html
|
|
375
|
+
<!-- wp:template-part {"slug":"header","area":"header"} /-->
|
|
376
|
+
|
|
377
|
+
<!-- wp:group {"tagName":"main","layout":{"type":"constrained"}} -->
|
|
378
|
+
<main class="wp-block-group">
|
|
379
|
+
<!-- wp:query {"queryId":1,"query":{"perPage":10,"inherit":true}} -->
|
|
380
|
+
<div class="wp-block-query">
|
|
381
|
+
<!-- wp:post-template -->
|
|
382
|
+
<!-- wp:post-date /-->
|
|
383
|
+
<!-- wp:post-title {"isLink":true} /-->
|
|
384
|
+
<!-- wp:post-excerpt {"moreText":"continua →"} /-->
|
|
385
|
+
<!-- /wp:post-template -->
|
|
386
|
+
|
|
387
|
+
<!-- wp:query-pagination -->
|
|
388
|
+
<!-- wp:query-pagination-previous /-->
|
|
389
|
+
<!-- wp:query-pagination-numbers /-->
|
|
390
|
+
<!-- wp:query-pagination-next /-->
|
|
391
|
+
<!-- /wp:query-pagination -->
|
|
392
|
+
</div>
|
|
393
|
+
<!-- /wp:query -->
|
|
394
|
+
</main>
|
|
395
|
+
<!-- /wp:group -->
|
|
396
|
+
|
|
397
|
+
<!-- wp:template-part {"slug":"footer","area":"footer"} /-->
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**`inherit: true`** fa si che WordPress usi la query principale della pagina, rispettando archivi e ricerche.
|
|
401
|
+
|
|
402
|
+
#### single.html — Post con Navigazione
|
|
403
|
+
|
|
404
|
+
Elementi chiave del template single:
|
|
405
|
+
- Data pubblicazione (`core/post-date`)
|
|
406
|
+
- Titolo (`core/post-title`)
|
|
407
|
+
- Categorie/tag (`core/post-terms`)
|
|
408
|
+
- Contenuto (`core/post-content`)
|
|
409
|
+
- Navigazione prev/next (`core/post-navigation-link`)
|
|
410
|
+
|
|
411
|
+
#### header.html — Navigazione
|
|
412
|
+
|
|
413
|
+
```html
|
|
414
|
+
<!-- wp:group {"layout":{"type":"flex","justifyContent":"space-between"}} -->
|
|
415
|
+
<!-- wp:site-title /-->
|
|
416
|
+
<!-- wp:navigation {"overlayMenu":"mobile"} -->
|
|
417
|
+
<!-- wp:navigation-link {"label":"Home","url":"/"} /-->
|
|
418
|
+
<!-- wp:navigation-link {"label":"About","url":"/about/"} /-->
|
|
419
|
+
<!-- /wp:navigation -->
|
|
420
|
+
<!-- /wp:group -->
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
**`overlayMenu: "mobile"`** attiva automaticamente il menu hamburger su schermi piccoli.
|
|
424
|
+
|
|
425
|
+
### 3.4 Patterns e Blocchi Custom
|
|
426
|
+
|
|
427
|
+
#### Pattern: Newsletter CTA
|
|
428
|
+
|
|
429
|
+
```php
|
|
430
|
+
<?php
|
|
431
|
+
/**
|
|
432
|
+
* Title: Newsletter CTA
|
|
433
|
+
* Slug: mio-tema/newsletter-cta
|
|
434
|
+
* Categories: call-to-action
|
|
435
|
+
*/
|
|
436
|
+
?>
|
|
437
|
+
<!-- wp:group {"backgroundColor":"surface","style":{"spacing":{"padding":{"top":"2rem","bottom":"2rem","left":"2rem","right":"2rem"}},"border":{"radius":"8px"}}} -->
|
|
438
|
+
<div class="wp-block-group has-surface-background-color has-background" style="border-radius:8px;padding:2rem">
|
|
439
|
+
<!-- wp:heading {"level":3} -->
|
|
440
|
+
<h3 class="wp-block-heading">Resta aggiornato</h3>
|
|
441
|
+
<!-- /wp:heading -->
|
|
442
|
+
<!-- wp:paragraph {"textColor":"muted"} -->
|
|
443
|
+
<p class="has-muted-color has-text-color">Ricevi i nuovi post direttamente nella tua inbox. Niente spam, solo contenuti.</p>
|
|
444
|
+
<!-- /wp:paragraph -->
|
|
445
|
+
</div>
|
|
446
|
+
<!-- /wp:group -->
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
Registra i pattern nella directory `patterns/` — WordPress li scopre automaticamente dal frontmatter PHP.
|
|
450
|
+
|
|
451
|
+
### 3.5 Plugin Consigliati
|
|
452
|
+
|
|
453
|
+
| Plugin | Scopo | Alternativa |
|
|
454
|
+
|--------|-------|-------------|
|
|
455
|
+
| **Yoast SEO** | SEO on-page, sitemap, schema | Rank Math (free, piu funzioni) |
|
|
456
|
+
| **WP Super Cache** | Caching pagine | W3 Total Cache |
|
|
457
|
+
| **Akismet** | Anti-spam commenti | Antispam Bee (GDPR-friendly) |
|
|
458
|
+
| **UpdraftPlus** | Backup automatici | BackWPup |
|
|
459
|
+
| **ShortPixel** | Ottimizzazione immagini | Imagify, EWWW |
|
|
460
|
+
| **Redirection** | Gestione redirect 301 | — |
|
|
461
|
+
| **WP Mail SMTP** | Delivery email affidabile | — |
|
|
462
|
+
|
|
463
|
+
**Per sviluppo locale**, i plugin si aggiungono in `.wp-env.json`:
|
|
464
|
+
|
|
465
|
+
```json
|
|
466
|
+
{
|
|
467
|
+
"plugins": [
|
|
468
|
+
"https://downloads.wordpress.org/plugin/wordpress-seo.latest-stable.zip"
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
### 3.6 Workflow di Sviluppo Locale
|
|
474
|
+
|
|
475
|
+
#### Ciclo di sviluppo
|
|
476
|
+
|
|
477
|
+
```
|
|
478
|
+
1. Modifica file theme (templates, theme.json, patterns)
|
|
479
|
+
↓
|
|
480
|
+
2. Salva — wp-env monta i file in tempo reale
|
|
481
|
+
↓
|
|
482
|
+
3. Ricarica browser su localhost:8888
|
|
483
|
+
↓
|
|
484
|
+
4. Verifica nel Site Editor (wp-admin/site-editor.php)
|
|
485
|
+
↓
|
|
486
|
+
5. Ripeti
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
**Hot reload**: wp-env mappa la directory del tema tramite Docker volumes. Ogni modifica ai file e immediatamente visibile senza riavviare i container.
|
|
490
|
+
|
|
491
|
+
#### Comandi WP-CLI utili per sviluppo blog
|
|
492
|
+
|
|
493
|
+
```bash
|
|
494
|
+
# Generare post di test
|
|
495
|
+
npx wp-env run cli wp post generate --count=20 --post_type=post
|
|
496
|
+
|
|
497
|
+
# Rigenerare thumbnails dopo cambio dimensioni
|
|
498
|
+
npx wp-env run cli wp media regenerate --yes
|
|
499
|
+
|
|
500
|
+
# Importare contenuti demo (WordPress Theme Unit Test)
|
|
501
|
+
npx wp-env run cli wp import /path/to/theme-unit-test.xml --authors=create
|
|
502
|
+
|
|
503
|
+
# Resettare il sito (attenzione: cancella tutto)
|
|
504
|
+
npx wp-env clean all
|
|
505
|
+
|
|
506
|
+
# Fermare e riavviare
|
|
507
|
+
npx wp-env stop
|
|
508
|
+
npx wp-env start
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
#### Debug
|
|
512
|
+
|
|
513
|
+
```bash
|
|
514
|
+
# Leggere il log di debug
|
|
515
|
+
npx wp-env run cli cat /var/www/html/wp-content/debug.log
|
|
516
|
+
|
|
517
|
+
# Controllare errori PHP
|
|
518
|
+
npx wp-env logs wordpress --watch
|
|
519
|
+
|
|
520
|
+
# Verificare che il tema sia valido
|
|
521
|
+
npx wp-env run cli wp theme status developer-journal
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
## 4. Checklist di Lancio
|
|
527
|
+
|
|
528
|
+
### Contenuti
|
|
529
|
+
- [ ] Almeno 5 post pubblicati con contenuto di qualita
|
|
530
|
+
- [ ] Pagina About completa
|
|
531
|
+
- [ ] Pagina Contatti con form funzionante
|
|
532
|
+
- [ ] Categorie create e assegnate a ogni post
|
|
533
|
+
- [ ] Immagini in evidenza per ogni post (opzionale ma consigliato)
|
|
534
|
+
|
|
535
|
+
### Tecnico
|
|
536
|
+
- [ ] Theme attivo e verificato su mobile/tablet/desktop
|
|
537
|
+
- [ ] Permalink impostati su `/%postname%/`
|
|
538
|
+
- [ ] Titolo sito e tagline configurati
|
|
539
|
+
- [ ] Favicon/site icon impostata
|
|
540
|
+
- [ ] Menu di navigazione funzionante
|
|
541
|
+
- [ ] Template 404 personalizzato
|
|
542
|
+
- [ ] `functions.php` carica i font correttamente
|
|
543
|
+
|
|
544
|
+
### SEO
|
|
545
|
+
- [ ] Plugin SEO installato e configurato
|
|
546
|
+
- [ ] Sitemap XML accessibile (`/wp-sitemap.xml`)
|
|
547
|
+
- [ ] Meta description su pagine principali
|
|
548
|
+
- [ ] Google Search Console collegato (produzione)
|
|
549
|
+
- [ ] robots.txt non blocca il crawling
|
|
550
|
+
|
|
551
|
+
### Performance
|
|
552
|
+
- [ ] Immagini ottimizzate (WebP, dimensioni appropriate)
|
|
553
|
+
- [ ] Caching attivo (produzione)
|
|
554
|
+
- [ ] Nessun plugin inutile attivo
|
|
555
|
+
- [ ] Lighthouse score > 90 su mobile
|
|
556
|
+
|
|
557
|
+
### Sicurezza
|
|
558
|
+
- [ ] Password admin forte (non la default di wp-env)
|
|
559
|
+
- [ ] Plugin aggiornati all'ultima versione
|
|
560
|
+
- [ ] SSL attivo (produzione)
|
|
561
|
+
- [ ] Commenti spam protetti (Akismet o Antispam Bee)
|
|
562
|
+
- [ ] Backup automatico configurato
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## 5. Riferimenti
|
|
567
|
+
|
|
568
|
+
### Skill del Plugin
|
|
569
|
+
|
|
570
|
+
| Skill | Quando usarla |
|
|
571
|
+
|-------|---------------|
|
|
572
|
+
| `wp-block-themes` | Sviluppo theme.json, templates, parts, patterns |
|
|
573
|
+
| `wp-local-env` | Setup e gestione ambiente wp-env |
|
|
574
|
+
| `wp-content` | Gestione contenuti, post, pagine |
|
|
575
|
+
| `wp-deploy` | Deploy in produzione |
|
|
576
|
+
| `wp-backup` | Backup e restore |
|
|
577
|
+
| `wp-performance` | Ottimizzazione performance |
|
|
578
|
+
| `wp-rest-api` | Integrazione API headless |
|
|
579
|
+
|
|
580
|
+
### Risorse Esterne
|
|
581
|
+
|
|
582
|
+
- [Block Theme Handbook](https://developer.wordpress.org/themes/block-themes/) — Documentazione ufficiale
|
|
583
|
+
- [theme.json Reference](https://developer.wordpress.org/themes/global-settings-and-styles/) — Schema completo
|
|
584
|
+
- [WordPress Template Hierarchy](https://developer.wordpress.org/themes/templates/template-hierarchy/) — Quale template viene usato
|
|
585
|
+
- [Block Editor Handbook](https://developer.wordpress.org/block-editor/) — Riferimento blocchi core
|
|
586
|
+
- [WP-CLI Commands](https://developer.wordpress.org/cli/commands/) — Tutti i comandi CLI
|
|
587
|
+
|
|
588
|
+
---
|
|
589
|
+
|
|
590
|
+
*Guida per il plugin [wordpress-manager](https://github.com/morrealev/wordpress-manager) v1.5.0+*
|