|
@@ -6,7 +6,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
|
|
|
|
|
**QDR - Studiou WC Export/Import Product Categories** is a WordPress plugin that extends WooCommerce to provide batch export/import functionality for both product categories and products, along with category manipulation tools.
|
|
**QDR - Studiou WC Export/Import Product Categories** is a WordPress plugin that extends WooCommerce to provide batch export/import functionality for both product categories and products, along with category manipulation tools.
|
|
|
|
|
|
|
|
-**Current Version:** 1.5.1
|
|
|
|
|
|
|
+**Current Version:** 1.5.2
|
|
|
|
|
|
|
|
## Requirements
|
|
## Requirements
|
|
|
|
|
|
|
@@ -52,9 +52,11 @@ The plugin follows a modular class-based architecture:
|
|
|
- Batch description updates for multiple categories
|
|
- Batch description updates for multiple categories
|
|
|
- Delete products in category (permanently deletes products and variants)
|
|
- Delete products in category (permanently deletes products and variants)
|
|
|
- Clear Media Categories (permanently deletes media files from media categories) (NEW in v1.5)
|
|
- Clear Media Categories (permanently deletes media files from media categories) (NEW in v1.5)
|
|
|
|
|
+ - Remove Not Assigned Media (deletes unused uncategorized media) (NEW in v1.5.2)
|
|
|
- Uses direct database queries for reliable product detection
|
|
- Uses direct database queries for reliable product detection
|
|
|
- - Batch processing for delete operations (10 products per batch)
|
|
|
|
|
|
|
+ - Batch processing for delete operations (10 items per batch)
|
|
|
- Auto-detects media category taxonomy (any custom taxonomy registered for attachments)
|
|
- Auto-detects media category taxonomy (any custom taxonomy registered for attachments)
|
|
|
|
|
+ - Robust media deletion with post-deletion verification and manual fallback cleanup
|
|
|
- Always-on error logging for media operations (prefix: "STUDIOU WC MEDIA:")
|
|
- Always-on error logging for media operations (prefix: "STUDIOU WC MEDIA:")
|
|
|
|
|
|
|
|
- **class-studiou-wc-product-manage-product-db.php** - Product database operations (NEW in v1.4)
|
|
- **class-studiou-wc-product-manage-product-db.php** - Product database operations (NEW in v1.4)
|
|
@@ -95,6 +97,7 @@ The plugin follows a modular class-based architecture:
|
|
|
- Batch description between categories (checkbox list + textarea + "Do" button)
|
|
- Batch description between categories (checkbox list + textarea + "Do" button)
|
|
|
- Delete products in category (checkbox list + "Delete" button + progress bar)
|
|
- Delete products in category (checkbox list + "Delete" button + progress bar)
|
|
|
- Clear Media Categories (checkbox list + "Delete" button + progress bar) (NEW in v1.5)
|
|
- Clear Media Categories (checkbox list + "Delete" button + progress bar) (NEW in v1.5)
|
|
|
|
|
+ - Remove Not Assigned Media ("Delete unused uncategorized media (N)" button + progress bar) (NEW in v1.5.2)
|
|
|
- **product-import.php** - Product import page UI (NEW in v1.4)
|
|
- **product-import.php** - Product import page UI (NEW in v1.4)
|
|
|
- File upload for CSV import
|
|
- File upload for CSV import
|
|
|
- Progress bar for import operations
|
|
- Progress bar for import operations
|
|
@@ -118,6 +121,7 @@ The plugin follows a modular class-based architecture:
|
|
|
- AJAX handlers for all category operations
|
|
- AJAX handlers for all category operations
|
|
|
- AJAX handlers for product import/export operations (NEW in v1.4)
|
|
- AJAX handlers for product import/export operations (NEW in v1.4)
|
|
|
- AJAX handlers for clear media categories operations (NEW in v1.5)
|
|
- AJAX handlers for clear media categories operations (NEW in v1.5)
|
|
|
|
|
+ - AJAX handlers for remove unassigned media operations (NEW in v1.5.2)
|
|
|
- Batch processing logic for delete and media deletion operations
|
|
- Batch processing logic for delete and media deletion operations
|
|
|
- Real-time progress bar updates
|
|
- Real-time progress bar updates
|
|
|
- Confirmation dialogs for destructive operations
|
|
- Confirmation dialogs for destructive operations
|
|
@@ -205,6 +209,7 @@ All pages are added under **Products** menu:
|
|
|
- Batch description between categories
|
|
- Batch description between categories
|
|
|
- Delete products in category
|
|
- Delete products in category
|
|
|
- Clear Media Categories (NEW in v1.5)
|
|
- Clear Media Categories (NEW in v1.5)
|
|
|
|
|
+ - Remove Not Assigned Media (NEW in v1.5.2)
|
|
|
- **Product Import (slug: `studiou-product-import`)** - NEW in v1.4
|
|
- **Product Import (slug: `studiou-product-import`)** - NEW in v1.4
|
|
|
- **Product Export (slug: `studiou-product-export`)** - NEW in v1.4
|
|
- **Product Export (slug: `studiou-product-export`)** - NEW in v1.4
|
|
|
|
|
|
|
@@ -280,6 +285,22 @@ All pages are added under **Products** menu:
|
|
|
- Verify media files are actually removed from disk
|
|
- Verify media files are actually removed from disk
|
|
|
- Verify deletion statistics are accurate
|
|
- Verify deletion statistics are accurate
|
|
|
- Test with media files used as product images (verify WooCommerce product references are handled)
|
|
- Test with media files used as product images (verify WooCommerce product references are handled)
|
|
|
|
|
+- Verify physical files are deleted from disk (check wp-content/uploads/)
|
|
|
|
|
+- Verify attachment posts are removed from Media Library
|
|
|
|
|
+
|
|
|
|
|
+### Remove Not Assigned Media Operations (NEW in v1.5.2)
|
|
|
|
|
+- Verify button count matches actual unused uncategorized media
|
|
|
|
|
+- Test deletion with:
|
|
|
|
|
+ - Media not in any category and not used anywhere
|
|
|
|
|
+ - Media used as featured image (should NOT be deleted)
|
|
|
|
|
+ - Media used in WooCommerce product galleries (should NOT be deleted)
|
|
|
|
|
+ - Media attached to a post (post_parent > 0, should NOT be deleted)
|
|
|
|
|
+ - Media in a media category (should NOT be deleted)
|
|
|
|
|
+ - Large numbers of unused media (test batch processing)
|
|
|
|
|
+- Verify confirmation dialog appears before deletion
|
|
|
|
|
+- Verify progress bar updates correctly
|
|
|
|
|
+- Verify physical files and attachment posts are both deleted
|
|
|
|
|
+- Verify button count updates after page reload
|
|
|
|
|
|
|
|
### General
|
|
### General
|
|
|
- Verify translations are properly loaded (English/Czech)
|
|
- Verify translations are properly loaded (English/Czech)
|
|
@@ -300,11 +321,13 @@ The plugin registers the following AJAX actions:
|
|
|
6. **studiou_wcpcm_delete_products_batch** - Processes product deletion in batches
|
|
6. **studiou_wcpcm_delete_products_batch** - Processes product deletion in batches
|
|
|
7. **studiou_wcpcm_clear_media** - Initial request to get media IDs for deletion (NEW in v1.5)
|
|
7. **studiou_wcpcm_clear_media** - Initial request to get media IDs for deletion (NEW in v1.5)
|
|
|
8. **studiou_wcpcm_clear_media_batch** - Processes media deletion in batches (NEW in v1.5)
|
|
8. **studiou_wcpcm_clear_media_batch** - Processes media deletion in batches (NEW in v1.5)
|
|
|
|
|
+9. **studiou_wcpcm_remove_unassigned_media** - Gets IDs of unused uncategorized media (NEW in v1.5.2)
|
|
|
|
|
+10. **studiou_wcpcm_remove_unassigned_media_batch** - Processes unassigned media deletion in batches (NEW in v1.5.2)
|
|
|
|
|
|
|
|
### Product Operations (NEW in v1.4)
|
|
### Product Operations (NEW in v1.4)
|
|
|
-7. **studiou_wcpcm_product_import_parse** - Parses CSV file and stores in transient (Step 1)
|
|
|
|
|
-8. **studiou_wcpcm_product_import_batch** - Processes batch of 5 products (Step 2, called recursively)
|
|
|
|
|
-9. **studiou_wcpcm_product_export** - Generates product CSV export by category selection
|
|
|
|
|
|
|
+11. **studiou_wcpcm_product_import_parse** - Parses CSV file and stores in transient (Step 1)
|
|
|
|
|
+12. **studiou_wcpcm_product_import_batch** - Processes batch of 5 products (Step 2, called recursively)
|
|
|
|
|
+13. **studiou_wcpcm_product_export** - Generates product CSV export by category selection
|
|
|
|
|
|
|
|
All AJAX handlers include:
|
|
All AJAX handlers include:
|
|
|
- Nonce verification (`studiou-wcpcm-nonce`)
|
|
- Nonce verification (`studiou-wcpcm-nonce`)
|