=== DawsonyWeb - Catalog Ops ===
Contributors: dawsonyweb
Tags: woocommerce, catalog, audit, sku, data quality
Requires at least: 6.2
Tested up to: 6.9
Requires PHP: 8.0
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Audit your WooCommerce catalog for missing SKUs, duplicate SKUs, zero prices, empty descriptions, and more. Fix issues inline.

== Description ==

**Catalog Ops** audits your entire WooCommerce product catalog in one click and surfaces the data-quality issues that silently hurt conversions, search rankings, and ad-feed accuracy.

Instead of clicking through hundreds of product editors, you get a single sortable, searchable issues list with inline tools to resolve problems on the spot.

= What It Audits =

* **Missing SKU** -- products without a SKU assigned.
* **Duplicate SKU** -- two or more products sharing the same SKU.
* **Zero or missing price** -- products with no regular price set.
* **Missing weight** -- physical products without a shipping weight.
* **Empty description** -- products with a blank full description.
* **Empty short description** -- products with a blank excerpt / short description.
* **Missing featured image** -- products without a product image.
* **Orphaned variations** -- variation products whose parent no longer exists.

Audits are aware of product types: variable and grouped parent products are correctly skipped for checks that only apply to simple or variation products.

= Fix Issues Directly =

Click **Fix** on any issue to open a quick-fix modal. Depending on the issue type you can:

* Enter a new SKU, price, or weight.
* Write or paste a description (with full rich-text support).
* Select a featured image from the media library.

The product is updated and the issue is marked resolved, all without navigating away.

= CSV Export and Import =

* **Export** your open issues to a CSV file for review in a spreadsheet.
* Add a `fix_value` column, fill in corrections, and **import** the CSV back to apply fixes in bulk.

Ideal for stores with large catalogs where dozens of products need the same kind of fix.

= Persistent Resolutions =

Issues you resolve or ignore stay that way. Future audit runs will not re-flag them. A dedicated **Resolved & Ignored** sub-tab lets you review past decisions and reopen any item if needed.

= Search, Filter, and Paginate =

* Search by product name, SKU, or product ID.
* Filter by issue type.
* All parameters persist correctly across pagination -- you never lose your place.

= Additional Details =

* Adds a **Catalog Ops** top-level menu in WP Admin with a dashboard and an issues list.
* Custom capability (`dwco_fix_issues`) for controlling which roles can apply fixes.
* Clean uninstall -- all database tables and options are removed when you delete the plugin.
* Fully translatable with a `dawsonyweb-catalog-ops` text domain.

== Installation ==

1. Upload the `dawsonyweb-catalog-ops` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **Catalog Ops** in the admin sidebar.
4. Click **Run Audit** to scan your catalog.
5. Review, fix, or ignore flagged issues from the Issues tab.

WooCommerce must be installed and active.

== Frequently Asked Questions ==

= Does this work with variable and grouped products? =

Yes. The auditor understands product types. Variable and grouped parent products are not flagged for missing SKU, price, or weight since those values belong to their child variations.

= What happens to resolved issues when I run a new audit? =

They stay resolved. Only genuinely new issues are added. You can reopen any resolved or ignored issue from the Resolved & Ignored sub-tab.

= Can I fix issues in bulk? =

Yes. Export open issues to CSV, add your fix values in a spreadsheet, and import the CSV. Every row with a `fix_value` is applied and resolved automatically.

= Is any data sent externally? =

No. All audits and data stay in your WordPress database. The plugin makes no external HTTP requests.

== Screenshots ==

1. Dashboard overview showing audit summary and last-run time.
2. Issues list with search, filters, and inline action buttons.
3. Quick-fix modal for entering a new SKU.
4. Quick-fix modal with the media library open for selecting a featured image.
5. Resolved & Ignored sub-tab with reopen support.

== Changelog ==

= 1.1.1 =
* Fixed: disabled audit types are now fully excluded from audit runs. Previously, existing open issues for a type stayed visible after the type was disabled in Settings. Disabling a type now clears its open issues on the next audit run.

= 1.1.0 =
* Quick-fix modal: fix missing SKUs, prices, weights, descriptions, and featured images directly from the issues list.
* CSV export and import: export open issues to CSV and re-import with fix values for bulk resolution.
* Resolved and ignored issues now persist across future audits. Dedicated Resolved & Ignored sub-tab with reopen support.
* Variable and grouped parent products are no longer incorrectly flagged for missing SKU, price, or weight.
* Variation product links now correctly open the parent product editor.
* Search issues by product name, SKU, or product ID.
* Filter and search parameters persist correctly across pagination.
* Wider table layout to prevent action-button stacking.

= 1.0.2 =
* Improved security: nonces, input sanitization, output escaping, and safe database queries throughout.
* Added clean uninstall routine. Added languages directory and text-domain compliance.
* Readme and licence header updates for WordPress.org guidelines.

= 1.0.1 =
* Maintenance.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.1.1 =
Bug fix: disabling an audit type in Settings now correctly removes its open issues from the list on the next run.

= 1.1.0 =
New: inline quick-fix modal, CSV export/import, persistent resolutions, and smarter audits for variable and grouped products.
