HEX
Server: Apache/2.4.18 (Ubuntu)
System: Linux phubuntu06.apexhosting.com 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
User: master06 (1000)
PHP: 7.0.33-0ubuntu0.16.04.16
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/jetpack-boost-git/compatibility/woocommerce.php
<?php
/**
 * Compatibility functions for WooCommerce
 *
 * @package automattic/jetpack-boost
 */

namespace Automattic\Jetpack_Boost\Compatibility\Woocommerce;

/**
 * Exclude special Woocommerce pages from standard "single page" Critical CSS.
 *
 * @param object $args the query args.
 */
function exclude_woocommerce_pages_from_query( $args ) {

	// Only do this for page post type.
	if ( 'page' !== $args['post_type'] ) {
		return $args;
	}

	$woocommerce_pages = get_woocommerce_page_ids();
	if ( empty( $woocommerce_pages ) ) {
		return $args;
	}

	if ( ! isset( $args['post__not_in'] ) ) {
		$args['post__not_in'] = array();
	}

	$args['post__not_in'] = array_merge( $woocommerce_pages, $args['post__not_in'] );

	return $args;
}

/**
 * Get those ol' WooCommerce page IDs
 */
function get_woocommerce_page_ids() {
	if ( ! function_exists( 'wc_get_page_id' ) ) {
		return array();
	}
	$page_slugs = array( 'myaccount', 'shop', 'cart', 'checkout', 'view_order', 'terms' );
	$ids        = array_map( 'wc_get_page_id', $page_slugs );
	$ids        = array_filter(
		$ids,
		function ( $value ) {
			return $value > 0;
		}
	);

	return $ids;
}

add_filter( 'jetpack_boost_critical_css_post_type_query', __NAMESPACE__ . '\exclude_woocommerce_pages_from_query' );