=== SEO AI for WooCommerce ===
Contributors: samson84
Author: SmartCategorySEO
Tags: woocommerce, seo, category description, product description, fill empty categories
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.13
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce category & product descriptions: fill empty category pages in 1 minute (no API). Collapse long text. PRO: AI bulk descriptions & SEO.

== Description ==

[youtube https://www.youtube.com/watch?v=lxlkvzeG48Y]

**SEO AI for WooCommerce** helps store owners fix two common catalog problems:

1. **Empty category pages** that look unfinished and weak for SEO.
2. **Long descriptions** that overwhelm shoppers on category and product pages.

### Free: Fill Empty Categories

No API key required. One shared category template with variables (`{category_name}`, prices, and more).

1. Open **Generate SEO** in the admin menu.
2. Write or paste a category template, then **Count** and **Preview**.
3. **Approve** rows and **Apply** — Free writes that one template into WooCommerce category descriptions (variables make each category unique).
4. Optional: keep a runtime template for any categories that stay empty.

Includes: variable library with click-to-insert, Display Studio (collapse long text), and clear PRO upsell for AI workflows.

### PRO: Bulk SEO with AI

Upgrade for **unique AI-generated text** per category and product, SERP packages, queue, cost estimate, and one-click rollback. Same plugin — PRO add-on sold separately.

= Free features =

* **Generate SEO (template)** — one category template, preview, approve, and write to the database.
* Runtime template fallback for empty `product_cat` pages (optional).
* Variable library + quick phrases for store-ready wording.
* Live preview with real category data and collapse mockup.
* Variable library: `{category_name}`, `{products_count}`, `{min_price}`, `{max_price}`, `{shop_name}`, and more.
* Optional setup wizard + victory flow after first save.
* Text collapse for category descriptions (desktop + mobile line limits).
* Optional collapse for product full and short descriptions.
* Button presets, alignment, fade gradient, exclusions.
* Shortcodes `[scatseo_toggle]` / `[scatseo_collapse]`.
* Compatible with AJAX/PJAX themes (e.g. WoodMart-style category tabs).

= PRO features (add-on) =

* AI generation for categories, product descriptions, and excerpts.
* SERP packages (title, meta, focus keyphrase) with Yoast / Rank Math adapters.
* Batch preview, Quality Guard, cost estimate, rollback.
* Per-category templates, `{if}` conditionals, bulk write to database.
* Private updates via license server.

**Privacy (Free):** settings stay in your WordPress database. The free plugin does not call external APIs.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate in **Plugins** (WooCommerce must be active).
3. Open **SEO AI for WooCommerce** in the admin menu.
4. Go to **Generate SEO**, set a category template, then **Count** → **Preview** → **Approve** → **Apply**.
5. Open a category on the storefront to verify the description.

== Quick Start (Free, ~60 seconds) ==

1. Open **Generate SEO**.
2. Paste a category template with variables (or keep the saved one).
3. **Count items**, then **Preview and review template**.
4. **Approve all** → **Apply approved changes**.
5. Confirm text on a live category page.

Pass criteria: visible category text on the storefront for an empty category, without editing each category in WooCommerce.

== Quick Start (PRO) ==

1. Connect AI API key → test key.
2. Count empty entities → AI preview → run batch.
3. Rollback last batch if needed.

== Frequently Asked Questions ==

= Why are my category pages empty? =

WooCommerce does not auto-fill category descriptions. This plugin shows helpful runtime text on **empty** categories using one template and dynamic variables — no per-category editing in Free.

= Does Free write to my category descriptions in the database? =

No. Free uses a **runtime template** (your WooCommerce category description field stays empty). PRO can bulk-write unique text to the database.

= Is collapsed text safe for SEO? =

Yes. Text remains in the HTML and is indexable. Collapse is for readability, not cloaking.

= Does it work with AJAX themes? =

Yes. Includes compatibility for dynamic content and category tab switches without full page reload.

= Can I use AI in the free plugin? =

AI bulk generation is **PRO only**. Free focuses on fill-empty templates and text collapse.

= How do I add descriptions to empty WooCommerce categories? =

Open **Fill Empty Categories** in the admin menu: pick a template style (or write your own), preview with real catalog data (name, stock count, prices), and save. One template covers every empty `product_cat` page on the storefront — no API key and no editing each category in WooCommerce. For unique AI-written text saved to the database, use the PRO add-on.

= Can I bulk generate product and category descriptions with AI? =

**PRO only** for unique AI text. Connect your AI provider API key, count empty categories or products, run AI preview, then apply in batch with cost estimate and one-click rollback. Free can still apply **one shared category template** (with variables) to WooCommerce descriptions via Preview → Approve → Apply. SERP fields (title, meta description, focus keyphrase) sync to Yoast SEO and Rank Math via PRO.

== Screenshots ==

1. Overview — coverage metrics and next action for empty categories.
2. Generate SEO — Free category template editor with variables.
3. Review Center — preview generated category text before apply.
4. Variable library — click-to-insert placeholders and current values.
5. Template apply flow — approve and write Free template to the catalog.
6. Display Studio — collapse lines, button preset, and storefront preview.

== Changelog ==

= 1.0.13 =
* Fix: duplicate category descriptions on archives (WooCommerce taxonomy printer + plugin collapse block).
* Category archives: plugin owns `woocommerce_archive_description` so text still appears when the theme does not print it; collapse JS no longer double-wraps.

= 1.0.12 =
* Free: category template Preview → Approve → Apply now writes descriptions to WooCommerce (one shared template with variables).
* Free: PRO upsell messaging for unique AI category/product copy, SERP, queue, and rollback.
* Settings: AI content language/tone/length persist correctly on Free saves.
* Admin SPA: sidebar collapse chevron centering fix.
* WordPress.org: plugin directory screenshots 1–6.

= 1.0.11 =
* Admin SPA: Free Generate SEO supports category template count/preview (read-only draft) without a full PRO lock screen.
* Template editor: click-to-insert variable library (Essential / Also useful / More) plus quick phrases.
* Display Studio polish and Russian/English admin UI language consistency for SPA strings.

= 1.0.10 =
* Fill Empty Categories: redesigned first-time setup wizard to match plugin admin UI (rounded buttons, spacing, progress bar, step hints).
* Admin: wizard navigation and restart link use the same design tokens as the rest of the settings page.

= 1.0.9 =
* WordPress.org listing: short description, tags, and FAQ tuned for category/product description and fill-empty search queries (readme only; no code changes).

= 1.0.8 =
* Fill Empty Categories: syntax highlighting for `{variables}`, active variable chips, and usage counter.
* Admin: no page scroll when inserting variables or marketplace styles; client-side template validation before save.
* Admin: rendered length hints, marketplace “Show full” preview, Ctrl+S save on the templates tab.
* i18n: Russian strings for new Fill Empty admin UI.

= 1.0.7 =
* Hotfix: ensure all template engine include files are packaged in the plugin zip (fixes fatal error on activation for some 1.0.6 downloads).
* No functional changes beyond 1.0.6 when all files are present.

= 1.0.6 =
* Free: **Fill Empty Categories** tab — wizard, template marketplace (9 styles), live AJAX preview, variable library, quick phrases, victory flow, **See it on your store**.
* Free: tiered template variables registry + expanded runtime placeholders (`{shop_name}`, `{currency}`, `{category_url}`, etc.).
* Admin: dashboard and copy aligned to “fill empty in about a minute” (Free) vs AI workspace (PRO).
* Docs: 60-second benchmark + MVP QA checklist (`docs/fill-empty-categories-mvp-checklist.md`).

= 1.0.5 =
* Admin: fixed settings save (color pickers sync before submit, no PHP warnings in inline scripts).
* Admin: unified button style presets (Link, Outline, Filled, Pill).
* Admin: live preview reads wpColorPicker values; preset cards update colors and preview together.
* Frontend: PRO/custom button colors apply via dynamic CSS and toggle.js with theme-safe specificity.
* Options: scatseo_btn_style is the source of truth; legacy scatseo_btn_preset stays in sync on save.

= 1.0.4 =
* Fixed PRO purchase links: pricing section on smartcategoryseo.online.

= 1.0.3 =
* Removed direct style tag output; CSS via wp_add_inline_style().
* Cache transients regenerate automatically (no direct update_option migration).

= 1.0.2 =
* register_setting() sanitize_callback for every option.
* Shortcode preview escaped via wp_kses_post().

= 1.0.1 =
* Renamed prefix scs → scatseo; migration for existing options/meta.
* Shortcodes [scatseo_toggle] and [scatseo_collapse].

= 1.0.0 =
* Initial public release.
