=== Polyflux Translation Engine ===
Contributors: simpleons
Tags: translation, translator, language switcher, multilingual, url routing
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Content translation and URL routing engine for WordPress with native SEO hreflang, glossary terminology protection, and WordPress AI Client support.

== Description ==

**Polyflux Translation Engine** is an automated translation and multilingual URL routing plugin for WordPress. It connects to the core WordPress 7.0+ AI Client and site-configured AI providers (including Groq Cloud, Google Gemini, DeepSeek, OpenAI, OpenRouter, or local AI engines) to translate posts, pages, and custom post types while maintaining clean URL structures (`example.com/hi/`, `example.com/es/`, `example.com/fr/`).

Polyflux Translation Engine integrates with standard WordPress post structures and lightweight URL rewrites, preserving permalinks, taxonomy associations, and theme templates.

---

### Key Features

* **Multi-Language URL Routing**: Clean language URL prefixes such as `example.com/hi/post-slug/` and `example.com/es/post-slug/`.
* **WordPress AI Client Integration**: Compatible with the core WordPress 7.0+ AI Client and site-configured API providers.
* **Glossary & Brand Terminology Locker**: Define "Never Translate" rules and custom terminology translations to keep doctor names, brand identities, and technical terms intact.
* **WooCommerce Store Translation**: Translate products and automatically synchronize SKU, regular prices, sale prices, stock status, and product gallery images across languages.
* **Multilingual SEO & Hreflang**: Generates `<link rel="alternate" hreflang="xx" href="..." />` and `x-default` tags in the document `<head>` with Rank Math and Yoast SEO compatibility.
* **Gutenberg Block & HTML Chunking**: Divides long posts along Gutenberg block boundaries and HTML structural tags, keeping block comments (`<!-- wp:... -->`), shortcodes, and markup structure intact.
* **Customizable Language Switcher**: Includes a floating language switcher pill widget (with configurable position and offsets), dropdown selector, and shortcode `[polyflux_switcher]`.
* **Batch Translation Queue**: Queue and process existing posts and pages step-by-step with live progress tracking and automatic rate-limit recovery.

---

### Third-Party Services & External APIs

This plugin can connect to external AI services to process content translations. All third-party connections operate on an administrator-configured model; no external API calls are made until an administrator configures settings in the dashboard and initiates translation.

* **Groq Cloud API**: Used for AI text translation via open models.
  * Data sent: Post title, excerpt, content chunks, slug, and SEO metadata.
  * [Groq Terms of Use](https://groq.com/terms-of-use/) | [Groq Privacy Policy](https://groq.com/privacy-policy/)
* **Google Gemini API / Google AI Studio**: Used for multilingual text translation via Gemini models.
  * Data sent: Post title, excerpt, content chunks, slug, and SEO metadata.
  * [Google AI Terms of Service](https://ai.google.dev/terms) | [Google Privacy Policy](https://policies.google.com/privacy)
* **OpenAI API**: Used for translation via OpenAI models.
  * Data sent: Post title, excerpt, content chunks, slug, and SEO metadata.
  * [OpenAI Terms of Use](https://openai.com/policies/terms-of-use/) | [OpenAI Privacy Policy](https://openai.com/policies/privacy-policy/)
* **DeepSeek API**: Used for translation via DeepSeek models.
  * Data sent: Post title, excerpt, content chunks, slug, and SEO metadata.
  * [DeepSeek Terms of Use](https://www.deepseek.com) | [DeepSeek Platform](https://platform.deepseek.com)
* **OpenRouter API**: Used for multi-model translation routing.
  * Data sent: Post title, excerpt, content chunks, slug, and SEO metadata.
  * [OpenRouter Terms of Service](https://openrouter.ai/terms) | [OpenRouter Privacy Policy](https://openrouter.ai/privacy)
* **Ollama / Local AI**: Self-hosted local inference. No data is transmitted externally.

---

### Supported Languages

Polyflux Translation Engine supports 23+ languages:
* English (`en`)
* Hindi (`hi` - हिन्दी)
* Spanish (`es` - Español)
* French (`fr` - Français)
* German (`de` - Deutsch)
* Italian (`it` - Italiano)
* Portuguese (`pt` - Português)
* Russian (`ru` - Русский)
* Chinese Simplified (`zh` - 中文)
* Japanese (`ja` - 日本語)
* Arabic (`ar` - العربية)
* Bengali (`bn` - বাংলা)
* Marathi (`mr` - मराठी)
* Telugu (`te` - తెలుగు)
* Tamil (`ta` - தமிழ்)
* Gujarati (`gu` - ગુજરાતી)
* Urdu (`ur` - اردو)
* Punjabi (`pa` - ਪੰਜਾਬੀ)
* Korean (`ko` - 한국어)
* Dutch (`nl` - Nederlands)
* Turkish (`tr` - Türkçe)
* Polish (`pl` - Polski)
* Vietnamese (`vi` - Tiếng Việt)

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/polyflux-translation-engine/` directory, or install the `.zip` archive via **Plugins &rarr; Add New &rarr; Upload Plugin**.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **Polyflux** in the WordPress admin menu.
4. Select your preferred AI Provider or WordPress Core AI Client and enter your API credentials if applicable.
5. Choose your default and active target languages (e.g., Hindi `/hi/`, Spanish `/es/`).
6. Click **Test API Connection** to verify your setup, then click **Save All Settings**.
7. *(Optional)* Use the **Bulk Translate** tab to translate existing posts and pages.

== Frequently Asked Questions ==

= How do I configure an AI Provider? =
Navigate to **Polyflux &rarr; AI API Settings**. You can select the core WordPress AI Client connector or choose a provider (such as Groq Cloud, Google Gemini, OpenAI, DeepSeek, OpenRouter, or a local Ollama instance) and provide the endpoint and API credentials.

= What permalink structure is required? =
Polyflux Translation Engine requires Pretty Permalinks (such as **Post name**: `/%postname%/`) so that language prefix routes like `/hi/` and `/es/` can be resolved properly.

= How does the Glossary & Brand Locker work? =
Under **Polyflux &rarr; Glossary & Brand Locker**, administrators can specify keywords, doctor names, brand terms, and medical vocabulary that must never be altered during translation.

= Is WooCommerce supported? =
Yes. When WooCommerce is active, the plugin synchronizes product attributes, categories, SKU, stock status, pricing, and gallery images across translated products.

= How do I display the language switcher? =
You can enable the floating switcher pill widget in settings, or place the shortcode `[polyflux_switcher]` into any post, widget, or template.

== Changelog ==

= 1.2.1 =
* Enhancement: Added Pro plan pricing guidance and direct upgrade navigation in licensing tab.
* Integration: Bundled official Freemius WordPress SDK for automated license activation and update delivery.
* Usability: Enhanced license key entry validation and responsive card layout.

= 1.2.0 =
* Architecture: Integrated WordPress 7.0+ AI Client and site-configured provider management.
* Rebrand: Complete rebrand to Polyflux Translation Engine with compliant prefixing and asset management.
* Security: Comprehensive output escaping audit across template tags and content filters.
* New: Glossary & Brand Terminology Locker for locking brand terms and clinical keywords.
* New: WooCommerce full product attribute, stock, and pricing synchronization.
* New: Scheduled WP-Cron background worker.
* Enhanced: Persistent language routing across menus, taxonomy terms, and canonical redirects.

= 1.1.0 =
* Functional page protection for checkout and booking pages.
* Virtual application route support.
* Enhanced floating switcher positioning controls.

= 1.0.0 =
* Initial release with multi-provider translation, Gutenberg block chunking, and SEO hreflang tags.
