• Resolved Bartosz Drewniak

    (@bartech101)


    Plugin is identifying duplicate queries where it shouldn’t. I cached function output using static like this

    if ( ! 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)
  • Plugin Author John Blackbourn

    (@johnbillion)

    WordPress Core Developer

    Query Monitor fetches the queries directly from WordPress, so they must be running some how.

    Do the queries show up 24 times each in the main Queries panel?

Viewing 1 replies (of 1 total)
  • The topic ‘False positive duplicate queries’ is closed to new replies.