# Changelog — Platform Helm

All notable changes are recorded here. Versions stay in 0.x until the first
public release. Format loosely follows Keep a Changelog; semantic-ish versioning.

## [0.13.0] — 2026-06-02
### Added — Search performance (the deferred pair + AI insights)
- **Search Console Connector (GSC)** (default off): connects to Google Search Console via service-account JWT or OAuth, caches per-post Search Analytics on a daily cron, and powers cannibalization, content-gap, off-brand, index-coverage and monitor reports. 17 classes, custom tables, all de-branded.
- **Content Auditor** (default off): scores every post on Search Console traffic + on-page health into a Keep / Refresh / Merge / Delete worklist; batched, recommend-only, CSV export. Depends on GSC.
- **AI Insights** (part of AI Assistant): the deferred analyst page is now active — reads the GSC + Auditor + Link Health stores to answer SEO questions on demand. All prompts de-branded.
- Dashboard Module Status grid surfaces all 17 modules automatically from the registry.
- GSC daily-sync cron is cleaned up on deactivation.

### Changed — UI consistency & release prep (2026-06-04)
- Design pass: rebuilt the Command Center (Site Health Overview score + issue rows, a real Broken Links stat tile, adaptive single/two-column layout) and removed the Module Status card from it; restyled Link Suggester, Bulk Suggestions, Link Health (+ CSV export), Activity Log, Tools, Ghost Purge, Link Assassin and Login Branding onto the `.ph-wrap` design system; redesigned the Modules page as a toggle list with per-module "View module" links.
- Navigation: trimmed the Helm sidebar to Dashboard, Modules, Roles & Menus and Tools (other module pages now open via "View module" and stay fully accessible — using CSS hiding rather than remove_submenu_page(), which had caused an "access denied" regression).
- Fixes: restored `LoginBrandingModule::DEFAULT_LOGO` and added `Assets::enqueue_schema_metabox()` (both undefined → fatals); reset WordPress-core `.card { max-width:520px }` leakage that was capping Helm cards; `Ui::open_page()` now allows a header button to submit a form below it.
- De-brand: renamed the leftover `topla-` CSS-class prefix to `ph-` across CSS/PHP/JS (with `topla-wrap` → `phla-wrap` to avoid the design root).
- Release prep: Tabler icons load from a local bundle when present (CDN fallback only when absent); added `.distignore` / `.gitattributes` so dev files (designs/, CLAUDE.md, ph-nscheck.php, .claude/) stay out of release zips; refreshed readme.txt to the full 17-module feature set.

## [0.12.0] — 2026-06-02
### Added — four site-tools modules (ported & de-branded)
- **Login Branding** (default off): premium dark "Aurora" login page. Accent now derives from the site's WordPress admin colour scheme (with a custom override), uses the site's own Customizer logo, and registration removal is an opt-in toggle (was forced/SME invite-only before).
- **Link Assassin** (default off): bulk-removes broken OUTBOUND links from post content and Elementor data, batched 25/req with a progress bar; every post backed up first, one-click restore. Complements Link Architect (which builds internal links). Content-rewrite logic unit-tested.
- **Ghost Purge** (default off): bulk-delete users in a role who have not logged in for N months; batched, dry-run-first, reassigns content to admin.
- **Uploads Vault** (default off): protects form-upload subdirectories with .htaccess + index.php and a PHP fallback for nginx.
- Support helpers: HtmlLinkStripper, ElementorDataProcessor.

### Skipped (with reason)
- 9 modules were intentionally NOT ported: AccessEngine, RouteResolver, Intelligence, Activity_Intelligence, Audit_Trail, Data_Retention_Engine, Executive_Dashboard, Partner_API_Receiver, Sync_Watchdog — all hardwired to BuddyBoss / MemberPress / the SME "funding applications" workflow, or overlapping Helm's existing Activity Log. They do not belong in a general-purpose plugin.
- GSC + Content Auditor remain deferred to a dedicated session (large + interdependent).

## [0.11.0] — 2026-06-02
### Added — five SEO & content-intelligence modules (ported from the ops plugin, de-branded for general use)
- **AI Assistant** (default on): connection settings for an OpenAI-compatible API (Groq by default). API key encrypted at rest with AES-256 keyed off site salts. Powers the rewriter and meta generator.
- **AI Visibility Check / AEO** (default on): editor meta box that scores an article intro for AI-answer-engine visibility (substance, concrete specificity, authority signals) and can suggest a refined intro via the AI Assistant. Client-side scoring; nothing saved. Prompts and scoring are locale-neutral.
- **AI Meta Generator** (default off): drafts an SEO meta title + description to copy into Yoast; suggestion-only, never outputs tags, so no conflict.
- **Structured Data (Schema)** (default on): HowTo + FAQ JSON-LD from an editor panel, emitted into the head. Seeds one neutral example on first run (no site-specific content).
- **Google Tag Manager** (default off): injects a GTM container correctly (script high in head, noscript after body open) once a container ID is set.

### Added — Core
- LlmClient + LlmSettings (encrypted AI connection), PostTypes helper, Authorization helper (capability-based gating; replaces the source plugin'"'"'s master-admin concept).

### Notes
- The AI Insights page and DataDigest were intentionally NOT ported yet: they depend on the Search Console (GSC) and Content Auditor modules, which are deferred to a dedicated session. AI Assistant ships as connection-settings-only until then.

## [0.10.0] — 2026-05-30
### Changed — UI overhaul (approved design system)
- Implemented the approved "refined-native" design system across the admin UI: a scoped stylesheet (assets/css/admin.css) built from the design mockup, with design tokens, cards, stat tiles, badges, buttons, notices, tables, accordions, and tabs — all scoped to .ph-wrap so nothing leaks into wp-admin.
- New shared Ui helper (Core/Ui.php): enqueues the stylesheet + Tabler icon font + admin.js on Helm screens, renders the logo (inline SVG), and provides page-header / stat-tile / card / badge / notice helpers matching the design vocabulary.
- New plugin logo used for the admin menu icon and headers.
- Command Center fully rebuilt to the new design (stat grid, getting-started checklist, recent-activity feed, module status) against the existing live data.
- All other screens (Modules, Link Health, Bulk Suggestions, Link Architect, Roles & Menus, Activity Log, Tools, Setup Wizard) re-skinned to the design system; existing logic, data, security, and module wiring unchanged.
- New assets/js/admin.js for shared interactions (accordions, tabs, toggle-badge sync, toast helper). Used WordPress native admin submenu (no duplicate in-page sidebar).

## [0.9.1] — 2026-05-29
### Added
- Admin-bar **Helm** menu with one-click **Clear cache** (plus quick links to the Command Center and Link Health), the way caching plugins surface theirs. Available front-end and admin for users who can manage options.
- Shared CacheManager in Core so the Tools page and admin-bar button use one cache-clearing implementation.

## [0.9.0] — 2026-05-29
Large feature release across four areas.

### Added — Onboarding
- First-run **Setup Wizard**: a welcome screen (auto-shown once on activation) to choose modules and optionally run a first scan. Never nags on re-activation.
- Command Center **Getting-started checklist** (state-driven; hides itself once complete) and a **Recent activity** feed fed by the Activity Log.

### Added — Activity Log depth
- **CSV export** (respects the active filter), daily **retention pruning** (configurable days; 0 = keep forever), expanded event coverage (plugin activate/deactivate, Helm settings + module-toggle changes, role-menu changes), and the dashboard activity feed.

### Added — Settings & Tools (Helm → Tools)
- **Export / Import** all Helm settings as JSON (import is whitelisted/validated). Maintenance tools: run all scans, clear all caches, reset settings to defaults.

### Added — Bulk Link Suggestions (Helm → Bulk Suggestions)
- Scan all published posts at once, chunked over AJAX with a progress bar, reviewing every internal-link opportunity in one table (same engine as the editor panel).
- **Dismiss** memory: dismissing a suggestion suppresses that source→target pair everywhere, permanently (complements the Architect-built LinkMemory).

### Changed
- SuggestionEngine now also suppresses user-dismissed pairs.
- New cron (activity prune) cleaned up on deactivation; new options + post-meta covered by opt-in uninstall teardown.

## [0.8.0] — 2026-05-29
### Added
- **Architect ↔ Suggester feedback loop.** Link Architect now records every source→target link it builds in a shared, persistent LinkMemory (post meta on the source). The Internal Link Suggester consults it and never re-suggests a pair the Architect already created — even across edits or with a different anchor phrase. Restoring a post from an Architect backup clears its recorded links so they can surface again.
- **Scheduled link-health alerts.** A weekly background cron scan compares internal-link health to the prior snapshot and warns when orphan pages or broken internal links rise: always via a dismissible in-dashboard admin notice, and optionally by email to the site admin (off by default, toggle under Helm → Modules → Module preferences). Cron is cleaned up on deactivation.

### Changed
- Settings: "Dashboard preferences" section renamed "Module preferences" and now also holds the Link Health email-alert toggle.
- uninstall.php opt-in teardown now also removes health snapshot/alert options and the LinkMemory post meta.

## [0.7.0] — 2026-05-29
### Added
- **Gutenberg one-click link insertion** for the Internal Link Suggester. A native block-editor sidebar panel (Helm link icon in the top-right) scans the post and inserts internal links directly into block content with one click — closing the gap where the block editor previously only offered copy-URL. Built no-build (plain wp.* JavaScript, no toolchain), reusing the existing suggestion AJAX endpoint and engine.
- Insertion is block-aware and safe: it wraps the first contextually-valid occurrence of the phrase in a paragraph/list/quote/verse block, skips text already inside an anchor, respects word boundaries for external-link rules, and never corrupts tag markup. Falls back to copy-URL when no linkable text block contains the phrase.

### Changed
- The classic-editor Suggester meta box is now marked back-compat so it is hidden in the block editor automatically (replaced by the sidebar panel); it still renders in the classic editor.

## [0.6.0] — 2026-05-29
### Added
- Per-post **Link Summary** meta box on the post-edit screen (Internal Link Health): inbound/outbound/broken-link counts for the current post, with an orphaned-post callout that deep-links into Link Architect when that module is enabled. Cache-only by design — never triggers a full-site scan from the editor.
- **Fix this** deep-link buttons on the Link Health → Orphan pages table: per-row + a bulk "Fix N orphans in Link Architect" button that pre-fills up to 25 orphan URLs into the Architect scan textarea in one click. Buttons appear only when Link Architect is enabled.
- HealthAnalyzer now persists a per-post link graph (inbound, outbound, broken-per-source) in the cached report; cache key bumped to v2.

## [0.5.0] — 2026-05-28
### Added
- Persona Dashboards: optional "Clean dashboard mode" toggle (Helm → Modules → Dashboard preferences). When on, the noisy native WordPress widgets are hidden for users with a Helm persona. Off by default; third-party plugin widgets are never touched.
- Link Architect now fires the documented `platform_helm_link_inserted` and `platform_helm_link_restored` action hooks at the write points; the Activity Log captures both automatically.
- WordPress.org submission prep: polished readme.txt (description, FAQ, screenshots/changelog sections, upgrade notice) and `languages/platform-helm.pot` translation template (233 strings) generated via WP-CLI.

## [0.4.1] — 2026-05-28
### Changed
- Redesigned the Role & Menu Manager UI: role overview cards with capability
  bars, a collapsible per-role accordion with live hidden-count badges,
  per-role search filter, Hide all/Show all bulk actions, toggle-pill menu
  items, and a sticky save bar. Backend logic, security, and behaviour
  unchanged — render layer only.

## [0.4.0] — 2026-05-28
### Added
- **Persona Dashboards module** (opt-in). Role-tailored dashboard widgets with
  capability-based, multi-role detection (a user sees every set they qualify
  for): Platform Manager (site pulse, recent content, optional WooCommerce
  snapshot), Editor (pipeline + top posts by engagement), Community Manager
  (engagement + moderation queue + recent comments), Author (personal stats).
  Generic data layer rebuilt from scratch (no SME-SA/funding/BuddyBoss code);
  widgets are additive (native dashboard left intact); hourly cron pre-warm;
  cron cleaned up on deactivate.
- **Role & Menu Manager module** (opt-in). Roles/capabilities overview and
  per-role admin-menu hiding. Presentational and fully reversible — never
  deletes roles or strips capabilities; full admins are never affected.
- **Activity Log module** (opt-in). Detailed logging (logins, content
  publish/update/trash/delete, role changes, registrations, Helm link edits)
  to a custom table with a filterable, paginated viewer. Table preserved on
  uninstall unless full data removal is opted into.

### Changed
- uninstall.php opt-in teardown now also drops the activity-log table and
  module options (roles map, suggester settings, schema markers). Roles and
  role assignments are still never touched.

## [0.3.0] — 2026-05-28
### Added
- **Link Architect module** (free core, opt-in / off by default). Bulk-builds
  internal links to orphan pages: Scan & Suggest (keyword candidates from
  Yoast/Rank Math focus keyword, cleaned title, content n-grams → matched
  source posts), batched Execute (25/req, progress UI, DOM insertion that skips
  headings/anchors/scripts, anti image-only-match filtering, per-source cap of
  3), and per-post one-click Restore from automatic pre-write backups. Optional
  Elementor support (graceful — never a dependency).
- **Internal Link Health module** (free core, enabled by default). Report under
  Helm → Link Health: orphan pages, total internal links, broken internal
  links, with Rescan. Feeds the Command Center cards with real numbers via the
  `platform_helm_dashboard_metrics` filter.

### Changed
- Command Center "Orphan Pages" and "Internal Links" cards now show live counts.
- Link Architect gated by `edit_others_posts`, replacing the internal single-owner gate.

## [0.2.0] — 2026-05-28
### Added
- **Internal Link Suggester module** (free core, enabled by default). In-editor
  panel that scans the current content and suggests existing posts to link to.
  - `SuggestionEngine`: full-title + n-gram + focus-keyword matching against
    real linkable body text only (strips existing anchors, headings, images,
    code, and Gutenberg block comments).
  - Rank Math / Yoast focus-keyword adapter (optional integration, never a
    dependency — absent plugins are simply skipped).
  - User-defined external-link rules (keyword | URL), whole-word matched.
  - Classic editor: one-click in-place insertion. Block editor: copy-to-URL
    (true one-click Gutenberg insertion flagged as a future enhancement).
  - Settings page under Helm → Link Suggestions (capability-gated, nonce-checked).
- Plugin logo (SVG master + WordPress.org icon and banner PNGs).
- Custom admin-menu icon (inlined data-URI helm wheel).

### Changed
- Registered the first module in the composition root.

## [0.1.0] — 2026-05-28
### Added
- Core modular framework ported from the internal plugin and productized:
  - PSR-4 autoloader (Composer-free).
  - `ModuleInterface`, `ModuleRegistry`, `Settings` (single-row), `Assets`, `Logger`.
  - `Plugin` composition root with per-module try/catch boot on `plugins_loaded`.
  - Command Center dashboard (capability-gated, transient-cached).
  - Modules settings page + "remove all data on uninstall" preference.
  - Safe `uninstall.php` (preserve-by-default; teardown only on explicit opt-in).
- OPcache-safe string-literal constants, PHP 8.0 guard, fatal-log shutdown handler.

### Security
- Removed the internal version's hardcoded master-email gate entirely. All admin
  UI is gated by the standard `manage_options` capability.

### Removed (intentionally not ported)
- All SME-South-Africa-specific modules: funding tooling, BuddyBoss/MemberPress
  role access, POPIA scrub, partner API, hardcoded owner email.
