The development team has provided an update after a detailed analysis of the profiler. They pinpointed the cause of the delay experienced on your side. The primary issue stems from a specific function that was invoked repeatedly, and with each call, hooks from WCML were also triggered, which contributed to the slowdown.
However, our dev team has found a potential workaround for this issue. After implementing the solution, we noticed that the time required to complete the request was reduced by approximately 40%. Please check the Blackfire comparison from this link: hidden link
Here's what you have to do:
- Please open the 'functions.php' file of your theme
- Add the following code to the file:
add_filter('rest_pre_dispatch', function ($result, $server, $request) {
global $woocommerce_wpml;
// $request contains the request parameters
$params = serialize($request->get_params());
if (str_contains($params, 'stock_quantity')){
remove_filter( 'get_post_metadata', [ $woocommerce_wpml->products, 'filter_product_data' ] );
}
return $result;
}, 10, 3);
- Once added, try to batch update the stock.
To see the difference in performance, you could first update the stock in batches using the code workaround, and then perform the update again without using the workaround. Please pay attention and test it thoroughly and hopefully, you'll also notice the improvement.
Please let me know the update. We will be happy to help if you need further assistance in this matter.
With plugin enabled and with the fix, it's about 31% faster than without the fix. However disabling the plugin makes it over 90% faster than even with the fix enabled.
I made 3 more profiler dumps, could you please re-enable the hidden field.
Thank you for the update. The WooCommerce Multilingual contains multiple synchronization mechanisms, which is why, achieving the 90% improved result could be difficult, but not impossible. Our development team is actively working on optimizing the performance of the WCML plugin and we are expecting that the performance will be improved a lot in the upcoming versions.
However, I have enabled the private box for you so that you can securely share the profiler. I'm hopeful that this will provide us with insights that could help in improving the performance.
Looking forward to your responses and I appreciate your continuous cooperation in this matter.
I appreciate your understanding. It's important to note that certain filters and actions within WCML may require some time to execute, as they are crucial for its proper functionality.
However, Thank you so much for sharing the profiler. I've forwarded it to our team for a more detailed analysis. As soon as I have more information on this, I will inform you.
Thanks a lot for your cooperation and patience while we are working on this issue.
Best regards,
Prosenjit
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.