=== CJDropshipping Import Sanitizer ===
Contributors: radilov
Tags: cjdropshipping, woocommerce, dropshipping, import, cleanup
Requires at least: 7.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Cleans up WooCommerce products imported from CJDropshipping at import time, before any translation plugin copies the mess into every language.

== Description ==

CJDropshipping's own import pipeline (legacy API, REST, or CSV) occasionally leaves supplier-side junk in the product it creates:

* Product photos hotlinked straight to the supplier's CDN (`cf.cjdropshipping.com` and similar) instead of being uploaded to your own media library — visible to any customer or reviewer who opens the product page.
* Internal sourcing fields ("Item Code", "Product Code", "Available Ship to", "Estimated shipping time: 2 days"…) left in the public description.
* `Brand: Unbranded` printed as literal text.
* Occasionally, a courier-restriction note ("WalMart Banned", "Swiship-Ship Prohibited"…) leaking straight into the product **title**.

This plugin hooks the same product-creation events CJDropshipping (and any importer) fires, and cleans all of the above **synchronously, in the same request that creates the product** — so by the time any delayed translation job runs, the source content is already clean.

If the cleanup accidentally empties a description that was nothing but hotlinked images, an AI rewrite (using your own AI provider, connected under Settings > Connectors — nothing is proxied through Asperor) drafts a short replacement from verified WooCommerce product data only (title, category, SKU, weight, dimensions, attributes), and applies it automatically.

**Works alongside AI Product Translator for CJDropshipping:** if that plugin is active, this plugin also holds its translation job back for a product whose AI rewrite is still pending, so an empty description never gets copied into every language before the rescue finishes.

Titles are **never** auto-rewritten — a possible supplier-text leak is flagged (in the products list and on the edit screen) for a human to review, not silently changed.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/cj-import-sanitizer` or install the zip via Plugins > Add New > Upload.
2. Activate. Requires WooCommerce.
3. Configure the hotlinked-domain list, junk labels and title-leak keywords under WooCommerce > CJ Import Sanitizer (sensible defaults are pre-filled).

== Changelog ==

= 1.0.0 =
* Initial release.
