=== RapidCatalog for WooCommerce ===
Contributors: dragonit09
Donate link: https://nghiapham.com
Tags: woocommerce, product generator, unsplash, bulk products, automation
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Automatically generate WooCommerce products with dynamic categories and high-quality Unsplash images — in bulk, in the background.

== Description ==

**RapidCatalog for WooCommerce** lets you spin up realistic WooCommerce products in seconds. Perfect for demos, staging environments, theme development, and store prototyping.

Simply enter your Unsplash API key, choose your categories, set a price range, and hit **Generate**. The plugin handles everything else — product names, descriptions, categories, featured images, and SKUs — all created automatically.

### ✨ Key Features

* **One-click bulk generation** — create up to 500 products at a time.
* **Unsplash integration** — every product gets a beautiful, high-quality featured image fetched from the Unsplash library.
* **Dynamic categories** — define comma-separated categories; the plugin auto-creates them in WooCommerce if they don't exist.
* **Randomised product content** — natural-sounding names, structured HTML descriptions with feature bullet points, and realistic pricing.
* **Background processing** — products are created in batches via AJAX so you never hit a timeout, and a live progress bar keeps you informed.
* **Cancellable** — stop a running generation at any time.
* **WP-CLI support** — generate products from the command line with `wp rapidcatalog-generate`.
* **HPOS compatible** — fully compatible with WooCommerce High-Performance Order Storage and Cart/Checkout Blocks.
* **Clean uninstall** — all plugin data is removed when you delete the plugin.
* **Built-in logging** — detailed logs written to `wp-content/uploads/rapidcatalog-logs/` for easy debugging.

### 🖥️ Admin Interface

A clean, modern settings page lives under **WooCommerce → Product Generator** and includes:

* Unsplash API key configuration with step-by-step setup instructions.
* Category, quantity, price range, and publish status controls.
* A real-time progress bar with cancel support.

### 🔧 WP-CLI Commands

Generate products directly from the terminal:

`wp rapidcatalog-generate`
`wp rapidcatalog-generate --count=20`
`wp rapidcatalog-generate --count=5 --category="Living Room" --status=draft`

== External services ==

This plugin relies on the **Unsplash API** to provide high-quality, royalty-free product images. 

* **Service**: Unsplash (provided by Unsplash Inc.)
* **Usage**: Fetching and downloading featured images for generated products based on your chosen categories.
* **Data Sent**: Search queries (e.g., category names like "Living Room") are sent to Unsplash to find relevant photos. The plugin also triggers a "download" tracking endpoint per Unsplash API guidelines to credit photographers. No user-identifiable data is sent.
* **Links**:
    * [Unsplash Terms of Service](https://unsplash.com/terms)
    * [Unsplash Privacy Policy](https://unsplash.com/privacy)
    * [Unsplash API Guidelines](https://help.unsplash.com/en/articles/2511245-unsplash-api-guidelines)

An Unsplash Application Access Key is required for the plugin to fetch images.

== Installation ==

1. Upload the `rapidcatalog-for-woocommerce` folder to the `/wp-content/plugins/` directory, or install directly through the WordPress plugin screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Make sure **WooCommerce** is installed and active — the plugin will not activate without it.
4. Go to **WooCommerce → Product Generator** to configure your settings.
5. Obtain a free Unsplash API key at [unsplash.com/oauth/applications](https://unsplash.com/oauth/applications) and paste the **Access Key** into the settings.
6. Adjust categories, product count, price range, and status to your liking.
7. Click **Save Settings**, then **Generate Products**.

== Frequently Asked Questions ==

= Does this plugin require WooCommerce? =

Yes. WooCommerce must be installed and active. The plugin will display an admin notice and refuse to activate if WooCommerce is missing.

= Where do I get an Unsplash API key? =

1. Create a free account at [unsplash.com](https://unsplash.com).
2. Go to [unsplash.com/oauth/applications](https://unsplash.com/oauth/applications).
3. Click **New Application** and accept the API guidelines.
4. Copy the **Access Key** from your application page.

Demo (free) apps are limited to 50 requests per hour. Apply for Production status to increase the limit.

= What happens if the Unsplash API key is missing or invalid? =

Products will still be created but without a featured image. A warning is logged for each product that could not receive an image.

= Can I cancel a generation in progress? =

Yes. Click the **Cancel** button that appears during generation to stop immediately. Products already created will remain.

= What content is generated for each product? =

Each product receives:

* A randomised name (adjective + category + noun).
* A structured HTML description with an intro paragraph, feature bullet points, and a closing paragraph.
* A short description.
* A random price within your configured range.
* A unique SKU prefixed with `rapidcatalog-`.
* A featured image from Unsplash.
* Assignment to one of your configured categories.

= Is the plugin compatible with WooCommerce HPOS? =

Yes. The plugin declares full compatibility with WooCommerce High-Performance Order Storage (Custom Order Tables) and Cart/Checkout Blocks.

= Does the plugin clean up after itself? =

On **deactivation**, the generation queue and progress state are cleared. On **deletion** (uninstall), all plugin options (`rapidcatalog_settings`, `rapidcatalog_queue`, `rapidcatalog_progress`) and scheduled events are removed. Generated products and their images are **not** deleted — they are standard WooCommerce products and can be managed normally.

= Can I use WP-CLI to generate products? =

Yes. If WP-CLI is available, you can run:

`wp rapidcatalog-generate --count=10 --category="Workspace" --status=publish`

Run `wp help rapidcatalog-generate` for all available options.

== Screenshots ==

1. The main settings page under WooCommerce → Product Generator.
2. Real-time progress bar during product generation.
3. Example products generated with Unsplash images.

== Changelog ==

= 1.0.0 =
* Initial release.
* One-click bulk product generation with configurable categories, pricing, and status.
* Unsplash API integration with search, random photo, and download-tracking endpoints.
* AJAX-driven background processing with real-time progress bar.
* WP-CLI command: `wp rapidcatalog-generate`.
* WooCommerce HPOS and Cart/Checkout Blocks compatibility.
* Built-in file logger with daily rotation.
* Clean uninstall handler removes all plugin data.

== Upgrade Notice ==

= 1.0.0 =
Initial release of RapidCatalog for WooCommerce.
