=== Translate Website & Rank Globally with SEO & GEO - MultiLipi AI Translation ===
Contributors: multilipitechnologies
Tags: translation, multilingual, seo, language switcher
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 3.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Server-side MultiLipi website translation with language subdirectories, optional local translated slugs, and indexed multilingual WordPress search.

== Description ==

MultiLipi Translate fetches permitted languages from the MultiLipi backend, keeps the API key on the WordPress server, and renders target-language public pages with translated HTML before they are sent to visitors or crawlers.

Features include language subdirectories, routing for standard WordPress URLs and public custom post types, WooCommerce product/store URL compatibility, hreflang output, an SEO Pack with manual target-language metadata fields and an optional multilingual sitemap, server-rendered text and social metadata translation, an automatic floating language switcher plus shortcode, conditional language-content shortcodes, API-managed language storage and redirects, a central local slug-translation editor, indexed target-language WordPress search with optional on-demand and visitor-driven modes, server response caching, API-enabled language-subdirectory `llms.txt` plus public-page `.md` files using the existing saved MultiLipi API key, and API-enabled best-effort LLM request analytics.

== External Services ==

This plugin connects to MultiLipi over HTTPS after a site administrator configures a MultiLipi account API key. The saved key remains on the WordPress server. Browser translation requests use the site's local WordPress REST API.

Service: MultiLipi API at https://multilipiseo.multilipi.com/
Used for: Fetching language and feature configuration and saved slug mappings; translating eligible page text and URL slugs; synchronizing slug mappings; reporting translation page usage; and reverse-translating search phrases when on-demand search is enabled and authorized by the API.
Data sent: The API key, site domain and URL path, source and target languages, text selected for translation, and source/translated slug paths. Search phrases are sent only for the enabled on-demand search fallback. Configuration and slug synchronization run on administrator requests, settings refreshes, or local slug updates; page translation runs on eligible target-language requests and configured background work.

Optional LLM files: When enabled by the verified API configuration, https://multilipiseo-2.multilipi.com/ receives the server-side API key, domain, language, URL path and eligible public-page HTML to generate llms.txt and Markdown content.

LLM request analytics: When the verified API configuration enables LLM or schema capabilities, https://multilipiseo.multilipi.com/domain/api/llm-analytics/ receives anonymous public-request events containing domain/path, detected AI crawler category, language, response status, response time and User-Agent. These events do not include the API key, cookies, IP address, query string, request body or page content.

Terms: https://multilipi.com/terms_and_conditions
Privacy Policy: https://multilipi.com/privacy_policy

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install its ZIP in WordPress.
2. Activate MultiLipi Translate.
3. Open MultiLipi > Settings, enter an API key, and fetch language settings.
4. Enable target languages and save.

== Changelog ==

= 3.0.0 =
* Retain the multilipi-multilingual-seo folder and entry filename for in-place upgrades from v2, using WordPress.org updates in this release.
* Automatically preserve the saved API key, source/target languages, selected languages, and API feature flags without reactivation.
* Refresh newer API configuration fields in a bounded background job; preserve local configuration if the service is unavailable.
* Preserve multilingual sitemap discovery and redirect old admin and sitemap entry points.
* Leave v2 slug mappings untouched and do not import them into v3.
* Import saved MultiLipi slug dictionaries when fetching configuration, with manual override precedence and collision checks.
* Hide the 404 translation and background pretranslation controls while preserving saved preferences.


= 0.7.6 =
* Simplify settings to the API key, target languages, and five SEO/search options; manage translation, slug, LLM, and usage behavior from fixed policy or API capabilities.
* Support session language storage for none, persistent cookies for dynamic_translation and language_redirection, and redirects for language_redirection.
* Restore a saved language on revisited source pages in place when dynamic translation is enabled; manual selections always navigate to language subdirectories.
* Honor use_dynamic_translation for browser text updates and dynamic content while preserving server rendering and page-view reporting.

= 0.7.5 =
* Move Settings and Slug translations into a top-level MultiLipi admin menu using the original MultiLipi icon.
* Refresh the settings page with grouped controls, connection and language sections, and responsive styling.
* Keep settings notices, language-switcher previews, and admin actions working at the new menu location.

= 0.7.4 =
* Repair the production settings-profile rendering path so packaged plugins pass PHP parsing and activate normally.
* Keep hidden production-profile settings and directory-routing choices intact when administrators save visible settings.

= 0.7.3 =
* Fix plugin deletion when WordPress runs uninstall cleanup without loading the main plugin bootstrap.
* Cache-bust browser translation assets after updates and recover safely from transient or expired translation-session tokens.
* Add an explicit per-row Remove control to the Slug translations editor.

= 0.7.2 =
* Make language-switcher button, dropdown, and hover colors consistently use the configured theme tokens across the catalog.
* Keep automatic floating switchers at their configured position from first render, and correctly mount automatic embedded switchers at their configured target.

= 0.7.1 =
* Build target-language URLs from the canonical source-site URL so a source language other than English cannot produce nested directories such as `/en/en-gb/`.
* Save the expanded language-configuration response, including switcher data, URL filter rules, and class-only block exclusions.
* Exclude matching target routes from translation, generated links, hreflang, sitemap, search, REST, and LLM/Markdown output; choose a 404 or temporary source-URL redirect in Settings.
* Treat each `exlclude_attribute` value as a class name only, and invalidate `llms.txt` cache entries when URL filter rules change.
* Add per-language directory-routing policies: keep native source routing, let MultiLipi claim the directory, or use native-first hybrid fallback after a confirmed native 404 on WordPress 6.1+. Policies can also be selected manually for custom routes WordPress cannot detect; protected WordPress directories remain source-only.
* Add a default-on setting to publish or suppress hybrid URLs in hreflang and the MultiLipi XML sitemap without changing their visitor routing.

= 0.7.0 =
* Add an opt-in administrator-only LLM diagnostics panel showing bounded, redacted upstream API request and response excerpts without exposing the saved API key or visitor data.
* Add a Settings switch to bypass stored `llms.txt` and Markdown responses. Disabled-cache responses use `no-store` headers while retaining generation locks and rate limits.
* Restrict `llms.txt` discovery to enabled language subdirectories and add target-home Markdown aliases: `/hi/.md`, `/hi.md`, and `/hi/index.html.md`.
* Resolve translated-slug and `index.php` Markdown routes back to their source-side path, and remove public no-translation/switcher regions before sending locally rendered HTML to the Markdown service.
* Add opt-in LLM request analytics for anonymous public WordPress responses when the fetched backend configuration enables `is_llms` or `is_schema`.
* Send the backend-compatible bot-family classification, source domain/path, language, response status, latency, and bounded raw User-Agent to the separate unauthenticated telemetry endpoint; no API key, cookie, IP address, query string, page content, or request body is sent.
* Deliver telemetry only after PHP-FPM has completed the visitor response, with a bounded single in-flight request and outage cool-off; hosts without a safe after-response primitive skip analytics.
* Add strict normalization for backend LLM/schema flags, so string values such as `no` and `false` do not accidentally enable the feature.

= 0.6.0 =
* Add opt-in server-side language-subdirectory `llms.txt` and public Markdown routes, including `/{language}/llms.txt`, `/about.md`, `/hi/.md`, `/hi.md`, and `/hi/index.html.md`.
* Use the existing saved MultiLipi API key as the server-side Bearer token for LLM/Markdown generation; no separate LLM key is stored or exposed.
* Add bounded caching, single-flight generation, rate limits, lifecycle regeneration, and privacy exclusions for generated LLM files.

= 0.5.11 =
* Emit portable query-form child sitemap URLs so nginx hosts that intercept unknown XML files cannot return a server-level 404 before WordPress runs.

= 0.5.10 =
* Prevent SEO-plugin URL hooks from printing duplicate raw canonical/Open Graph URLs into translated page heads.
* Make multilingual sitemap child URLs work before rewrite rules are refreshed and add the MultiLipi sitemap index to compatible sitemap indexes, including Rank Math.

= 0.5.9 =
* Add an SEO Pack that safely localizes standard canonical, Open Graph/Twitter URL, and semantic page JSON-LD output alongside common SEO plugins.
* Add manual target-language SEO title, description, Open Graph, and Twitter overrides for public posts, products, custom post types, and terms.
* Add an off-by-default multilingual XML sitemap with hreflang alternates, advertised alongside existing WordPress/SEO-plugin sitemaps.

= 0.5.8 =
* Decode valid percent-encoded UTF-8 text before writing translated document titles, descriptions, and social metadata, so browser tabs display readable target-language text.

= 0.5.7 =
* Add an off-by-default Visitor-driven search index that translates and stores only a public target-language post/product a visitor actually opens, without queueing cron or bulk-pretranslating the site.

= 0.5.6 =
* Add an off-by-default, backend-authorized and rate-limited on-demand source-language search fallback for target-language queries with no local translated-index match.

= 0.5.5 =
* Server-render initial target-language HTML for explicitly enabled logged-in visitors, with private/no-store response headers to protect personalized pages from shared caches.

= 0.5.4 =
* Show WordPress percent-encoded Unicode localized slugs as readable text in the Slug translations editor while retaining their safe internal URL form.

= 0.5.3 =
* Translate mixed search labels such as “Search results: “हुडी”” while keeping the visitor-entered target-language term out of API requests.
* Add opt-in Background pretranslation. It is off by default, so pages and automatic slugs are translated on eligible visitor visits rather than queued for cron.

= 0.5.2 =
* Add a nonce-protected Settings action to permanently delete all MultiLipi data for the current site.
* Delete all plugin-owned settings, caches, queued jobs, slug mappings, and translated-search tables automatically on uninstall, including every site in a multisite network.

= 0.5.1 =
* Keep Gutenberg and other recognized GET search forms inside the active language directory instead of submitting to the source-language home URL.

= 0.5.0 =
* Add conditional language-content shortcodes, including safe migration aliases when no other plugin owns them.
* Add an opt-in, browser-only language redirect for first visits to the source home page; explicit switcher choices are remembered.
* Translate existing Open Graph/Twitter title and description fields server-side, translate visible select/button controls, honor common no-translation markers, and translate only genuinely new dynamic element subtrees after a server-rendered page.

= 0.4.0 =
* Fix translated WooCommerce product slugs and generic public custom-post-type routes by replaying WordPress's viewable CPT query handling after the language directory is removed.
* Add WooCommerce compatibility for product-search actions, Cart/Checkout/My Account URLs and supported endpoints, same-origin Woo AJAX URLs, return redirects, cart-item links, and safely targeted fragment translation.
* Add plugin-neutral canonical/Open Graph URL normalization for standard SEO-plugin head output.

= 0.3.1 =
* Add Settings > Slug translations: a searchable, paginated editor for local post/page/CPT and taxonomy-term translated slugs by target language.

= 0.3.0 =
* Add opt-in local automatic slug translation for published posts, public custom post types, and public terms through queued jobs or a safe first eligible, query-free target-language GET visit, while preserving manual slug overrides and collision protection.
* Add opt-in indexed multilingual WordPress search for translated post titles and content on target-language search pages.

= 0.2.2 =
* Preserve WordPress static front-page routing under a language directory instead of falling back to the configured posts page.

= 0.2.1 =
* Rewrite same-site and root homepage links emitted directly by themes and builders into the active language directory.

= 0.2.0 =
* Render target-language pages with translated HTML before sending the page to visitors.

= 0.1.2 =
* Fix persistence of fetched language configuration after saving or reloading Settings.

= 0.1.1 =
* Show the fetched, key-free backend language configuration directly in Settings.
* Add an automatic public floating language selector and improve shortcode placement guidance.

= 0.1.0 =
* Initial MultiLipi API integration.

== Bundled libraries ==

Flag icons use flag-icons 6.6.6 by Panayiotis Lipiridis (MIT license). The CSS and SVGs are served locally from this plugin. The license is included at assets/vendor/flag-icons/LICENSE.
