HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/delta/wp-content/plugins/w3-total-cache/UsageStatistics_AdminActions.php
<?php
/**
 * File: UsageStatistics_AdminActions.php
 *
 * @package W3TC
 */

namespace W3TC;

/**
 * Class UsageStatistics_AdminActions
 *
 * phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
 */
class UsageStatistics_AdminActions {
	/**
	 * Config
	 *
	 * @var Config
	 */
	private $_config = null;

	/**
	 * Constructor for the UsageStatistics_AdminActions class.
	 *
	 * Initializes the configuration property by retrieving settings from the Dispatcher.
	 *
	 * @return void
	 */
	public function __construct() {
		$this->_config = Dispatcher::config();
	}

	/**
	 * Disables usage statistics tracking.
	 *
	 * This method updates the configuration to disable usage statistics tracking
	 * by setting the 'stats.enabled' key to `false` and saving the configuration.
	 * It then redirects the user back to the appropriate location using `Util_Admin::redirect`.
	 *
	 * @return void
	 *
	 * @throws Exception If there is an error saving the configuration or during the redirect process.
	 */
	public function w3tc_ustats_note_disable() {
		$this->_config->set( 'stats.enabled', false );
		$this->_config->save();

		Util_Admin::redirect( array(), true );
	}
}