/** Site title from localized plugin data (preferred) or browser tab title. */ export function getSiteNameForReports(): string { if (typeof window === 'undefined') return 'WordPress'; const w = window as { llmagnetBotAnalyticsData?: { siteName?: string }; llmagnetPagesData?: { siteName?: string }; llmagnetProductsData?: { siteName?: string }; llmagnetDashboardData?: { siteName?: string }; }; const fromWp = w.llmagnetBotAnalyticsData?.siteName || w.llmagnetPagesData?.siteName || w.llmagnetProductsData?.siteName || w.llmagnetDashboardData?.siteName; if (fromWp) return String(fromWp); return document.title.replace(/\s*(\u2014|—|-)\s*.*$/, '').trim() || 'WordPress'; }