Repository navigation
fix: sync WooCommerce Shipment Tracking to PayPal again - #4747
Merged
Conversation
…e request Tracking a merchant added through WooCommerce Shipment Tracking never reached PayPal. Both plugins answer the same AJAX action at the default priority, and that plugin registers first and ends its own handler with die(), so this callback was never reached at all. Nothing was logged, because the code that logs sits inside the callback that never ran, which is why the report stood for months with nothing to go on. Priority 5 puts it ahead of that handler. It reads the tracking from the request rather than from what the other plugin stores, so running first costs it nothing.
The registration is the regression: drop the priority argument and the sync stops silently, with nothing failing and nothing logged. Covered alongside the REST path it shares the class with, and the submissions that should and should not reach PayPal.
Narek13
requested review from
AlexP11223,
Dinamiko,
danieldudzic,
mmaymo and
stracker-phil
as code owners
September 25, 2026 12:05
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 🔗 Test this pull request with WordPress Playground What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit f03300c • Last updated: 2026-09-25T12:09:14.008Z |
Three lines rather than six, and a block comment, which is the house style for more than one line above a hook registration.
Dinamiko
approved these changes
Sep 28, 2026
Dinamiko
approved these changes
Sep 28, 2026
Dinamiko
deleted the
dev/PCP-6263-package-tracking-breaks-compatibility-with-woo-commerce-shipment-tracking
branch
September 28, 2026 10:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking added through WooCommerce Shipment Tracking never reached PayPal. The PayPal Package Tracking box stayed empty and nothing appeared in the logs.
Why
Both plugins answer
wp_ajax_wc_shipment_tracking_save_format the default priority. WooCommerce Shipment Tracking registers first and ends its handler withdie(), so ours never ran:The only logging sits inside that callback, which is why the report stood since April with nothing to go on.
The fix
Priority 5, ahead of that handler. The callback reads the tracking from the request, not from what the other plugin stores, so running first costs it nothing.
Hooking
wc_shipment_tracking_before_add_tracking_itemswould be tidier but it is absent from older versions, and the compat gate checks no version at all.Verified
On the admin order screen with WooCommerce Shipment Tracking 2.3.1:
ShipStation, which the ticket also names, was tested separately and works: firing
woocommerce_shipstation_shipnotifysynced the tracking to PayPal and it reads back. Its integration hooks ShipStation's own action, so this trap never applied. That half of the report does not reproduce.Test steps
Couldn't sync tracking information: …— either way the callback ran.