✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ webm004.cluster127.gra.hosting.ovh.net ​🇻​♯➤ 6.18.42-ovh-vps-grsec-zfs+ #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 54.36.91.62 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.223
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ _dyuweyrj4,_dyuweyrj4r,dl

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/docteuh/www/integrations/admin//check-required-version.php
<?php

namespace Yoast\WP\SEO\Integrations\Admin;

use Plugin_Upgrader;
use WP_Error;
use WP_Upgrader;
use Yoast\WP\SEO\Conditionals\Check_Required_Version_Conditional;
use Yoast\WP\SEO\Integrations\Integration_Interface;

/**
 * The Check_Required_Version class.
 *
 * This class checks if the required version of Yoast SEO is installed.
 * It also adds the `Requires Yoast SEO` header to the list of headers and updates the comparison table for the plugin overwrite.
 */
class Check_Required_Version implements Integration_Interface {

	/**
	 * Initializes the integration.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_filter( 'upgrader_source_selection', [ $this, 'check_required_version' ], 10, 3 );
		\add_filter( 'install_plugin_overwrite_comparison', [ $this, 'update_comparison_table' ], 10, 3 );
	}

	/**
	 * Returns the conditionals based on which this loadable should be active.
	 *
	 * @return string[] The conditionals based on which this loadable should be active.
	 */
	public static function get_conditionals() {
		return [ Check_Required_Version_Conditional::class ];
	}

	/**
	 * Checks if the required version of Yoast SEO is installed.
	 *
	 * The code is partly inspired by Plugin_Upgrader::check_package() in wp-admin/includes/class-plugin-upgrader.php.
	 *
	 * @param string           $source        File source location.
	 * @param string|null      $remote_source Remote file source location.
	 * @param WP_Upgrader|null $upgrader      WP_Upgrader instance.
	 *
	 * @return string|WP_Error The source location or a WP_Error object if the required version is not installed.
	 */
	public function check_required_version( $source, $remote_source = null, $upgrader = null ) {
		global $wp_filesystem;

		// Bail out early if we are not installing/upgrading a plugin.
		if ( ! $upgrader instanceof Plugin_Upgrader ) {
			return $source;
		}

		$info = [];

		if ( \is_wp_error( $source ) ) {
			return $source;
		}

		$working_directory = \str_replace( $wp_filesystem->wp_content_dir(), \trailingslashit( \WP_CONTENT_DIR ), $source );
		if ( ! \is_dir( $working_directory ) ) { // Confidence check, if the above fails, let's not prevent installation.
			return $source;
		}

		// Check that the folder contains at least 1 valid plugin.
		$files = \glob( $working_directory . '*.php' );
		if ( $files ) {
			foreach ( $files as $file ) {
				$info = \get_plugin_data( $file, false, false );
				if ( ! empty( $info['Name'] ) ) {
					break;
				}
			}
		}

		$requires_yoast_seo = ! empty( $info['Requires Yoast SEO'] ) ? $info['Requires Yoast SEO'] : false;

		if ( ! $this->check_requirement( $requires_yoast_seo ) ) {
			$error = \sprintf(
				/* translators: 1: Current Yoast SEO version, 2: Version required by the uploaded plugin. */
				\__( 'The Yoast SEO version on your site is %1$s, however the uploaded plugin requires %2$s.', 'wordpress-seo' ),
				\WPSEO_VERSION,
				\esc_html( $requires_yoast_seo ),
			);

			return new WP_Error(
				'incompatible_yoast_seo_required_version',
				\__( 'The package could not be installed because it\'s not supported by the currently installed Yoast SEO version.', 'wordpress-seo' ),
				$error,
			);
		}

		return $source;
	}

	/**
	 * Update the comparison table for the plugin installation when overwriting an existing plugin.
	 *
	 * @param string        $table               The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.
	 * @param array<string> $current_plugin_data Array with current plugin data.
	 * @param array<string> $new_plugin_data     Array with uploaded plugin data.
	 *
	 * @return string The updated comparison table.
	 */
	public function update_comparison_table( $table, $current_plugin_data, $new_plugin_data ) {
		$requires_yoast_seo_current = ! empty( $current_plugin_data['Requires Yoast SEO'] ) ? $current_plugin_data['Requires Yoast SEO'] : false;
		$requires_yoast_seo_new     = ! empty( $new_plugin_data['Requires Yoast SEO'] ) ? $new_plugin_data['Requires Yoast SEO'] : false;

		if ( $requires_yoast_seo_current !== false || $requires_yoast_seo_new !== false ) {
			$new_row = \sprintf(
				'<tr><td class="name-label">%1$s</td><td>%2$s</td><td>%3$s</td></tr>',
				\__( 'Required Yoast SEO version', 'wordpress-seo' ),
				( $requires_yoast_seo_current !== false ) ? \esc_html( $requires_yoast_seo_current ) : '-',
				( $requires_yoast_seo_new !== false ) ? \esc_html( $requires_yoast_seo_new ) : '-',
			);

			$table = \str_replace( '</tbody>', $new_row . '</tbody>', $table );
		}

		return $table;
	}

	/**
	 * Check whether the required Yoast SEO version is installed.
	 *
	 * @param string|bool $required_version The required version.
	 *
	 * @return bool Whether the required version is installed, or no version is required.
	 */
	private function check_requirement( $required_version ) {
		if ( $required_version === false ) {
			return true;
		}

		return \version_compare( \WPSEO_VERSION, $required_version . '-RC0', '>=' );
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
23 Sep 2026 4.16 AM
docteuh / users
0755
addon-installation
--
13 Sep 2026 12.44 PM
docteuh / users
0755
activation-cleanup-integration.php
1.849 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
admin-columns-cache-integration.php
7.596 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
background-indexing-integration.php
10.753 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
brand-insights-page.php
2.132 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
check-required-version.php
4.881 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
crawl-settings-integration.php
10.895 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
cron-integration.php
0.979 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
deactivated-premium-integration.php
4.216 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
first-time-configuration-integration.php
15.179 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
first-time-configuration-notice-integration.php
4.997 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
fix-news-dependencies-integration.php
1.552 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
health-check-integration.php
2.745 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
helpscout-beacon.php
14.32 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
import-integration.php
8.631 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexables-exclude-taxonomy-integration.php
1.386 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexing-notification-integration.php
6.929 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
indexing-tool-integration.php
7.286 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
installation-success-integration.php
4.842 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
integrations-page.php
9.754 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
link-count-columns-integration.php
7.528 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
menu-badge-integration.php
0.905 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
migration-error-integration.php
1.347 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
old-configuration-integration.php
1.659 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
redirect-integration.php
2.971 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
redirections-tools-page.php
1.555 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
redirects-page-integration.php
4.461 KB
23 Jun 2026 6.19 PM
docteuh / users
0644
workouts-integration.php
11.058 KB
23 Jun 2026 6.19 PM
docteuh / users
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF