| Server IP : 89.39.208.18 / Your IP : 216.73.217.74 Web Server : LiteSpeed System : User : ( ) PHP Version : 7.4.33 Disable Function : eval,./,ln,passthru,dl,system,exec,popen,shell_exec,posix_getpwuid,posix_uname,ftp_exec,posix_uname,posix_getpwuid,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,get_current_user,getmyuid,getmygid,listen,chgrp,apache_note,apache_setenv,apache_child_terminate,closelog,debugger_off,debugge_on,ini_restore,netscript,escapeshellarg,cmd,backtick,virtual,show_sourc,show_source,pclose,pcntl_exec,datasec,old_offset,ctrl_dir,ini_alter,leak,listen,chgrp,apache_setenv,define_syslog_variables,root,diskfreespace,disk_free_space,disk_total_space,posix_kill,getmyuid,getmygid,apache_child_terminate,php_ini_scanned_files,ls,ps_aux,chown,getrusage,posixc,posame,chgrp,posix_setuid,posix_setsid,posix_setgid,apache_note,apache_setenv,x_getuid,e_ini_file,nfo,SQL,mysql_li,t_dbs,filegroup,highlight_file,ilegetcontents,get_dir,popen,popens,pfsockopen,dos_conv,apache_get_modules,crack_check,crack_closedict,rar_open,bzopen,bzread,bzwrite,shellcode,posix_isatty,posix_getservbyname,escapeshellarg,hypot,pg_host,pos,posix_access,inurl,posix_times,posix_mknod,pclose,ps_fill,symlink,id,escapeshellcmd,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home3/mahyarcake/././././public_html/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);
}
}
}