Plugin Versions: 1.25.12 & 1.25.11
I have minimal PHP experience, but think I have this tracked down to the version / commit where this has broken.
If the project is short people please ping me with resources to get started and I will jump into fixing this issue myself. Happy to help where I can.
The shop owner received multiple orders and on a order with multiple products they select 'Create Shipping Label' on the following URLs page by going to the left menu 'Woocommerce' > 'orders' and clicking into a order with multiple products on the right
URL: https://shopowner.com/wp-admin/post.php?post=9124&action=edit
The Shop owner goes through the process of buying the label, but is returned to the above URL afterwards and an error is displayed Failed to retrieve shipping label refund status: Unexpected server error.
No 'shipment tracking' section has been populated on this page like would be normally be seen and the the 'Create Shipping Label' button is still present for the order though charges are happening and email receipts are being sent to the shop owner.
When I pop into a browser console and watch the network tab on the above URL I see the following endpoint fails with error 403 in plugin version 1.25.11 and 1.25.12.
https://shopowner.com/wp-json/wc/v1/connect/label/9124/3707992,3707991,3707980,3707979,3707972,3707971
when I switch to plugin version 1.25.10 the endpoint works but is queried in a different way where the endpoint is queried one time for each label id instead of just once like in plugin 1.25.11 and 1.25.12 .
https://shopowner.com/wp-json/wc/v1/connect/label/9124/3707992
https://shopowner.com/wp-json/wc/v1/connect/label/9124/3707980
In the plugin version 1.25.11 – 2021-04-06 the following change log was recorded.
Tweak – Update the shipping label status endpoint to accept and return multiple ids.
I believe the following commit might have something to do with this: Click For The Commit
Install 'WP Rollerback Plugin' and down grade the 'WooCommerce Shipping & Tax' to version - 1.25.10
Hey @ispeakcomputer , thanks for the super detailed bug report! It's really appreciated.
This indeed looks like a regression and should be fixed as soon as possible. I'm gonna give it critical priority, so it should be taken care of soon.
Thanks again for your help!
Hello @ispeakcomputer, thanks again for the detailed report! I've been looking into this issue a bit more and haven't been able to reproduce this. I can see those label IDs have been successfully purchased, so the error is only happening when trying to retrieve the label status, which should simplify things. As you noted the biggest difference between those versions is in trying to get multiple labels at once vs one at a time. The problem is if any one of the label statuses fails, the entire request will fail. A couple things that might help us narrow down the issue would be:
Thanks for any help in narrowing down this issue!
I will take care of this right this afternoon and report back. Just wanted to give an update to let you know I was working on it.
The answers to your questions are as follows:
Thank you again for the details, sorry to ask for one more thing. Within that network tab, on the failed requests, would you be able to provide the contents on the Preview tab? I'm looking to see if there is any message along with the 403 by any chance?
Great idea. Didn't think about any of this.
Looks like this could be a server misconfigure by looking at this. What do you think?
That does indeed look like a server level block. I did a quick test on the site and noticed that a comma in the URL causes the 403 response. You could look into any server configurations (or contact the hosting provider about this) or WordPress security plugins that may be performing this block.
Great thanks for the insights. Ill reach out to the hosting.