﻿=== Newsroom OS – Discover & AI-Visibility OS for WordPress Publishers ===
Contributors: koskar22
Tags: google discover, search console, newsroom workflow, schema markup, ai assistant
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

The Discover & AI-visibility OS for WordPress publishers: Editorial + Discover readiness scores, **Google Search Console traffic**, semantic JSON-LD, newsroom workflow, and trend radar. Gutenberg + Classic Editor. Pro unlocks GSC sync, AI Assist (BYOK), Author Performance, and more at newsos.io.

== Description ==

= Update 2.2 — AI Assist SEO pipeline (Pro BYOK) =

**Newsroom OS 2.2** upgrades **AI Assist (Pro)** for newsroom SEO: shared **article analysis** (keywords, entities, intent), stronger **headline**, **optimize**, and **trend** suggestions, **meta description** generation with one-click apply to Yoast SEO / Rank Math (or excerpt), smarter **tag match**, and **Discover Score** entity signals when analysis is saved on the post. **Story timelines** use semantic `<aside>` markup, dedicated CSS, and **no empty date/footer nodes** when labels are unset.

= Big update 2.1 — Chief Insights, AI Daily Brief, and indexing diagnostics =

**Newsroom OS 2.1** adds **Chief Insights** (desk-wide KPIs, channel tables, top categories/articles), **AI Daily Brief** (Morning/Evening), and **Print to PDF**. Clear **Last attempted vs Last successful** diagnostics for **Google Indexing API** and **IndexNow**.

Preview Pro on [newsos.io](https://newsos.io/).

= Big update 2.0 — Google Search Console meets your newsroom =

**Newsroom OS 2.0** connects your editorial desk to **real Google traffic**. Writers still get **Focus** (article quality) and **Discover readiness** (distribution checklist) in the editor — separate from **Search Console clicks** (Discover, Google News, and web search). Chiefs see who publishes well *and* who earns traffic, in one dashboard.

Built for **newsrooms, publishers, and high-frequency editorial teams** — not generic blogs.

**Pro license:** [newsos.io](https://newsos.io/) — one key per site, same plugin you already install. **Live Pro demo available on newsos.io**.

**Yoast, Rank Math, AIOSEO, and SEOPress optimize posts.** Newsroom OS runs the newsroom: Discover-ready signals, semantic JSON-LD, assignments, writer coaching, and **GSC-backed analytics** in one editorial layer on top of WordPress.

= Classic Editor & Gutenberg (Block Editor) =

Newsroom OS is built for **real newsroom setups** — including sites that still use Classic Editor, sites on full Gutenberg, and hybrid installs (block editor with the classic Tags metabox).

**Gutenberg / Block Editor**

* Publication Readiness sidebar (Editorial + Discover twin gauges, Next Best Action)
* REST-aware duplicate tag guard (snackbar + “Use existing” / “Keep anyway”)
* Breaking news mode, live H3 update insertion via blocks
* Trend Radar, Smart Tags, AI Assist (Pro) in the editor sidebar
* JS strings via `wp_set_script_translations` (el, en, de, es)

**Classic Editor**

* Same Publication Readiness panel and scores (TinyMCE / `#content` hooks — no block editor APIs on classic screens)
* Classic Tags metabox duplicate guard (AJAX before the tag chip is added)
* Breaking mode, live updates, and smart tag insert via Classic UI
* **Stability:** Gutenberg-only APIs (`wp.data.subscribe`, `getEditedPostContent`) run only when `block-editor-page` is present — prevents Classic Editor `blocks.min.js` stack overflows on large sites

**Works with any theme** (Astra, GeneratePress, Newspaper, NewsMag, Flavor, etc.) and alongside Yoast SEO, Rank Math, WooCommerce, and SureCart.

**WordPress 7.0:** Tested through **WordPress 7.0** (Classic Editor, Gutenberg, and wp-admin dashboard). Requires **PHP 7.4+** (PHP 8.1+ recommended).

= Six pillars (2.0) =

**1. Discover optimization**

* **Publication Readiness** — twin scores in the editor: **Editorial (Focus)** and **Discover readiness**. They are separate on purpose.
* **Discover Score** — Google-aligned checklist: hero 1200px+, 16:9, 300k pixels, alt; clear 55–70 headline (anti-clickbait); topic/tags; optional trend fit; saved OG image when available.
* **Breaking news mode** — one toggle: LiveBlogPosting schema, faster IndexNow/Google ping, optional “developing story” badge, auto-expire, live-update workflow (H3 headings).
* **Trend Radar** — Google Trends + Google News in the sidebar, localized per country.

**2. Google Search Console traffic (Pro) — NEW in 2.0**

* **Service account sync** — connect Search Console with `webmasters.readonly`; separate token from the Indexing API.
* **Discover, Google News, and web search** — per-post clicks, impressions, CTR, and average position stored in your database (`wp_newsai_gsc_performance`).
* **Sync now** in settings plus **daily cron** (04:00 site time) when Pro is active.
* **Author Performance** — real clicks per writer, top articles by traffic, coaching tab, 7d / 30d / 90d windows.
* **Posts list** — **GSC (30d)** column for chiefs (`edit_others_posts`).
* **My Inbox** — writers see their own GSC totals when sync is enabled.
* **Clear labeling** — Discover Score = editorial readiness; GSC numbers = measured Google clicks (not the same metric).

**3. Semantic schema & entities**

* **NewsArticle / LiveBlogPosting JSON-LD** — `@graph` with Organization, WebPage, author `Person`, geo, `about` / `mentions`.
* **Entity tags** — Wikidata Q-IDs, coordinates, entity types woven into schema; lazy enrichment when tags are used (1.9+).
* **Richness presets** — Minimal / Balanced / Full; optional `articleBody` modes (omit, full, first N words).
* **Works with Yoast SEO & Rank Math** — reads your meta; does not replace them.

**4. Editorial workflow**

* **Tasks & assignments** — deadlines, keywords, briefs, reference links.
* **Dashboard** — active / overdue / completed, KPIs, SEO health.
* **Roles** — chiefs see the full desk; writers see **My Inbox** only.
* **Content Decay Radar (Pro)** — flags stale evergreen posts and opens refresh tasks.

**5. AI newsroom (Pro, BYOK)**

* **OpenAI, Gemini, or Groq** — your API key stays on your site; free tiers supported (Groq / Gemini).
* **Discover-optimized titles** (55–70 chars, five angles), targeted optimization hints, trend-aware keywords, **AI Tag Match** from your site taxonomy.
* **Geo-aware language** — answers in the language of your configured region (40+ locales).

**6. Knowledge layer**

* **Smart Tag Suggester** — weighted, confidence-scored tags from *your* taxonomy; one-click insert; duplicate-tag guard (Pro).
* **Story timelines** — archive clusters + internal-link blocks + CollectionPage schema.
* **Archive link finder** — semantic internal links from your own back catalog (accent-aware scoring).
* **Author E-E-A-T** — profiles, schema `Person`, performance analytics (Pro).

UI in **Greek, English, German, and Spanish** (per-site language picker). See `languages/README.txt` for gettext catalogs.

---

== 🆓 What you get for FREE ==

Everything below ships in the free plugin — no signup, no rate limits, no nag screens:

* **Publication Readiness** — Editorial score + **Discover Score**, Next Best Action, detailed checklists
* **Breaking news mode** — LiveBlog schema workflow with auto-expire (when LiveBlog is enabled in settings)
* **Smart Tag Suggester** — confidence levels, one-click insert
* **Editorial dashboard** — tasks, deadlines, keywords, briefings
* **Trend Radar** — Google Trends + News in the editor
* **Auto-story timeline** + archive internal-link finder
* **NewsArticle JSON-LD** — entities, geo, E-E-A-T author signals
* **SEO auditor**, **4-step wizard**, **4-language UI**
* **My Inbox personal stats** — your own 30-day Focus & Discover readiness (team GSC analytics are Pro)

---

== 🚀 PRO Features (Buy at [newsos.io](https://newsos.io/) — €29/month per site) ==

Pro is a single license key tied to one site, activated inside your dashboard at "Editorial Control → 🚀 PRO". No separate plugin to install — Pro unlocks inside the same plugin you already trust. Need more than one site? Buy one license per site at newsos.io.

= 📊 Google Search Console integration (NEW in 2.0) =

Stop guessing which writers earn traffic. Newsroom OS pulls **Search Analytics** into WordPress:

* **Three channels** — Discover clicks, Google News clicks, and web search clicks (plus impressions, CTR, position where available).
* **Per-post storage** — map GSC page URLs to posts and authors; aggregate by 7 / 30 / 90 days.
* **Settings → PRO → Indexing** — paste your service account JSON, set the property (`sc-domain:example.com` or URL-prefix), test connection, **Sync now**.
* **Automatic daily sync** — Pro + enabled + valid credentials.
* **Privacy** — data stays in your database; we do not proxy GSC through newsos.io.

= 📈 Author Performance 2.0 (Pro) =

Redesigned chief dashboard (**Editorial Control → Author Performance**):

* **Your performance** card for chiefs who also write — same expand/collapse UX as the team grid.
* **Compact team cards** — posts, Focus readiness, web clicks at a glance; expand for full detail.
* **Tabs inside each author** — **Summary** (editorial quality + categories + GSC totals), **Articles** (latest posts + top traffic), **Coaching** (Discover weak spots + action links).
* **GSC coach tips** on low click counts (hero image, headlines, timeliness).
* **Search & sort** — filter by name; sort by posts, web clicks, Focus, or A–Z.
* **7d / 30d / 90d** — live AJAX refresh without reloading the page.
* Cached aggregates with smart invalidation on publish, task completion, score change, and GSC sync.

= 🧭 Chief Insights + AI Daily Brief (NEW in 2.1) =

Built for editor-in-chief oversight in one screen:

* **Chief Insights tab** — summary-first KPI strip + channel performance + top categories + top articles + top keyword/entity signals.
* **PRO live / FREE demo** — free sites see a realistic demo layout; Pro shows live desk data.
* **AI Daily Brief** — one click executive summary with **Morning mode** (planning) and **Evening mode** (retrospective + next actions).
* **Print to PDF** — export the current chief view for standups and editorial meetings.
* **Indexing diagnostics polish** — Google + IndexNow now show **Last attempted** and **Last successful** URL/ping, plus health badge (Healthy / Degraded / Unknown).

= 🤖 AI Assist (BYOK – Bring Your Own Key) =

Bring your own API key for **OpenAI**, **Google Gemini**, or **Groq**. Newsroom OS never proxies AI traffic through our servers — your key stays on your site.

**💸 Free AI tier supported**: Groq offers a very generous free tier (no credit card) on `llama-3.3-70b-versatile`. The settings page links directly to:

* [https://platform.openai.com/api-keys](https://platform.openai.com/api-keys) (OpenAI)
* [https://aistudio.google.com/apikey](https://aistudio.google.com/apikey) (Google Gemini — free tier available)
* [https://console.groq.com/keys](https://console.groq.com/keys) (Groq — free tier, no card required)

You can write your first AI-assisted article with $0 of API spend.

**Direct in-editor actions:**

* 🎯 **Discover-optimized Title Suggestions** — five alternative headlines per run (facts / impact / aftermath / authority / Discover hook), 55–70 characters, live validation.
* ✨ **Targeted Content Optimization** — non-rewrite suggestions per paragraph (readability / seo / eeat / structure / factcheck).
* 🔥 **Trend-Aware Keywords** — regional Google Trends fit with placement hints.
* 🏷️ **AI Tag Match** — semantic tag picks from *your* taxonomy pool.
* FAQ Block generation in valid FAQPage JSON-LD
* Key Takeaways block
* Per-user daily rate limits + transient caching

**🌍 Geo-aware language output** — 40+ locales; filter `newsai_ai_geo_to_locale` for custom multilingual newsrooms.

= 💬 Editorial Comms (Task Threads + Email) =

* Two-way messaging thread per task — chief ↔ assignee, with unread badges
* Capability-aware visibility: writers only see their own threads
* Configurable email alerts: new assignment, new message, task completed
* Auto-purge old threads on a configurable retention window

= 🛡️ Duplicate-Tag Guard =

Site-wide audit for near-duplicate tags; merge and consolidate authority. Integrated with Smart Tags in Gutenberg and Classic.

= 🔥 Content Decay Radar =

Detects evergreen articles losing freshness and creates "Needs Refresh" tasks. Cursor-based scans for large archives (1.9+).

= ⚡ Instant Indexing API =

Google Indexing API (service account JSON or bearer token) + IndexNow for Bing/Yandex. Async pings on publish; separate credentials from GSC read-only sync.

= 📰 LiveBlogPosting Schema =

One toggle turns a post into valid LiveBlogPosting JSON-LD for Top Stories live coverage.

= 🖼️ Google Discover Image Validator =

Pre-publish check for the 1200px-wide featured image minimum Discover expects.

= 🔧 Priority Support & Updates =

License-gated updates through the same plugin. Verify at newsos.io — no re-uploading a different zip.

---

== Why publishers choose us ==

* **Category:** Discover & publishing infrastructure — not “another SEO plugin”
* **2.0:** Editorial readiness **plus** real Search Console traffic per writer
* Trusted by **2,000+** active installs in **20+** countries
* Built for high-traffic desks: event-driven editor JS, strict API timeouts, smart caching
* **Zero conflicts** with Yoast / Rank Math / SureCart / WooCommerce
* **30-day money-back** guarantee on Pro

👉 **Buy Pro at [newsos.io](https://newsos.io/)** — €29/month or $233/year (save 33%). One license key per site, instant delivery via email.

---

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`, or install via Plugins → Add New → Upload.
2. Activate "Newsroom OS – Discover & AI-Visibility OS".
3. Run the 4-step Wizard (it auto-launches on first activation).
4. Open any post in **Gutenberg** or **Classic Editor** — the Newsroom OS sidebar appears on the right.
5. (Optional) Activate Pro at "Editorial Control → 🚀 PRO" with your [newsos.io](https://newsos.io/) license key.
6. (Pro) **Settings → PRO → Indexing** — add your Search Console service account, set the property, run **Test** and **Sync now** to populate Author Performance.

== Frequently Asked Questions ==

= What is new in version 2.0? =

**Google Search Console integration (Pro):** sync Discover, Google News, and web search metrics into WordPress; show real clicks on Author Performance, My Inbox, and the Posts list. Plus a redesigned Author Performance UI (tabs, coaching, search/sort, 7d/30d/90d). Requires a one-time database table on upgrade (`wp_newsai_gsc_performance`).

= Does Newsroom OS replace Google Search Console? =

No. You still use [Google Search Console](https://search.google.com/search-console) for verification and property management. Newsroom OS **reads** Search Analytics via API and surfaces the numbers where your editors already work — next to Focus and Discover readiness scores.

= What is the difference between Discover Score and GSC Discover clicks? =

**Discover Score** is an **editorial readiness checklist** in the post editor (image, headline, topic, OG, etc.) — it does not read Search Console. **GSC Discover clicks** are **real measured traffic** from Google after you enable sync. Both appear in Author Performance so chiefs can coach writers on quality *and* outcomes.

= How do I connect Google Search Console? =

Pro license active → **Settings → PRO → Indexing** → enable GSC → paste a Google Cloud **service account JSON** with Search Console access to your property → enter the property exactly as in GSC (`sc-domain:example.com` or `https://www.example.com/`) → **Test** → **Sync now**. Daily sync runs automatically when enabled.

= Does it work with Classic Editor and Gutenberg? =

Yes — **both**, out of the box. Publication Readiness, Discover Score, Trend Radar, Smart Tags, Breaking news mode, and live H3 updates work in **Gutenberg** and **Classic Editor**. Pro duplicate-tag guard uses REST in Gutenberg and AJAX in Classic.

= Is it compatible with WordPress 7? =

Yes. **Tested up to WordPress 7.0** on wp-admin, Gutenberg and Classic post editor, and REST/AJAX flows. Minimum PHP **7.4**; PHP **8.1+** recommended for production newsrooms.

= Does it work with my theme? =

Yes. Compatible with standard themes (Astra, GeneratePress, Newspaper, NewsMag, etc.). Frontend output is limited to optional schema, timeline blocks, and breaking badges.

= Will it conflict with Yoast SEO or Rank Math? =

No. Newsroom OS reads your SEO meta and adds editorial workflow, smart tags, scores, and JSON-LD enrichment. Yoast/Rank Math keep meta tags and sitemaps.

= Will it slow down my website? =

No. External requests use strict timeouts; dashboards use transients; editor JS is event-driven (no polling on the post screen). GSC sync runs on a schedule or manual action — not on every page view.

= How does the Smart Tag system work? =

In-browser ranking against *your* taxonomy (title, lead, body weighted). HIGH/MEDIUM/LOW confidence badges. Pro adds duplicate-tag guard and AI Tag Match (BYOK).

= Where do I buy Pro? =

[https://newsos.io/](https://newsos.io/) — one license per site, 30-day money-back guarantee.

= Is there a live Pro demo before I buy? =

Yes — visit [newsos.io](https://newsos.io/) and open the live demo section to preview Pro dashboards and workflows in action.

= What if I cancel Pro? =

Your site keeps working. Articles, tags, schema, tasks, and saved scores remain. GSC sync and Pro dashboards stop updating until you renew.

= Which AI providers does Pro support? Can I use AI for free? =

**OpenAI**, **Google Gemini** (free tier at aistudio.google.com), and **Groq** (free tier at console.groq.com). Your key never leaves your server.

= Will the AI answer in my language? =

Yes — geo-aware prompts for 40+ locales (Greece → Greek, Brazil → Portuguese, etc.).

= Does the plugin store private data off-site? =

No. Tasks, scores, GSC rows, and AI cache live in your database. Pro licensing validates once per day with newsos.io.

== Screenshots ==

1. **Publication Readiness** — Editorial + Discover twin gauges and Next Best Action
2. **Author Performance 2.0 (Pro)** — team cards, GSC clicks, expand with Summary / Articles / Coaching tabs
3. **Google Search Console settings (Pro)** — service account, property, Test + Sync now
4. **Breaking news mode** — live coverage panel, H3 updates, schema-ready workflow
5. **Editorial dashboard** — tasks, KPIs, desk overview
6. **Trend Radar** — Google Trends and News in the editor sidebar
7. **Smart tags** — confidence-scored suggestions, one-click insert
8. **Schema** — NewsArticle / LiveBlogPosting JSON-LD in page source
9. **Setup wizard** — four steps, under one minute

== Changelog ==

= 2.2.0 =
* IMPROVEMENT: **Story cluster / timeline blocks** use semantic `<aside class="newsai-story-cluster">` (complementary related coverage, not main article body) and external `story-cluster.css` instead of heavy inline styles — better parser clarity and front-end performance.
* FIX: **Timeline labels** — empty saved settings no longer output blank `<span class="newsai-story-cluster__date">` or footer links; defaults apply (Σήμερα / Χθες / dates / «Όλο το χρονικό»). Blank label fields are removed from options on save. Timeline HTML cache bumped (`v2` transient).
* NEW (Pro BYOK): **Shared SEO article analysis** — primary keyword, entities, search intent, and article type extracted once per post (cached) and reused across AI Assist tasks.
* IMPROVEMENT (Pro BYOK): **Title suggestions** — Discover/News headline rules, internal quality scoring, entity/keyword-aware angles; uses article lede (first paragraphs) for focus.
* IMPROVEMENT (Pro BYOK): **Content optimization** — search-oriented suggestions (5W in lede, E-E-A-T, entities, internal linking ideas) without full rewrites.
* IMPROVEMENT (Pro BYOK): **Trending keywords** — anti-stuffing guidance, direct vs adjacent relevance; no forced headline weaving.
* IMPROVEMENT (Pro BYOK): **Key takeaways** — snippet-friendly bullets with primary entity/outcome when supported by the article.
* IMPROVEMENT (Pro BYOK): **AI Tag Match** — existing tags plus up to three **suggested new tag** labels for manual creation.
* NEW (Pro BYOK): **Generate meta description** — 140–160 character factual snippet; **Apply to SEO fields** (Yoast, Rank Math, or post excerpt) with editor sync.
* IMPROVEMENT: **Discover Score** — small entities bucket bonus when AI SEO analysis is stored on the post (after running AI Assist).
* I18N: refreshed gettext and JS translation catalogs (el, en, de, es).
* SAFE: **No database migrations.** Safe upgrade from 2.1.x and 2.0.x.

= 2.1.0 =
* NEW: **Chief Insights (Pro)** — executive dashboard tab for chiefs with KPI summary, channel table (Web / Discover / Google News), top categories, top articles by traffic, and top keyword/entity coverage.
* NEW: **AI Daily Brief (Pro)** — one-click brief inside Chief Insights with **Morning / Evening** mode and structured output (wins, risks, next actions).
* NEW: **Print to PDF** from Chief Insights for editorial reporting.
* NEW: **FREE demo mode** for Chief Insights — same layout with demo metrics and upgrade CTA.
* IMPROVEMENT: **Indexing diagnostics** (Google + IndexNow) now track and display **Last attempted** and **Last successful** ping/URL/code separately, plus a health badge.
* IMPROVEMENT: **AI provider hardening** — retries for transient failures and fallback chain across configured providers.
* IMPROVEMENT: **Schema date edge-case guards** — safer datetime resolution for publish/schedule workflows, with resilient fallback behavior in JSON-LD.
* I18N: refreshed gettext/script catalogs for new 2.1 UI strings (el/en/de/es).

= 2.0.0 =
* **BIG UPDATE — Google Search Console (Pro):** Search Analytics sync via service account (`webmasters.readonly`). Stores Discover, Google News, and web search metrics per post and author in `wp_newsai_gsc_performance` (DB version **1.3**).
* **GSC settings:** property helper (`sc-domain:` and URL-prefix), connection test, **Sync now**, daily cron at **04:00** site time when Pro + enabled.
* **Author Performance 2.0:** redesigned dashboard — personal card, compact team grid, expandable cards with **Summary / Articles / Coaching** tabs, search & sort, **7d / 30d / 90d** AJAX range, GSC channel chips and totals, top articles by clicks, coaching weak spots + action links, micro-tips on low traffic.
* **Posts list:** **GSC (30d)** column for users with `edit_others_posts` (batch prefetch per page).
* **My Inbox:** writers see own GSC totals when sync is active.
* **Clarity:** Discover Score remains **editorial readiness**; GSC numbers are **real Google clicks** (labeled separately everywhere).
* **Assets:** dedicated `author-performance.css` + `author-performance.js` for the perf tab (tabs, expand, grid refresh).
* **Includes 1.9.x stability:** schema filters on `plugins_loaded`, author E-E-A-T save hardening, holiday import validation, `representativeOfPage` on lead image, PHPUnit smoke tests, editor tag pool cap, Wikidata lazy enrich, AI Tag Match, decay pagination improvements.
* **Upgrade:** creates GSC table on activation/upgrade; safe from 1.7.4+ and 1.9.x.

= 1.9.1 =
* STABILITY: **Schema SEO conflict filters** moved to `plugins_loaded` (no global `get_option()` at file load — safer for CLI/imports).
* STABILITY: **Author E-E-A-T profile save** — nonce + section gate so partial profile saves cannot wipe custom fields.
* STABILITY: **Holiday bulk import** — validates each JSON row (title, day 1–31, month 1–12, lead 0–365) before insert.
* SCHEMA: **Lead image** — `representativeOfPage: true` on the first `NewsArticle` `ImageObject`.
* UX: Admin menu icon uses **`currentColor`** (visible in wp-admin dark mode).
* DEV: **PHPUnit** smoke tests for Discover Score helpers and author slim/full entity (see `composer test`).
* SAFE: **No database migrations** (except 2.0.0 GSC table).

= 1.9.0 =
* PERF: **Editor tag pool cap** — separate **Editor tag pool (sidebar JSON)** setting (default 300 tags) from the larger tag-guard pool; faster post editor loads on tag-heavy sites.
* PERF: **Content Decay Radar** — cursor pagination with `newsai_decay_scan_last_id` instead of slow SQL `OFFSET` on large archives.
* PERF: **Dashboard overdue KPIs** — SQL `COUNT` for dated tasks plus PHP only for recurring date rules (year/month rollover).
* PERF: **SQL date thresholds** — static datetime strings in Author Performance and dashboard queries instead of `DATE_SUB(UTC_TIMESTAMP())` in `WHERE`.
* NEW: **AI Tag Match (Pro BYOK)** — semantic tag suggestions from your site pool via the editor sidebar button.
* NEW: **Wikidata lazy enrich** — auto-fills empty tag entity fields (Wikidata URL, type, geo when known) when a tag is assigned to a post or created; Settings toggle.
* AI: **Input limit** raised to **25,000** characters (filter `newsai_ai_max_input_chars`) for long-form Key Points / optimization.
* UX: **Timeline** — clearer errors (`no_tags` / `no_matches`), Gutenberg `post_id` resolution, improved default message.
* SAFE: **No database migrations.** Upgrade from 1.8.x preserves all data.

= 1.8.2 =
* FIX: **IndexNow rewrite flush** — no longer calls `flush_rewrite_rules()` on public `init`; uses versioned `newsai_indexnow_rewrite_ver`, flushes on plugin activation and when IndexNow is enabled in settings, with a one-time admin migration from the legacy `newsai_indexnow_flushed` flag.
* NEW: **My Inbox personal performance (Free)** — every writer sees their own 30-day stats card (posts, tasks, Focus, Discover); Pro CTA for team Author Performance remains on the chief dashboard.
* COMPAT: **Discover OG score** — explicit and featured-image fallback for **AIOSEO** and **SEOPress** (alongside Yoast SEO and Rank Math).
* SAFE: **No database migrations.** Safe direct upgrade from 1.8.1 or 1.8.0.

= 1.8.1 =
* FIX: **Find archive links** — candidate pool no longer relies on core `WP_Query` search (`s`), which often returned zero rows on large Greek newsrooms. Uses shared tags/categories, title token SQL (OR), accent-normalized scoring, Gutenberg `post_id` resolution, and does not cache empty “no matches” for 10 minutes.
* FIX: **Discover OG score** — counts Yoast SEO / Rank Math **featured-image OG fallback** (same as front-end HTML) when no explicit `og:image` meta is set; breakdown shows `featured_fallback` vs `explicit` in the editor checklist.
* COMPAT: **Tested up to WordPress 7.0** — verified on wp-admin, Gutenberg and Classic post editor, dashboard tasks, and editor AJAX. Readme `Tested up to: 7.0` (major.minor format for WordPress.org).
* STANDARDS: GPL **`License` + `License URI`** in main plugin header; **Plugin Check** hardening — output escaping in editor sidebar and admin dashboard; prepared SQL for dynamic task lists, views meta-key detection, semantic archive link queries, and weekly task cleanup.
* FIX: **Escaping** — `includes/sidebar.php` (tasks, summaries, breaking panel, prompts); `includes/admin-ui.php` (nav tabs, KPI cards, Google status banner, task table, latest posts); task thread close button uses `esc_attr__` with text domain.
* FIX: **SQL** — `$wpdb->prepare()` with spread args for archive link candidate queries; whitelisted `ORDER BY` on task dashboard queries; inline `prepare` for done-task cleanup.
* i18n: **Discover checklist & next-action badges** — strings ship from PHP via `discover_ui` (`wp_localize_script`) for **English, Greek, German, and Spanish**; removed hardcoded Greek/English branches in `script.js`. Translators comments for sidebar placeholders; new strings in `.pot` / `.po`.
* UX: **Publication Readiness sidebar** — full-width stacked **Fix Now** (primary) and **Open Detailed Panel** (secondary); structured Discover checklist rows with sublines (timeliness cache, OG hints).
* SAFE: **No database migrations.** Safe direct upgrade from 1.8.0 or 1.7.4+.

= 1.8.0 =
* RELEASE: **Major public release** since 1.7.4 — bundles Discover Score v2, Breaking News Mode + live coverage tools, Author Performance Discover layer, Classic Editor stability fixes, duplicate tag guard fix, and readme/positioning refresh (see 1.7.5–1.7.12 entries below for detail).
* DOCS: WordPress.org readme — `Stable tag` 1.8.0, dedicated **Classic Editor & Gutenberg** section, FAQ, installation step, and plugin tags for block/classic editor discoverability.
* SAFE: **No database migrations.** Existing posts, tags, schema, tasks, Focus/Discover scores, and settings stay intact. Safe direct upgrade from 1.7.4+ on small and large sites.

= 1.7.12 =
* FIX: **Classic tag duplicate guard** — AJAX check used invalid `assign_terms` capability (always denied for Authors/Editors), so the UI silently added tags without the “keep or use existing?” prompt. Fixed taxonomy capability check; classic script no longer bypasses on 403. Improved typo detection (e.g. NEWSOS vs NEWSSS). Classic script also loads when the classic Tags metabox is shown alongside the block editor.

= 1.7.11 =
* NEW (Pro): **Author Performance — Discover readiness layer** — per-writer **avg Discover Score**, up to **3 coaching weak spots** (16:9 hero, headline, topic, OG, author profile), **Discover** column on cards, and **Focus + Discover** per article in drill-down. Uses saved `_newsai_discover_score` / breakdown meta from the editor (Phase 2 GSC traffic stays separate).

= 1.7.10 =
* CHANGE: **Discover Score v2** aligned with [Google Discover best practices](https://developers.google.com/search/docs/appearance/google-discover): hero **1200px+**, **16:9**, **300k+ pixels**, descriptive alt (35 pts); headline **55–70** chars with **anti-clickbait** penalties (25 pts); softer timeliness/trends (10 pts); saved **OG image** from Yoast/Rank Math when post is saved (5 pts). Not scored in-editor: `max-image-preview:large`, Core Web Vitals.

= 1.7.9 =
* DOCS: **Positioning & readme refactor** — hero “Discover & AI-Visibility OS”, five-pillar narrative (Discover / Semantic / Workflow / AI / Knowledge), clearer free vs Pro story; updated screenshot list and plugin short description. No feature code changes.

= 1.7.8 =
* FIX: **Classic Editor crash** — `Maximum call stack size exceeded` in `blocks.min.js` when Breaking/live-update code called Gutenberg APIs (`getEditedPostContent`, `createBlock`, `wp.data.subscribe`) on Classic Editor screens. Block APIs now run only when `block-editor-page` + `core/block-editor` store are present; Classic uses TinyMCE/textarea only.

= 1.7.7 =
* NEW: **Live coverage editor tools** — collapsible “How to write live coverage” guide, **Insert live update (H3)** button (Gutenberg heading block or Classic insert), and a **warning** when Breaking is active but the post has no H2/H3 headings (live `liveBlogUpdate` needs structured headings).
* FIX: **LiveBlog schema** — no more fallback `liveBlogUpdate` built from the first 24 words when Breaking/LiveBlog is on or when content looks like a pasted plugin readme; avoids bogus updates on announcement posts.
* i18n: Greek, English, German, and Spanish catalogs updated for Discover Score, Breaking News Mode, and new editor strings (PHP `.po` + JS `newsai-script.json`).

= 1.7.6 =
* NEW: **Breaking News Mode** — replaces the editor “LiveBlogPosting” checkbox with a unified workflow: enable breaking coverage (LiveBlog schema + `liveBlogUpdate`), optional **“developing story”** badge on the article, **IndexNow / Google ping on enable**, **Resolve now**, and **auto-expire** (24/48/72h, hourly cron). AJAX toggle works in Gutenberg; classic editor uses the same metabox save path.
* NEW: Settings → Schema: breaking **auto-expire hours** and **frontend badge** toggle.

= 1.7.5 =
* NEW: **Discover Score** — separate from Editorial (Focus) score: hero image width/aspect/alt, cached regional **trend token** fit (daily refresh + on-demand when empty), entity/tag/category/geo cues, author E-E-A-T fields, internal links / storytelling; **headline** subscore (50–65 char sweet spot, numbers, power chars, recency cues, specificity) merged in the editor. **Publication Readiness** meta box: twin gauges, **Editorial / Discover** tabs under Score Details, combined **Next Best Action** across both tracks. Postmeta: `_newsai_discover_score`, `_newsai_discover_score_breakdown`. Filter: `nros_discover_score_weights`.
* NEW: `includes/discover-score.php` — AJAX `newsai_discover_score_partial`, `newsai_save_discover_score`, cron `nros_refresh_trend_keyword_cache` (cleared on plugin deactivation).

= 1.7.4 =
* FIX: **JSON-LD dates use site local time** — `datePublished`, `dateModified`, `dateCreated`, LiveBlog coverage times, and video `uploadDate` now output ISO 8601 with the WordPress timezone offset (e.g. `2026-05-16T09:45:00+03:00`) instead of UTC (`+00:00`), aligning with wp-admin display and Rank Math Open Graph.
* FIX: **Site Health REST false alarm** — removed a **UTF-8 BOM** (3 bytes) at the start of `includes/admin-ui.php` that WordPress reported as `charsout=3` on activation and that could prefix REST loopback responses so Site Health showed *"The REST API did not process the context query parameter correctly"* even when the endpoint returned HTTP 200.
* FIX: **REST-safe i18n** — on `/wp-json/*` requests the plugin no longer reloads its text domain or overrides `plugin_locale` for `newsroom-ai-assistant`, so core REST and Site Health checks stay stable while the per-site language picker (1.7.1+) continues to work in wp-admin.
* FIX: **Per-site UI language picker** — restored the 1.7.3 gettext loading path (`load_textdomain` with `determine_locale()` lookup) after an experimental init-only loader caused the dashboard to stay in English regardless of Settings → Language.
* FIX: Task assignment dropdown uses `capability` => `edit_posts` instead of deprecated `who` => `authors` (WordPress 5.9+).
* IMPROVEMENT: `the_content` / timeline shortcode and speakable snippet bail out during REST/JSON requests (no mutation of API payloads).

== Upgrade Notice ==

= 2.2.0 =
Recommended update: major **AI Assist (Pro BYOK)** SEO upgrade — article analysis, better headlines and optimization, meta description generator with apply to Yoast/Rank Math, Discover entity signals, and cleaner **story timeline** HTML (semantic aside, no empty date/footer nodes). No database migration. Safe from 2.1.x and 2.0.x.

= 2.1.0 =
Recommended update: adds Chief Insights + AI Daily Brief (Pro), PDF print reporting, and clearer indexing diagnostics (last attempted vs last successful) for Google and IndexNow. Safe upgrade from 2.0.x and 1.9.x.

= 2.0.0 =
**Big update:** Google Search Console sync (Pro) — real Discover, Google News, and web clicks per author and post. Author Performance 2.0 UI with tabs and coaching. Creates table `wp_newsai_gsc_performance` on upgrade. Configure under Settings → PRO → Indexing after updating. Safe upgrade from 1.9.x and 1.7.4+.

= 1.9.1 =
Stability release: schema bootstrap fix, author profile save hardening, holiday import validation, lead image representativeOfPage, PHPUnit smoke tests. No database migration.

= 1.9.0 =
Performance and entity SEO release: smaller editor tag pool, faster decay scans, Wikidata lazy tag enrichment, AI Tag Match (Pro), and timeline UX fixes. No database migration.

= 1.8.2 =
Recommended after **1.8.1**: safer IndexNow permalink handling, **free** personal performance in My Inbox, and Discover OG scoring for **AIOSEO** / **SEOPress**. No database migration.

= 1.8.1 =
Recommended after **1.8.0** (or direct from **1.7.4+**): **Find archive links** fix, Discover **OG** scoring, four-locale Discover UI, **tested through WordPress 7.0**, GPL license header, escaping and prepared-SQL hardening for Plugin Check. No database migration.

= 1.8.0 =
Recommended for every site still on **1.7.4 or older**: one update to get Discover Score v2, Breaking News Mode, live coverage tools, Author Performance Discover coaching, Classic Editor crash fix, and duplicate tag guard fix. Works in **Gutenberg and Classic Editor**. No database migration — upload and activate over your current install.

== Translators / i18n ==

* Text domain: **newsroom-ai-assistant** — every string uses `__()`, `_e()`, `esc_html__()`, and the editor script is registered with `wp_set_script_translations()` so Gutenberg sidebar strings translate too.
* Compiled `.mo` catalogs for **el, en_US, de_DE, es_ES** ship under `/languages`, alongside the corresponding `newsroom-ai-assistant-{locale}-newsai-script.json` files for JS translations.
* The plugin loads catalogs directly with the resolved request locale (`determine_locale()`), making it compatible with the WordPress 6.7+ Just-In-Time loader and the new `WP_Translation_Controller`. The Site Details → Language picker switches the UI language per site without touching the global WP locale.
* Want to add another language? Drop a new `newsroom-ai-assistant-{locale}.mo` (and optionally the matching `-newsai-script.json`) into `/languages`. Loco Translate or `wp i18n make-mo` are the usual tools. See `languages/README.txt` for details.
