Developer hooks
PremiumTune batch behavior, customize order notes, and react when a CSV job finishes.
Reviewed 2026-10-20
These hooks are available in version 1.15.8. The current names use the
laqi_cosc_ prefix; the former csv_order_status_changer_ names are no longer
called. Update older customizations to use the names below.
Processing filters
Each filter receives the current integer value and must return the value to use.
| Filter | Controls | Default | Minimum |
|---|---|---|---|
laqi_cosc_chunk_size | Rows per interactive request | 1 | 1 |
laqi_cosc_batch_size | Rows per background batch | 25 | 1 |
laqi_cosc_batch_delay | Seconds between background batches | 0 | 0 |
The interactive default favors smooth live progress. A background delay of 0
queues the next batch immediately. Values below the minimum are clamped to it.
Test changes on a staging store: larger batches reduce requests but increase the
work and failure impact of each request.
Order-note filter
laqi_cosc_order_note filters the note passed to WooCommerce when applying a
status change. It receives three arguments:
$note(string): the default translated note, “Status changed by Laqi CSV Order Status Changer.”$order_id(int): the WooCommerce order ID.$new_status(string): the target status without thewc-prefix.
Return the note text. Register the callback with 3 accepted arguments when it
needs the order ID or target status. Validation-only runs and skipped rows do not
call this filter. Keep notes useful for store staff and avoid credentials or
unnecessary customer information.
Completion action
laqi_cosc_after_process fires when an interactive or background job completes.
Its single argument, $log, is an array of result rows capped at the first
1,000 entries. It is not a complete row-by-row record of larger files.
The action also fires for completed validation-only jobs and jobs containing skipped or errored rows. Completion means processing has finished; it does not prove that orders changed or that every row succeeded. The action receives only the log, without a separate job summary or validation flag. Cancelled jobs do not fire this completion action.
Troubleshooting logs
laqi_cosc_enable_logging receives a boolean, defaulting to false. Return
true to send caught status-change exceptions to WooCommerce logging. The log
source is csv-order-status-changer; entries include the exception message,
order ID, and target status.
Enable logging only while investigating a failure and avoid logging sensitive file contents in additional custom code.