| Server IP : 89.108.64.180 / Your IP : 216.73.216.60 Web Server : Apache/2.4.41 (Ubuntu) System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : www-root ( 1010) PHP Version : 8.0.30 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,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, MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/www-root/data/www/omapart.ru/wp-content/plugins/litespeed-cache/thirdparty/ |
Upload File : |
<?php
/**
* The Third Party integration with the bbPress plugin.
*
* @since 1.0.5
*/
namespace LiteSpeed\Thirdparty;
defined('WPINC') || exit();
use LiteSpeed\Router;
class BBPress
{
/**
* Detect if bbPress is installed and if the page is a bbPress page.
*
* @since 1.0.5
* @access public
*/
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.
*
* @access public
* @since 1.2.0
*/
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 integer $post_id The post id of the page being purged.
*/
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 purge them as well.
if (!empty($ancestors)) {
foreach ($ancestors as $ancestor) {
do_action('litespeed_purge_post', $ancestor);
}
}
global $wp_widget_factory;
if (bbp_is_reply($post_id) && !is_null($wp_widget_factory->widgets['BBP_Replies_Widget'])) {
do_action('litespeed_purge_widget', $wp_widget_factory->widgets['BBP_Replies_Widget']->id);
}
if (bbp_is_topic($post_id) && !is_null($wp_widget_factory->widgets['BBP_Topics_Widget'])) {
do_action('litespeed_purge_widget', $wp_widget_factory->widgets['BBP_Topics_Widget']->id);
}
}
}