Thanks for reaching out @yannielsen . Klaviyo’s plugin does not trigger order updates. Klaviyo’s WooCommerce integration only subscribes to order-related webhooks via the order.update topic, note that this subscription is managed outside of the plugin.
If you’re seeing an excessive number of order updates I would recommend investigating other plugins that might manipulate orders directly. These updates trigger the webhooks to Klaviyo and are causing a backup in the Action Scheduler.
If you wish to pause webhook sending for the order.update topic you may do so manually under WooCommerce > Settings > Advanced > Webhooks. Please note, this may delay order-related events (Placed Order, Ordered Product, etc.) from being recorded in your Klaviyo account as these will instead be saved via periodic sync every 60 minutes.
Don’t hesitate to reach out if you have any further questions.
Hi @scottklaviyo
Thank you for you reply, we wen digging a bit futher and found the cause of the issue seemed to be an underlying bug in WooCommerce Subscription where subscriptions that were cancelled got called again and again with order updates.
We were able to locate the Stack Trace of it through this method:
add_action('woocommerce_update_order', 'yanco_woocommerce_update_order', 10, 1);
function yanco_woocommerce_update_order($order_id)
{
$wc_logger = wc_get_logger();
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 20);
$formatted_trace = '';
foreach ($trace as $i => $frame) {
$file = isset($frame['file']) ? $frame['file'] : '';
$line = isset($frame['line']) ? $frame['line'] : '';
$function = isset($frame['function']) ? $frame['function'] : '';
$class = isset($frame['class']) ? $frame['class'] : '';
$formatted_trace .= "#$i $file($line): $class$function()\n";
}
$wc_logger->debug(
"Order #$order_id updated",
array(
'stack' => $formatted_trace,
'source' => 'order_update_debug',
'order_id' => $order_id,
'action' => 'woocommerce_update_order',
)
);
}
This should not be left running for a long time as it can log quite a bunch of data on a system that has a lot of subscriptions on it 😅
Thanks for following up, @yannielsen . I’m glad you were able to locate the source of the excessive order updates and thanks for sharing your debugging process.