/*
Theme Name: Polara AI
Theme URI: https://polara.ai
Author: Polara AI
Author URI: https://polara.ai
Description: Custom theme for Polara AI. Italian AI agency landing page. Light/dark toggle, light default. v5.11.23: phone is now genuinely required in the admin-ajax contact handler (polara_handle_contact rejects invalid_fields when empty) — the front-end already enforced it, and the FastAPI /api/contact ContactRequest now also requires phone (min 6). Closes the gap where the earlier v5.8.2 "backend requires it" note in practice only held for the Readiness Audit. Theme folder slug bumped to polara-ai-v51123. v5.11.22: mobile PageSpeed — dropped unused Geist weight 300 from the font request (weights 400-900 are the only ones used). Fonts stay async (preload+onload). Note: an async style_loader_tag defer of style.css/widgets.css was tested and REVERTED — it caused a large CLS regression (widgets.css styles the hero audit CTA), so the non-critical CSS stays render-blocking (it is small and CLS-safe). Desktop unchanged. v5.11.21: move ai-vendite-b2b-guida-v2 and add ai-vendite-b2b-guida-v2-2 to $always_redirects (published pages need hard redirects, not 404-only). v5.11.20: ROI calculator page (calcolatore-roi-agente-ai) — linkable asset for backlink strategy. Vanilla JS, real-time output, CCNL-derived hourly defaults per sector, payback vs Polara engagement cost range, priority badge. Registered in polara_create_lp_pages() + polara_page_meta_map(). v5.11.19: backlink pre-work — fix noindex slugs (was 'privacy', now 'privacy-policy' to match actual page slug so Privacy Policy page is correctly noindexed); add 301 redirects for common legal page shorthand paths (/privacy → /privacy-policy/, /terms and /terms-of-service → /termini-di-servizio/, /cookie → /cookie-policy/). Theme folder slug bumped to polara-ai-v5119b. v5.11.18: page-blog-en.php template for /en/blog/ — queries polara_lang=en posts directly so the EN blog archive shows the 10 English posts. v5.11.17: save_post hook in i18n.php auto-sets polara_lang=en for slugs ending in -en, polara_lang=it otherwise (skips if already set) — enables EN blog posts to be published via bridge without plugin update. v5.11.16: fix nav.toggle_aria EN string (was Italian "Passa all'italiano"). v5.11.15: fix meta desc &#039; double-encoding: html_entity_decode() in save_post hook + wpseo_metadesc filter at priority 99. v5.11.14: remove temp /schema-purge endpoint (backfill done: 18 posts cleaned to FAQPage-only). v5.11.12: SEO batch — defer widgets.js; remove WP emoji+block CSS; noindex /en/blog/; remove hreflang from blog posts (no EN counterparts); llms.txt served inline; 301 /home-en/→/en/ and /davvero/→/scegliere/; Gravatar alt text; trim agenti-ai-vs-zapier title to 65. v5.11.11: 301 /blog/page/3+ → /blog/page/2/ (post count dropped below pagination threshold after duplicate posts were privatized). v5.11.10: fixed `founders` → `founder` (valid Schema.org property) in ProfessionalService JSON-LD on homepage (both IT + EN variants). v5.11.9: save_post hook syncs post_excerpt → _yoast_wpseo_metadesc on every post save (blog posts only). Fixes missing <meta name="description"> on all Yoast-managed sites without touching the bridge plugin. Theme folder slug bumped to polara-ai-v5119. v5.11.8: (bridge-updater attempt, superseded by v5.11.9). Theme folder slug bumped to polara-ai-v5118. v5.11.7: on the 7 vertical funnels, replaced the hero "Guarda la demo" video pill (lightbox + empty <video>, no clip yet) with a "Prenota una demo" CTA scrolling to the booking form (#prenota); removed the lightbox markup + its JS. Cleaner conversion pages for paid traffic ahead of the vertical Google Ads launch. Theme folder slug bumped to polara-ai-v5117. v5.11.6: image-less blog listing — when a post has no featured image, home/archive/search drop the image column entirely (no "P##" placeholder tiles); list rows + the featured card collapse to full-width text. Fixes a CSS source-order bug that kept home rows pinned in the 14rem image column; featured card now hugs its content instead of a tall empty box. featured_images is disabled engine-wide. Theme folder slug bumped to polara-ai-v5116. v5.11.0: the 7 vertical product LPs (automazione-logistica, automazione-noleggio, ai-immobiliare, ai-system-integrator, ai-studi-dentistici, monitoraggio-prezzi-manifatturiero, reportistica-ai) rebuilt as self-contained high-conversion funnels — minimal chrome (logo + sticky "Prenota una demo" CTA), animated hero demo (chat / stepper / dual-agent KB+compilatore for noleggio), bespoke "Su di te" custom-build section, hero demo-video lightbox, inline #polara-contact-form. Each renders its own head (no get_header/get_footer) to avoid clashing with the theme's global inline CSS, but keeps the Google Ads gtag conversion (fires on /grazie), in-range title/meta + canonical/OG, and Service/FAQ/Breadcrumb JSON-LD. Shared styles in funnel.css; fully responsive (920/560 breakpoints, floating cards pulled in-viewport on mobile). Page->template assignments unchanged (same filenames). Theme folder slug bumped to polara-ai-v5110. v5.10.0: 7 vertical product LPs (automazione-logistica, automazione-noleggio, ai-immobiliare, ai-system-integrator, ai-studi-dentistici, monitoraggio-prezzi-manifatturiero, reportistica-ai) — industry-named, build-grounded, client-anonymized, with a before/after demo slot (video-ready) + Service/FAQ/Breadcrumb JSON-LD; registered in polara_create_lp_pages() + per-page meta in polara_page_meta_map(). Added a "Servizi correlati" cross-link block to siti-web/seo/google-ads and a "lo usiamo noi per primi" proof block to automazione-vendite-b2b (GTM). Theme folder slug bumped to polara-ai-v5100. v5.9.2: noindex now hard-emitted in wp_head for tag archives + legal pages (this Yoast build outputs no robots meta, so the wpseo_robots_array filter was a no-op). Theme folder slug bumped to polara-ai-v592. v5.9.1: on-page SEO fix (2026-06-01 audit, On-Page 56/100). Per-page title (30-65) + meta description (110-165) for every LP + the blog index via polara_page_meta_map() (was homepage-only); noindex tag archives + legal pages; 301 redirect map for stale/renamed slugs (consulenza-ai-cosa-aspettarsi*, ai-vendite-b2b-guida*, contatti); trimmed the over-length imprese-edili post title. Theme folder slug bumped to polara-ai-v591. v5.9.0: 3 service landing pages for the Tier-1 Google Ads strategy (siti-web, seo, google-ads), validated keyword clusters (Keyword Planner 2026-05-31). Each clones the LP pattern with service-specific HERO/PROBLEM/COS'È/SERVICES/PROCESS/FAQ + Service & FAQ JSON-LD; contact form + audit modal inherited, conversion fires on /grazie. Theme folder slug bumped to polara-ai-v590. v5.8.2: mandatory phone field added to all contact forms and the Readiness Audit (front-end + JS validation, full-width tel styling; backend now requires it and passes it to Attio; privacy policy IT/EN updated to list phone). Theme folder slug bumped to polara-ai-v582. v5.8.0: EN thank-you page (/en/thank-you-en/) now fires the Google Ads conversion (Polara Lead Form Submit), parity with /grazie. v5.7.9: 6 new vertical LPs for Google Ads campaign rebuild (ai-per-avvocati, ai-per-architetti, ai-per-medici, ai-per-professionisti, chatgpt-aziendale, ai-whatsapp). Each LP is a homepage clone with retargeted HERO/PROBLEM/COS'È/CTA per ad group, validated keyword set (335 KW tested across 6 rounds). v5.7.8: Google Ads conversion tracking (gtag.js AW-18165256941) with Consent Mode v2. v5.7.7: 4 IT Google Ads LPs. v5.7.6: H1 reflows. v5.7.5 cut "Come funziona". v5.7.4 removed redundant CTA. v5.7.3 dropped "no hiring" line.
Version: 5.11.23
License: Proprietary
Text Domain: polara
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 7.4
*/
/* v5.11.1: Cloudflare Turnstile anti-spam on contact form, Readiness Audit, and chatbot (token verified server-side on the Railway API + the admin-ajax fallback). Site/secret keys in Polara Lead Capture settings. Theme folder slug bumped to polara-ai-v5111. */
