Changeset 3761177
- Timestamp:
- 10/23/2026 08:34:31 AM (3 hours ago)
- Location:
- bulk-cogs-editor-for-woocommerce
- Files:
-
- 2 edited
-
tags/1.2.0/readme.txt (modified) (5 diffs)
-
trunk/readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
bulk-cogs-editor-for-woocommerce/tags/1.2.0/readme.txt
r3761066 r3761177 21 21 = Watch the plugin in action = 22 22 23 See how this WooCommerce bulk editor helps you filter and preview products, apply bulk updates, import and export product cost data, review operation history, and roll back recorded changes safely.24 25 23 https://youtu.be/sOEOg0xiqYs 26 24 27 25 = Why use Bulk COGS Editor? = 28 26 29 * **Save time when supplier prices change.** Raise or lower costs for a whole category, brand, or group of products in one pass instead of editing products one by one. 30 * **Preview before you apply.** See the current COGS, the calculated COGS, and the exact change for every product. Previewing never changes your store data. 31 * **Built for large catalogs.** Updates run in Action Scheduler batches, with live progress and the option to cancel. 32 * **Faster bulk updates.** The latest reported WP-CLI benchmark updated 10,000 products in 15 minutes 24 seconds, compared with 50–60 minutes in the initial implementation. See the performance results below for context. 33 * **Review and reverse recorded updates.** Find past operations in History, inspect recorded product cost and results, and review a rollback to retained original costs. 34 * **Choose your rollback policy.** Restore original costs even after later edits, or skip products whose costs changed afterward. Set the history retention period to suit your store. 35 * **Your prices stay untouched.** The plugin only changes the Cost of Goods Sold value. 27 * **Save time on supplier price changes.** Update a category, brand, or selected group instead of editing products one by one. 28 * **Work from your spreadsheet.** Bring supplier costs into your catalog or prepare updates from exported product data. 29 * **Make informed changes.** Check the effect on product costs before committing an update. 30 * **Keep a record of your work.** Identify past operations and decide whether eligible changes need to be reversed. 36 31 37 32 = How it works = 38 33 39 1. **Filter** products by title or SKU, category, brand, product type, stock status, current price, or current COGS.40 2. **Choose an action:** set an exact COGS, increase or decrease it by a percentage or a fixed amount, or clear it.41 3. **Preview** the proposed changes in a paginated table.42 4. **Apply** the update and follow the progress, elapsed time, and success, skipped, and failed counts.34 1. Open **Products > Bulk COGS Editor** and choose Bulk edit. 35 2. Choose your filters and find the matching products. 36 3. Choose a cost action, review the preview, and select the products to update. 37 4. Review and confirm the update, then follow its results in the editor. 43 38 44 39 = Features = 45 40 46 41 * Filter products and variations by title, SKU, category, brand, product type, stock status, current price, or current COGS. 47 * Set a cost, increase or decrease it by a fixed amount or percentage, or clear it. 48 * Preview current and proposed costs, select products, and confirm before applying changes. 49 * Process updates in Action Scheduler background batches with progress and cancellation. Completed changes are kept if an operation is cancelled. 50 * Import cost updates from CSV or XLSX using a product ID or SKU, and export matching costs to CSV. 51 * Review operation outcomes and retained original values in History. Rollback depends on retention and product eligibility. 52 * Update WooCommerce COGS only; product prices are not changed. 53 54 Relative adjustments skip products without a COGS value. Use "Set exact" to add a cost to those products. WooCommerce treats a COGS value of zero as empty; clearing a cost uses the COGS API's null value. 42 * Set an exact cost, increase or decrease it by a fixed amount or percentage, or clear it. 43 * Preview product images alongside current COGS, proposed COGS, and the exact difference, with pagination and product selection. 44 * Process updates through Action Scheduler, WooCommerce's background task system, with progress and cancellation controls. 45 * Import CSV or XLSX costs using product IDs or SKUs, export matching costs to CSV, and download validation and update reports. 46 * Inspect recorded outcomes and retained original costs in History, with rollback review and confirmation. 47 * Configure history retention and choose whether rollback overwrites later cost edits or skips changed products. 55 48 56 49 = Performance for large catalogs = 57 50 58 Bulk processing has been improved by reducing repeated product scans and counts, preparing product and variation-parent caches in batches, and grouping WooCommerce product cache cleanup. Progress counters are checkpointed while each product's outcome is saved for recovery. COGS updates continue to use WooCommerce's CRUD/data layer, preserving its hooks and cache handling. 59 60 In the developer's [reported benchmark results](https://github.com/dineshinau/bulk-cogs-editor-for-woocommerce/discussions/12), processing approximately 10,000 products improved from 50–60 minutes initially to 40–42 minutes, then 25–28 minutes. The latest reported WP-CLI run updated **10,000 products in 15 minutes 24 seconds, with zero skipped and zero failed** — about 69–74% less elapsed time than the initial implementation. 61 62 The supplied completion screenshot records an editor operation elapsed time of **00:15:24**, not a separately measured end-to-end CLI runtime. The latest result is a single benchmark run, not a guaranteed completion time. Actual performance depends on hosting, database speed, product types, installed extensions, and background worker availability. Repeated runs and larger catalogs still need benchmarking. 63 64 = Import CSV and XLSX files = 65 66 Choose CSV mode and Import on the Bulk COGS Editor page. Upload a UTF-8 CSV or an XLSX workbook. The upload limit follows WordPress's maximum upload size, shown beside the file field; the plugin does not impose a separate file-size or row-count cap. Hosting upload, memory, storage and execution limits still apply. 67 68 Exported CSV files end with a blank `new_cogs` column. Fill this column with the new costs, then import the file. Required headers are `new_cogs` and `id` or `sku`; legacy files may use `cogs` when `new_cogs` is absent. ID and SKU must agree when both are supplied. Blank costs are excluded; use decimal points without currency symbols. Duplicate product rows are excluded and included in the error report. 69 70 XLSX imports read the first worksheet's raw cell values. Replace formulas with values before uploading, and store SKUs as text to preserve leading zeros. XLSX needs PHP's ZIP, XMLReader and DOM extensions. XLSX text is decoded by its XML reader; Windows-1252 is not required. CSV remains UTF-8 only. Export still produces CSV. 71 72 Preview preparation runs in Action Scheduler batches without changing products. You can close the page and return to resume its progress display. Once ready, review paged products, download validation errors, select products and explicitly apply the changes. Preparation can be cancelled independently of an applied update. Original uploads are deleted when preparation ends; staged previews and reports expire through scheduled cleanup after approximately 24 hours, with retention extended while an applied update is active. 73 74 Completed bulk operation history, original cost records, and one-use preview claims use the retention period in Settings: 30 days by default, 90 days, or custom days. A bounded daily cleanup removes expired records and rechecks retention before deleting history. Active operations and staged imports that still support a report are retained until their work and report dependencies are finished. Preview claims protect against replay and concurrent Apply requests until their retention and dependency checks permit removal. 75 76 The WP-CLI command below processes both preview preparation and confirmed updates. Preview workers must run on the upload server as the same operating-system user as PHP, because original uploads are stored in private temporary files. If your shell uses a different user, ask your host to run the command as the PHP user; ordinary product updates do not need the uploaded file. During preparation, worker logs report the stage, checked row count and batch size. The total and remaining row counts are unknown until reading finishes. 51 Bulk processing reduces repeated product searches and counts. It loads reusable product data in batches and groups cache cleanup to reduce repeated work. 52 53 The plugin saves progress checkpoints and each product's result to support recovery after interruptions. Costs are saved through WooCommerce's product APIs, preserving its hooks and cache handling. 54 55 In the developer's [reported benchmark results](https://github.com/dineshinau/bulk-cogs-editor-for-woocommerce/discussions/12), processing approximately 10,000 products improved from 50–60 minutes initially to 40–42 minutes, then 25–28 minutes. 56 57 The latest reported WP-CLI run updated **10,000 products in 15 minutes 24 seconds, with zero skipped and zero failed** — about 69–74% less elapsed time than the initial implementation. 58 59 The completion screenshot records the editor operation's elapsed time of **00:15:24**. End-to-end CLI runtime was not measured separately. This is a single benchmark run, not a guaranteed completion time. 60 61 Actual performance depends on hosting, database speed, product types, installed extensions, and background worker availability. Repeated runs and larger catalogs still need benchmarking. 62 63 = Import and export product costs with CSV or Excel = 64 65 ### CSV and XLSX import 66 67 Choose **CSV mode** and click **Import** on the Bulk COGS Editor page. Upload a UTF-8 CSV or XLSX file. 68 69 The upload limit follows WordPress's maximum upload size, shown beside the file field. The plugin has no separate file-size or row-count limit. Hosting upload, memory, storage and execution limits still apply. 70 71 ### Sample CSV 72 73 Exported CSV files include a blank `new_cogs` column. Fill it with new costs and import the file. 74 75 ```csv 76 id,sku,new_cogs 77 123,PRODUCT-001,25.50 78 124,PRODUCT-002,40.00 79 ``` 80 81 Required headers are `new_cogs` and `id` or `sku`. Older files can use `cogs` if `new_cogs` is missing. 82 83 - Use either ID or SKU to identify products. 84 - If both are provided, they must match. 85 - Use decimal values without currency symbols. 86 - Blank costs are skipped. 87 - Duplicate product rows are excluded and listed in the error report. 88 89 XLSX imports read raw values from the first worksheet. Replace formulas with values and store SKUs as text to preserve leading zeros. 90 91 XLSX requires PHP's ZIP, XMLReader and DOM extensions. Exports use CSV format. 92 93 ### Preview and apply 94 95 Preview preparation runs in Action Scheduler batches without changing products. You can close the page and return to check progress. 96 97 When ready, review products, download validation errors, select products and click **Apply**. Preparation can be cancelled separately from an applied update. 98 99 Original uploads are deleted after preparation. Staged previews and reports expire after about 24 hours. Retention extends while an applied update is active. 100 101 ### History and retention 102 103 Operation history and original cost records follow the retention period set in Settings. See the retention FAQ below. Daily cleanup preserves active operations and data needed for reports. 104 105 The plugin also keeps records that prevent the same preview from being applied more than once, including simultaneous Apply requests. These records follow the configured retention period and are removed only when they are no longer needed. 77 106 78 107 = Run background updates with WP-CLI = 79 108 80 Use Action Scheduler's CLI runner to process the plugin queue while the editor continues to show progress and accept cancellations. See the [Action Scheduler documentation](https://actionscheduler.org/) for more information. 109 Use Action Scheduler's CLI runner for import preview preparation and confirmed updates while the editor continues to show progress and accept cancellations. See the [Action Scheduler documentation](https://actionscheduler.org/) for more information. 110 111 Import preview workers must run on the upload server under the same operating-system account as PHP. This lets them read the private temporary uploads. 112 113 If your shell uses a different account, ask your host to run the command under PHP's account. Ordinary product updates do not need the uploaded file. 114 115 During preparation, worker logs show the stage, checked row count, and batch size. Total and remaining row counts become available after reading finishes. 81 116 82 117 After uploading an import for preview or confirming an update in the editor, run this command from your WordPress directory: … … 88 123 `wp action-scheduler status --group=bulk-cogs-editor` 89 124 90 The status report covers the site's full Action Scheduler queue. The runner handles due plugin actions for all users, exits when none remain, and does not wait for retries. `--batch-size` counts actions, not products. 125 The status report covers the site's full Action Scheduler queue. 126 127 The run command processes due plugin actions for all users and exits when none remain. It does not wait for scheduled retries. `--batch-size` counts scheduled actions, not products. 91 128 92 129 If another worker owns the available batch, wait for it to finish or run: … … 94 131 `wp action-scheduler run --group=bulk-cogs-editor --batch-size=1 --batches=0 --force` 95 132 96 Operation locks prevent simultaneous work on one operation, but `--force` increases server load. Keep the normal runner enabled for retries. A host-approved cron may invoke the command with a process lock. 133 The plugin prevents two workers from changing the same operation simultaneously. Using `--force` can still increase server load. 134 135 Keep the normal background runner enabled for retries. If your host runs the command on a schedule, use a process lock to prevent overlapping command runs. 97 136 98 137 For performance checks, prefix the command with `time`. WooCommerce > Status > Logs under source `dkbce` records worker timing and runner details. 99 100 = Use cases =101 102 * **Supplier price change:** filter the affected products by category or brand, preview a percentage or fixed increase, then apply it to the matching products.103 * **Correct a specific group of products:** find products by title or SKU, select the ones to change, preview exact COGS values or clear them, then confirm the update.104 * **Add missing costs:** use "Set exact" to give a COGS value to products that do not have one yet.105 138 106 139 = Requirements = … … 140 173 141 174 = How do I bulk update Cost of Goods Sold (COGS) in WooCommerce? = 142 Go to Products > Bulk COGS Editor, filter the products you want to change, choose an action (set exact, increase or decrease by a percentage or fixed amount, or clear), review the preview, and confirm. Updates are applied in background batches.175 Use Bulk edit for one cost action across a selected group. Use CSV import when individual products need different values. The steps for both workflows appear above. 143 176 144 177 = Can I import WooCommerce product costs from CSV or Excel? = 145 Yes. Upload a UTF-8 CSV file or an Excel XLSX workbook with a `new_cogs` column and an `id` or `sku` column to identify each product. If both ID and SKU are supplied, they must identify the same product. Review the validated preview, select the products, and confirm before applying changes.178 Yes. Both formats support product IDs or SKUs. See the import section above for required columns, file requirements, and validation steps. 146 179 147 180 = Can I export product costs and import updated values? = 148 Yes. Export matching products to CSV, fill the blank `new_cogs` column with the updated costs, and import the file. Keep the product IDs or SKUs so each row matches the correct product. Review the preview and explicitly confirm the update; uploading a file alone does not change product costs.181 Yes. Keep the exported product IDs or SKUs unchanged when preparing your updates. Export produces CSV even if a previous import used XLSX; see the sample CSV above. 149 182 150 183 = Does this plugin work with WooCommerce's native Cost of Goods Sold feature? = 151 Yes. Bulk COGS Editor is designed specifically for WooCommerce's native Cost of Goods Sold (COGS) feature. COGS must be supported by your installed WooCommerce version and enabled in WooCommerce settings. If it is disabled or unavailable, the editor explains what is required. 152 153 = Which WooCommerce version do I need? = 154 WooCommerce 10.3 or later, with the Cost of Goods Sold feature enabled in WooCommerce settings. 184 Yes. It requires WooCommerce 10.3 or later with native COGS enabled. If the feature is disabled or unavailable, the editor explains what is required. 155 185 156 186 = Can I increase all product costs by a percentage? = 157 Yes. Filter the products you want, choose "Increase by percentage", enter the value, and review the preview before applying. You can also decrease by a percentage, or increase or decrease by a fixed amount.158 159 = Can I preview changes before applying them? =160 Yes. You can preview all proposed cost changes in a paginated table showing product images, current COGS, calculated COGS, and the exact difference before confirming any update. Previewing never modifies your store data.187 Yes. The percentage action applies to your selected products. Products without a saved cost are skipped; use Set exact cost to assign their initial values. 188 189 = Does preparing a preview change product costs? = 190 No. Finding products or validating an import only prepares a preview. Product costs change after you explicitly confirm the update. 161 191 162 192 = Do I need to read the documentation or watch the video before using the editor? = 163 The editor includes Help and instructions for Bulk edit, CSV Import, and CSV Export. The steps change with your selected task. Field guidance, cost examples, previews, and a confirmation summary help you review changes before applying them. Documentation and video links are available formore detail.193 No. The editor includes task-specific Help and instructions, field guidance, and cost examples. Use the documentation or video when you need more detail. 164 194 165 195 = Where can I see the result of my last update? = 166 Expand Recent activity to see the latest completed operation, its updated count, completion time, and elapsed time. Skipped or failed products and cancellation or failure outcomes are highlighted. Cancelling an operation keeps changes that were already saved.196 Expand Recent activity for the latest completed operation, including updated counts, completion time, elapsed time, and highlighted problems. Open History to inspect earlier operations. 167 197 168 198 = Can I roll back a completed update? = 169 199 170 Open History, select View details for the source operation, then choose Review rollback when retained original costs are available. Review the current and original values, check the confirmation, and choose Confirm rollback. Older summary-only or expired operations cannot be rolled back. Cancelling an operation keeps changes already saved; restoring them requires a separate rollback. 200 Open History, select View details, and choose Review rollback when original costs are retained. Compare current and original values, then choose Confirm rollback. 201 202 Expired operations and older records that contain only summary results cannot be rolled back. Restoring changes saved before cancellation also requires a separate rollback. 171 203 172 204 = What if product cost changed after the original update? = 173 205 174 Settings lets you choose whether new rollbacks overwrite current costs with the recorded original costs or skip products changed afterward. The chosen policy appears during review and remains fixed for that attempt. After a terminal incomplete rollback, review a new attempt for remaining products; products already restored are excluded even if edited again later. 206 Choose the skip-changed policy in Settings to preserve later cost edits. Choose overwrite to restore recorded original costs instead. The policy shown during review remains fixed for that rollback attempt. 207 208 If a rollback is cancelled or does not finish, review a new attempt for the remaining products. Already restored products are excluded, even if edited again later. 175 209 176 210 = How long is operation history retained? = 177 211 178 Choose 30 days, 90 days, or custom days in Settings. The default is 30 days; custom values support 1 to 36,500 days. Shortening retention also applies to existing history. Scheduled cleanup removes expired records, so extending retention cannot recover original values already deleted. 212 Choose 30 days, 90 days, or a custom period of 1 to 36,500 days in Settings. The default is 30 days. 213 214 Shortening retention also affects existing history. Extending it cannot recover original costs already deleted by scheduled cleanup. 179 215 180 216 = How does the plugin handle variable products and variations? = … … 194 230 195 231 = What happens to products without a COGS value during relative adjustments? = 196 Relative actions (percentage and fixed amount increases or decreases) skip products that do not have a COGS value set. To assign costs to those products, use the "Set exact" action.232 Percentage and fixed-amount adjustments skip products without a saved COGS value. Use Set exact cost to assign one. WooCommerce treats zero as empty; use Clear cost to remove a saved value. 197 233 198 234 = How are large catalogs processed? = 199 Updates run in background batches through Action Scheduler. Completion time depends on hosting and worker availability. Monitor progress in the editor; cancellation keeps changes already saved.235 Updates run in background batches, so you can close the browser and return to the editor for progress. Completion depends on hosting and background worker availability. Cancelling keeps changes already saved; it does not undo them. 200 236 201 237 = Does this plugin modify product prices? = 202 238 No. The plugin only modifies the WooCommerce Cost of Goods Sold value. 203 204 = Does it use an external service? =205 No. The plugin processes product data on your WordPress/WooCommerce installation.206 239 207 240 = Where can I give feedback? = -
bulk-cogs-editor-for-woocommerce/trunk/readme.txt
r3761066 r3761177 21 21 = Watch the plugin in action = 22 22 23 See how this WooCommerce bulk editor helps you filter and preview products, apply bulk updates, import and export product cost data, review operation history, and roll back recorded changes safely.24 25 23 https://youtu.be/sOEOg0xiqYs 26 24 27 25 = Why use Bulk COGS Editor? = 28 26 29 * **Save time when supplier prices change.** Raise or lower costs for a whole category, brand, or group of products in one pass instead of editing products one by one. 30 * **Preview before you apply.** See the current COGS, the calculated COGS, and the exact change for every product. Previewing never changes your store data. 31 * **Built for large catalogs.** Updates run in Action Scheduler batches, with live progress and the option to cancel. 32 * **Faster bulk updates.** The latest reported WP-CLI benchmark updated 10,000 products in 15 minutes 24 seconds, compared with 50–60 minutes in the initial implementation. See the performance results below for context. 33 * **Review and reverse recorded updates.** Find past operations in History, inspect recorded product cost and results, and review a rollback to retained original costs. 34 * **Choose your rollback policy.** Restore original costs even after later edits, or skip products whose costs changed afterward. Set the history retention period to suit your store. 35 * **Your prices stay untouched.** The plugin only changes the Cost of Goods Sold value. 27 * **Save time on supplier price changes.** Update a category, brand, or selected group instead of editing products one by one. 28 * **Work from your spreadsheet.** Bring supplier costs into your catalog or prepare updates from exported product data. 29 * **Make informed changes.** Check the effect on product costs before committing an update. 30 * **Keep a record of your work.** Identify past operations and decide whether eligible changes need to be reversed. 36 31 37 32 = How it works = 38 33 39 1. **Filter** products by title or SKU, category, brand, product type, stock status, current price, or current COGS.40 2. **Choose an action:** set an exact COGS, increase or decrease it by a percentage or a fixed amount, or clear it.41 3. **Preview** the proposed changes in a paginated table.42 4. **Apply** the update and follow the progress, elapsed time, and success, skipped, and failed counts.34 1. Open **Products > Bulk COGS Editor** and choose Bulk edit. 35 2. Choose your filters and find the matching products. 36 3. Choose a cost action, review the preview, and select the products to update. 37 4. Review and confirm the update, then follow its results in the editor. 43 38 44 39 = Features = 45 40 46 41 * Filter products and variations by title, SKU, category, brand, product type, stock status, current price, or current COGS. 47 * Set a cost, increase or decrease it by a fixed amount or percentage, or clear it. 48 * Preview current and proposed costs, select products, and confirm before applying changes. 49 * Process updates in Action Scheduler background batches with progress and cancellation. Completed changes are kept if an operation is cancelled. 50 * Import cost updates from CSV or XLSX using a product ID or SKU, and export matching costs to CSV. 51 * Review operation outcomes and retained original values in History. Rollback depends on retention and product eligibility. 52 * Update WooCommerce COGS only; product prices are not changed. 53 54 Relative adjustments skip products without a COGS value. Use "Set exact" to add a cost to those products. WooCommerce treats a COGS value of zero as empty; clearing a cost uses the COGS API's null value. 42 * Set an exact cost, increase or decrease it by a fixed amount or percentage, or clear it. 43 * Preview product images alongside current COGS, proposed COGS, and the exact difference, with pagination and product selection. 44 * Process updates through Action Scheduler, WooCommerce's background task system, with progress and cancellation controls. 45 * Import CSV or XLSX costs using product IDs or SKUs, export matching costs to CSV, and download validation and update reports. 46 * Inspect recorded outcomes and retained original costs in History, with rollback review and confirmation. 47 * Configure history retention and choose whether rollback overwrites later cost edits or skips changed products. 55 48 56 49 = Performance for large catalogs = 57 50 58 Bulk processing has been improved by reducing repeated product scans and counts, preparing product and variation-parent caches in batches, and grouping WooCommerce product cache cleanup. Progress counters are checkpointed while each product's outcome is saved for recovery. COGS updates continue to use WooCommerce's CRUD/data layer, preserving its hooks and cache handling. 59 60 In the developer's [reported benchmark results](https://github.com/dineshinau/bulk-cogs-editor-for-woocommerce/discussions/12), processing approximately 10,000 products improved from 50–60 minutes initially to 40–42 minutes, then 25–28 minutes. The latest reported WP-CLI run updated **10,000 products in 15 minutes 24 seconds, with zero skipped and zero failed** — about 69–74% less elapsed time than the initial implementation. 61 62 The supplied completion screenshot records an editor operation elapsed time of **00:15:24**, not a separately measured end-to-end CLI runtime. The latest result is a single benchmark run, not a guaranteed completion time. Actual performance depends on hosting, database speed, product types, installed extensions, and background worker availability. Repeated runs and larger catalogs still need benchmarking. 63 64 = Import CSV and XLSX files = 65 66 Choose CSV mode and Import on the Bulk COGS Editor page. Upload a UTF-8 CSV or an XLSX workbook. The upload limit follows WordPress's maximum upload size, shown beside the file field; the plugin does not impose a separate file-size or row-count cap. Hosting upload, memory, storage and execution limits still apply. 67 68 Exported CSV files end with a blank `new_cogs` column. Fill this column with the new costs, then import the file. Required headers are `new_cogs` and `id` or `sku`; legacy files may use `cogs` when `new_cogs` is absent. ID and SKU must agree when both are supplied. Blank costs are excluded; use decimal points without currency symbols. Duplicate product rows are excluded and included in the error report. 69 70 XLSX imports read the first worksheet's raw cell values. Replace formulas with values before uploading, and store SKUs as text to preserve leading zeros. XLSX needs PHP's ZIP, XMLReader and DOM extensions. XLSX text is decoded by its XML reader; Windows-1252 is not required. CSV remains UTF-8 only. Export still produces CSV. 71 72 Preview preparation runs in Action Scheduler batches without changing products. You can close the page and return to resume its progress display. Once ready, review paged products, download validation errors, select products and explicitly apply the changes. Preparation can be cancelled independently of an applied update. Original uploads are deleted when preparation ends; staged previews and reports expire through scheduled cleanup after approximately 24 hours, with retention extended while an applied update is active. 73 74 Completed bulk operation history, original cost records, and one-use preview claims use the retention period in Settings: 30 days by default, 90 days, or custom days. A bounded daily cleanup removes expired records and rechecks retention before deleting history. Active operations and staged imports that still support a report are retained until their work and report dependencies are finished. Preview claims protect against replay and concurrent Apply requests until their retention and dependency checks permit removal. 75 76 The WP-CLI command below processes both preview preparation and confirmed updates. Preview workers must run on the upload server as the same operating-system user as PHP, because original uploads are stored in private temporary files. If your shell uses a different user, ask your host to run the command as the PHP user; ordinary product updates do not need the uploaded file. During preparation, worker logs report the stage, checked row count and batch size. The total and remaining row counts are unknown until reading finishes. 51 Bulk processing reduces repeated product searches and counts. It loads reusable product data in batches and groups cache cleanup to reduce repeated work. 52 53 The plugin saves progress checkpoints and each product's result to support recovery after interruptions. Costs are saved through WooCommerce's product APIs, preserving its hooks and cache handling. 54 55 In the developer's [reported benchmark results](https://github.com/dineshinau/bulk-cogs-editor-for-woocommerce/discussions/12), processing approximately 10,000 products improved from 50–60 minutes initially to 40–42 minutes, then 25–28 minutes. 56 57 The latest reported WP-CLI run updated **10,000 products in 15 minutes 24 seconds, with zero skipped and zero failed** — about 69–74% less elapsed time than the initial implementation. 58 59 The completion screenshot records the editor operation's elapsed time of **00:15:24**. End-to-end CLI runtime was not measured separately. This is a single benchmark run, not a guaranteed completion time. 60 61 Actual performance depends on hosting, database speed, product types, installed extensions, and background worker availability. Repeated runs and larger catalogs still need benchmarking. 62 63 = Import and export product costs with CSV or Excel = 64 65 ### CSV and XLSX import 66 67 Choose **CSV mode** and click **Import** on the Bulk COGS Editor page. Upload a UTF-8 CSV or XLSX file. 68 69 The upload limit follows WordPress's maximum upload size, shown beside the file field. The plugin has no separate file-size or row-count limit. Hosting upload, memory, storage and execution limits still apply. 70 71 ### Sample CSV 72 73 Exported CSV files include a blank `new_cogs` column. Fill it with new costs and import the file. 74 75 ```csv 76 id,sku,new_cogs 77 123,PRODUCT-001,25.50 78 124,PRODUCT-002,40.00 79 ``` 80 81 Required headers are `new_cogs` and `id` or `sku`. Older files can use `cogs` if `new_cogs` is missing. 82 83 - Use either ID or SKU to identify products. 84 - If both are provided, they must match. 85 - Use decimal values without currency symbols. 86 - Blank costs are skipped. 87 - Duplicate product rows are excluded and listed in the error report. 88 89 XLSX imports read raw values from the first worksheet. Replace formulas with values and store SKUs as text to preserve leading zeros. 90 91 XLSX requires PHP's ZIP, XMLReader and DOM extensions. Exports use CSV format. 92 93 ### Preview and apply 94 95 Preview preparation runs in Action Scheduler batches without changing products. You can close the page and return to check progress. 96 97 When ready, review products, download validation errors, select products and click **Apply**. Preparation can be cancelled separately from an applied update. 98 99 Original uploads are deleted after preparation. Staged previews and reports expire after about 24 hours. Retention extends while an applied update is active. 100 101 ### History and retention 102 103 Operation history and original cost records follow the retention period set in Settings. See the retention FAQ below. Daily cleanup preserves active operations and data needed for reports. 104 105 The plugin also keeps records that prevent the same preview from being applied more than once, including simultaneous Apply requests. These records follow the configured retention period and are removed only when they are no longer needed. 77 106 78 107 = Run background updates with WP-CLI = 79 108 80 Use Action Scheduler's CLI runner to process the plugin queue while the editor continues to show progress and accept cancellations. See the [Action Scheduler documentation](https://actionscheduler.org/) for more information. 109 Use Action Scheduler's CLI runner for import preview preparation and confirmed updates while the editor continues to show progress and accept cancellations. See the [Action Scheduler documentation](https://actionscheduler.org/) for more information. 110 111 Import preview workers must run on the upload server under the same operating-system account as PHP. This lets them read the private temporary uploads. 112 113 If your shell uses a different account, ask your host to run the command under PHP's account. Ordinary product updates do not need the uploaded file. 114 115 During preparation, worker logs show the stage, checked row count, and batch size. Total and remaining row counts become available after reading finishes. 81 116 82 117 After uploading an import for preview or confirming an update in the editor, run this command from your WordPress directory: … … 88 123 `wp action-scheduler status --group=bulk-cogs-editor` 89 124 90 The status report covers the site's full Action Scheduler queue. The runner handles due plugin actions for all users, exits when none remain, and does not wait for retries. `--batch-size` counts actions, not products. 125 The status report covers the site's full Action Scheduler queue. 126 127 The run command processes due plugin actions for all users and exits when none remain. It does not wait for scheduled retries. `--batch-size` counts scheduled actions, not products. 91 128 92 129 If another worker owns the available batch, wait for it to finish or run: … … 94 131 `wp action-scheduler run --group=bulk-cogs-editor --batch-size=1 --batches=0 --force` 95 132 96 Operation locks prevent simultaneous work on one operation, but `--force` increases server load. Keep the normal runner enabled for retries. A host-approved cron may invoke the command with a process lock. 133 The plugin prevents two workers from changing the same operation simultaneously. Using `--force` can still increase server load. 134 135 Keep the normal background runner enabled for retries. If your host runs the command on a schedule, use a process lock to prevent overlapping command runs. 97 136 98 137 For performance checks, prefix the command with `time`. WooCommerce > Status > Logs under source `dkbce` records worker timing and runner details. 99 100 = Use cases =101 102 * **Supplier price change:** filter the affected products by category or brand, preview a percentage or fixed increase, then apply it to the matching products.103 * **Correct a specific group of products:** find products by title or SKU, select the ones to change, preview exact COGS values or clear them, then confirm the update.104 * **Add missing costs:** use "Set exact" to give a COGS value to products that do not have one yet.105 138 106 139 = Requirements = … … 140 173 141 174 = How do I bulk update Cost of Goods Sold (COGS) in WooCommerce? = 142 Go to Products > Bulk COGS Editor, filter the products you want to change, choose an action (set exact, increase or decrease by a percentage or fixed amount, or clear), review the preview, and confirm. Updates are applied in background batches.175 Use Bulk edit for one cost action across a selected group. Use CSV import when individual products need different values. The steps for both workflows appear above. 143 176 144 177 = Can I import WooCommerce product costs from CSV or Excel? = 145 Yes. Upload a UTF-8 CSV file or an Excel XLSX workbook with a `new_cogs` column and an `id` or `sku` column to identify each product. If both ID and SKU are supplied, they must identify the same product. Review the validated preview, select the products, and confirm before applying changes.178 Yes. Both formats support product IDs or SKUs. See the import section above for required columns, file requirements, and validation steps. 146 179 147 180 = Can I export product costs and import updated values? = 148 Yes. Export matching products to CSV, fill the blank `new_cogs` column with the updated costs, and import the file. Keep the product IDs or SKUs so each row matches the correct product. Review the preview and explicitly confirm the update; uploading a file alone does not change product costs.181 Yes. Keep the exported product IDs or SKUs unchanged when preparing your updates. Export produces CSV even if a previous import used XLSX; see the sample CSV above. 149 182 150 183 = Does this plugin work with WooCommerce's native Cost of Goods Sold feature? = 151 Yes. Bulk COGS Editor is designed specifically for WooCommerce's native Cost of Goods Sold (COGS) feature. COGS must be supported by your installed WooCommerce version and enabled in WooCommerce settings. If it is disabled or unavailable, the editor explains what is required. 152 153 = Which WooCommerce version do I need? = 154 WooCommerce 10.3 or later, with the Cost of Goods Sold feature enabled in WooCommerce settings. 184 Yes. It requires WooCommerce 10.3 or later with native COGS enabled. If the feature is disabled or unavailable, the editor explains what is required. 155 185 156 186 = Can I increase all product costs by a percentage? = 157 Yes. Filter the products you want, choose "Increase by percentage", enter the value, and review the preview before applying. You can also decrease by a percentage, or increase or decrease by a fixed amount.158 159 = Can I preview changes before applying them? =160 Yes. You can preview all proposed cost changes in a paginated table showing product images, current COGS, calculated COGS, and the exact difference before confirming any update. Previewing never modifies your store data.187 Yes. The percentage action applies to your selected products. Products without a saved cost are skipped; use Set exact cost to assign their initial values. 188 189 = Does preparing a preview change product costs? = 190 No. Finding products or validating an import only prepares a preview. Product costs change after you explicitly confirm the update. 161 191 162 192 = Do I need to read the documentation or watch the video before using the editor? = 163 The editor includes Help and instructions for Bulk edit, CSV Import, and CSV Export. The steps change with your selected task. Field guidance, cost examples, previews, and a confirmation summary help you review changes before applying them. Documentation and video links are available formore detail.193 No. The editor includes task-specific Help and instructions, field guidance, and cost examples. Use the documentation or video when you need more detail. 164 194 165 195 = Where can I see the result of my last update? = 166 Expand Recent activity to see the latest completed operation, its updated count, completion time, and elapsed time. Skipped or failed products and cancellation or failure outcomes are highlighted. Cancelling an operation keeps changes that were already saved.196 Expand Recent activity for the latest completed operation, including updated counts, completion time, elapsed time, and highlighted problems. Open History to inspect earlier operations. 167 197 168 198 = Can I roll back a completed update? = 169 199 170 Open History, select View details for the source operation, then choose Review rollback when retained original costs are available. Review the current and original values, check the confirmation, and choose Confirm rollback. Older summary-only or expired operations cannot be rolled back. Cancelling an operation keeps changes already saved; restoring them requires a separate rollback. 200 Open History, select View details, and choose Review rollback when original costs are retained. Compare current and original values, then choose Confirm rollback. 201 202 Expired operations and older records that contain only summary results cannot be rolled back. Restoring changes saved before cancellation also requires a separate rollback. 171 203 172 204 = What if product cost changed after the original update? = 173 205 174 Settings lets you choose whether new rollbacks overwrite current costs with the recorded original costs or skip products changed afterward. The chosen policy appears during review and remains fixed for that attempt. After a terminal incomplete rollback, review a new attempt for remaining products; products already restored are excluded even if edited again later. 206 Choose the skip-changed policy in Settings to preserve later cost edits. Choose overwrite to restore recorded original costs instead. The policy shown during review remains fixed for that rollback attempt. 207 208 If a rollback is cancelled or does not finish, review a new attempt for the remaining products. Already restored products are excluded, even if edited again later. 175 209 176 210 = How long is operation history retained? = 177 211 178 Choose 30 days, 90 days, or custom days in Settings. The default is 30 days; custom values support 1 to 36,500 days. Shortening retention also applies to existing history. Scheduled cleanup removes expired records, so extending retention cannot recover original values already deleted. 212 Choose 30 days, 90 days, or a custom period of 1 to 36,500 days in Settings. The default is 30 days. 213 214 Shortening retention also affects existing history. Extending it cannot recover original costs already deleted by scheduled cleanup. 179 215 180 216 = How does the plugin handle variable products and variations? = … … 194 230 195 231 = What happens to products without a COGS value during relative adjustments? = 196 Relative actions (percentage and fixed amount increases or decreases) skip products that do not have a COGS value set. To assign costs to those products, use the "Set exact" action.232 Percentage and fixed-amount adjustments skip products without a saved COGS value. Use Set exact cost to assign one. WooCommerce treats zero as empty; use Clear cost to remove a saved value. 197 233 198 234 = How are large catalogs processed? = 199 Updates run in background batches through Action Scheduler. Completion time depends on hosting and worker availability. Monitor progress in the editor; cancellation keeps changes already saved.235 Updates run in background batches, so you can close the browser and return to the editor for progress. Completion depends on hosting and background worker availability. Cancelling keeps changes already saved; it does not undo them. 200 236 201 237 = Does this plugin modify product prices? = 202 238 No. The plugin only modifies the WooCommerce Cost of Goods Sold value. 203 204 = Does it use an external service? =205 No. The plugin processes product data on your WordPress/WooCommerce installation.206 239 207 240 = Where can I give feedback? =
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)