• Resolved Vijay Hardaha

    (@vijayhardaha)


    Hey there,

    I recently encountered a performance issue on one of our websites related to your plugin. The problem was brought to my attention by one of our clients who reported that the backend orders page was noticeably slow. In response, I decided to investigate the issue to identify the root cause of the slowdown and found that your plugin was contributing to the performance degradation.

    To troubleshoot this issue, I used Query Monitor to monitor various aspects of the page’s performance. My first step was to disable the WooCommerce actions that display action icons, but this had no significant impact on the page speed.

    Next, I decided to disable the Invoice column that our website relies on. Surprisingly, after disabling this column, the page performance improved significantly. This led me to inspect the code responsible for rendering the column data.

    Upon examining the file woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-admin.php, I noticed a function called invoice_columns_data($column, $post_or_order_object). In this function, you prepare two variables, $order and $invoice, for all columns, even though you only utilize them when the column name matches.

    This means that for each column, $order and $invoice are being prepared unnecessarily. If I’m not mistaken, this could result in significant overhead. To address this issue, I introduced a validation check at the beginning of the function, like so:

    if (!in_array($column, array('invoice_number_column', 'invoice_date_column'), true)) {
        return;
    }

    After implementing this validation, I observed a substantial improvement in page performance, with load times decreasing by approximately 30-40%. Without the validation, the total page load time was around 3.35 seconds, but with the validation in place, it reduced to 2.15 seconds.

    I kindly request that you review this issue based on my debugging findings. It appears that optimizing the preparation of $order and $invoice variables can lead to a significant improvement in the plugin’s performance. Your expertise in addressing this matter would be greatly appreciated.

    Thank you for your attention and for creating such a valuable plugin. We look forward to your feedback and any potential updates that can enhance the overall performance of the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @vijayhardaha,

    Thanks for the detailed report. I will elevate it to our team, so we check this and try to improve the invoice columns performance.

    I’ll keep you posted!

    Plugin Contributor alexmigf

    (@alexmigf)

    Hi @vijayhardaha

    Thank you for reporting this to us. We have introduced your suggestion now here, it should be in our next release.

    Hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Performance Issue with Your Plugin’ is closed to new replies.