=== Automatic Product Categories for WooCommerce ===
Contributors: berrypress
Tags: woocommerce, manage categories, tags, automation, product management
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 7.0
Stable tag: 1.2.7
License: GNU General Public License version 3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Automatically assign WooCommerce product categories and tags using smart, rule-based automation. Save time managing products at scale.

== Description ==

**Save hours of manual work by automating how your WooCommerce products are categorized.**

Automatic Product Categories helps you keep your store structured, searchable, and up-to-date - whether you're managing 30 or 3,000 products.

Define flexible rules to assign product categories and tags based on product data, events, or schedules - no coding required.
 
Build rules with many condition types (including stock status, whether stock is managed, attribute values, attribute term names, and category lists with is/is not matching), reorder conditions as needed, and use inline help where selections work as multiselects.

**Example use cases**

* **After imports or migrations** - bring large catalogs in line by assigning categories and tags from product data as you standardize.
* **Parent and child categories** - e.g. when a product is in a child category, automatically add a parent category too.
* **Stock or sales-based merchandising** - organize or highlight products using stock status, stock quantity, total sales, or sale state.
* **"New" or "recently updated" collections** - use days since created or modified to keep time-based categories or tags accurate.
* **Seasonal or promotional groups** - move products in or out of promo categories using titles, tags, attributes, or scheduled runs.

[More context and ideas on the BerryPress blog](https://berrypress.com/blog/why-your-woocommerce-products-should-be-auto-categorized/).


== Features ==

✅ Rule-based automation for WooCommerce products
✅ Automatically assign (add or remove) categories and tags based on product data
✅ Broad set of rule conditions - see the **Available conditions** section
✅ Reorder conditions in the rule editor
✅ Support for custom fields (product meta)
✅ Event triggers (on product creation or update)
✅ Scheduled rule execution (run daily)
✅ Works with variable, grouped, and simple products

== Available conditions ==

These conditions are included in the **free** plugin (match types vary by condition - text, numeric, exact list, is/is not, and taxonomy-style rules where noted):

* **Title** - product title
* **Description** - product description
* **Price** - product price
* **Total sales** - lifetime sales amount
* **Type** - product type (simple, variable, etc.)
* **Days since created** / **days since modified** - time since product dates
* **Status** - post status (published, draft, etc.)
* **Stock status** - WooCommerce stock status (including products without manage stock)
* **Manage stock enabled** - yes/no
* **Stock quantity** - numeric quantity when stock is managed
* **Is on sale** - yes/no
* **Attribute value** - pick an attribute and match term(s); supports is/is not style matching
* **Attribute term name** - text comparison against attribute term names across all product attributes
* **Meta field** - value of a chosen product meta key
* **Category value** - pick categories from a list; match whether the product is / is not in those categories
* **Category names** - text matching against assigned category names (several match modes)
* **Tag names** - text matching against assigned tag names (several match modes)

**Pro** adds more conditions, extra match types for list-based conditions, custom-taxonomy actions, and the workflow features below. Details: [Automatic Product Categories Pro](https://berrypress.com/product/woocommerce/automatic-product-categories/).

---

== 🚀 Pro Features ==

Automatic Product Categories **PRO** extends the free plugin with stronger rule management, richer conditions, and safer testing.

**Rule management & workflow**

🔥 **Dry Run** - run a rule and preview what would change without applying taxonomy changes live  
🔥 **Run summary** - when you run a rule, see per-product feedback on which terms were added or removed  
🔥 **Search** - search the rules list  
🔥 **Filters** - filter rules by enabled/disabled and by **group**  
🔥 **Groups** - tag rules with groups (dedicated column + filtering)  
🔥 **Clone rules** and **clone conditions** in one click  
🔥 **Import / export** rules as JSON from a dedicated admin screen

**Scheduling**

🔥 **Hourly** and **weekly** scheduled runs, in addition to **daily** (free)

**Pro conditions, match types, and actions**

You get everything in **Available conditions**, plus extras aimed at larger or more customized catalogs.

* **Custom taxonomy names (e.g. brand name)** - For brands, vendors, and other product taxonomies beyond core categories and tags, you can match the **names** of assigned terms using the same kinds of rules you already use for category/tag name conditions. (WooCommerce product attributes stay covered by the free **attribute** conditions above.)
* **Brand value** - If your site registers the `product_brand` taxonomy, choose brands from a searchable list and match them like **category value** (including options such as is/is not, only these terms, or whether a value is set at all, where the UI offers them).
* **Index** - Match products by their **position** as the rule runs (for example, "skip the first 10 products"). If you use "all conditions must match", put this condition **first** so the count stays correct; the editor explains why.
* **Probability (%)** - Each product gets a random chance to match (0-100%). Handy for sampling or splitting traffic. If other conditions use "all must match", order matters - see the note in the plugin.
* **Probability (count)** - About **N** products match each run out of your catalog, chosen at random - useful when you want a rotating spotlight without maintaining a manual list. Same ordering tip as probability percent.
* **Richer list matching (Pro)** - On attribute, category, brand, and similar pick-list conditions, Pro adds stricter options: **only** these exact terms, or **is set** / **is not set** when you care whether a field has any value.
* **Actions on custom taxonomies** - Rules can add or remove terms on those same taxonomies (such as brands), not only on WooCommerce categories and tags.

**UI**

🔥 Searchable (SelectWoo) dropdowns for long lists when picking categories, tags, and taxonomy terms

**Support**

🔥 Priority support from the BerryPress team

**Planned Features:**
🔥 Advanced rule logs
🔥 Schedule rule execution on specific dates
🔥 **Group conditions** (Pro) - in development: organize conditions into groups inside one rule and combine those groups with AND/OR logic, so advanced setups stay readable. This will ship in a future **Automatic Product Categories Pro** release, not in the free plugin.

👉 **Get Pro:** [Automatic Product Categories Pro](https://berrypress.com/product/woocommerce/automatic-product-categories/)

== Something missing? ==

The best features often start with someone saying, "I wish the plugin could just..." If a condition, action, or workflow would make your store easier to run, we want to know.

**Tell us what you need** - a one-off use case, a compatibility question, or an idea for the roadmap. Your feedback helps us prioritize fixes and new capabilities that matter to WooCommerce merchants, not just a feature checklist.

**[Join the conversation on the WordPress.org support forum](https://wordpress.org/support/plugin/automatic-product-categories-for-woocommerce/)** - ask for help, suggest improvements, or share how you automate categories and tags. We read the threads and use them to steer development.

Prefer a community space? **[BerryPress - WordPress Plugins Community](https://www.facebook.com/groups/1423153459311620/)** - tips, questions, and store owners swapping how they use WooCommerce automation.

---

== 📚 Documentation ==
**[Full setup instructions](https://berrypress.com/docs/automatic-product-categories-for-woocommerce/)** 
---

== 📦 Installation ==

1. Upload the plugin files to the `/wp-content/plugins/automatic-product-categories` directory or install via the WordPress Plugins screen.
2. Activate the plugin.
3. Go to **BerryPress -> Automatic Product Categories** in the admin menu.
4. Start creating rules to automate your product categorization.

---

== Screenshots ==

1. Rule editor with flexible condition logic
2. Settings
3. Condition example
4. Condition example
5. Rule settings
6. Category select search (PRO)
7. Custom taxonomy support (PRO)
8. Import/export interface (PRO)
---

== FAQ ==

= Does this work with custom taxonomies like brands? =
Yes! With Pro version you can target any custom taxonomy, including ones registered by plugins like "Perfect Brands for WooCommerce".

= Can I schedule rules to run at specific intervals? =
Yes. Rules can be scheduled to run daily. With the Pro version, you can also use hourly and weekly schedules (in addition to daily).

= Can I assign or remove tags/categories in bulk? =
Yes - using rule actions based on defined conditions.

= Are custom fields supported? =
Support for custom fields and advanced logic is available in the Pro version.

= How can I report security bugs? =
You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team helps validate, triage and handle any security vulnerabilities. [Report a security vulnerability.]( https://patchstack.com/database/vdp/7569d451-f0f4-4d20-8cb4-c3b1e9784cbe )

== Changelog ==

=== 1.2.7 ===
- Add: New condition "attribute term name" - text comparison on attribute term names across all attributes
- Add: New condition "category value" - select categories from list with is/is not matching
- Add: "is not" option for the "attribute value" condition
- Add: Tooltips explaining multiselect behavior for category value and attribute value conditions
- Add: Option to reorder rule conditions

=== 1.2.6 ===
- Fix: Stock status condition now works for products without "manage stock" enabled
- Add: New condition "manage stock enabled" (yes/no)

=== 1.2.5 ===
- Fix: Scheduled trigger issues
- Add: New hooks for plugin extensibility

=== 1.2.4 ===
- Add: Process rules in batches to avoid timeout issues
- Fix: Daily schedule rule execution
- Fix: potential run order issue

=== 1.2.3 ===
- Don't exclude the default category from the category list in rules

=== 1.2.2 ===
Fix: Resolved an issue where product rules failed to match tags and categories containing special characters (e.g. &)

=== 1.2.1 ===
- Fix: When bulk-editing rules, settings were not saved for newly added rules.

=== 1.2.0 ===
- Store rules in a separate table
- Add columns sorting
- Mixed styling changes
- Add created date column

=== 1.1.8 ===
- Fix new actions not saving
- Fix error outline icon not displaying

=== 1.1.7 ===
- Syntax fix for old php

=== 1.1.6 ===
- Styling changes, optimize icon font size
- Minify CSS files
- Plugin check fixes
- Page length option save

=== 1.1.5 ===
- Fix potential memory issues

=== 1.1.4 ===
- Add: pagination to rule list
- Mixed small fixes

=== 1.1.3 ===
- Fix: Save all and run selected doesn't run the rule

=== 1.1.2 ===
- Fix: Limit submitted rule fields to prevent exceeding PHP max_input_vars
- Change: Update menu item
- Add documentation tooltips
- Update: Rename condition matches and adjust "not" condition behavior to resolve confusion with category/tag conditions
- Update: Rename condition comparison options

=== 1.1.1 ===
- Styling fix

=== 1.1.0 ===

- Completely refreshed plugin UI.
- Refactored logic, removed unnecessary code, improved error handling.
- JavaScript: Fixed JS inconsistencies.
- Updated rule execution to apply to all product statuses, not just published ones.
- Add to conditions "product status"
- Add rule name field
- Rebrand to BerryPress

=== 1.0.8 ===
* Fix error when a rule references a category or tag that has been removed.

=== 1.0.7 ===
* Fix rule load issue

=== 1.0.6 ===

* Show "and" operator between multiple rule conditions
* Declare text domain
* Declare plugin dependency

=== 1.0.5 ===

* Add rule condition: Product total sales
* Add rule condition: Days since product created
* Add rule condition: Days since product modified
* Add rule condition: Product category
* Add the ability to automatically run rules daily on publicly published products
* Add case insensitive match types for "Product meta field" condition
* Improve UI layout on smaller monitors
* Fix: Certain comparison settings (for example, "less than") result in an exception when saving
* Fix: PHP fatal error related to exception
* Fix: Certain match settings on numeric conditions result in an exception when saving rules
* Fix: Exception when saving rule including a "Product price" condition
* Fix: JavaScript error related to "Product meta field" condition
* Fix: Product attribute value condition not working correctly
*
=== 1.0.4 ===

* When removing product categories due to an enabled rule not matching, add the default (Uncategorized) category if the product has no other categories
* Don't show the default (Uncategorized) category in the "Categories/Tags to Add/Remove" column
* Label tweak

=== 1.0.3 ===

* Added case-insensitive string matching options
* Added option not to remove categories/tags for non-matching rules
* Added product tag rule condition
* Clarified button label

=== 1.0.2 ===

* Add header comments to JS and CSS files

=== 1.0.1 ===

* Add an additional permissions check to admin functionality

=== 1.0.0 ===

* Initial release