| 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/editors/framework/ |
Upload File : |
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
namespace Yoast\WP\SEO\Editors\Framework;
use Yoast\WP\SEO\Editors\Domain\Analysis_Features\Analysis_Feature_Interface;
use Yoast\WP\SEO\Helpers\Language_Helper;
use Yoast\WP\SEO\Helpers\Options_Helper;
use Yoast\WP\SEO\Helpers\Product_Helper;
/**
* Describes the inclusive language analysis feature.
*/
class Inclusive_Language_Analysis implements Analysis_Feature_Interface {
public const NAME = 'inclusiveLanguageAnalysis';
/**
* The options helper.
*
* @var Options_Helper
*/
private $options_helper;
/**
* The language helper.
*
* @var Language_Helper
*/
private $language_helper;
/**
* The product helper.
*
* @var Product_Helper
*/
private $product_helper;
/**
* The constructor.
*
* @param Options_Helper $options_helper The options helper.
* @param Language_Helper $language_helper The language helper.
* @param Product_Helper $product_helper The product helper.
*/
public function __construct(
Options_Helper $options_helper,
Language_Helper $language_helper,
Product_Helper $product_helper
) {
$this->options_helper = $options_helper;
$this->language_helper = $language_helper;
$this->product_helper = $product_helper;
}
/**
* If this analysis is enabled.
*
* @return bool If this analysis is enabled.
*/
public function is_enabled(): bool {
return $this->is_globally_enabled() && $this->is_user_enabled() && $this->is_current_version_supported()
&& $this->language_helper->has_inclusive_language_support( $this->language_helper->get_language() );
}
/**
* If this analysis is enabled by the user.
*
* @return bool If this analysis is enabled by the user.
*/
private function is_user_enabled(): bool {
return ! \get_user_meta( \get_current_user_id(), 'wpseo_inclusive_language_analysis_disable', true );
}
/**
* If this analysis is enabled globally.
*
* @return bool If this analysis is enabled globally.
*/
private function is_globally_enabled(): bool {
return (bool) $this->options_helper->get( 'inclusive_language_analysis_active', false );
}
/**
* If the inclusive language analysis should be loaded in Free.
*
* It should always be loaded when Premium is not active. If Premium is active, it depends on the version. Some
* Premium versions also have inclusive language code (when it was still a Premium only feature) which would result
* in rendering the analysis twice. In those cases, the analysis should be only loaded from the Premium side.
*
* @return bool If the inclusive language analysis should be loaded.
*/
private function is_current_version_supported(): bool {
$is_premium = $this->product_helper->is_premium();
$premium_version = $this->product_helper->get_premium_version();
return ! $is_premium
|| \version_compare( $premium_version, '19.6-RC0', '>=' )
|| \version_compare( $premium_version, '19.2', '==' );
}
/**
* Gets the name.
*
* @return string The name.
*/
public function get_name(): string {
return self::NAME;
}
/**
* Gets the legacy key.
*
* @return string The legacy key.
*/
public function get_legacy_key(): string {
return 'inclusiveLanguageAnalysisActive';
}
}