=== Asperor Product Translator for CJDropshipping ===
Contributors: radilov
Tags: cj dropshipping, translation, polylang, woocommerce, multilingual
Requires at least: 7.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 2.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatically translates CJDropshipping products into all your Polylang languages using your own AI provider, keeping the shared SKU intact.

== Description ==

Dropshipping stores fed by CJDropshipping receive their products in English. This plugin detects every product CJ creates through the WooCommerce API and automatically creates linked Polylang translations in every language of your store — title, short and long description, and optionally category, tag and attribute names.

The critical part for dropshipping: **the SKU of every product and variation is shared between translations** (through the woo-poly-integration plugin), so CJDropshipping keeps matching order items by SKU no matter which language your customer bought in. Stock, prices, images and variations are shared too.

**Translations run on your own AI provider.** This plugin uses the WordPress 7.0+ AI Client (Settings > Connectors): connect Anthropic, OpenAI or Google with your own API key once, and every translation is generated directly by that provider under your own account. Product texts are never sent to or proxied through Asperor.

**Features**

* Detects products created by CJ through the WooCommerce API (legacy `wc-api/v3` and modern REST), plus the WooCommerce CSV importer.
* Waits a configurable delay so CJ finishes uploading variations and images, then translates in the background (WP-Cron).
* Creates linked Polylang translations sharing SKU, stock, prices, images and variations.
* Optionally translates category, tag and attribute term names, creating linked term translations.
* Bulk-translate your existing catalogue: one button for everything pending, or a bulk action in the products list.
* Activity log with errors and retries.

**Plans**

The free plan translates up to 10 products per site (all your active languages), using your own AI provider — most stores can run this entirely free with a no-card Google Gemini key. Unlimited translation requires a paid license: €45/year, one-time payment, no auto-renewal. Buy at [asperor.com](https://asperor.com/store/).

**Requirements**

* WordPress 7.0 or later, with an AI provider connected under Settings > Connectors
* WooCommerce
* Polylang (free version is enough) with your languages configured
* [Hyyan WooCommerce Polylang Integration](https://github.com/hyyan/woo-poly-integration) (woo-poly-integration) — used to duplicate variations and share SKUs

== External services ==

This plugin uses two separate external connections:

1. **Your own AI provider (Anthropic, OpenAI or Google), via the WordPress 7.0+ AI Client.** Product texts to translate (title, descriptions, category/tag/attribute names) are sent directly from your site to whichever provider you connected under Settings > Connectors, using your own account and API key. Asperor never sees this traffic. This happens every time a product is translated. See your chosen provider's own terms and privacy policy.
2. **The Asperor license API** (`https://asperor.com/store/`), operated by the plugin author, used only to validate a paid license key: your site URL and license key are sent when you activate/deactivate a license and once a week to re-check its validity. No product content is ever sent here. Terms and privacy policy: [asperor.com](https://asperor.com/).

== Installation ==

1. Install and activate WooCommerce, Polylang (with your languages configured) and woo-poly-integration.
2. Go to Settings > Connectors and connect an AI provider (Anthropic, OpenAI or Google) with your own API key.
3. Install this plugin and activate it.
4. (Optional) Go to WooCommerce → AI Translator and activate a license key for unlimited products.
5. Every product CJ pushes to your store gets translated automatically. For the existing catalogue use "Translate all pending".

== Frequently Asked Questions ==

= Will CJDropshipping still recognise my orders? =

Yes. CJ matches order items by SKU, and every translation shares the SKU of the original product and of each variation. Orders placed in any language sync to CJ exactly like the English ones.

= Does it work with WPML? =

No, it is built for Polylang (plus woo-poly-integration). Polylang's free version is enough.

= Do I need to pay for AI usage? =

Google Gemini offers a real free tier (a free API key, no card required) that comfortably covers the plugin's free 10-product plan. Anthropic and OpenAI don't have a free tier, so using them means paying that provider directly for usage — Asperor never bills or sees this.

= What does the free plan include? =

10 products per site, each translated into every language configured in Polylang, using your own connected AI provider. An unlimited license is available at [asperor.com](https://asperor.com/store/).

= Are already-translated products overwritten? =

No. Products that already have a translation in a language are skipped for that language.

= What about the cart, checkout and other shop pages? =

Those are covered by the official WordPress/WooCommerce language packs and Polylang string translations — this plugin focuses on products and their taxonomies.

== Screenshots ==

1. Settings page: AI provider connection status and license activation.
2. Settings page: target languages, automatic translation toggle, initial delay and term translation option.
3. Bulk-translate existing products: pending products count and the "Translate all pending" button.
4. Activity log with translation history (date, product, language, status).

== Changelog ==

= 2.2 =
* Renamed the plugin to "Asperor Product Translator for CJDropshipping" (slug asperor-product-translator-for-cjdropshipping) to avoid leading with a third-party trademark.
* Removed bundled .po/.mo translation files; translations are now handled entirely through translate.wordpress.org.

= 2.1 =
* The "AI provider" section on the settings page now reports whether the connected provider is actually working, based on the outcome of the last real translation on this site — not just whether one is wired up under Settings > Connectors. This surfaces problems like an exhausted free tier or depleted paid credits before they silently block your translations.

= 2.0 =
* Translations now run on the site's own AI provider via the WordPress 7.0+ AI Client (Settings > Connectors), instead of being proxied through Asperor's own API key. No product text is sent to Asperor anymore.
* License activation switched to the unified Asperor store (asperor.com/store), EDD-compatible.
* Free-plan usage (10 products) is now tracked locally on the site instead of server-side.

= 1.2 =
* Hardened the translation process: a fatal error thrown by another plugin hooked into WooCommerce/Polylang (for example a PHP 8 incompatibility in woo-poly-integration) no longer leaves a half-created translated product or stops the background job. The orphaned product is now removed automatically and the translation is retried.

= 1.1 =
* Removed the deprecated load_plugin_textdomain() call (translations now load automatically via WordPress.org).
* Shortened the plugin's short description to fit the 150-character limit.

= 1.0.0 =
* First public release: automatic translation of CJ products, linked Polylang translations with shared SKUs, term translation, bulk actions, activity log, free plan (10 products) and license activation.
