From 0c5db517390a0c47ff597f5e94f5628f5e4e02a7 Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Thu, 23 Apr 2026 23:50:44 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20guard=20is=5Fwoocommerce()=20with=20func?= =?UTF-8?q?tion=5Fexists()=20=E2=80=94=20fatal=20when=20WC=20not=20active?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Call to undefined function is_woocommerce() in perf-asset-policy.php:69 caused a 500 on all page loads. WooCommerce is not active on this site. Added function_exists() guard so the WC asset dequeue block is skipped when WooCommerce is not installed. --- inc/perf-asset-policy.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/perf-asset-policy.php b/inc/perf-asset-policy.php index da75c9a..90f4d13 100644 --- a/inc/perf-asset-policy.php +++ b/inc/perf-asset-policy.php @@ -66,7 +66,7 @@ function peptide_starter_perf_dequeue_plugin_assets() { } // WooCommerce assets: dequeue on non-shop pages. - if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) { + if ( function_exists( 'is_woocommerce' ) && ! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page() ) { // Get configured WC handles from filter; default list. $wc_styles = apply_filters( 'peptide_starter_perf_woocommerce_styles',