== Changelog ==
# Italian SEO Validator - Changelog
## Version 3.7.8 (2026-01-08)

### BUGFIX: Slug save stability
- **FIXED:** Gutenberg slug field no longer syncs with Yoast/Rank Math; saved only to Italian SEO Validator meta to avoid redirects/overwrite loops
- **FIXED:** Removed `wp_update_post` slug writes in save_post to prevent unintended slug changes and Yoast redirects
- **FIXED:** Slug casting to string on REST save prevents undefined/TypeError on pages and drafts

## Version 3.7.7 (2026-01-06)

### BUG FIX: Meta field persistence + SERP preview
- **FIXED:** Critical bug where meta title, meta description, and slug were not being saved to database
  - ROOT CAUSE: Form field names used `italseva_` prefix but save_meta() function was checking `$_POST['ept_*']` keys
  - SOLUTION: UpdaVted save_meta() to read correct `$_POST['italseva_*']` keys before update_post_meta() calls
- **FIXED:** SERP preview showing placeholder text instead of actual meta values
  - ROOT CAUSE: JavaScript selectors were searching for `#ept-meta-*` but actual IDs were `#italseva-meta-*`
  - SOLUTION: Updated jQuery selectors in metabox rendering to use correct ID names
- **REMOVED:** Attempted featured image integration in SERP preview (incompatible with Classic Editor DOM structure)
- **RESULT:** All meta fields now correctly persist across page reloads; SERP preview displays accurate content
## Version 3.7.7 (2026-01-06)

### BUG FIX: Meta field persistence + SERP preview
- **FIXED:** Critical bug where meta title, meta description, and slug were not being saved to database
  - ROOT CAUSE: Form field names used `italseva_` prefix but save_meta() function was checking `$_POST['ept_*']` keys
  - SOLUTION: Updated save_meta() to read correct `$_POST['italseva_*']` keys before update_post_meta() calls
- **FIXED:** SERP preview showing placeholder text instead of actual meta values
  - ROOT CAUSE: JavaScript selectors were searching for `#ept-meta-*` but actual IDs were `#italseva-meta-*`
  - SOLUTION: Updated jQuery selectors in metabox rendering to use correct ID names
- **REMOVED:** Attempted featured image integration in SERP preview (incompatible with Classic Editor DOM structure)
- **RESULT:** All meta fields now correctly persist across page reloads; SERP preview displays accurate content

## Version 3.7.6 (2026-01-06)

### CRITICAL BUG FIX: Bullet points counted as long sentences
- **FIXED:** Bug where bullet points in `<ul><li>` blocks were incorrectly concatenated and counted as a single very long sentence (false positive on "frase troppo lunga")
- **ROOT CAUSE:** `strip_html_keep_structure()` was using `wp_strip_all_tags()` without preserving block-level separators, causing list items to lose sentence boundaries
- **SOLUTION IMPLEMENTED:**
  - Enhanced `strip_html_keep_structure()` to preserve sentence boundaries by adding periods after `</li>`, `</p>`, `</div>`, and `<br>` tags before stripping HTML
  - Added filtering in `analyze_long_sentences()` to skip list-like patterns (short items matching "label: description" structure)
- **IMPACT:** 
  - Eliminates false "frase troppo lunga" suggestions for bullet point content
  - More accurate Gulpease readability scoring for content with lists
  - Better distinction between actual long sentences and list items
- **TESTING:** Verified with the specific case: "il rischio è nei picchi, non nei kWh mensili..." now correctly identified as list items instead of 57-word sentence

## Version 3.7.5 (2025-11-25)

### FEATURES & BUGFIX: Pages Support + Gutenberg Slug Handling
- **ADDED:** Full support for Pages - validator now appears in both Gutenberg sidebar and Classic Editor metabox for pages
- **FIXED:** Gutenberg sidebar TypeError on Pages - seoSlug value now safely converted to string before calling trim() (handles null/undefined from pages)
- **IMPROVED:** Meta field registration extended to pages - all validator meta fields (_italseva_intent, _italseva_keyword, _italseva_result, _italseva_seo_title/description) now register for both 'post' and 'page' post types
- **RESULT:** Users can now validate pages using the validator, with same functionality as posts

## Version 3.7.4 (2026-01-05)

### BUG FIX: Slug box sync and fallback
- **FIXED:** Lo slug ora si carica anche se non presente nei meta Yoast/RankMath, usando lo slug corrente del post come fallback
- **FIXED:** Quando inserisci lo slug nel box, viene scritto anche nello slug del post per evitare vuoti
- **NOTE:** Nessun impatto su scoring/analisi; fix limitato ai campi SEO Meta Tags

## Version 3.7.2 (2025-11-20)


### CRITICAL FIXES: Gutenberg & Cannibalization
- **FIXED:** Gutenberg keyword auto-save - Main Keyword ora salvata automaticamente in `_italseva_keyword` meta quando l'utente la modifica (risolve problema keyword persa al reload)
- **FIXED:** Cannibalization check Gutenberg - ora funziona correttamente su nuovi post con slug manuale inserito (non richiede più pubblicazione articolo)
- **FIXED:** Cannibalization warning corretto - messaggio "Inserisci lo slug manualmente" invece di "Salva prima l'articolo" per nuovi post
- **FIXED:** Classic Editor cannibalization - eliminato errore "undefined" al primo click, warning ora mostra correttamente con bottone "Ricontrolla"
- **IMPROVED:** Logica slug-based cannibalization - verifica keyword salvata in `_italseva_keyword` invece di richiedere pubblicazione
- **IMPROVED:** Button label Gutenberg - mostra "Check Cannibalizzazione" invece di generico "Ricontrolla"
- **STABILITY:** Eliminati race conditions e comportamenti inconsistenti tra Gutenberg/Classic su nuovi post
- **RESULT:** Plugin ora completamente funzionante su post in bozza con slug manuale - nessuna pubblicazione richiesta per controlli

## Version 3.7.1 (2025-11-20)

### IMPROVEMENTS: Cannibalization Detection & Scoring Refinements
- **FIXED:** Empty slug detection for new posts - validation now requires manual slug entry before checking keyword cannibalization
- **ADDED:** Warning system for missing slugs - users see clear message "Per controllare la cannibalizzazione devi inserire lo slug manualmente" with "Ricontrolla" button
- **IMPROVED:** Cannibalization algorithm - weighted similarity (60% slug + 40% keyword), prioritizes keyword match when ≥95% similar
- **IMPROVED:** Manual slug parameter added to REST API - frontend editors pass slug explicitly for accurate duplicate detection
- **IMPROVED:** Gulpease readability rescaled - realistic thresholds (80+→100pts, 70-79→92pts, 60-69→78pts, 50-59→65pts, 40-49→45pts, <40→25pts)
- **ADDED:** Intent-based word count validation - minimum thresholds per content type (news:500, how_to:1200, pillar:1500) with -20pts penalty if insufficient
- **ADDED:** Entity salience outro check - keyword presence in conclusion paragraph verified with -5pts penalty if missing
- **ADDED:** Citation pattern detection - authoritative content (news/pillar) checked for source attribution ("secondo|fonte|studio|ricerca") with -12pts or -6pts penalties
- **RESULT:** Cannibalization false positives eliminated, scoring more realistic (good content 70-75 instead of 80-85), content depth properly validated

## Version 3.7.0 (2025-11-16)

### MAJOR UPDATE: WordPress.org Compliance - Prefix Renaming
- **CRITICAL:** Renamed all "ept" prefixes (3 characters) to "italseva" (8 characters) for WordPress.org compliance
- **CHANGED:** Constants: EPT_VERSION → ITALSEVA_VERSION, EPT_VALIDATOR_VERSION → ITALSEVA_VALIDATOR_VERSION, etc.
- **CHANGED:** AJAX actions: wp_ajax_ept_* → wp_ajax_italseva_*
- **CHANGED:** Options: ept_validator_* → italseva_validator_*
- **CHANGED:** Database tables: wp_ept_usage → wp_italseva_usage, wp_ept_user_tiers → wp_italseva_user_tiers
- **CHANGED:** Meta keys: _ept_intent, _ept_keyword, _ept_result → _italseva_intent, _italseva_keyword, _italseva_result
- **CHANGED:** REST API namespace: ept/v1 → italseva/v1
- **CHANGED:** JS localized objects: eptAdmin → italsevaAdmin, eptClassic → italsevaClassic, eptConfig → italsevaConfig
- **CHANGED:** CSS classes: .ept-* → .italseva-* (maintained for styling consistency)
- **CHANGED:** File names: ept-*.js, ept-*.css → italseva-*.js, italseva-*.css
- **CHANGED:** Main plugin file: ept-validator.php → italian-seo-validator.php
- **CHANGED:** Transient keys: ept_sitemap_urls → italseva_sitemap_urls
- **CHANGED:** Nonces: ept_admin_nonce → italseva_admin_nonce, ept_save_meta_nonce → italseva_save_meta_nonce
- **CHANGED:** License option: ept_license → italseva_license
- **CHANGED:** Product permalinks: ept-standard, ept-pro → italseva-standard, italseva-pro
- **CHANGED:** Main class: EPT_Validator → ITALSEVA_Validator
- **BACKWARDS COMPATIBILITY:** Text domain "italian-seo-validator" unchanged
- **NOTE:** This update addresses WordPress.org requirement for 4+ character prefixes to avoid naming conflicts

## Version 3.6.3 (2025-11-16)

### IMPROVEMENTS: Branding, Score Clamp, and Enhanced Persistence
- **ADDED:** Custom brand logo (red circle with white up arrow) replacing generic Dashicons icon
- **FIXED:** Final score now clamped to 0-100 range (prevents edge cases where metrics exceed 100)
- **IMPROVED:** Sidebar title changed to "Italian SEO Validator" for better brand recognition
- **IMPROVED:** Enhanced result persistence recovery with early return to prevent effect loops
- **IMPROVED:** Added debug logging for result restoration troubleshooting

## Version 3.6.2 (2025-11-16)

### BUG FIX: Gutenberg Result Persistence on Navigation
- **FIXED:** Validation results now persist when navigating to Settings and back in Gutenberg editor
- **IMPROVED:** Added dual recovery mechanism (meta reload + global cache fallback)
- **IMPROVED:** useEffect dependencies now include postId to detect editor context changes
- **STABILITY:** Results automatically restore from saved _ept_result meta when sidebar becomes visible

## Version 3.6.1 (2025-11-16)

### BUG FIXES: Post v3.6.0 Submission Issues
- **FIXED:** Usage counter box now visible in Gutenberg sidebar (matches Classic "UTILIZZO CORRENTE" display with purple gradient)
- **FIXED:** Validation results now persist correctly on page reload (enriched savedResult with intent field)
- **FIXED:** SEO Meta synchronization between Classic and Gutenberg editors (unified field names _ept_seo_title and _ept_seo_description)
- **IMPROVED:** Classic Editor now reads Yoast SEO → Rank Math → EPT fields with automatic fallback chain
- **IMPROVED:** Both editors now use identical meta field names for cross-editor compatibility
- **STABILITY:** All three reported bugs resolved for seamless Classic/Gutenberg workflow

## Version 3.6.0 (2025-11-15)

### MAJOR UPDATE: Full Gutenberg Feature Parity with Classic Editor
- **ADDED:** Breakdown Dettagliato accordion with 6-7 expandable metrics (Leggibilità, Struttura H2/H3, Ottimizzazione LLM, Semantic Relevance, AI-Proxy, E-E-A-T, Content Quality)
- **ADDED:** SEO Meta Tags input box with 3 editable fields (Meta Title, Meta Description, URL Slug)
- **ADDED:** Smart loading from Yoast SEO, Rank Math, or saved EPT values with automatic fallbacks
- **ADDED:** Meta fields registration for Gutenberg REST API access (_yoast_wpseo_title, _yoast_wpseo_metadesc, rank_math_title, rank_math_description)
- **FIXED:** Keyword density now correctly calculated in Gutenberg (was 0%, now matches Classic Editor 1:1)
- **FIXED:** SEO Meta Tags analysis box now shows correct character counts (was 0/70)
- **FIXED:** Backend API parameter `keyword` (was `main_kw` causing empty keyword analysis)
- **FIXED:** HTML content extraction from Gutenberg blocks (removed block comments <!-- wp: -->)
- **FIXED:** Meta description extraction with automatic fallback from content excerpt (first 160 chars)
- **IMPROVED:** Validation scores now identical between Classic and Gutenberg editors (100% parity)
- **IMPROVED:** Removed duplicate "Breakdown Dettagliato" visualization (kept only accordion version)
- **IMPROVED:** Removed "Dettagli Tecnici" box to avoid confusion (same data as Breakdown)
- **IMPROVED:** Suggestions now grouped by metric inside each accordion panel
- **COMPATIBILITY:** WordPress 6.7+ with full Block Editor support

## Version 3.5.4 (2025-11-15)

### FINAL FIXES: Gutenberg Sidebar Feature Complete
- **FIXED:** Link Suggestions copy button with fallback for older browsers (execCommand)
- **FIXED:** Validazione deterministica con cache hash (stesso contenuto = stesso risultato)
- **FIXED:** Breakdown Dettagliato mostra tutte 6 metriche come Classic Editor
- **IMPROVED:** Copy feedback visivo ("Copiato!" per 2 secondi)
- **IMPROVED:** Fallback clipboard per compatibilità cross-browser
- **IMPROVED:** Prevent duplicate validations (isValidating flag)
- **IMPROVED:** Intent salvato in validation result per Gulpease Benchmark
- **STABILITY:** Tutti fix applicati per full feature parity con Classic Editor

## Version 3.5.3 (2025-11-15)

### CRITICAL FIXES: Gutenberg Sidebar
- **FIXED:** Speedometer display aligned to Classic Editor (no needle, clean arc with pathLength)
- **FIXED:** HTTP 403 error on Cannibalization Check (restNonce instead of nonce)
- **FIXED:** Keyword Density score display (semantic key mapping)
- **FIXED:** Gulpease formula (89 + 300*frasi/parole - 10*lettere/parole, clamped 0-100)
- **FIXED:** Final score calculation weights aligned to Classic (20%+25%+20%+5%+15%+15%)
- **IMPROVED:** Cannibalization button color changed to orange (#f59e0b) for visibility
- **IMPROVED:** Breakdown metrics show correct semantic score
- **IMPROVED:** Details panel displays correct keyword score

## Version 3.5.2 (2025-11-15)

### UX IMPROVEMENT: Gutenberg Sidebar Redesign
- **FIXED:** Gutenberg sidebar now has full feature parity with Classic Editor
- **REMOVED:** Excessive emoji decorations (📖🏗️🤖⭐✨📊💡🔴🟠🟡🟢) for professional appearance
- **ADDED:** Gulpease Benchmark visualization (STANDARD/PRO tier)
- **ADDED:** Long Sentences analysis (>30 words detection)
- **ADDED:** Link Suggestions box (STANDARD/PRO tier)
- **IMPROVED:** Compact layout optimized for narrow sidebar (<300px width)
- **IMPROVED:** Breakdown metrics reduced from 6 to 4 critical ones
- **IMPROVED:** Suggestions limited to top 3 instead of 6
- **IMPROVED:** Typography: smaller fonts (13px→11px) for better readability
- **IMPROVED:** Speedometer gauge reduced from 200x140px to 180x120px
- **IMPROVED:** Details panel: vertical list instead of 2-column grid
- **IMPROVED:** Cannibalization check results with compact conflict cards
- **UX:** All elements aligned with Classic Editor visual style
- **COMPATIBILITY:** WordPress 6.9 tested and confirmed

## Version 3.5.1 (2025-11-15)
* NEW: Gulpease Benchmark - Confronta leggibilità con tue medie personali (30gg/90gg)
* NEW: Tooltip Gulpease dettagliato - 6 livelli con spiegazione contestuale e target
* NEW: Badge "Powered by Gulpease" - Valorizzazione indice italiano nel metabox
* NEW: Analisi frasi lunghe - Rileva top 3 frasi >25 parole con suggerimenti specifici
* IMPROVED: Score 50-59 Gulpease da 70 a 85 punti - Riconosciuto come contenuto professionale accettabile
* IMPROVED: Suggerimenti leggibilità - Solo specifici (frasi lunghe), no warning generici per 50-59
* IMPROVED: UX metabox - Font ridotti (16px numeri, 10px label), design pulito senza emoji
* IMPROVED: Benchmark personale - Griglia 3 colonne (Questo Articolo | Tua Media 30gg | Tua Media 90gg)
* REMOVED: "Top 10% blogger" marketing concept - Sostituito con progresso personale reale
* REMOVED: Emoji da UI - Aspetto professionale senza decorazioni visive eccessive
* TIER: Gulpease Benchmark disponibile solo per tier STANDARD/PRO (FREE vede teaser locked)
* UX: Colori basati su progresso personale (verde=miglioramento, blu=media, giallo=sotto media, rosso=critico)
* UX: Bottone "Ricontrolla" per refresh manuale benchmark dopo modifica testo
* TECH: REST endpoint `/ept/v1/gulpease-benchmark` con tier gating e calcolo medie personalizzate
* DOCS: Documentazione Gulpease vs Flesch aggiornata con tabella comparativa completa

= 3.0.0-rc17 - 2025-11-15 =
* FIX CRITICAL: Cannibalization ora funzionante in tutti gli ambienti (locale/produzione)
* FIX: Locale (*.local, localhost): usa DB fallback diretto - risolve timeout cURL su loopback
* FIX: Produzione: sitemap parsing con fallback DB automatico su errori
* IMPROVED: Soglia abbassata da 50% a 45% per confronti slug-based - riduce falsi negativi
* IMPROVED: Stopwords solo grammaticali universali (articoli, preposizioni) - rimosse parole tematiche ("guida", "migliore") per compatibilità multi-tema
* IMPROVED: Auto-detection sitemap intelligente - preferisce sitemap index (wp-sitemap.xml) su sitemaps dirette
* IMPROVED: Supporto sitemap index WordPress - itera sub-sitemaps (wp-sitemap-posts-post-X.xml)
* IMPROVED: Post arricchiti con metadata keyword (has_saved_keyword, keyword) per confronto coerente
* IMPROVED: Limite aumentato a 500 post (da 200) per coverage migliore su siti grandi
* REMOVED: Title disambiguator disabilitato - creava falsi negativi su slug-based matching
* TECH: Codice completamente WordPress-compliant (wp_remote_get, get_posts, Transients API, no SQL dirette)
* IMPACT: Plugin ora plug-and-play su siti 500+ articoli - zero timeout, SEMPRE funzionante
* DEBUG: Rimossi tutti i log di debug da produzione - codice pulito e performante

= 3.0.0-rc16 - 2025-11-14 =
* BREAKING: Nuova strategia cannibalizzazione - confronto primario SLUG vs SLUG (sempre disponibile)
* NEW: Jaccard similarity + stemming per gestire varianti morfologiche (elettrica/elettriche, auto/automobile)
* NEW: Confronto secondario keyword vs keyword quando disponibili (DB si arricchisce nel tempo)
* NEW: Title disambiguator per casi ambigui (es: "cambio bici" = cambiare vs cambio meccanico)
* IMPROVED: Peso 60% slug + 40% keyword (o 100% slug se keyword mancante) - precisione cresce progressivamente
* IMPROVED: Soglia aumentata a 50% (era 40%) per ridurre falsi positivi
* REMOVED: Eliminate penalità complesse (topic_overlap, intent extraction, post_status) - approccio più semplice e robusto
* IMPACT: Risolve falsi positivi "vantaggi mobilità elettrica" vs "auto elettrica inverno 2025" (erano 50%, ora ~25%)
* TECH: Algoritmo più manutenibile e predicibile - focus su similarità reali invece di penalizzazioni artificiali
* UX: Bottone "Ricontrolla" spostato su riga azioni sotto l'intestazione per evitare overflow del box; rimosse etichette testuali "Severo/Borderline" in favore di un pallino colore (giallo/arancio/rosso)

= 3.0.0-rc14 - 2025-11-13 =
* DEBUG: Aggiunti log dettagliati per tracciare persistenza tier (post_meta _ept_user_tier)
* DEBUG: Log quando tier viene salvato dopo validazione/cannibalizzazione
* DEBUG: Log quando tier viene letto da post_meta al caricamento metabox
* TECH: Sistema tier persistence già implementato (salvataggio in DB + inizializzazione JS da PHP)

= 3.0.0-rc13 - 2025-11-13 =
* FIX CRITICAL: STRATEGY 2 loop (confronto con titoli) ora salta correttamente i post con keyword salvata
* IMPACT: Risolto bug che confrontava post già processati nel primo loop anche con il titolo completo (doppio confronto keyword+title)
* DEBUG: Post con has_saved_keyword=true vengono ora esclusi dal secondo loop per evitare false positives

= 3.0.0-rc12 - 2025-11-13 =
* FIX CRITICAL: Tier persistence - licenza STANDARD ora riconosciuta correttamente dopo save/reload pagina
* IMPROVED: Tier cache globale JavaScript aggiornato da response API (/check-cannibalization e /validate)
* IMPROVED: Fallback intelligente usa tier cachato invece di default 'free' quando usage.tier non disponibile
* IMPACT: Box "Link Interni Suggeriti" non mostra più "Passa a STANDARD" per utenti con licenza attiva
* DEBUG: Fix warning PHP "Undefined array key gumroad_standard_permalink" in class-admin-page.php

= 3.0.0-rc11 - 2025-01-13 =
* NEW: Indicatore visual "match_source" nella cannibalizzazione - mostra se conflitto basato su Focus Keyword salvata (🎯 KEYWORD) o titolo fallback (⚠️ TITOLO)
* IMPROVED: Badge verde per match precisi (keyword), arancione per match meno affidabili (titolo)
* UX: Tooltip sui badge spiega differenza tra confronti keyword-based vs title-based
* IMPACT: Trasparenza maggiore - utente capisce quando validare un articolo per migliorare precisione cannibalizzazione

= 3.0.0-rc10 - 2025-01-12 =
* FIX CRITICAL: Cannibalization ora usa STESSA logica del Link Suggester (sitemap + DB fallback automatico)
* FIX: Eliminata incoerenza tra Link Suggestions (funzionava sempre) e Cannibalization (array vuoto in produzione)
* IMPROVED: get_posts_from_sitemap() ora ha DB fallback integrato con get_posts() - identico a Link Suggester
* IMPROVED: Tier check unificato in handle_link_suggestions - usa direttamente License Manager (no cache user_meta)
* DEBUG: Aggiunti log WP_DEBUG per tracciare sitemap fetch, XML parsing, DB fallback, post count
* IMPACT: Cannibalizzazione ora GARANTITA funzionante anche senza sitemap configurata (come Link Suggestions)

= 3.0.0-rc8 - 2025-01-12 =
* FIX MAJOR: Cannibalization ora usa TITOLO come fallback quando manca _ept_keyword meta - funziona SUBITO su siti con centinaia di articoli esistenti
* BREAKING: Non serve più validare manualmente tutti gli articoli per popolare cannibalizzazione
* IMPROVED: Query DB con LEFT JOIN + COALESCE per recuperare keyword O titolo in singola query (performance)
* IMPROVED: Sitemap parsing ora usa titolo quando _ept_keyword vuota
* IMPACT: Plugin ora plug-and-play per siti esistenti con 400+ articoli - zero setup richiesto, rilevamento cannibalizzazione immediato
* UX: Man mano che validi articoli, precisione aumenta (keyword salvata > titolo), ma funziona fin da subito

= 3.0.0-rc7 - 2025-01-12 =
* FIX: Cannibalization detection ora usa sitemap configurata come fonte primaria (fallback a DB locale) - risolve problema produzione con sitemap esterna
* IMPROVED: Cache sitemap (5 min TTL) per ridurre chiamate HTTP ripetute
* IMPACT: Cannibalization detection ora coerente tra locale/produzione quando sitemap configurata (es. elettricopertutti.it/post-sitemap.xml)

= 3.0.0-rc6 - 2025-01-12 =
* FIX #10: Meta description boundary aggiornato a 160 caratteri (da ~155) per allineamento con limite Google - riduce falsi positivi su descrizioni 156-160 char
* FIX #9: Slug parity check con Levenshtein distance - penalizza -10pt se slug e keyword hanno distanza >3 caratteri (es. "consigli-inverno" vs "auto elettrica inverno 2025") - migliora allineamento URL-keyword
* FIX #6: ALT fuzzy match con fuzzy_keyword_match() - sostituisce strpos() exact match con tolleranza morfologica (elettrica/elettriche, plurali, articoli) - riduce falsi negativi ~15-20%
* IMPACT: Quick wins totali 1h10min - 3 fix algoritmici per SEO meta tags, URL optimization e immagini
* STATUS: Completata Fase 1 Quick Wins del POST-APPROVAL-ROADMAP (rimangono Fix #7 H2/H3 separate e Fix #8 keyphrase length per v3.0.0 final)

= 3.0.0-rc5 - 2025-01-12 =
* REMOVED: Feature "Keyword Correlate Suggerite" rimossa per semplificare UI e focus su cannibalization detection
* RATIONALE: Suggerimenti generici poco utili senza analisi contenuto; feature potrà essere reintrodotta in futuro con generazione contestuale da H2/H3

= 3.0.0-rc4 - 2025-01-12 =
* FIX: check_topic_overlap() ora con stemming base (elettrica/elettriche→elettric, 2025/26→2025) - riduce falsi negativi da plurali/varianti
* FIX: Strategy 2 cannibalization (title-based) ora sempre attiva, non solo se <3 conflitti - cattura articoli con keyword salvata diversa ma titolo simile (es. "Accessori inverno" vs "auto elettrica inverno")
* IMPROVED: Box keyword correlate con debug console per troubleshooting generazione varianti
* TEST: Validato con "Accessori auto elettriche inverno" e "Autonomia inverno" - ora rilevati come potenziali conflitti (75%)

= 3.0.0-rc3 - 2025-01-11 =
* FIX: Cannibalization intent penalty ora differenziata: ×0.80 se topic overlap alto (≥60%, veri positivi), ×0.50 se topic overlap basso (<60%, falsi positivi)
* FIX: Soglia title cannibalization aumentata da 50% a 65% per ridurre borderline su keyword generiche
* IMPROVED: Link suggestions con topic cluster boost (+15pt): articoli con parole specifiche condivise (es. "inverno", "autonomia", "freddo") ora hanno priorità maggiore
* NEW: Box "🔑 Keyword Correlate Suggerite" nella UI cannibalization - genera 2-4 varianti long-tail per differenziare articoli
* TEST: Validato su "auto elettrica inverno 2025" - vera cannibalizzazione ("freddo inverno") ora rilevata, falsi positivi (incentivi, cyber) eliminati

= 3.0.0-rc2 - 2025-01-10 =
* FIX: Keyword nel titolo riconosce anche meta title SEO (Yoast/RankMath) - riduce false negative 40-50%
* FIX: Cannibalization detection con intent alignment (guida|confronto|recensione|acquisto|news|modello) e threshold rebalanced (≥60% keyword, ≥50% title) - riduce false positive 50%→30%
* FIX: Link interni con URL completo dello stesso dominio ora riconosciuti correttamente (normalizzazione www)
* IMPROVED: Link suggestions con tracking localStorage - button "📋 Copia URL" diventa verde quando usato, resta cliccabile
* IMPROVED: H3 section length check esenta FAQ e shortcode embeds ([wpcode], [calculator], iframe, Gutenberg blocks) - riduce false negative 15-20%
* NEW: Endpoint REST `/ept/v1/link-suggestions` per Gutenberg integration
* NEW: Gutenberg sidebar con pannello link suggestions e tracking localStorage
* TEST: Testato su articolo "auto elettrica inverno 2025" (1792 parole) - score atteso 85-88/100
* DOCS: README.md aggiornato con sezione "Recenti Miglioramenti" dettagliata (file, line numbers, algoritmi)


= 2.10.0 (compliance sweep) - 2025-11-07 =
* COMPLIANCE: Affidamento al caricamento automatico i18n (WP ≥ 4.6), rimossa chiamata manuale
* COMPLIANCE: Sanitizzati input POST con wp_unslash() + sanitize_* in admin settings e AJAX
* COMPLIANCE: Rimossi o protetti i log di debug con WP_DEBUG (niente error_log in produzione)
* COMPLIANCE: Whitelist su identificatori tabella nelle query schema (SHOW/DESCRIBE)
* DOCS: Aggiornati README, readme.txt, CONTEXT-FOR-AI e documentazione interna

= 2.10.0 - 2025-11-07 =
* NEW: Tier STANDARD attivo con Link Suggestions e Cannibalization Detection
* NEW: Gestione licenze Gumroad (attivazione/disattivazione, verifica automatica, grace period 7 giorni)
* NEW: Settings page con sezione Licenza e Piano
* IMPROVED: FAQ detection intelligente - H3 dentro sezioni FAQ escluse da controllo range 100-160 parole
* IMPROVED: Conteggio grassetti dinamico basato su lunghezza articolo (ideale: 1 ogni ~50 parole)
* IMPROVED: Link upgrade puntano direttamente a https://pannonius.gumroad.com/l/Italian-seo-validator
* FIX: Metabox posizionata sempre in 'normal' context per evitare scomparsa in sidebar
* FIX: Main Keyword box sempre visibile anche con licenza scaduta (tier FREE)
* API: Endpoint REST per license activation, deactivation, status
* API: Endpoint /check-cannibalization con gating STANDARD/PRO
* UI: Teaser locked features per FREE tier con gradients, badges, esempi output
* DOCS: Aggiornata documentazione con sezione licenze

== Changelog ==

= 3.6.0 - 2025-11-15 =
* MAJOR FIX: SEO Meta Tags now retrieved from Yoast SEO / Rank Math in Gutenberg
* ADDED: Support for _yoast_wpseo_title, _yoast_wpseo_metadesc meta fields
* ADDED: Support for rank_math_title, rank_math_description meta fields
* ADDED: Post slug automatically extracted from Gutenberg
* FIXED: SEO Meta Tags box now shows correct character counts (not 0)
* IMPROVED: Fallback to post title if no SEO title set

= 3.5.9 - 2025-11-15 =
* CRITICAL FIX: Properly extract validation data from backend response wrapper
* FIXED: Badge status now uses backend values (excellent/good/average)
* FIXED: E-E-A-T badge displays correctly from eeat_badge field
* FIXED: word_count field correctly mapped from backend response

= 3.5.8 - 2025-11-15 =
* CRITICAL FIX: Removed cache blocking backend API calls in Gutenberg
* ADDED: Speedometer info box with Word Count, Gulpease, E-E-A-T badge like Classic
* FIXED: Every validation now calls backend API for fresh results
* IMPROVED: Gutenberg sidebar shows same detailed info as Classic Editor

= 3.5.7 - 2025-11-15 =
* CRITICAL FIX: Gutenberg now calls backend API instead of client-side validation
* FIXED: Validation results now identical between Classic and Gutenberg editors
* FIXED: Breakdown scores match Classic Editor (same backend logic)
* FIXED: All suggestions from backend now displayed correctly
* IMPROVED: Backend provides richer analysis (TL;DR, MiniAnswers, Takeaways)

= 3.5.6 - 2025-01-XX =
* Added: Keyword Analysis box in Gutenberg sidebar (density, found_in, missing_in)
* Added: Images Analysis box in Gutenberg sidebar (total, with ALT, with keyword)
* Added: Links Analysis box in Gutenberg sidebar (total, internal, external)
* Added: SEO Meta Tags box in Gutenberg sidebar (title, description, slug length)
* Improved: Complete feature parity between Classic and Gutenberg editors

= 3.5.5 - 2025-01-XX =
* Fixed: Gutenberg sidebar now shows ALL suggestions (not limited to 3)
* Fixed: Gulpease Benchmark box rendering in Gutenberg for STANDARD/PRO users
* Fixed: EEAT score calculation to match Classic Editor (4 criteria)
* Improved: Added debug logging for Gulpease Benchmark rendering
* Improved: Validation algorithm fully aligned with Classic Editor

= 3.5.4 - 2025-01-XX =
* Initial release
* Free Tier: Validator PHP locale (Gulpease, structure, word count)
* Pro Tier: API Python con EEAT score, AI-proxy, fix plan
* Gutenberg integration: sidebar con bottone validazione
* License key system via Gumroad
* Support 6 intent: news_brand, news_istituzionale, dati_mensili, how_to, pillar_eeat, confronto
* Admin dashboard e settings page
* Contatore usage: 3 validazioni/mese free tier
* REST API: /wp-json/ept/v1/validate
* Documentazione completa in italiano

= 0.9.0-beta - 2025-01-XX =
* Private beta testing
* Core validator logic implemented
* Gutenberg sidebar prototype
* API backend deployed on Render.com

= 0.1.0-alpha - 2024-12-XX =
* Initial development
* Proof of concept validator PHP