# Changelog

All notable changes to SeoScope will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-04-29

### Added

- Initial CodeCanyon release package.

### Fixed

- Admin login CSRF: custom `session_save_path`, early `SessionAuth::start()`, cookie `path` from `app.base_path`, trim POST token; do not rotate CSRF on every GET `/login` (multi-tab / back button); rotate after failed CSRF POST only.

## [Unreleased]

### Added

- N/A

### Fixed

- N/A

### Changed

- N/A

## [1.1.0] - 2026-05-16

### Added

- **SEO AI Assistant** on report screens (optional, same pattern as Dashboard): **Quick Win** (IQQI, CTR Opportunity, Low CTR Pages, Topical Gaps), **Keywords**, **Pages**, **Cannibalization**, **Long Tail**, **Question Queries**, and **Decay** — on-demand **Generate insight** / **Regenerate**, server-side cache, rate limits, and token usage accounting per provider.
- Report-level payloads send a **compact JSON snapshot** of the current table view (top rows, filters, and report-specific context such as compare periods or decay thresholds); landing URLs or query lists are included only where the report itself is URL- or query-centric (see **Settings → AI** privacy note).
- **Settings → AI:** **Enable AI insights** toggle saves **immediately** (no need to click **Save AI settings** for on/off); provider keys, models, and monthly token limits still use **Save AI settings**.
- Keywords report: **tracked queries** — persist per user and Search Console property (`tracked_queries` migration), filter **All | Tracked**, CSV export respects the filter, add/remove actions with CSRF, per-property cap (`TrackedQueryRepository::MAX_TRACKED_PER_PROPERTY`), English + Italian UI strings.
- **Tracked pages:** migration `tracked_pages` and `TrackedPageRepository`; Pages report **All | Tracked** filter, CSV export, drill-down, **track / untrack** URLs (`POST /pages/track`, `POST /pages/untrack`, CSRF, cap 500/property).
- Dashboard: **Tracked keywords** and **Tracked pages** cards below the traffic widgets (top items by impressions in the dashboard date range).
- **PHPUnit** (dev): payload tests for SEO AI report services; optional MySQL integration tests for tracked queries/pages when `SEOSCOPE_TEST_PDO_DSN` is set (see `CONTRIBUTING.md`).

### Fixed

- Keywords / Pages: post track/untrack redirect appends a **URL fragment** (`#ss-kw-row-N` / `#ss-pg-row-N`) so the browser returns to the same table row.
- **Decay** report: threshold filters from the on-page form (GET) are applied consistently with the SEO AI payload (shared `resolveDecayConfig`).

### Changed

- **Settings → AI:** “What is sent to your AI provider” is a **short summary** instead of a per-report bullet list.
- **Settings** tabs: **Update** appears before **Reset** in the tab bar.

## [0.3.0-m2] - 2026-04-02 (pre-release)

### Added

- Admin authentication (`SessionAuth`), login/logout, CSRF (`AdminCsrf`) separate from installer session.
- `WebDispatcher` routing: `/`, `/login`, `/logout`, `/projects`, `/projects/new`, `/projects/edit`, `/projects/delete`.
- `sscope_projects` migration; `ProjectRepository`, `UserRepository`, `ConnectionFactory`.
- Mazer-based admin layout and placeholder dashboard KPIs; projects CRUD with table UI.
- Optional `app.base_path` in config for subdirectory deploys; `seoscope_url()` helper.
- English strings for auth, nav, dashboard, projects.

## [0.2.0-m1] - 2026-04-02 (pre-release)

### Added

- M1 installation wizard (`/install/`): environment checks, database connection test, admin user creation.
- `config/local.php` generation; `storage/app/install.lock` and `storage/app/installation.key`.
- Database migrations (`database/migrations/`) with `MigrationRunner`; initial `sscope_migrations` + `sscope_users`.
- CSRF tokens for install forms; session cookie flags (HttpOnly, Secure when HTTPS, SameSite=Lax).
- Helpers: `SeoScope\Http\Request`, `SeoScope\Security\CsrfToken`, `SeoScope\Install\*`, `SeoScope\Database\MigrationRunner`.
- Documentation: `M1-rollback.md`; home page `?installed=1` notice.

## [0.1.0-m0] - 2026-04-02 (pre-release)

### Added

- M0 foundation: `public/` front controller, `app/bootstrap.php`, `SeoScope\Version`.
- Composer PSR-4 autoload `SeoScope\` with autoload fallback without `vendor/`.
- i18n (`Translator`, `lang/en/messages.php`, `__()` helper).
- `config/config.example.php`, `.gitignore` for `local.php` and `storage` noise.
- `install/` stub for M1 wizard; `storage/` structure for cache, logs, sessions, app locks.
- Documentation: `THIRD-PARTY-LICENSES.md`, `network-and-privacy.md` stub, `CODECANYON-CHECKLIST.md`, `M0-implementazione.md`.
- `public/.htaccess` rewrite rules for front controller.
- Symlink layout documented: `public/assets` → Mazer assets, `public/install` → installer.
