 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Thank you so much for sharing the steps and the report.
I have forwarded the information to the development team for further investigation. As soon as I have more information, I will immediately inform you.
I truly appreciate your kind cooperation in this matter.
Best regards,
Prosenjit
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hi There,
I hope you're doing well.
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.
Best regards,
Prosenjit
|
 aarniH
|
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.
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hi,
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.
Best regards,
Prosenjit
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
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
|