=== Quick Variable Products – Generate Variations for WooCommerce ===
Contributors: erenlabs
Tags: woocommerce, variations, variable-products, attributes, sku
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.1.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create variable products fast: pick attributes, generate every variation in one click, then set price, SKU and stock per row. No CSV needed.

== Description ==

Adding a variable product in WooCommerce is slow. You add the attributes, save, hit **Generate variations**, then expand every single row to type a price, a SKU and a stock quantity. For a product with three colours and four sizes that is twelve forms to open, one at a time.

**Quick Variable Products** collapses the whole job into one admin screen. Choose your global product attributes, type their values, and generate variations for every combination of your attributes in a single click — then fill in price, SKU and stock per row on the same page and save once.

There is no CSV import or export and no spreadsheet round-trip. You never leave WordPress.

= What it does =

* **Generate variations from all attributes at once.** Type `red, blue, green` and `S, M, L` and the plugin creates all combinations at once — nine real WooCommerce variations, ready to sell.
* **Any attributes, any number of axes.** Use the global product attributes you already have (Size, Colour, Material…), or create a new attribute without leaving the screen.
* **Per-variation stock, SKU and price.** Every generated row gets its own fields, so you stop filling in one variation form at a time. Override the price on individual rows when you need to.
* **Built-in SKU generator.** Auto-generate SKUs for every row with one click, or type your own — handy when your codes follow a pattern.
* **One image per variation.** Optionally give each colour (or any attribute value) its own photo as you create the product.
* **Shared stock pool.** Opt in and a single quantity is managed on the parent, so every variation draws from the same stock — WooCommerce-native, no shadow inventory.
* **Fast data entry.** "Set all quantities", bulk SKU generation, and Enter-to-next-row so a barcode scanner can walk the whole list.
* **Handles big products.** Need more than 50 variations? There is no 50-variation limit here — large combination sets are created in one pass, with a safe cap you can filter.
* **Simple products too.** Leave the attributes empty and it saves a simple product with the same fast form.

= Built to be safe with the rest of your site =

Products created here are ordinary WooCommerce products — no custom tables, no lock-in. If you deactivate the plugin, everything you made stays exactly as it is.

While a product and its variations are written, the plugin briefly detaches core post hooks so one broken third-party `save_post` callback cannot abort the loop and leave you with a half-built product. It then re-fires the key hooks once for the finished product, so Yoast, Rank Math, WPML, Polylang and search indexers still see it normally.

It is **admin-only with no frontend changes** — the plugin loads nothing on your storefront, so it cannot slow your shop down or fight your theme. It is **HPOS compatible** and works with the standard WooCommerce product editor, so anything you create can still be edited the usual way. Any shop manager with the WooCommerce permissions you already grant can use it.

= Free vs Pro =

Everything below marked **Free** is in this plugin, with no limits and no locked buttons. **Quick Variable Products Pro** (a separate download, distributed through Freemius) adds a catalog operations workspace for stores that also need to change products they already have.

**Free — the complete create-fast workflow:**

* Create screen: use any attributes, generate every combination, set stock, SKU and price per row
* One image per variation — a single photo for each attribute value (e.g. one for Red, one for Blue, one for Green)
* Built-in SKU generator
* Shared stock pool (one quantity on the parent, shared by every variation)
* Simple products from the same fast screen
* Cost/COGS, tax, inventory, shipping, categories, tags and brand fields
* Admin-only, HPOS compatible, standard WooCommerce products as output

**Pro — adds a catalog operations workspace:**

* **Add variations to products that already exist**
* **Bulk edit variation prices, sale prices, cost, stock, weight and dimensions**
* Extend one attribute across many products at once (with preview + undo)
* Galleries per value — several photos for one value, not just one
* Smart views (on sale, no cost, low margin, low stock, missing SKU)
* Exact dry-run before → after preview
* Persistent, conflict-safe undo of any recent run, with a run-history panel
* Saved filter + operation recipes, and reusable templates / presets
* Bulk edit tax/shipping class, backorders, SKU, title, description, categories, tags, brands, visibility and status
* Target-margin pricing (cost ÷ (1 − margin%) + charm ending)
* Text tools: find & replace, prefix/suffix, case transform and regex
* CSV import / export
* Priority email support

== Installation ==

1. Upload the `quick-variable-products` folder to `/wp-content/plugins/`, or install the zip via Plugins → Add New → Upload.
2. Activate the plugin. WooCommerce must be active.
3. Open **Quick Products → Add Product** in the admin menu.

== Frequently Asked Questions ==

= How do I generate variations for every combination of my attributes? =
Open Quick Products → Add Product, give the product a name and a price, then add one row per attribute (for example Colour and Size) and type the values separated by commas. Press **Generate matrix** and the plugin creates variations from all attributes at once — one row per combination. Fill in stock, SKU and price on the rows and press Save product.

= Can I create more than 50 variations at once? =
Yes. There is no 50-variation limit in this plugin — a large combination set is created in a single pass. A safety cap (1500 by default) protects your server from an accidental runaway request, and developers can raise it with a filter.

= Does it work with my existing attributes? =
Yes. It lists every global product attribute defined under Products → Attributes. You can also create a new attribute without leaving the screen; creating brand-new terms requires the product-term management capability.

= Can I add variations to an existing product? =
That is a Pro feature. The free plugin is focused on creating new products fast. Pro adds an "add variations to existing products" tool, plus a catalog editor that can bulk edit variation prices and stock across many products at once.

= Do I need a CSV import or a spreadsheet? =
No. There is no CSV import or export and no spreadsheet round-trip in the free plugin — you type the attribute values and the variations are generated in place. (Pro adds CSV import/export for stores that want it.)

= Can I give each colour its own image? =
Yes. Turn on the per-variation image option and pick one image per variation value while you create the product. WooCommerce stores one image per variation natively; Pro adds full per-value galleries.

= Are the products it creates normal WooCommerce products? =
Completely. Variations are written through the WooCommerce API into the standard tables, so the WooCommerce product editor, reports, feeds and every other extension treat them like any other product. Deactivating the plugin changes nothing about products you already created.

= Will it slow down my shop? =
No. The plugin is admin-only with no frontend changes — it registers no storefront scripts, styles or queries at all.

= Does it work with SEO, translation and indexing plugins? =
Yes. The key post hooks are re-fired once for the finished product, so Yoast, Rank Math, WPML, Polylang and search indexers process it normally.

= Is it translatable? =
Yes. All strings use the `quick-variable-products` text domain and a POT template ships in `/languages`.

== Screenshots ==

1. Type your attribute values, press Generate matrix, and every combination of your attributes appears as a real variation — ready for price, SKU and stock.
2. Fill in stock, SKU and price per row on one screen, instead of opening one variation form at a time.
3. Give each attribute value its own image while you create the product — one image per variation.
4. Auto-generate SKUs for every row, set all quantities at once, and save the whole product in a single click.
5. Leave the attributes empty and the same fast screen saves a simple product.
6. Free forever for creating products — Pro adds the catalog workspace for products you already have.

== External services ==

This plugin can connect to Freemius (freemius.com) to power the optional Pro upgrade: licence activation, automatic updates for the paid version, and the checkout/upgrade screens. **Nothing is sent unless you opt in.** If you click "Allow & Continue" during the optional opt-in, non-sensitive environment data (site URL, WordPress and PHP versions, active theme/plugins and your admin email) is sent to Freemius to enable licensing and updates; if you skip it, no data is transmitted. Freemius is only contacted for these upgrade/licensing actions.

* Freemius Terms of Use: https://freemius.com/terms/
* Freemius Privacy Policy: https://freemius.com/privacy/

== Changelog ==

= 1.1.3 =
* Admin notices from your theme and other plugins now appear in the standard WordPress place — just below the screen header, not inside the plugin's header banner. They are still shown in full and never hidden.
* Hardening: product, gallery and per-variation image IDs are now validated as real image attachments before they are assigned, so a stray or non-image ID can never be stored as an image.
* Fix: when creating a variable product, a variation row whose typed attribute value cannot be resolved to a term (for example a brand-new value the current user lacks permission to create) is now skipped cleanly instead of being saved as an over-broad "Any" combination that could merge with its siblings; the reported variation count reflects exactly what was created.
* Housekeeping: removed leftover Pro-only styles from the free build for a strictly clean free/Pro separation.

= 1.1.2 =
* Every plugin-authored function, class, constant, option, meta key, hook, AJAX action, menu slug and script handle now uses a distinct, four-plus-character prefix to avoid collisions with other plugins.
* Translation catalogs are no longer bundled — WordPress.org distributes them through translate.wordpress.org. The per-user language switcher now reads the installed language pack for its chosen locale.

= 1.1.1 =
* Security & review hardening: the create-product request payload is now recursively sanitized immediately after it is decoded, so every value — including the variation rows passed to the `erenqvp_variation_saved` hook — is clean before any use.
* Admin notices from WordPress, WooCommerce and other plugins are no longer hidden on the plugin's screens.
* The Cost of Goods extension's `_wc_cog_cost` meta key is now only written or removed while that plugin is active; the plugin's own `_erenqvp_cost` key always carries the value.
* The free and Pro builds can no longer conflict if both are briefly installed during an upgrade (guarded constants, functions and a single-boot check).
* Small output-escaping fixes on the Upgrade page.

= 1.1.0 =
* New "Show me around" guided tour on the Add Product screen — an optional, replayable walkthrough that points out how attributes turn into the full set of variations, the shared-stock option, per-value images and where to set stock and SKU per row. Start it from the card button or the Tips control; it never opens on its own.
* The plugin now speaks 7 more languages (Turkish, Spanish, German, French, Italian, Portuguese-BR and Arabic, which renders right-to-left).
* Added a per-user language switcher in Settings — pick the language for this plugin without changing the rest of wp-admin.
* Added a Help & FAQ screen and a support link (community forum, or priority contact with Pro).

= 1.0.1 =
* Bulk confirmations (apply, undo, save) now use an accessible in-page dialog instead of the browser's native pop-up — clearer, on-brand and keyboard-friendly.
* The before/after preview now dims while it recalculates, so a briefly-stale sample is never mistaken for the current one (applying was already blocked until a fresh preview matched).

= 1.0.0 =
* First release of the productized build: the proven create-fast free engine plus the Pro catalog tools (bulk editor, add-to-existing, recipes, conflict-safe undo) as one plugin with a free/pro split.
* Creating brand-new categories, tags, brands or attribute values now requires the product-term management capability.

For the full pre-1.0 history of the free and pro engines, see changelog.txt.
