NabuLingo changelog
===================

= 0.13.0 =
* Fixed: with "Search engines" (Multilingual SEO) on, language pages are translated the normal way when the NabuLingo service does not offer the extra search metadata for your website (before, the whole site stayed in the source language). The service is asked at most every five minutes.
* New: a floating language switcher. A button in a corner of every public page lets visitors pick the language. Settings > NabuLingo > Language switcher: on or off, six places (the four corners, top center, bottom center) and a color (ten colors or a hex value like #2d2d2d). The switcher is on for new installations and off after an update from an older version (a note on the dashboard points to the setting). It is shown only when a site token and a target language are saved, and not on pages that contain the shortcode [nabulingo_lang_switcher], on 404 pages, previews, feeds, in the admin and for password-protected or unpublished posts. The script ships inside the plugin (assets/nabulingo-embed.js); the page carries no site key and nothing is loaded from another server. The shortcode works as before.
* Changed: the settings page is a short guide in three steps (languages, website key, done) with one Save button. The language of the website is a list of names, the key field is hidden until you press Show, and rarely needed settings (service address, language addresses, search engine data, shortcode) are under "Advanced settings". The buttons for translating in advance are only shown with a key. Messages about the service no longer show HTTP codes; the message about a used-up allowance points to your account. The box "Your plan" links to your account (the plugin does not know your plan or usage).
* Changed: a new installation does not translate all pages in advance until you switch it on (it uses words of your allowance); sites that are updated keep their setting.
* Changed: the note about a missing WordPress language pack appears only with WooCommerce, in one sentence, and can be dismissed.
* Changed: a shortcode [nabulingo_lang_switcher] in a widget, menu or footer no longer hides the language button on every page; only a shortcode in the content of a page does, on that page.
* Changed: new installations take the source language from the language of the WordPress site when NabuLingo knows that language (for example de_DE gives de), otherwise en as before.
* Changed: the form for the free key can be sent only after a target language is saved; before that it says what to do first. After the request was sent, the form is hidden and a link shows it again. The field names in German no longer carry English additions.
* Changed: one note after the plugin was activated (dashboard and plugins page, shown once) points to the settings. The note about a missing WordPress language pack is shorter, appears as information below the messages of the settings page and names WooCommerce only when it is active.
* Fixed: the language switcher no longer repeats the tracking parameters (utm_*, gclid, fbclid ...) of the first visitor to all later visitors. A page cache that leaves these parameters out of its cache key (LiteSpeed Cache on OpenLiteSpeed) kept the page of the first visit with the links of the first visit. The links of the switcher now keep only the query variables WordPress itself knows (p, page_id, s, paged ...), like the canonical link. A query variable that only a plugin adds (for example a shop filter) is no longer carried to the other language either.
* Fixed: a correction saved or taken back in Tools > NabuLingo translations is visible to visitors without emptying the page cache by hand. A correction applies to a text everywhere on the site (menu, footer), so the plugin asks the active page cache plugin to forget its whole page cache: WP Super Cache (wp_cache_clear_cache), W3 Total Cache (w3tc_flush_posts: the page cache only), LiteSpeed Cache (the purge action for all pages) and WP Fastest Cache (wpfc_clear_all_cache). W3 Total Cache keeps serving the old copy for up to 30 seconds (its own rule). Saving the NabuLingo settings empties the page cache the same way. Another page cache is not touched: empty it as before.
* Fixed: when a published page is saved, the same plugins forget its language addresses (LiteSpeed Cache did this already; the others kept the old language copies): WP Super Cache (wpsc_delete_url_cache), W3 Total Cache (w3tc_flush_url), LiteSpeed Cache (litespeed_purge_url) and WP Fastest Cache (wpfc_clear_cache_by_url).
* Fixed: with WP Fastest Cache, its cache is emptied once at the first request after the version of the plugin has changed (wpfc_clear_all_cache()). Pages that 0.12.1 stored under the wrong address are gone without a manual step. The version is kept in the option nabulingo_version.
* Fixed: deleting the plugin removes the confirmation record that "Multilingual SEO" keeps (transient nabulingo_confirmed_site_...) and the options added in this version.
* Fixed: with Rank Math, its sitemap cache is cleared when "Multilingual SEO" or the languages are changed and when a language version becomes public, so the language sitemaps appear in its sitemap index.
* Fixed: the attribute aria-valuetext (for example Elementor progress bars) is translated.
* Unchanged: the address handling, the code of the requests to the service and the database layout. Sites that do not use the new switcher or a page cache plugin keep the same pages, apart from the switcher links when the address carries foreign parameters and the text of aria-valuetext attributes, which is now sent for translation.
* Known: with Yoast SEO or Rank Math, an incomplete language page still carries their robots meta tag next to the noindex header of NabuLingo; unchanged in this version.

= 0.12.2 =
* Fixed: with WP Fastest Cache, every language address now gets its own cache file. Before, WP Fastest Cache saw the address without the language folder and kept one copy for /leistungen/, /fr/leistungen/ and /es/leistungen/: the first visitor decided which language everybody got, and canonical link and <html lang> were wrong. The folder is now taken off the address after all plugins are loaded (only when WP Fastest Cache is active; on other sites nothing changes).
* Fixed: with WP Fastest Cache, a page that is not completely translated (service slow or unavailable, translation still running, provisional text) is no longer kept in its cache. The page is marked with WP Fastest Cache's own call (wpfc_exclude_current_page()), because it ignores DONOTCACHEPAGE here.
* Fixed: with WP Fastest Cache, the background translation now reaches the service. Before, when the page in the source language was already in its cache, WP Fastest Cache answered the requests of the background translation with that page, so it was not translated in advance.
* Changed: with WP Fastest Cache, its page exclusions of type "Starts With" or "Is Equal To" apply to the address as written. Each language has its own address now, so a rule written for the source language does not cover /fr/...: add the language addresses (fr/contact) as rules or use "Contains".
* Unchanged: the code and content of the requests to the service, the database layout and every site without WP Fastest Cache.
* Upgrade note: if you use WP Fastest Cache, empty its cache once after the update (pages saved by 0.12.1 are under the wrong address).

= 0.12.1 =
* Changed: the background translation is much faster. Until now a run asked for 3 pages and a page that the service was still translating went to the end of the queue, so the first translations arrived only after minutes. Now a run asks for page after page (one request at a time, a short pause after each, at most 25 seconds per run, 5 seconds between runs) and comes back to a page after 3, 6, 9 ... seconds (at most 15). A page is asked for up to 10 times (was 6). At most 3 pages are in work at the service at the same time (3 x 4 provider calls = 12, as in 0.12.0); the others wait. A page that is asked for again counts no words: the service counts each text once.
* Changed: when an administrator saves a first site key or a new language in the settings form, the existing posts and pages are queued by itself if the switch "Translate in the background ..." is on, the background translation was not stopped and the estimate is at most 5,000 words (fits every plan, also Free). Only a save in the form counts (nonce and the right to manage options); the migration of old settings, WP-CLI and other plugins start nothing. A new language queues only that language. The message after saving names the estimated number of words. Above 5,000 words nothing starts; the message says so and points to the button "Translate all pages now" with the estimate and the confirmation. The order is: front page, pages of the menus in menu order, other pages, posts by date. The next run is due at once, so the page that follows the save starts WP-Cron.
* Changed: while pages are waiting, the progress on the settings page refreshes every few seconds. WP-Cron runs only when the site is visited; this refresh is such a visit, so the translation goes on while the page is open. With a real cron job (DISABLE_WP_CRON) nothing else is needed.
* Changed: the consent text of the free key form reads "I accept the terms including the data processing agreement and have read the privacy policy." The settings page shows a note that translations are produced by AI and can be wrong, incomplete or out of date.
* Unchanged: nothing is sent for password-protected, private or draft posts; the queue entries of 0.12.0 are still read; no change to the database layout.
* Upgrade note: nothing starts after the update; the automatic start follows the next save of a first key or of a new language.

= 0.12.0 =
Combines three changes (the numbers 0.11.6 to 0.11.8 and 0.12.0-rc1 were internal working versions and were never published).
* New: free key. *Settings > NabuLingo* offers a free key (plan Free). The administrator enters an email address and accepts the terms; the plugin sends the address, the host name of the website, the source language and the first target language to the service (POST /v1/free/request). The service mails a confirmation link; the key is created only after the link is used and is shown on the confirmation page. Nothing is sent until the button is clicked. The notice about the missing site key points to the free key and to the pricing page. The request creates a NabuLingo customer account for that email address.
* New: *Tools > NabuLingo translations* lists the texts of a page with their translation. An editor can correct a translation. A correction costs no words, stays in your database and is never replaced by the service. It opens from the admin bar on a translated page ("Edit translation of this page"), from a box on the editing screen and from the list of pages. Search over all pages and all corrections, filters, paging. "Back to automatic" takes a correction back. A correction whose original text changed stays listed as outdated until you remove it. A correction is only accepted for a text that is on the page. Characters such as < and > in a correction are shown as plain text.
* New: names that are never translated (administrators, same screen). Brands and product names stay as written, also with common endings (Holzwerks, Holzwerk's) and in hyphenated words (Holzwerk-Shop), never inside other words. Upper and lower case can be made to matter per name. The names are replaced by neutral markers before the text goes to the service. If the service loses a name, the text is tried at most twice per day, then it stays in the original language and is marked in the list ("Name not preserved - please correct"). A text without such a name is sent exactly as before. This is a list of names to protect, not a glossary with fixed translations per language.
* New: all plugin screens and notices come in English and German (de_DE, also used for de_AT, de_CH and formal German; German uses the polite form "Sie").
* New: WooCommerce cart, checkout, order confirmation and My Account are translated with fixed texts only (labels, buttons, headings); no customer data is sent (names, addresses, e-mail addresses, notes, products, order data). AJAX parts of the checkout and the mini cart too.
* New: POST forms (for example "Add to cart") keep the language; the page that answers a form is translated from stored texts only and is never indexed or cached; the order confirmation opens in the language of the checkout.
* New: WordPress language packs of the page language are used (texts of WordPress, theme, plugins and browser-created WooCommerce block texts); a note on the settings page names missing packs. E-mails and the admin area stay in the site language.
* New: a warning on the settings page, the dashboard and the plugins page next to Polylang, WPML, TranslatePress and Weglot; NabuLingo writes no hreflang links while one of them is active. (Tested with Polylang only.)
* Changed: with Yoast SEO, og:url, og:locale and og:title/twitter:title follow the language; canonical link and og:url of a static front page are the language home page (/fr/, not /fr/start/). (Rank Math: not verified.)
* Changed: short description in readme.txt shortened (150 characters); the readme states that requesting a free key creates a free key and a NabuLingo account.
* Unchanged: without a free-key request, corrections, protected names, WooCommerce or another translation plugin the plugin sends and shows exactly what 0.11.5 did, including the time budget per request to the service. No change to the database layout.
* Upgrade note: pages of a WooCommerce shop that were left in the source language before (cart, checkout, My Account) are now translated; their fixed texts count against the word allowance once.

= 0.11.5 =
* Fixed: Flag-only language switcher links now include language names for assistive technology.
* Fixed: The settings form fits narrow WordPress admin screens.

= 0.11.4 =
* Fixed: SEO pages can show confirmed translations saved by the service when the word allowance blocks new translations. Incomplete pages stay out of search indexes and page caches.

= 0.11.3 =
* Changed: each request to the service says how long the plugin waits for the answer, so the service answers in time and the site is not paused after a timeout.
* Changed: pages that are not completely translated or show a provisional translation also send "no-store" cache headers, for caches in front of WordPress.
* Changed: provisional translations are only used for page views, not for the REST route.

= 0.11.2 =
* New: the first visitor of a page that is not translated yet can get a quick provisional translation within the usual waiting time, while the service makes the final translation. The provisional text is kept only 30 seconds and is never cached by page caches; the next visit gets the final translation. The background translation keeps waiting for the final one. Services that do not offer this behave exactly as before.

= 0.11.1 =
* Fixed: the background translation asked for languages that the service had refused for the site key (error 400 "target language not enabled"; the plugin switches such a language off until the settings are saved again). These languages are now left out of the queue, of the word estimate and of the progress display on the settings page, so "x of y translated" can reach the end; before, one refused language kept it at 0 and caused many useless requests. Entries of such a language that are already in the queue are dropped at the next run.
* Changed: the note under *Language addresses* on the settings page no longer makes a claim about search engines.
* Changed: "Requires at least" is WordPress 6.1 (tested with 6.1.1 and 7.1.4).

= 0.11.0 =
* New: language versions in folders (`example.com/fr/about/`) instead of the parameter `?nabu_lang=fr`. Setting *Language addresses* on the settings page: folders for new installations, the parameter stays for sites updated from 0.10.x. A switch redirects the old addresses to the new ones (301).
* New: with folders, `hreflang`, the canonical link, the language switcher, links to your site and search forms use the folder addresses; the language home page is `/fr/`; WordPress redirects (trailing slash, `?p=12`, front page slug) keep the folder; a folder that is not a language of the site leads to "not found" (404).
* New: with folders, the WordPress sitemap lists the language versions (one sitemap per language).
* New: the settings page and the dashboard name a page whose slug is the folder of a target language, and say when the permalink setting "Plain" makes the plugin use the parameter.
* New: a page that is not completely translated is marked `DONOTCACHEPAGE`, so page caches do not keep it.
* New: with folders, the home page and archives in a language folder get a canonical link when WordPress or an SEO plugin sets none; the parameter in a folder (`/fr/?nabu_lang=it`) redirects to the folder address (301); a feed in a folder (`/fr/feed/`) redirects to the feed of the source language (302).
* Fixed: content that is not public was sent to the service and counted (also in 0.10.x): views of logged-in users, private, draft and scheduled posts, password-protected posts (also after the password was entered) and visitors who entered a post password. They now use only stored translations. The background translation leaves password-protected posts out.
* Fixed: with folders and a page whose slug is a language folder, the language sitemap listed the folder home page several times and the canonical link pointed to the wrong page; the WordPress sitemap leaves such a page out.
* Unchanged: REST API, `wp-admin`, `wp-login.php`, `wp-cron.php` and previews; with the parameter, pages of anonymous visitors are delivered exactly as by 0.10.5, except for the protected content above.

= 0.10.5 =
* New: background translation, started by hand. *Settings > NabuLingo* shows an estimate of the words for all published posts and pages and translates them after you confirm; a post or page you publish or change is translated in the background on its own (can be switched off). It sends pages nobody has visited yet, and their words count against your allowance. Progress, start, stop and the switch are on the settings page. It stops at the word limit and when the key is refused.
* New: the plugin understands the answer "still translating" of the service (status 202). The visitor gets the original language for that view (with `noindex`, as before), but the site is no longer paused for a minute and the original text is not stored as a translation; the page is asked for again after about 15 seconds.
* New: texts the service marks as not translated are shown in the original language but not stored, so they are asked for again later.
* New: right-to-left languages (for example Arabic) get `dir="rtl"` on the translated page.
* Changed: services that do not know these answers behave exactly as before.

= 0.10.4 =
* Fixed: translations were requested but never shown, because the plugin read the wrong field of the service answer. It now reads `translations` (and still accepts `texts`).
* Fixed: long posts were cut off after 500 characters. Text is now split into short pieces at sentence and word borders; HTML tags are kept byte for byte, so the page structure stays intact and nothing is lost or reordered.
* Changed: the finished page is translated as a whole instead of single WordPress filters. Widgets, menus, footer, the browser title, verse and preformatted blocks and `placeholder` / `aria-label` texts are translated now, and nothing is translated twice.
* New: the page is cut into tags and texts by the rules of the browsers, in one pass for text, attributes and links. Inline scripts, styles, text areas, comments and the values of other attributes are never touched. A stray quotation mark in a tag (for example `alt="27" Monitor"`), a tag or comment that never ends, or a `<` inside a script no longer turns markup into text or hides the rest of the page. When the plugin is not sure about a part of the page, it leaves that part as it is, does not set `lang` to the new language and sends the page with `noindex`.
* New: all texts of a page go to the service together (one call; more only for very long pages). Per page and language only one visitor at a time asks the service, others wait for the result; at most three calls run at the same time on the whole site, so the rate limit of the service holds.
* New: search results, 404 pages and other `noindex` pages never call the service; they use the translations that are already stored.
* New: an error 400 "target language not enabled" pauses only that language (switcher, `hreflang`, admin notice) until the settings are saved again, instead of the whole site for minutes.
* New: `<pre>` blocks are translated only for the verse and preformatted blocks; the canonical link of a translated page points to the translated address; the current menu item stays marked; feed and oEmbed link titles are not sent to the service.
* New: the settings survive removing an older copy of the plugin in another folder (a second copy of the settings is kept).
* New: translations are stored in an own database table (`nabulingo_cache`). A second view of the same page makes no service call; if a text changes, only that text is fetched again.
* New: a time budget of about 3.5 seconds per page view (a request to the service is only started if at least 3 seconds are left), smaller calls after a timeout, a pause after a failure, and a notice in the WordPress admin for wrong key (401), used-up allowance (402), too many requests (429) and other service problems. Visitors see the source language in these cases.
* Fixed: links to your site get the language on the finished page. Page 2 of a post, author links and comment feeds no longer end up with a broken address.
* Fixed: the language switcher can lead back to the source language; `hreflang` and `x-default` point to the right pages (without tracking parameters); the page says `lang="xx"` only when it is really translated, otherwise it is sent with `noindex`; the switcher is never sent for translation and its style loads without a token.
* Fixed: an older copy of the plugin in a folder such as `nabulingo-0.10.3/` no longer ends the activation of this version with a fatal error; a notice asks to delete one copy.
* Removed: the "path prefix" URL mode (it never worked: `/de/page/` did not show a translated page). Language URLs always use `?nabu_lang=xx`.
* New: a comment that is still waiting for approval (visible to its author only) is never sent to the service, because anybody can write one and use up the word allowance with it.
* Fixed: character references are read like a browser reads them: `&copy 2026` and `&amp` without a semicolon, and the numbers 128 to 159 (`&#128;` is the euro sign) are no longer shown as typed. Links like `/a=b/` get the language parameter in the right place; `placeholder`, `aria-label` and `title` of text fields and the `title` of frames are translated; an HTML comment of more than a megabyte no longer makes the plugin leave the whole page untouched; a `<title>` inside an SVG is read as the markup it is.
* Fixed: titles in the source language are no longer altered (HTML such as `<em>` in a title showed as text for all visitors).
* Fixed: the "major rewrite" notice no longer appears on fresh installs, only after a real upgrade from a version before 0.10.
* readme: removed statements that could not be backed up (page-builder support, data location, legal claims) and links to pages that do not exist; keys are issued on request.
* The package folder inside the zip is now `nabulingo/` (it had a version number in the name, which created a second plugin folder on manual updates).
* Fixed: the labels of buttons (`<input type="submit">`) are translated; a request to the service is kept small (about 3,500 characters) and only started with at least 3 seconds left, so it is answered in time and not sent twice; texts shared by several pages are sent once; names, brands and addresses that come back unchanged stay in the cache as long as translations.
* Tested up to WordPress 7.1.

= 0.10.3 =
* The `the_title` and `get_the_excerpt` filter callbacks escaped every front-end return path. (The source-language escaping was removed again in 0.10.4.)
* These content filters are no longer registered in wp-admin.

= 0.10.2 =
* Bumped "Tested up to" to WordPress 7.0.

= 0.10.1 =
* REST `/wp-json/nabulingo/v1/translate` now requires the `edit_posts` capability. A bare REST nonce is no longer accepted.
* REST argument validation tightened: `text` is non-empty and capped at 8 KB; `target` must match the BCP-47 regex AND be in the site's configured languages.
* Added `uninstall.php` for clean plugin removal.

= 0.10.0 =
* Rewrite as a thin client for the NabuLingo translation service.
* Removed the in-plugin account system, checkout, plan-gating logic, landing pages, visual editor and WP-CLI commands.
* Settings page reduced to a few fields: service URL, site token, source language, target languages, switcher style.
* Strict input validation and escaping throughout.
