includes/Integrations/class-woo-detect.php
Woo_Detect boundary — WooCommerce detection, excluded paths, and self-test.
Class Woo_Detect
Class Woo_Detect
final class Woo_Detectpublicstatic is_woo_safe_mode_enabled()
public static function is_woo_safe_mode_enabled(?array=null $settings): boolWhether WooCommerce safe mode is enabled. Parameter Type Default Description $settings?array=null— Optional settings array (defaults to get_settings()).
Return: bool — True when safe mode is enabled.
publicstatic is_woo_store_api_path()
public static function is_woo_store_api_path(string $path): boolWhether a normalized request path is a WooCommerce Store API route. Parameter Type Default Description $pathstring— Request path (leading slash optional) or a `rest_route` value.
Return: bool — True when the path is a Store API route.
publicstatic is_woo_store_api_request()
public static function is_woo_store_api_request(string=\'\' $path, ?string=null $query_string, ?string=null $rest_route): boolWhether the current request targets a WooCommerce Store API route. Parameter Type Default Description $pathstring=\'\'— Request path (leading slash optional). $query_string?string=null— Optional raw query string (defaults to `$_SERVER[\’QUERY_STRING\’]`). $rest_route?string=null— Optional `rest_route` value (defaults to `$_GET[\’rest_route\’]`).
Return: bool — True when the request is a Store API request.
publicstatic is_woo_dynamic_path()
public static function is_woo_dynamic_path(string $path): boolWhether a request path belongs to a WooCommerce dynamic page. Parameter Type Default Description $pathstring— Request path (leading slash optional).
Return: bool — True when the path is Woo-dynamic.
publicstatic get_woo_excluded_paths()
public static function get_woo_excluded_paths(): arrayRelative paths treated as WooCommerce endpoints for static-cache bypass.
Return: string[] — Relative paths (e.g. `cart`, `shop/basket`), unique, lowercased.
publicstatic is_woo_active()
public static function is_woo_active(): boolWhether WooCommerce is active on the current site.
Return: bool — True when any WooCommerce symbol is available.
publicstatic is_woo_faceted_query()
public static function is_woo_faceted_query(?string=null $query_string): boolWhether a query string carries WooCommerce layered-nav / faceted-filter params. Parameter Type Default Description $query_string?string=null— Raw query string. Defaults to `$_SERVER[\’QUERY_STRING\’]`.
Return: bool — True when faceted params are present.
publicstatic is_woo_ajax_request()
public static function is_woo_ajax_request(string=\'\' $path, string=\'\' $query_string): boolWhether path/query values indicate a WooCommerce AJAX endpoint. Parameter Type Default Description $pathstring=\'\'— Request path (leading slash optional). $query_stringstring=\'\'— Raw query string (without leading `?`).
Return: bool — True when the values indicate a wc-ajax request.
publicstatic is_woo_add_to_cart_request()
public static function is_woo_add_to_cart_request(string=\'\' $query_string): boolWhether a query string carries a WooCommerce add-to-cart action. Parameter Type Default Description $query_stringstring=\'\'— Raw query string (without leading `?`).
Return: bool — True when the query carries an add-to-cart action.
publicstatic is_woo_excluded_url()
public static function is_woo_excluded_url(string $url, string=\'\' $query, string=\'\' $rest_route): boolWhether an absolute URL targets a WooCommerce dynamic route. Parameter Type Default Description $urlstring— Absolute URL. $querystring=\'\'— Optional pre-parsed query string (parsed from $url when \’\’). $rest_routestring=\'\'— Optional pre-parsed rest_route value.
Return: bool — True when the URL must not be cached/preloaded.
publicstatic woo_cache_self_test()
public static function woo_cache_self_test(): arrayVerifiable WooCommerce cart/checkout cache-exclusion self-test.
Return: array{woo_active: — bool, safe_mode: bool, runnable: bool, excluded_paths: string[], donotcachepage_honored: bool, checks: array<int, array{url: string, path: string, is_dynamic: bool, cacheable: bool, donotcachepage_honored: bool, pass: bool, error?: string}>, fragment_checks: array<int, array{url: string, path: string, is_dynamic: bool, cacheable: bool, donotcachepage_honored: bool, pass: bool, error?: string}>, editor_checks: array<int, array{url: string, bypass: bool, cacheable: bool, donotcachepage_honored: bool, pass: bool, error?: string}>, preload_checks: array<int, array{url: string, path: string, skipped: bool, pass: bool, error?: string}>, cart_checks: array<int, array{key: string, url: string, bypass: bool, cacheable: bool, donotcachepage_honored: bool, pass: bool, error?: string}>, force_exclude: bool, all_pass: bool} Structured self-test result.
Hooks
Hooks referenced in includes/Integrations/class-woo-detect.php: Hook Type Line Notes wppo_woo_faceted_query_paramsfilter 348 —