# Changelog

All notable changes to AIT Multilingual Translate are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [0.3.40] - 2026-07-30

### Added

- Added an opt-in Database Maintenance screen with grouped statistics, dry-run previews, confirmation gates, and bounded cleanup batches.
- Added WP-CLI maintenance commands for statistics, classification, dry runs, cleanup, index inspection, table analysis, optimization, and runtime self-tests.
- Added a separate runtime usage table for cache hit counts and last-used timestamps without altering the large translation table.
- Added configurable runtime cache TTL, per-language capacity, text length limits, excluded paths, selectors, and source types.

### Changed

- Page-load provider translation and page-load database storage are now independent, disabled-by-default runtime features.
- Runtime text is normalized consistently before hashing while existing legacy hashes remain readable.
- Runtime DOM translation is limited to visible human-readable text and selected accessibility attributes.
- Legacy translation writes now use atomic inserts and preserve published, manual, imported, and draft translations.

### Fixed

- Prevented empty or unknown source types from entering the translation queue.
- Prevented concurrent page requests from sending the same missing string to a provider.
- Prevented cart, checkout, account, AJAX, REST, preview, feed, XML, sitemap, script, style, hidden, and technical content from runtime collection.
- Replaced unbounded page-load queue deletion with resumable batches.

## [0.3.39] - 2026-07-03

### Added

- Added safe-by-default provider guidance with pricing notices for OpenAI, Gemini, Grok/xAI, Google Translate, and DeepL.
- Added provider setup assistants with quota, budget, model, and documentation links.
- Added an API cost estimator panel and a global safety warning when plugin-side limits or expensive automation settings are unsafe.
- Added free-quota recommendations and provider documentation shortcuts directly inside the provider configuration UI.
- Added clearer release documentation for onboarding, setup wizard flow, frontend translation editing, scanner safety, translation matrix review, and provider usage controls.

### Changed

- New installs now use conservative plugin-side character limits, smaller batches, and disabled background/page-load translation behavior by default.
- Provider cards now highlight free-tier, usage-based, or paid API expectations and emphasize Translation Memory reuse before provider calls.
- Improved onboarding UX by steering new users toward safer queue-based translation, local Translation Memory reuse, and small batches before large provider runs.
- Improved setup wizard messaging around provider keys, API cost expectations, and staging-first testing.
- Improved frontend translation and translation editor guidance so administrators understand when saved translations, cache hits, or provider calls are used.
- Improved scanner and translation matrix release notes to make cost, queue, and cleanup behavior easier to understand before bulk translation.

### Fixed

- Improved target-language search so language codes such as `ru` match the correct language.
- Fixed release documentation gaps around safe API defaults, provider warnings, and cost-conscious translation workflows.
- Improved performance guidance by emphasizing deduplication, Translation Memory, conservative batches, and disabled expensive automation defaults for new installs.

## [0.3.38] - 2026-07-03

### Added

- Added a guarded cleanup action for queued strings collected from page-load discovery.
- Added a Scanner warning when page-load collection is enabled on production sites.

### Changed

- Queue source reports now separate queued characters from historical total characters so old translated rows do not make current queue estimates look inflated.
- Legacy rows with missing source metadata are now displayed as `Legacy/missing source` instead of an empty source label.

### Fixed

- Reduced confusion in Scanner and Usage reports where total historical characters could appear next to current queued counts.

## [0.3.37] - 2026-07-02

### Added

- Added a technical queue cleanup action for queued rows that contain data URIs, base64 payloads, URLs, hashes, IDs, JSON/settings data, asset paths, code fragments, and other non-translatable strings.
- Added skipped-string diagnostics with top rejection reasons and technical samples so admins can see why strings were blocked before provider calls.
- Added additional unsafe page-load guards for customizer, Elementor preview, WooCommerce cart/checkout/add-to-cart/remove-item, filter, sort, and preview requests.

### Changed

- Translate All is now blocked when queued rows contain unknown or technical/non-translatable items.
- Translate All estimates now show blocked technical rows/characters separately from billable unique source strings and target-language jobs.
- Page-load collection no longer queues missing strings by default on new installs.

### Fixed

- Prevented `source_type=unknown` rows from being created when source metadata cannot be determined.
- Prevented data URI, base64, CSS/JS, JSON settings, IDs, classes, hashes, URLs, emails, and low-letter-ratio strings from entering the translation queue.
- Reduced the risk of accidental Google Cloud Translation API spend from repeated technical queue items.

## [0.3.36] - 2026-07-02

### Added

- Added a queue debug report showing top queued source types, object IDs, field keys, target-language counts, duplicate hash groups, and the longest queued strings.
- Added a guarded cleanup action for queued rows whose source metadata is missing or marked as `unknown`.

### Changed

- Translate All estimates now separate total queued rows, unique source strings, target-language jobs, billable characters, per-language character totals, and unknown rows that are blocked from provider calls.
- Scanner guards now reject more technical/non-human strings such as JSON settings, classes, IDs, URLs, hashes, short values, pure numbers, and oversized strings before they can enter the queue.

### Fixed

- Blocked `source_type=unknown` queued rows from being sent to translation providers.
- Prevented unsafe queue items from inflating Google Cloud Translation API estimates or running through Translate All.
- Preserved source metadata for scan, page-load, menu, widget, taxonomy, post, meta, and Elementor queue items so queue reports can explain where rows came from.

## [0.3.35] - 2026-07-02

### Added

- Added a queue lock with TTL so manual Translate All, cron, and background queue processing cannot run in parallel.
- Added processing status handling, retry counters, last attempt timestamps, failed reasons, and stale processing recovery for queued translations.
- Added provider usage logging and an admin usage report for daily/monthly provider character totals.
- Added Translate All preflight estimates for strings, target languages, characters, and approximate Google Cloud Translation API cost.
- Added source reporting for queued translations so admins can see whether queue items come from products, pages, Elementor, menus, widgets, taxonomies, SEO/meta, or site strings.

### Changed

- New installs now keep page-load translation, background queue processing, and scan-on-save disabled until explicitly enabled.
- Draft translations are treated as existing translations and are not resent to providers by default.
- Elementor scanning now focuses on visible human-readable fields instead of technical settings, CSS, IDs, URLs, or metadata.

### Fixed

- Reduced the risk of duplicate provider requests from overlapping queue runs, repeated scans, failed jobs, and already translated strings.
- Added Google Cloud Translation API billing warnings and local quota checks before provider calls.

## [Unreleased]

### Planned

- Additional workflow demonstrations for the scanner, frontend editor, translation matrix, and queue.
- Expanded documentation for provider setup and production translation workflows.

## [0.3.34] - 2026-06-26

### Changed

- Updated DeepL Terms and Privacy Policy links for WordPress.org review.
- Confirmed the public plugin name as AIT Multilingual Translate.
- Prepared GitHub-facing documentation for the approved WordPress.org release.

## [0.3.33]

### Changed

- Renamed public plugin branding to AIT Multilingual Translate.
- Removed restricted or trademark-sensitive wording from the public plugin name.
- Updated public package metadata for the WordPress.org submission.
- Improved external services disclosure in `readme.txt`.
- Removed or corrected outdated external service legal and privacy links.

### Improved

- Improved WordPress enqueue handling for JavaScript and CSS.
- Improved plugin directory and path handling through WordPress helper functions.
- Improved output buffering lifecycle.
- Improved output escaping in frontend and admin rendering.
- Tested the updated package with Plugin Check.

### Fixed

- Removed custom updater and self-update override logic for WordPress.org compliance.
- Restored target language search in the dashboard and setup wizard after the public prefix cleanup.
- Restored frontend language switcher styling for shortcode, Elementor widget, automatic placement, and WordPress menu output.
- Restored frontend editor editable text detection and AJAX actions after the final public rename.
- Prepared the updated ZIP package for WordPress.org review.

## [0.3.32]

### Changed

- Updated the final plugin slug, folder, ZIP name, and text domain to `ait-multilingual-translate`.
- Removed previous public-facing naming from the installable package.

### Fixed

- Removed beta self-update and repair updater hooks for WordPress.org compliance.
- Replaced remaining direct admin inline script and style output with WordPress enqueue APIs.
- Updated generated log storage to use `wp_upload_dir()`.
- Clarified Google Translate disclosure.
- Added explicit output-buffer shutdown handling for review safety.

## [0.3.31]

### Changed

- Updated the public WordPress.org plugin name to AIT Multilingual Translate.
- Updated submission slug, text domain, package structure, language template filename, and public-facing branding for WordPress.org guidelines.

### Fixed

- Improved WordPress.org naming compliance.
- Reduced generic and trademark review risk with a distinct public brand.

## [0.3.30]

### Added

- Public Beta release metadata and package slug.
- Translation Mode and Tone of Voice foundation for prompt-based AI providers.
- AI Cost Optimization settings for quality mode, temperature, request character limits, estimated per-request cost limits, and model recommendations.
- Provider statistics for API requests, estimated tokens, estimated cost, cache hits, duplicates skipped, provider, and model.
- Provider capability cards for active providers and planned architecture targets.
- External services disclosure in `readme.txt`.

### Improved

- AI provider handling and provider diagnostics.
- Translation memory and deduplication before provider requests.
- Scanner and queue workflow visibility.
- Frontend editor UX, loading states, and manual-save flow.
- Language switcher UI and local flag handling.
- Elementor widget display options.
- Setup wizard and dashboard organization.
- WordPress text-domain loading for language-pack readiness.

### Fixed

- Plugin Check errors for WordPress.org preparation.
- SQL prepared statement issues in reviewer-sensitive areas.
- Sanitization, escaping, and nonce handling in admin and frontend actions.
- ZIP package structure for the public plugin slug.
- Public Beta wording and older commercial-facing text.
- Developer-only support notes excluded from the installable ZIP.

## [0.3.29]

### Added

- Translation Style and Tone of Voice settings section for the Public Beta release.
- Translation Mode visibility in scanner and queue statistics.

### Changed

- Documented that per-content-type modes are planned for a future release while the current build uses Global Translation Mode.

## [0.3.28]

### Added

- Scanner and Queue "Translate All" action for processing queued translations in safe provider batches.
- Global Translation Mode and Tone of Voice UI copy.
- Server-side custom instruction length protection.

## [0.3.27]

### Fixed

- Admin asset loading for plugin subpages after the public slug change.
- Remaining public Elementor switcher label using outdated branding.
- Modular settings link to the top-level admin page.

## [0.3.26]

### Added

- Public WordPress.org package name and metadata.
- Translation Mode and Tone of Voice settings for prompt-based AI providers.
- `languages/` folder required by the plugin header.

### Changed

- Default OpenAI model changed to `gpt-4o-mini`.
- Default xAI / Grok model changed to a lightweight default where available.

### Fixed

- Hardened custom-table SQL and local file handling for Plugin Check compatibility.

## [0.3.25]

### Added

- Secure frontend editor Auto Translate workflow.

### Improved

- Frontend editor modal states, textarea resizing, and provider error messaging.
- Manual save flow so AI translation is previewed and edited before saving.

## [0.3.24]

### Improved

- WordPress.org preparation cleanup.
- URL parsing through WordPress helper APIs.
- Uninstall variable prefixing and translator comments.

## [0.3.23]

### Added

- Public Beta Build prepared for WordPress.org review.
- WordPress.org `readme.txt`.
- GPL metadata.
- External service disclosures.

### Changed

- Replaced earlier beta wording with Public Beta Build wording.
