kinsta_cache_purge ?? null; if ( is_object( $kinsta ) && \method_exists( $kinsta, 'purge_complete_caches' ) ) { self::attempt( [ $kinsta, 'purge_complete_caches' ] ); } if ( \defined( 'IS_PRESSABLE' ) || \defined( 'WPCOMSH_VERSION' ) ) { self::attempt( 'wp_cache_flush' ); } if ( isset( $_SERVER['X-LSCACHE'] ) && ! \headers_sent() ) { \header( 'X-LiteSpeed-Purge: *', false ); } foreach ( self::PURGE_ACTIONS as $hook ) { self::attempt( static function () use ( $hook ): void { \do_action( $hook ); } ); } } private static function isStaticMethod( string $class, string $method ): bool { if ( ! \class_exists( $class ) || ! \method_exists( $class, $method ) ) { return false; } return ( new \ReflectionMethod( $class, $method ) )->isStatic(); } private static function attempt( callable $purge ): void { try { $purge(); } catch ( \Throwable $e ) { return; } } }