-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HC] woocommerce.com requested on every admin page #2738
Comments
I added these lines to the beginning of the add_sift_js_tracker method in "woocommerce-services.php":
So now the tracker is only added to pages where I think it is needed. Maybe this can be solved by the page that requires the tracker to set some global variable that is being checked in the method instead of checking a list of pages in the method. |
Is there a reason it needs to load on the orders page? Ideally there wouldn't be any external requests impacting the load time on the order listings page as it will be requested often. If it is required is there any way to cache the api.woocommerce.com/payment/sift get request for a short period or does the nonce, signature etc returned from that request need to be dynamic. Bear in mind the wc-orders page is only for when HPOS is enabled otherwise the standard post type edit screen is requested (edit.php?post_type=shop_order) |
I'm not 100% sure what this thing is used for, but I guess it's for creating Shipping Labels and on the wc-orders page (or the shop_order page) you can create Shipping Labels. But, I will leave this conversation as I uninstalled the plugin, because in my search through why we have it in the first place I found out, that we don't need it. We had another Plugin for the Labels. |
If WooCommerce needs to load external scripts, it should use proper WordPress enqueue hooks, so that we can dequeue them at least, or add an option in the WooCommerce settings.
|
agreed with all of the above. I tried using remove_action to get rid of this to no avail |
Any update to fix this in the near future or maybe provide a code that will only call the API on necessary pages. |
The https://api.woocommerce.com/payment/sift URL is being requested on every page in the admin, adding .67s (depending on the server response time) to the page generation time of admin pages.
The external request to the sift URL is found within the admin_print_footer_scripts action in the woocommerce-services\woocommerce-services.php file, on line #897:
add_action( ‘admin_print_footer_scripts’, array( $this, ‘add_sift_js_tracker’ ) );
This will load the “add_sift_js_tracker” function on every admin page, which then requests https://api.woocommerce.com/payment/sift
This can be seen below in the add_sift_js_tracker function which calls “get_sift_configuration” that makes the HTTP request to the woocomerce.com/payment/sift URL
Here is a tool to see the response time of that request from around the world:
https://tools.keycdn.com/performance?url=https://api.woocommerce.com/payment/sift
From Sydney it’s taking .74s to respond . This adds .74s to the backend page generation whilst WordPress waits for the request to finish.
From what I gather, related to #2689 .
Reported at:
The text was updated successfully, but these errors were encountered: