== Changelog ==

= 1.3.0 =

_Release date: 2026-11-04_

**Highlights**

* New "AI provider" setting: pin translations to a specific configured AI provider instead of relying on the WordPress AI client automatic selection.

**Added**

* "AI provider" dropdown in the site and network settings pages. Options: "Automatic (WordPress picks the provider)" (default, previous behavior) and every provider registered with the WordPress AI client that has configured credentials. The selection is applied server-side through the AI client's `using_provider()` API to every translation path (editor REST endpoints, WP-CLI, MultilingualPress integration). Submitted values are validated against the live provider list; unknown or deconfigured providers fall back to "Automatic" when the form is saved.

**Changed**

* `AI_Translator_Admin::__construct()` now requires a third parameter, `AI_Translator_Translator $translator`. Third-party code constructing this internal class directly must pass it.

**Compatibility**

* WordPress: 7.0 - 7.2
* PHP: 8.3 - 8.6
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra (0 errors, 0 warnings)
* PHPCompatibility: 8.3 - 8.6 (declared range) and 5.6 - 8.6 (informational full range) — 0 errors
* PHPStan: level max/10, no baseline (incl. wp-compat @ Requires at least 7.0)
* PHPUnit: 68/68 tests passing (single-site) on WordPress 7.2-beta4 / PHP 8.6, including new tests for the provider setting and the provider list helper
* composer audit: no known CVEs

= 1.2.4 =

_Release date: 2026-11-04_

**Highlights**

* WordPress 7.2 compatibility, including the refactored native AI client. PHP support documented up to 8.6.

**Fixed**

* "Request timeout" setting was ignored whenever the WordPress AI client passes an explicit request timeout to the HTTP API (observed on WordPress 7.2, whose AI client was refactored onto a shared builder base class): explicit arguments bypass the `http_request_timeout` filter the plugin relied on. The configured timeout is now also applied through the `wp_ai_client_default_request_timeout` filter (available since WordPress 7.0), so the setting works identically on WordPress 7.0 through 7.2+.
* Settings `request_timeout` values stored as non-numeric garbage now fall back to the schema default (60 s) instead of being cast to `0`.

**Changed**

* Tested up to WordPress 7.2. The plugin was verified against the WordPress 7.2 development tree (7.2-beta4): the AI client's public API used by the plugin (`wp_ai_client_prompt()`, `using_system_instruction()`, `generate_text()`, `is_supported_for_text_generation()`, `wp_supports_ai()`) is unchanged — the builder methods are now proxied through a shared `WP_AI_Client_Builder` base class.
* Minimum PHP version raised from 5.6 to 8.3 (ROBOTSTXT ecosystem support floor). For the record, the code still passes a full-range PHPCompatibility 5.6-8.6 scan — 8.3 is a support-policy decision, not a code limitation.
* PHP support documented up to 8.6. Verified with PHPCompatibility and the full test suite on PHP 8.6.
* Static analysis raised to the maximum strictness: PHPStan now runs at `level: max` (10 as of PHPStan 2.3) with zero errors and no baseline. Tooling updated (PHPStan 2.3.5, WordPress stubs 7.1, PHPUnit 9.6.38); no runtime dependencies were added.

**Compatibility**

* WordPress: 7.0 - 7.2
* PHP: 8.3 - 8.6
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra (0 errors, 0 warnings)
* PHPCompatibility: 8.3 - 8.6 (declared range) and 5.6 - 8.6 (informational full range) — 0 errors
* PHPStan: level max/10, no baseline (incl. wp-compat @ Requires at least 7.0)
* PHPUnit: 64/64 tests passing (single-site) on WordPress 7.2-beta4 / PHP 8.6, including new tests for both request-timeout filters
* composer audit: no known CVEs

= 1.2.3 =

_Release date: 2026-08-24_

**Changed**

* Manager (by ROBOTSTXT) detection now checks the ecosystem presence constant `ROBOTSTXT_MANAGER_NOTICED` (defined by Manager 1.6.2+) instead of scanning the installed plugin list on every call. On sites running older Manager versions the detection falls back to the previous plugin-list scan.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 5.6 - 8.5
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 5.6 - 8.5
* PHPStan: level 9 (incl. wp-compat @ Requires at least 7.0)
* PHPUnit: all tests passing (single-site), including both Manager-detection paths (constant defined / not defined)

= 1.2.2 =

_Release date: 2026-08-17_

**Highlights**

* Manager (by ROBOTSTXT) detection: a dismissible notice on the Plugins list screens and a persistent warning on the plugin settings pages recommend installing Manager when it is not active, since plugin updates are delivered through it.
* Removed the bundled JSON updater; updates are now handled by Manager (by ROBOTSTXT).

**Added**

* Dismissible admin notice on the site and network Plugins list screens recommending Manager (by ROBOTSTXT) (`https://www.robotstxt.software/plugins/robotstxt-manager/`) when it is not installed and active.
* Persistent (non-dismissible) warning with the same recommendation on the site and network settings pages of the plugin when Manager is not active.

**Changed**

* Removed the bundled `class-robotstxt-updater.php` library and the `update.json` file. Plugin updates are now delivered through Manager (by ROBOTSTXT).
* Plugin URI and new Update URI header now point to `https://www.robotstxt.software/plugins/robotstxt-ai-translator/`; Author URI now points to `https://www.robotstxt.software/`.
* Minimum PHP version lowered from 7.4 to 5.6, matching the real compatibility floor verified with a PHPCompatibility 5.6-8.5 scan. Minimum WordPress version remains 7.0 (the plugin uses the native WordPress AI client).
* Updated the Spanish (es_ES) and Catalan (ca) translations, including the new Manager notice strings.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 5.6 - 8.5
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 5.6 - 8.5
* PHPStan: level 9 (incl. wp-compat @ Requires at least 7.0)
* PHPUnit: 57/57 tests passing (single-site)

= 1.2.1 =

_Release date: 2026-08-07_

**Highlights**

* Confirmed compatibility with WordPress 7.1. No functional changes.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 7.4 - 8.5
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 7.4 - 8.5
* PHPStan: level 9 (incl. wp-compat @ Requires at least 7.0)
* PHPUnit: 51/51 tests passing (single-site)

= 1.2.0 =

_Release date: 2026-05-28_

**Highlights**

* Parallel chunked content translation: long posts are split at block or paragraph boundaries and all chunks are translated concurrently, eliminating timeout errors.
* Configurable request timeout: control how long the server waits for an AI response (30–300 s).

**Added**

* Configurable "Request timeout" setting (default 60 s, minimum 30 s, maximum 300 s) in both site and network admin. Controls how long the server waits for a single AI response before timing out. The PHP `max_execution_time` value is shown as a hint.
* Parallel chunked content translation — long post content is automatically split at Gutenberg block boundaries (Block editor) or paragraph/heading boundaries (Classic editor) and all chunks are sent to the AI concurrently via `Promise.all()`.
* Progress indicator — the Translate button label updates in real time: "Translating… (2/5)" after each chunk resolves.
* New REST endpoint `POST /wp-json/ai-translator/v1/translate-text` — translates a raw text string (HTML or plain text) supplied directly in the request body. Used internally by the chunked content path. Requires the same `edit_post` capability as the existing `/translate` endpoint.

**Changed**

* Content translation now reads directly from the current editor state (unsaved changes are included) instead of from the last saved post revision. Title and excerpt continue to be read from the database.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 7.4 - 8.5
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 8.2 - 8.5
* PHPStan: level 9
* PHPUnit: 51/51 tests passing (single-site)

= 1.1.0 =

_Release date: 2026-05-25_

**Highlights**

* MultilingualPress integration: new connected posts are automatically translated at creation time.
* Excerpt translation: `post_excerpt` is now a translatable field.
* Removed dependency on the third-party AI plugin — uses the native WordPress 7.0 AI client.

**Added**

* Excerpt field translation (title, content, and excerpt are now independently toggleable).
* MultilingualPress integration: opt-in "Auto-translate new connected posts" toggle in the settings pages. When enabled and MLP creates a new connected post, the plugin translates the enabled fields synchronously into the target site's language.

**Changed**

* `Requires Plugins: ai` removed from plugin headers. `wp_ai_client_prompt()` is native to WordPress 7.0 — the plugin works with any provider configured in Settings → AI.
* "AI not active" admin notice replaced by a "no provider configured" notice, which fires when no provider supports text generation.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 7.4 - 8.5
* WP-CLI: 2.12 or newer
* MultilingualPress: 5.x (optional)

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 7.4 - 8.5
* PHPStan: level 9
* PHPUnit: 50/50 tests passing (single-site)

= 1.0.0 =

_Release date: 2026-05-23_

**Highlights**

* Initial release of AI Translator (by ROBOTSTXT).
* Translates post title and content from the editor using the official WordPress AI plugin as backend.
* Multisite-ready with global or per-site configuration.

**Added**

* Block editor sidebar panel and Classic editor metabox with target-language selector and a Translate button.
* REST endpoint `POST /wp-json/ai-translator/v1/translate` for editor and external integrations.
* WP-CLI command `wp ai-translator translate` for single-post and bulk translation.
* Network admin settings page with global / per-site mode toggle.
* Site admin settings page with title and content translation toggles.
* Model recommendations table in the settings pages as guidance.

**Compatibility**

* WordPress: 7.0 - 7.1
* PHP: 7.4 - 8.5
* WP-CLI: 2.12 or newer

**Tests**

* PHP Coding Standards: WordPress-Core, WordPress-Docs, WordPress-Extra
* PHPCompatibility: 7.4 - 8.5
* PHPStan: level 9
* PHPUnit: 50/50 tests passing (single-site)
