HEX
Server: LiteSpeed
System: Linux cde2.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: dtptviut (1121)
PHP: 8.0.30
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/dtptviut/public_html/wp-content/plugins/w3-total-cache/Extensions_AdminActions.php
<?php
/**
 * File: Extensions_AdminActions.php
 *
 * @package W3TC
 */

namespace W3TC;

/**
 * Class Extensions_AdminActions
 */
class Extensions_AdminActions {
	/**
	 * Activates a specified extension.
	 *
	 * @return void
	 */
	public function w3tc_extensions_activate() {
		$w3tc_config = Dispatcher::config();

		$w3tc_extension = Util_Request::get_string( 'w3tc_extensions_activate' );
		$w3tc_ext       = Extensions_Util::get_extension( $w3tc_config, $w3tc_extension );

		/**
		 * Per-extension capability gate, floored at manage_options.
		 * Prevents non-admins from activating extensions even if a
		 * downstream filter lowers the per-extension cap.
		 *
		 * @since 2.10.0
		 */
		$capability = apply_filters(
			'w3tc_capability_extensions_activate_' . $w3tc_extension,
			'manage_options'
		);
		if ( ! \current_user_can( 'manage_options' ) || empty( $capability ) || ! \current_user_can( $capability ) ) {
			wp_die(
				\esc_html__( 'You do not have sufficient permissions to perform this action.', 'w3-total-cache' ),
				'',
				array( 'response' => 403 )
			);
		}

		if ( ! is_null( $w3tc_ext ) && Extensions_Util::activate_extension( $w3tc_extension, $w3tc_config ) ) {
			Util_Admin::redirect_with_custom_messages2(
				array(
					'notes' => array(
						sprintf(
							// Translators: 1 HTML strong tag containing extension name.
							__(
								'Extension %s has been successfully activated.',
								'w3-total-cache'
							),
							'<strong>' . $w3tc_ext['name'] . '</strong>'
						),
					),
				)
			);
			return;
		}

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