HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/w3-total-cache/Extension_AlwaysCached_AdminActions.php
<?php
/**
 * File: Extension_AlwaysCached_AdminActions.php
 *
 * Controller for AlwaysCached extension admin actions.
 *
 * @since 2.8.0
 *
 * @package W3TC
 */

namespace W3TC;

/**
 * AlwaysCached Admin Actions.
 *
 * @since 2.8.0
 */
class Extension_AlwaysCached_AdminActions {

	/**
	 * Handles regenerate page/post request.
	 *
	 * @since 2.8.0
	 *
	 * @return void
	 */
	public function w3tc_alwayscached_regenerate() {
		$post_id = Util_Request::get_integer( 'post_id' );
		$url     = get_permalink( $post_id );

		if ( empty( $url ) ) {
			$note = __( 'Failed to detect current page.', 'w3-total-cache' );
		} else {
			$result = wp_remote_request(
				$url,
				array(
					'headers' => array(
						'w3tcalwayscached' => '-10',
					),
				)
			);

			if (
				is_wp_error( $result )
				|| empty( $result['response']['code'] )
				|| 500 === $result['response']['code']
			) {
				$note = __( 'Failed to handle url ', 'w3-total-cache' ) . $url;
			} elseif ( empty( $result['headers'] ) || empty( $result['headers']['w3tcalwayscached'] ) ) {
				$note = __( 'No evidence of cache refresh.', 'w3-total-cache' );
			} else {
				$note = __( 'Page was successfully regenerated.', 'w3-total-cache' );
			}
		}

		Util_Admin::redirect_with_custom_messages2(
			array(
				'notes' => array(
					'alwayscached_regenerated' => $note,
				),
			)
		);
	}

	/**
	 * Process queue item.
	 *
	 * @since 2.8.0
	 *
	 * @return void
	 */
	public function w3tc_alwayscached_process_item() {
		Extension_AlwaysCached_Worker::run();

		Util_Admin::redirect_with_custom_messages2(
			array(
				'notes' => array(
					'alwayscached_process' => __( 'Queue successfully processed.', 'w3-total-cache' ),
				),
			)
		);
	}

	/**
	 * Process queue.
	 *
	 * @since 2.8.0
	 *
	 * @return void
	 */
	public function w3tc_alwayscached_process() {
		Extension_AlwaysCached_Worker::run();

		Util_Admin::redirect_with_custom_messages2(
			array(
				'notes' => array(
					'alwayscached_process' => __( 'Queue successfully processed.', 'w3-total-cache' ),
				),
			)
		);
	}

	/**
	 * Handles empty queue request.
	 *
	 * @since 2.8.0
	 *
	 * @return void
	 */
	public function w3tc_alwayscached_empty() {
		Extension_AlwaysCached_Queue::empty();

		Util_Admin::redirect_with_custom_messages2(
			array(
				'notes' => array(
					'alwayscached_empty' => __( 'Queue successfully emptied.', 'w3-total-cache' ),
				),
			)
		);
	}
}