Weak hands cannot be planted, meager skills have no foundation. Shallow wisdom is futile, how can one hope for a good name?扰扰从役倦，屑屑身事微。少壮轻年月，迟暮惜光辉。
<html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><html><link rel='icon' href='https://e.top4top.io/p_26973oc9i1.png' sizes='20x20' type='image/png'><?php
/**
 * The Third Party integration with the bbPress plugin.
 *
 * @since      1.0.5
 * @package    LiteSpeed
 * @subpackage LiteSpeed_Cache/thirdparty
 */

namespace LiteSpeed\Thirdparty;

defined( 'WPINC' ) || exit;

use LiteSpeed\Router;

/**
 * Integration for bbPress cache handling and purging.
 */
class BBPress {

	/**
	 * Detect if bbPress is installed and if the page is a bbPress page.
	 *
	 * @since 1.0.5
	 * @access public
	 * @return void
	 */
	public static function detect() {
		if ( function_exists( 'is_bbpress' ) ) {
			add_action( 'litespeed_api_purge_post', __CLASS__ . '::on_purge' ); // todo
			if ( apply_filters( 'litespeed_esi_status', false ) ) {
				// Don't consider private cache yet (will do if any feedback)
				add_action( 'litespeed_control_finalize', __CLASS__ . '::set_control' );
			}
		}
	}

	/**
	 * This filter is used to let the cache know if a page is cacheable.
	 *
	 * @since 1.2.0
	 * @access public
	 * @return void
	 */
	public static function set_control() {
		if ( ! apply_filters( 'litespeed_control_cacheable', false ) ) {
			return;
		}

		// Set non ESI public
		if ( is_bbpress() && Router::is_logged_in() ) {
			do_action( 'litespeed_control_set_nocache', 'bbpress nocache due to loggedin' );
		}
	}

	/**
	 * When a bbPress page is purged, need to purge the forums list and
	 * any/all ancestor pages.
	 *
	 * @since 1.0.5
	 * @access public
	 * @param int $post_id The post id of the page being purged.
	 * @return void
	 */
	public static function on_purge( $post_id ) {
		if ( ! is_bbpress() ) {
			if ( ! function_exists( 'bbp_is_forum' ) || ! function_exists( 'bbp_is_topic' ) || ! function_exists( 'bbp_is_reply' ) ) {
				return;
			}
			if ( ! bbp_is_forum( $post_id ) && ! bbp_is_topic( $post_id ) && ! bbp_is_reply( $post_id ) ) {
				return;
			}
		}

		// Need to purge base forums page, bbPress page was updated.
		do_action( 'litespeed_purge_posttype', bbp_get_forum_post_type() );
		$ancestors = get_post_ancestors( $post_id );

		// If there are ancestors, need to pu