HEX
Server: nginx/1.18.0
System: Linux iZj6c1ieg2jrpk1z5tzi19Z 6.3.9-1.el7.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 21 22:18:40 EDT 2023 x86_64
User: www (1001)
PHP: 8.2.4
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,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,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/www.cytocare.cn/wp-content/plugins/gwolle-gb/functions/gb-cache.php
<?php


if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly



/*
 * Clear the cache of the most common Cache plugins.
 *
 * @param object $entry instance of gb_entry class
 */
function gwolle_gb_clear_cache( $entry = false ) {

	$page_id = 0;
	if ( is_object( $entry ) && is_a( $entry, 'gwolle_gb_entry' ) ) {
		$book_id = $entry->get_book_id();
		$page_id = (int) gwolle_gb_get_postid( $book_id );
	}

	/* Default WordPress */
	wp_cache_flush();


	/* Gwolle: Transient for admin menu counter */
	delete_transient( 'gwolle_gb_menu_counter' );

	/* Gwolle: Transient for frontend pagination counter */
	if ( is_object( $entry ) && is_a( $entry, 'gwolle_gb_entry' ) ) {
		$book_id = $entry->get_book_id();
		$key = 'gwolle_gb_frontend_pagination_book_' . $book_id;
		delete_transient( $key );
	} else {
		// no book_id available, clear all transients.
		$postids = gwolle_gb_get_books();
		if ( is_array($postids) && ! empty($postids) ) {
			foreach ( $postids as $postid ) {
				$bookid = (int) get_post_meta( $postid, 'gwolle_gb_book_id', true );
				if ( empty( $bookid ) ) {
					continue;
				}
				$key = 'gwolle_gb_frontend_pagination_book_' . $bookid;
				delete_transient( $key );
			}
		}
	}

	/* Cachify */
	if ( class_exists('Cachify') ) {
		$cachify = new Cachify();
		if ( method_exists($cachify, 'flush_total_cache') ) {
			$cachify->flush_total_cache(true);
		}
	}

	/* W3 Total Cache */
	if ( function_exists('w3tc_pgcache_flush') ) {
		w3tc_pgcache_flush();
	}

	/* WP Fastest Cache */
	if ( class_exists('WpFastestCache') ) {
		$wp_fastest_cache = new WpFastestCache();
		if ( method_exists($wp_fastest_cache, 'deleteCache') ) {
			$wp_fastest_cache->deleteCache();
		}
	}

	/* WP Super Cache */
	if ( function_exists('wp_cache_clear_cache') ) {
		$GLOBALS['super_cache_enabled'] = 1;
		wp_cache_clear_cache();
	}

	/* WP Rocket */
	if ( function_exists('rocket_clean_domain') ) {
		rocket_clean_domain();
	}

	/* Siteground Cache */
	if (function_exists('sg_cachepress_purge_cache')) {
		sg_cachepress_purge_cache();
	}

	/* Litespeed Cache
	https://docs.litespeedtech.com/lscache/lscwp/api/#purgeBest */
	if ( defined('LSCWP_V') ) {
		do_action( 'litespeed_purge_post', $page_id );
	}

}
add_action( 'gwolle_gb_save_entry_admin', 'gwolle_gb_clear_cache' );
add_action( 'gwolle_gb_save_entry_frontend', 'gwolle_gb_clear_cache' );