=== WebGears AI Product Descriptions for WooCommerce ===
Contributors: webgears
Tags: woocommerce, ai, product descriptions, bulk content, seo
Requires at least: 6.9
Tested up to: 7.1
Stable tag: 3.4.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate SEO-optimized WooCommerce product descriptions using AI. Supports OpenAI and Google Gemini — including a free Gemini API tier.

== Description ==

Generate hundreds of WooCommerce product and category descriptions in minutes — directly inside your WordPress dashboard.

No copywriting. No repetitive work. No switching between tools.

Perfect for stores with large catalogs, dropshipping businesses, and anyone who wants fast, SEO-ready product content.

= ⚡ Why this plugin? =

**❇️❇️❇️ Free to start — Google Gemini supported ❇️❇️❇️**
Now supports both OpenAI (ChatGPT) and Google Gemini. Gemini offers a free API tier — no credit card required to get started.

**🚀 5× faster bulk generation — free and Pro!**
A brand new parallel generation engine pre-fetches up to 5 descriptions simultaneously in the background. In free (preview) mode you still approve each one individually — but the next item is ready instantly, with zero wait between approvals. In Pro (auto-approve) mode the entire batch completes up to 5× faster. Even more speed improvements coming soon!

**⚡ Bulk generation in seconds**
Select multiple products or categories and generate descriptions in one click — no manual writing needed.

**🧠 Smart AI output**
Uses your product data, categories, and custom prompts to create structured, relevant descriptions.

**🔍 SEO-ready content**
Clean HTML output with headings, lists, and keyword-focused structure — ready to publish.

**🔄 Native WooCommerce integration**
Works directly inside WooCommerce bulk actions — no external tools or dashboards.

**🤖 Automation with Pro**
Generate and publish descriptions automatically without manual review.

**💸 Pay only for what you use**
Connect your own API key — no hidden fees, no artificial limits.

= 🎯 Who is this for? =

* WooCommerce stores with large product catalogs
* Dropshipping businesses adding products daily
* Store owners who want faster SEO content
* Agencies managing multiple WooCommerce sites

= ⚙️ How it works =

1. Choose your AI provider: OpenAI or Google Gemini (free tier available)
2. Enter your API key
3. Customize prompts (optional)
4. Select products or categories
5. Click "Generate AI Descriptions" — done

= 🔥 Pro Features =

With the [WebGears AI Product Descriptions Pro add-on](https://webgears.net/en/ai-bulk-product-and-description-tool/), you can fully automate your workflow:

* Auto-generate and save descriptions without preview
* Include existing content for better AI context
* Append new content instead of replacing
* AI-generated image keywords
* Hybrid image mode (product images + stock fallback)
* SEO templates for ALT / Title / Caption
* Bulk restore original content
* AI preview directly in product list

= 🧩 Flexible Prompt System =

Customize how the AI writes using dynamic placeholders:

* `{title}` – Product or category name
* `{price}` – Product price
* `{sku}` – Product SKU
* `{categories}` – Product categories
* `{attributes}` – Product attributes

== External Services ==

This plugin connects to third-party AI and image APIs. Connections are made only when the user explicitly triggers content generation.

= AI Providers =

**OpenAI** — [Terms](https://openai.com/policies/terms-of-use) · [Privacy](https://openai.com/policies/privacy-policy)
**Google Gemini** — [Terms](https://ai.google.dev/gemini-api/terms) · [Privacy](https://policies.google.com/privacy)

Data sent: product title, price, SKU, categories, attributes, and prompt text.

= Image Sources (optional) =

**Unsplash** — [Terms](https://unsplash.com/terms) · [Privacy](https://unsplash.com/privacy)
**Pexels** — [Terms](https://www.pexels.com/terms-of-service/) · [Privacy](https://www.pexels.com/privacy/)
**Freepik** — [Terms](https://www.freepik.com/legal/terms-of-use) · [Privacy](https://www.freepik.com/legal/privacy)

Data sent: image search keywords derived from product/category titles. Used only when image integration is enabled.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`
2. Activate through the 'Plugins' menu
3. Go to WooCommerce > AI Descriptions
4. Choose your AI provider and enter your API key
5. Start generating descriptions

== Frequently Asked Questions ==

= Do I need a paid API key? =

Not necessarily. Google Gemini offers a free API tier — get your key at [aistudio.google.com](https://aistudio.google.com). OpenAI is also supported and charges based on usage.

= How much does it cost to generate descriptions? =

With Gemini's free tier — nothing. With OpenAI, costs depend on the model; typically $1–5 per 100 descriptions.

= Will it work with my language? =

Yes. Write your prompts in any language and the AI will respond in that language.

= What happens to my original descriptions? =

Original content is automatically backed up before generation and can be restored anytime.

= Can I use my own product images? =

Yes. Choose "Product/Category Gallery" as the image source to use existing images. Hybrid mode combines gallery images with stock photos (Pro).

= Is it compatible with page builders? =

Yes. Generated content is standard HTML, compatible with Elementor, Divi, and all themes.

== Screenshots ==

1. Settings page — Overview tab with feature grid
2. AI Settings — provider selection, API key, and prompt configuration
3. Images tab — source strategy and display options
4. Bulk generation modal with progress tracking

== Changelog ==

= 3.4.0 =
* Improvement: AI Settings now explain model capabilities, recommended output budgets, reasoning-token usage, and variable Gemini free-tier availability.
* Compatibility: Updated the Gemini model catalog and safely replaces retired saved models with a supported fallback during generation.
* Fix: API failures no longer make the Preview disappear; provider errors remain visible so users can correct their settings.
* Cleanup: Removed the obsolete v3.3.1 migration notice while preserving actionable dependency, license, and API warnings.

= 3.3.11 =
* Improvement: The AI column in Products and Product Categories can now be sorted to group generated descriptions or missing descriptions first.

= 3.3.10 =
* Fix: AI status now requires a successfully saved, non-empty description instead of only a backup record.
* Fix: Short and long product descriptions now receive independent AI status markers.
* Fix: Existing false AI status markers are safely reconciled by comparing live content to saved originals.

= 3.3.9 =
* Fix: Also restores AI status indicators from the backup table used by the intermediate `aipd_` plugin releases.

= 3.3.8 =
* Fix: Restored the AI status indicators for product and category descriptions generated by earlier plugin versions.
* Compatibility: Migrates legacy description backups to the current data store without modifying the live product or category text.
* Improvement: Saves a persistent generated-content marker for new descriptions, so the AI column remains accurate even when old backups are cleaned up.

= 3.3.7 =
* Compatibility: Declared compatibility with WordPress 7.1 and raised the supported WordPress baseline to 6.9.
* Fix: Updated the bulk-actions JavaScript package used by the WordPress admin.

= 3.3.5 =
* Improvement: All admin JavaScript files are now minified (terser) — faster page load in WP admin.
* Original source .js files remain in the package for WordPress.org compliance.

= 3.3.4 =
* Improvement: Parallel pre-fetch buffer for bulk generation — up to 5 items generated simultaneously.
* Free version: previews still shown one-by-one for approval; next items pre-fetched in background so wait time between approvals is near zero.
* Pro version (auto-approve): up to 5× faster bulk generation.
* Added ⏳ indicator when UI is waiting for the next pre-fetched item.

= 3.3.3 =
* Fix: Gemini responses in Markdown format are now automatically converted to HTML (headings, bold, lists, paragraphs).
* Improvement: Gemini model list updated — removed non-existent Gemini 3.x entries, added gemini-2.0-flash-lite and gemini-1.5-flash-8b.
* Improvement: Models split into "Free tier available" and "Paid API only" groups in the dropdown.
* Improvement: Replaced yellow rate-limit warning box with a simple description link to Google's pricing page.
* Improvement: Green Gemini banner updated to mention that some advanced models require a paid plan.

= 3.3.2 =
* Fix: Admin notice for v3.3.0 bug now shows on all versions until dismissed (not only 3.3.1).
* Improvement: Plugin zip now includes all required core files for correct WordPress.org distribution.

= 3.3.1 =
* Fix: Plugin no longer causes fatal error / white screen if a file is missing after install. Shows admin notice with reinstall link instead.
* Fix: Defensive file loading in class-loader.php with file_exists() checks for all dependencies.

= 3.3.0 =
* Architecture: Bulk AI fix.
* Free plugin: Removed unnecessary modal views, css, and  JavaScript.
* Pro add-on v2.3.0 required for Pro version.

= 3.2.1 =
* Gemini: Fixed temperature encoding on servers with non-English locale (e.g. Bulgarian) where PHP could produce "0,7" instead of "0.7" in the JSON request body, causing API errors. Now uses locale-safe number_format with explicit "." separator.
* Gemini: Added automatic retry (up to 2 times) when the API returns 503 "high demand" error, with 3s/6s backoff.
* Gemini: Added 3 new models — gemini-3.5-flash (ultra-fast, low cost), gemini-3.1-pro-preview (deep reasoning), gemini-3.1-flash-lite (ultra-budget). Models now grouped by generation in the dropdown.

= 3.2.0 =
* Added Google Gemini support: choose between OpenAI (ChatGPT) and Google Gemini as your AI provider. New "AI Provider" dropdown at the top of the AI Settings tab. Both providers use the same prompt templates.
* New Gemini models available: gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash (default), gemini-1.5-pro, gemini-1.5-flash.
* AI keyword translation (title/auto modes) now uses whichever provider is selected.
* GPT Settings tab renamed to AI Settings.

= 3.1.1 =
* Settings UI: Optimization.
* Images tab: Added "Image Selection Mode" setting (Random / Sequential).

= 3.1.0 =
* Stripped trailing AI commentary/markdown fences from generated content (clean_ai_response)
* Images tab: Custom Keywords row now visible.
* GPT Settings: Added o3, o3-mini, o1, o1-mini to the Reasoning Models optgroup
* Updated Tested up to: 7.0

= 2.0.0 =
* Complete rewrite with bulk generation, multi-source images, and tabbed settings

== Upgrade Notice ==

= 3.2.1 =
Google Gemini is now supported — including a free API tier. No OpenAI account needed to get started.
