registered as $handle => $item ) { $src = is_object( $item ) && isset( $item->src ) && is_string( $item->src ) ? $item->src : ''; if ( '' !== $src && ( false !== strpos( $src, '/aiolos-checkout-for-woocommerce/' ) || false !== strpos( $src, '/aiolos-checkout-pro/' ) ) ) { $handles[] = (string) $handle; } } return $handles; } /** * Adds our stylesheet paths to a list of patterns. * * @param mixed $patterns Patterns. * @return array */ public static function append_styles( $patterns ): array { $patterns = is_array( $patterns ) ? $patterns : array_filter( array( (string) $patterns ) ); return array_values( array_unique( array_merge( $patterns, self::STYLE_MARKERS ) ) ); } /** * Adds our stylesheet paths to a comma-separated list (Autoptimize). * * @param mixed $list List. */ public static function append_css_csv( $list ): string { $list = is_scalar( $list ) ? trim( (string) $list ) : ''; return ( '' === $list ? '' : rtrim( $list, ', ' ) . ', ' ) . implode( ', ', self::STYLE_MARKERS ); } /** * WP Rocket: WordPress's script packages are not delayed. * * @param mixed $patterns Patterns. * @return array */ public static function append_wp_dist( $patterns ): array { $patterns = is_array( $patterns ) ? $patterns : array_filter( array( (string) $patterns ) ); if ( ! in_array( self::WP_DIST, $patterns, true ) ) { $patterns[] = self::WP_DIST; } return array_values( $patterns ); } /** * Adds our inline script markers to a list of inline contents. * * @param mixed $contents Contents. * @return array */ public static function append_inline( $contents ): array { $contents = is_array( $contents ) ? $contents : array(); return array_values( array_unique( array_merge( $contents, array( 'aiolosSideCart', 'aiolosCheckout', 'aiolosCompat', 'wc_checkout_params' ) ) ) ); } /** * WP Rocket: on the checkout, nothing is delayed. * * @param mixed $patterns Patterns. * @return array */ public static function exclude_everything( $patterns ): array { $patterns = is_array( $patterns ) ? $patterns : array(); $patterns[] = '(.*)'; return $patterns; } /** * Clears the page caches (after the settings change what pages show). */ public static function purge_all(): void { // phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment if ( function_exists( 'rocket_clean_domain' ) ) { rocket_clean_domain(); } if ( function_exists( 'rocket_clean_minify' ) ) { rocket_clean_minify(); } do_action( 'litespeed_purge_all' ); if ( function_exists( 'w3tc_flush_all' ) ) { w3tc_flush_all(); } if ( function_exists( 'wp_cache_clear_cache' ) ) { wp_cache_clear_cache(); } if ( isset( $GLOBALS['wp_fastest_cache'] ) && is_object( $GLOBALS['wp_fastest_cache'] ) && method_exists( $GLOBALS['wp_fastest_cache'], 'deleteCache' ) ) { $GLOBALS['wp_fastest_cache']->deleteCache( true ); } if ( function_exists( 'sg_cachepress_purge_cache' ) ) { sg_cachepress_purge_cache(); } if ( class_exists( '\autoptimizeCache' ) && method_exists( '\autoptimizeCache', 'clearall' ) ) { \autoptimizeCache::clearall(); } if ( class_exists( '\FlyingPress\Purge' ) && method_exists( '\FlyingPress\Purge', 'purge_everything' ) ) { \FlyingPress\Purge::purge_everything(); } do_action( 'wphb_clear_page_cache' ); do_action( 'cache_enabler_clear_complete_cache' ); do_action( 'breeze_clear_all_cache' ); do_action( 'rt_nginx_helper_purge_all' ); // phpcs:enable } }