• Resolved simplevendor

    (@simplevendor)


    I am trying to figure out why the processing time for this task takes so long and if there is a solution. We update product sales pricing by going to Products > Check all products in a category > Under Bulk Actions at the top select “Edit” and click Apply. When the form appears we go to sales and select “Set to regular price decreased by (fixed amount or %)” and on the textfield enter “20%”. Then click Update. It typically takes 5 seconds per product to update, so if we update 100 products at a time it will take 3-5 minutes to process. Is there a faster solution or some fix to make this quicker besides selecting less products? We typically run sitewide sales and have thousands of products to update at once. Our staging site currently has WordPress 6.6.1, Woocommerce 9.1.4, and the latest 2024 theme running. The server uses PHP 8.2. Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @simplevendor,

    Thanks for reaching out.

    The time it takes to update products in bulk largely depends on the server’s resources. Even though your server uses PHP 8.2, which is quite efficient, the process might still take time if the server’s CPU and memory resources are limited.

    However, there are a few steps you can try to potentially improve the processing time:

    1. Increase Server Resources: If possible, consider increasing the memory limit and max execution time in your server’s PHP settings. This could allow for quicker processing of bulk actions.

    2. Use a Plugin: There are several plugins available that can help optimize bulk actions. For example, the Bulk Price Update for WooCommerce plugin is designed to handle bulk price changes more efficiently.

    3. Database Optimization: Regularly optimizing your database can also help improve performance.

    4. Disable Unnecessary Plugins: If you have plugins activated that you do not currently need, consider deactivating them. Some plugins can slow down your site, especially during bulk operations.

    Remember to always backup your site before making any major changes.

    Let us know if this helps.

    Thread Starter simplevendor

    (@simplevendor)

    Thanks for the feedback, here’s some more details:

    1. Our server was currently set to use 4032M for memory_limit and 1000 for max_execution_time. This seems like a good amount over default. Our server has 8G of Ram and we never really max out the CPU.
    2. Why would a plugin work more efficiently than the default bulk edit built into WordPress? I can look into that third-party plugin.
    3. We currently use the default databaes tables and indexes for wordpress and woocommerce and have also use the Index WP MySQL for Speed plugin that adds in high performance indexing. In either case the response time is pretty slow while doing bulk edits.
    4. On the staging site we only have WordPress and Woocommerce enabled. The theme is also the standard 2024 theme.
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello simplevendor,

    Thank you for your reply.

    The server specs you have are more than enough.
    But the 5 seconds per product for updating is slow.

    For comparison, I updated the sale price on my test site using the same steps.
    All of the 20 products were updated in less than 3 seconds.

    As a test, could you select 20 products manually and update the sale price?
    This will provide further insights into the problem.

    To help you further, I’d like to review your site’s System Status Report.
    You can find it via WooCommerce > Status.
    Select Get system report and then Copy for support.

    Once you’ve done that, you can paste the text in https://gist.github.com
    After that, you can paste the Gist link here in your reply.

    Looking forward to your response. ??

    Best regards.

    Thread Starter simplevendor

    (@simplevendor)

    Here is the Gist link: https://gist.github.com/phpdevop/a1fb0da3c9a8f02e91e11414a72647ba

    I manually selected 20 products and then went to Bulk Actions > Edit and set the sales price. It took about 45 seconds to complete the process.

    Thread Starter simplevendor

    (@simplevendor)

    Our host has also been looking into the performance issue and said that the database interactions appear in the slow log, not sure if there’s a way to optimize the table or re-build it with the correct keys if any are missing?

    Here is what they said:

    The above slow log indicates that the time-consuming operations are primarily related to database interactions and bulk processing of posts. Optimizing database performance and reviewing the efficiency of these functions could help improve speed.

    You may consider involving a developer to look into the database optimization & the woocommerce functions involved.

    Here are the entries in the log:

    script_filename = /wp-admin/edit.php
    mysqli_query() /wp-includes/class-wpdb.php:2344
    _do_query() /wp-includes/class-wpdb.php:2258
    query() /wp-includes/class-wpdb.php:3026
    get_var() /wp-content/plugins/woocommerce/includes/wc-term-functions.php:490
    _wc_term_recount() /wp-includes/taxonomy.php:3566
    wp_update_term_count_now() /wp-includes/taxonomy.php:3549
    wp_update_term_count() /wp-includes/post.php:7910
    _update_term_count_on_transition_post_status() /wp-includes/class-wp-hook.php:324
    apply_filters() /wp-includes/class-wp-hook.php:348
    do_action() /wp-includes/plugin.php:517
    do_action() /wp-includes/post.php:5521
    wp_transition_post_status() /wp-includes/post.php:4781
    wp_insert_post() /wp-includes/post.php:4993
    wp_update_post() /wp-admin/includes/post.php:703
    bulk_edit_posts() /wp-admin/edit.php:194
    Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @simplevendor

    Thanks for sharing further details.

    From the logs you’ve shared, the bulk update process is slowing down due to the recounting of terms (categories, tags, etc.) for each product update. This is necessary to ensure accurate counts on your site, but it can slow things down when updating many products at once.

    One possible solution to this issue could be to disable the term recounting during the bulk update process and manually trigger a term recount after all updates have been completed. This should speed up the bulk update process significantly. However, this would require custom coding, and you may need to hire a developer if you’re uncomfortable with it.

    Another possible solution is to use a plugin that handles bulk updates more efficiently, like the Bulk Edit Products, Prices, and Attributes for WooCommerce or Product Bulk Editor for WooCommerce. While WooCommerce and WordPress’s default bulk edit tool is designed to handle a wide range of tasks, some plugins are specifically optimized for bulk updates of WooCommerce products.

    Furthermore, you may need to consider optimizing your database. This could involve cleaning up old data, optimizing tables, or upgrading your database server. Again, you might need a developer’s assistance with this.

    I hope this helps. If you have any further questions, please don’t hesitate to ask.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.