Title: Debug logger affecting PDP performance
Last modified: May 9, 2026

---

# Debug logger affecting PDP performance

 *  Resolved [dev](https://wordpress.org/support/users/devksec/)
 * (@devksec)
 * [1 month ago](https://wordpress.org/support/topic/debug-logger-affecting-pdp-performance/)
 * Hello,
   This is a debug logger that shipped to production
 * plugins/conditional-extra-fees-for-woocommerce/admin/class-payment-processing-
   fee.php:59-72:
 *     ```wp-block-code
       add_filter( 'woocommerce_available_payment_gateways', [$this, 'log_available_gateways'], -100 );function log_available_gateways( $gateways ) {    $logged_gateways = [];    foreach ( $gateways as $gateway_id => $gateway ) {        $logged_gateways[ $gateway_id ] = $gateway->get_title();    }    // Save it for later use (e.g., print_r in debug bar or log)    update_option( 'pisol_logged_gateways', $logged_gateways );    return $gateways;}
       ```
   
 * The CEFW author’s own comment confirms it’s **purely a debug aid**. It does three
   terrible things on every PDP render:
    1. **Hooks at priority -100** (runs before everything), on every `get_available_payment_gateways()`
       call
    2. **Calls `get_title()` on every gateway** — which triggers Stripe’s `filter_gateway_title`
       callback that does `wc_get_order()` lookups
    3. **Calls `update_option('pisol_logged_gateways', …)`** — a database UPDATE every
       time the function runs, on a hot path that fires ~6× per request
 * Impact estimate
    - Eliminates **all 90 wc_orders SELECTs per PDP render**
    - Eliminates **6 `update_option()` writes per PDP render** (~6 INSERT/UPDATE
      on `_options`)
    - The function returns `$gateways` unchanged, so removal has **zero functional
      impact** on CEFW’s actual extra-fees feature
      Please can you investigate and
      remove if not expected?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [jyotsnasingh520](https://wordpress.org/support/users/jyotsnasingh520/)
 * (@jyotsnasingh520)
 * [1 month ago](https://wordpress.org/support/topic/debug-logger-affecting-pdp-performance/#post-18903683)
 * Hi,
 * Thank you for raising this concern. This function is not intended for error logging;
   rather, it utilizes the array that we create within the plugin. We will be modifying
   the function to ensure it no longer calls the `get_title` function repeatedly
   and to prevent unnecessary `update_option` executions. Additionally, we will 
   implement a check to determine whether any data has actually been modified before
   proceeding, so that redundant operations are avoided.
 *  Plugin Author [jyotsnasingh520](https://wordpress.org/support/users/jyotsnasingh520/)
 * (@jyotsnasingh520)
 * [4 weeks, 1 day ago](https://wordpress.org/support/topic/debug-logger-affecting-pdp-performance/#post-18904251)
 * Hi,
 * We have released a new version **1.1.49.46** in this we have optimized this function

Viewing 2 replies - 1 through 2 (of 2 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdebug-logger-affecting-pdp-performance%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/conditional-extra-fees-for-woocommerce/assets/icon.svg?rev
   =2538481)
 * [PiWeb Conditional cart fee / Extra charge rule for WooCommerce](https://wordpress.org/plugins/conditional-extra-fees-for-woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/conditional-extra-fees-for-woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/conditional-extra-fees-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/conditional-extra-fees-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/conditional-extra-fees-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/conditional-extra-fees-for-woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jyotsnasingh520](https://wordpress.org/support/users/jyotsnasingh520/)
 * Last activity: [4 weeks, 1 day ago](https://wordpress.org/support/topic/debug-logger-affecting-pdp-performance/#post-18904251)
 * Status: resolved