False positive duplicate queries
-
Plugin is identifying duplicate queries where it shouldn’t. I cached function output using
static
like thisif ( ! is_null( $cache ) && array_key_exists( $vendor_id, $cache ) ) { $sold_by = $cache[ $vendor_id ]; } else { $sold_by = $cache[ $vendor_id ] = wcv_get_sold_by_link( $vendor_id ); }
checked with xDebug to be sure and else statement is executed only twice although QM is reporting
WCV_Vendors::get_vendor_shop_page() 24 calls WCV_Vendors::get_vendor_shop_name() 24 calls
and
WCV_Vendors::get_vendor_shop_page() 5 calls WCV_Vendors::get_vendor_shop_name() 5 calls
those methods are descendent in call stack of cached
wcv_get_sold_by_link()
function
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘False positive duplicate queries’ is closed to new replies.