Issue:
Calling get_shipping_methods should not be called on every page load, but only when necessary. This call can be potentially quite heavy, as it checks with all shipping providers, if they are available, etc. This can be _super_ heavy, as it might even call external APIs!
WooCommerce knows this, and does a call to `get_shipping_methods()` only when absolutely necessary. WCML does this on _every_ init()!
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
Hello there!
This sounds indeed as something that should not be happening.
If you can give me the steps to recreate the problem in the sandbox site you used before, i'd be able to escalate the case ( hidden link ).
I'm asking this because went to the admin page of the sandbox to run a quick test. I used the query monitor plugin > Request > Hooks in use in different places of the admin screen but i didn't see any shipping related WC call.
However, you quote a stack trace so you probably used a different way to debug this, right? can you test it in the sandbox and check if the problem happens there as well + let me know the steps you took, please?
Hello! Please note that after the initial init hook, there are no hooks involved. It's just "normal" methods calling methods. Please also note that I am not talking about the admin / backend interface, but the front end! just going to /shop does the trick, sadly.
The stack trace is quite straightforward for this, but I assume you would need a developer environment and setting up XDEBUG.
As for if the `init`: It's called on plugin load (wp `init` hook), and for this you can find this in the screenshot for example.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Rome (GMT+02:00)
Hello!
I know it's been a while since my last reply. i just wanted to let you know that major performance fixes, including the one for this issue will be included into WooCommerce Multilingual V5.3.0.
This one was a tough one because when we had a stable version, WooCommerce changed a lot of the things we relied on and we had to start over and work in a more secure way 🙁