Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/wordpres.../src/editors/framewor...
File: inclusive-language-analysis.php
<?php
[0] Fix | Delete
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong
[1] Fix | Delete
namespace Yoast\WP\SEO\Editors\Framework;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Editors\Domain\Analysis_Features\Analysis_Feature_Interface;
[4] Fix | Delete
use Yoast\WP\SEO\Helpers\Language_Helper;
[5] Fix | Delete
use Yoast\WP\SEO\Helpers\Options_Helper;
[6] Fix | Delete
use Yoast\WP\SEO\Helpers\Product_Helper;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Describes the inclusive language analysis feature.
[10] Fix | Delete
*/
[11] Fix | Delete
class Inclusive_Language_Analysis implements Analysis_Feature_Interface {
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* The options helper.
[15] Fix | Delete
*
[16] Fix | Delete
* @var Options_Helper
[17] Fix | Delete
*/
[18] Fix | Delete
private $options_helper;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* The language helper.
[22] Fix | Delete
*
[23] Fix | Delete
* @var Language_Helper
[24] Fix | Delete
*/
[25] Fix | Delete
private $language_helper;
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* The product helper.
[29] Fix | Delete
*
[30] Fix | Delete
* @var Product_Helper
[31] Fix | Delete
*/
[32] Fix | Delete
private $product_helper;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* The constructor.
[36] Fix | Delete
*
[37] Fix | Delete
* @param Options_Helper $options_helper The options helper.
[38] Fix | Delete
* @param Language_Helper $language_helper The language helper.
[39] Fix | Delete
* @param Product_Helper $product_helper The product helper.
[40] Fix | Delete
*/
[41] Fix | Delete
public function __construct(
[42] Fix | Delete
Options_Helper $options_helper,
[43] Fix | Delete
Language_Helper $language_helper,
[44] Fix | Delete
Product_Helper $product_helper
[45] Fix | Delete
) {
[46] Fix | Delete
$this->options_helper = $options_helper;
[47] Fix | Delete
$this->language_helper = $language_helper;
[48] Fix | Delete
$this->product_helper = $product_helper;
[49] Fix | Delete
}
[50] Fix | Delete
[51] Fix | Delete
/**
[52] Fix | Delete
* If this analysis is enabled.
[53] Fix | Delete
*
[54] Fix | Delete
* @return bool If this analysis is enabled.
[55] Fix | Delete
*/
[56] Fix | Delete
public function is_enabled(): bool {
[57] Fix | Delete
return $this->is_globally_enabled() && $this->is_user_enabled() && $this->is_current_version_supported()
[58] Fix | Delete
&& $this->language_helper->has_inclusive_language_support( $this->language_helper->get_language() );
[59] Fix | Delete
}
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* If this analysis is enabled by the user.
[63] Fix | Delete
*
[64] Fix | Delete
* @return bool If this analysis is enabled by the user.
[65] Fix | Delete
*/
[66] Fix | Delete
private function is_user_enabled(): bool {
[67] Fix | Delete
return ! \get_user_meta( \get_current_user_id(), 'wpseo_inclusive_language_analysis_disable', true );
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
/**
[71] Fix | Delete
* If this analysis is enabled globally.
[72] Fix | Delete
*
[73] Fix | Delete
* @return bool If this analysis is enabled globally.
[74] Fix | Delete
*/
[75] Fix | Delete
private function is_globally_enabled(): bool {
[76] Fix | Delete
return (bool) $this->options_helper->get( 'inclusive_language_analysis_active', false );
[77] Fix | Delete
}
[78] Fix | Delete
[79] Fix | Delete
/**
[80] Fix | Delete
* If the inclusive language analysis should be loaded in Free.
[81] Fix | Delete
*
[82] Fix | Delete
* It should always be loaded when Premium is not active. If Premium is active, it depends on the version. Some
[83] Fix | Delete
* Premium versions also have inclusive language code (when it was still a Premium only feature) which would result
[84] Fix | Delete
* in rendering the analysis twice. In those cases, the analysis should be only loaded from the Premium side.
[85] Fix | Delete
*
[86] Fix | Delete
* @return bool If the inclusive language analysis should be loaded.
[87] Fix | Delete
*/
[88] Fix | Delete
private function is_current_version_supported(): bool {
[89] Fix | Delete
$is_premium = $this->product_helper->is_premium();
[90] Fix | Delete
$premium_version = $this->product_helper->get_premium_version();
[91] Fix | Delete
[92] Fix | Delete
return ! $is_premium
[93] Fix | Delete
|| \version_compare( $premium_version, '19.6-RC0', '>=' )
[94] Fix | Delete
|| \version_compare( $premium_version, '19.2', '==' );
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
/**
[98] Fix | Delete
* Gets the name.
[99] Fix | Delete
*
[100] Fix | Delete
* @return string The name.
[101] Fix | Delete
*/
[102] Fix | Delete
public function get_name(): string {
[103] Fix | Delete
return 'inclusiveLanguageAnalysis';
[104] Fix | Delete
}
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* Gets the legacy key.
[108] Fix | Delete
*
[109] Fix | Delete
* @return string The legacy key.
[110] Fix | Delete
*/
[111] Fix | Delete
public function get_legacy_key(): string {
[112] Fix | Delete
return 'inclusiveLanguageAnalysisActive';
[113] Fix | Delete
}
[114] Fix | Delete
}
[115] Fix | Delete
[116] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function