diff --git a/build/plugin-compatibility/woocommerce.php b/build/plugin-compatibility/woocommerce.php index 78cc515..1d5a7f8 100644 --- a/build/plugin-compatibility/woocommerce.php +++ b/build/plugin-compatibility/woocommerce.php @@ -26,9 +26,6 @@ class_exists( 'WooCommerce' ) return $options; } - // Do not preload 'add to cart' links. - $wc_ignores[] = preg_quote( 'add-to-cart=', '/' ); - // Do not preload the 'my account' page, as it is usually ressource heavy. $myaccount_page_id = get_option( 'woocommerce_myaccount_page_id' ); if ( $myaccount_page_id ) { @@ -36,14 +33,14 @@ class_exists( 'WooCommerce' ) } // Do not preload the cart, as it is usally ressource heavy. - $wc_ignores[] = '^' . preg_quote( $woocommerce->cart->get_cart_url(), '/' ); + $wc_ignores[] = '^' . preg_quote( wc_get_cart_url(), '/' ); // Do not preload the checkout url for the same reason as above. - $wc_ignores[] = '^' . preg_quote( $woocommerce->cart->get_checkout_url(), '/' ); + $wc_ignores[] = '^' . preg_quote( wc_get_checkout_url(), '/' ); // Do not preload the 'Payment' page, as it is usually ressource heavy. - if ( woocommerce_get_page_id( 'pay' ) ) { - $wc_ignores[] = '^' . preg_quote( get_permalink( woocommerce_get_page_id( 'pay' ) ), '/' ); + if ( wc_get_page_id( 'pay' ) ) { + $wc_ignores[] = '^' . preg_quote( get_permalink( wc_get_page_id( 'pay' ) ), '/' ); } // Remove possible empty strings and duplicates from the array. diff --git a/build/quicklink.php b/build/quicklink.php index 69838bc..943d0c6 100644 --- a/build/quicklink.php +++ b/build/quicklink.php @@ -71,6 +71,9 @@ function quicklink_enqueue_scripts() { // Do not preload wp-content items (like downloads). preg_quote( wp_parse_url( content_url(), PHP_URL_PATH ), '/' ), + + // Do not preload links with get parameters. + '.*\?.+', ), );