=== SEO AI for WooCommerce ===
Contributors: samson84
Author: SmartCategorySEO
Tags: seo, woocommerce, ai, categories, bulk
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Collapse WooCommerce descriptions and generate AI SEO content in bulk for categories and products.

== Description ==

**SEO AI for WooCommerce** (Bulk SEO for Categories & Products) helps WooCommerce store owners solve two key problems:

1. Empty or generic category/product pages with weak SEO value.
2. Manual content work that does not scale across 100+ catalog pages.

The plugin gives you an AI-first workflow in PRO: connect API -> test key -> count -> preview -> run -> rollback.  
You can generate unique SEO descriptions in batches, review quality reasons before saving, and keep frontend UX clean with collapsible text blocks.

### Core idea

- **Free:** solid text collapse + optional default fallback template for empty category descriptions.
- **PRO:** data-driven AI generation for categories and products with quality guard, preview, cost estimate, and batch safety.

= Free Features =

* Automatic text collapse for long category descriptions.
* Optional text collapse for product full description.
* Optional text collapse for product short description.
* Separate line limits for desktop and mobile.
* "Read More / Hide" text customization.
* Button presets and alignment settings.
* Fade gradient support (basic and advanced height/color).
* Button style presets, custom colors, icons, and padding.
* Truncation by lines, characters, or words (HTML-safe).
* Collapse on additional taxonomies and public post types.
* Collapse animation duration and easing.
* Optional fallback template for empty category descriptions with dynamic variables.
* Works with Elementor and AJAX-based themes (including WoodMart-like flows).

= PRO Features =

Upgrade to **SmartCategorySEO PRO** for AI automation and scaling:

* AI generation for:
  * WooCommerce categories
  * product full descriptions
  * product short descriptions (excerpts)
* Data-driven prompts using catalog signals (brands, prices, attributes).
* Quality Guard v2:
  * length checks
  * bad-fragment checks
  * duplicate-risk detection inside batch
  * structured reason/detail statuses
* AI Batch Preview:
  * old/new values
  * char counts
  * status + fallback reason per row
* Cost and safety controls:
  * model-based cost estimate before run
  * batch run limit
  * auto-stop on consecutive errors
* Changed categories mode (update only categories affected by catalog changes).
* One-click rollback for the last bulk run.
* Template fallback when AI result is rejected by quality checks.
* License activation + private update delivery.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin in **Plugins**.
3. Make sure WooCommerce is active.
4. Open **SEO AI for WooCommerce** in the WordPress admin menu (root menu with plugin icon).
5. Configure text collapse settings.
6. (PRO) Configure AI provider/model and connect your API key.
7. (PRO) Run the built-in API key test in settings.
8. (PRO) Count entities -> preview rows -> run batch.

== Quick Start (PRO) ==

1. Connect AI API key under **SEO AI for WooCommerce** in the admin menu.
2. Test key (one-click check inside settings).
3. Count target entities (categories/products/excerpts).
4. Review preview table (old/new, status, fallback reason).
5. Run batch and rollback if needed.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. It is built for WooCommerce category and product contexts.

= Is hidden/collapsed text safe for SEO? =

Yes. The text remains in page HTML and is indexable. Collapse is for UX/readability, not cloaking.

= Does it work with AJAX themes like WoodMart? =

Yes. The plugin includes compatibility logic for dynamic content updates and AJAX/PJAX-like category transitions.

= Can I generate SEO text in bulk with AI? =

Yes, in PRO. Recommended path: connect API -> test key -> count -> preview -> run. Rollback is available for the last batch.

= How much does AI generation cost? =

Cost depends on your model and item count. PRO shows an estimate before launch (based on per-model pricing).

= Can I update only changed categories? =

Yes, in PRO. There is a dedicated mode for categories changed since the last AI generation date.

== Privacy Policy ==

This plugin does not connect to external services in the free version.
Settings are stored locally in your WordPress database. No personal data is sent to third-party servers by the free plugin.

== Screenshots ==

1. AI settings panel (API, model, tone, length, batch limit).
2. AI batch count with estimated run cost.
3. AI preview modal with old/new text, char count, and row status.
4. Batch final summary: processed / success / fallback / errors.
5. Changed categories mode (targeted update).
6. Rollback action for the last batch run.

== Changelog ==

= Next (AI workflow update) =
* AI-first PRO workflow for categories and products.
* Data-driven prompt enrichment (brands, price ranges, typical attributes).
* Quality Guard v2 with structured reason/detail statuses.
* AI Batch Preview enhancements (char length and status meta).
* Cost estimate and safety controls (batch cap, consecutive error stop).
* Changed categories update mode.
* Basic/Pro plan logic on category batch limits.
* Landing/readme messaging updated to AI-first positioning.

= 1.0.4 =
* Fixed PRO purchase links: they now point to the pricing section on smartcategoryseo.online (legacy /buy/ returned 404).

= 1.0.3 =
* Removed remaining direct style tag output; generated CSS now uses wp_add_inline_style().
* Removed direct update_option() migration for transient cache keys; cache transients regenerate automatically.

= 1.0.2 =
* register_setting() now passes an inline array with an explicit sanitize_callback for every option.
* Shortcode admin/AJAX preview output is escaped via wp_kses_post().

= 1.0.1 =
* Renamed code prefix from scs to scatseo (functions, hooks, options, CSS classes) per WordPress.org guidelines.
* Replaced inline style/script output with wp_add_inline_style() and wp_add_inline_script().
* Removed load_plugin_textdomain(); translations load automatically on WordPress 5.8+.
* Database migration for existing scs_* options and meta on upgrade.
* Shortcodes are now [scatseo_toggle] and [scatseo_collapse] (replace [scs_toggle] in content if used).

= 1.0.0 =
* Initial public release.
* Runtime category fallback generation.
* Dynamic category variables.
* Text collapse for category descriptions.
* Optional text collapse for product full and short descriptions.
* Desktop/mobile line controls.
* Button presets and gradient settings.