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/wp-conte.../plugins/wordpres.../src/editors/framewor.../integrat...
File: multilingual.php
<?php
[0] Fix | Delete
// @phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- This namespace should reflect the namespace of the original class.
[1] Fix | Delete
namespace Yoast\WP\SEO\Editors\Framework\Integrations;
[2] Fix | Delete
[3] Fix | Delete
use Yoast\WP\SEO\Conditionals\Third_Party\Polylang_Conditional;
[4] Fix | Delete
use Yoast\WP\SEO\Conditionals\Third_Party\TranslatePress_Conditional;
[5] Fix | Delete
use Yoast\WP\SEO\Conditionals\Third_Party\WPML_Conditional;
[6] Fix | Delete
use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface;
[7] Fix | Delete
[8] Fix | Delete
/**
[9] Fix | Delete
* Describes if the Multilingual integration is enabled.
[10] Fix | Delete
*/
[11] Fix | Delete
class Multilingual implements Integration_Data_Provider_Interface {
[12] Fix | Delete
[13] Fix | Delete
/**
[14] Fix | Delete
* The WPML conditional.
[15] Fix | Delete
*
[16] Fix | Delete
* @var WPML_Conditional $wpml_conditional
[17] Fix | Delete
*/
[18] Fix | Delete
private $wpml_conditional;
[19] Fix | Delete
[20] Fix | Delete
/**
[21] Fix | Delete
* The Polylang conditional.
[22] Fix | Delete
*
[23] Fix | Delete
* @var Polylang_Conditional $polylang_conditional
[24] Fix | Delete
*/
[25] Fix | Delete
private $polylang_conditional;
[26] Fix | Delete
[27] Fix | Delete
/**
[28] Fix | Delete
* The TranslatePress conditional.
[29] Fix | Delete
*
[30] Fix | Delete
* @var TranslatePress_Conditional $translate_press_conditional
[31] Fix | Delete
*/
[32] Fix | Delete
private $translate_press_conditional;
[33] Fix | Delete
[34] Fix | Delete
/**
[35] Fix | Delete
* The constructor.
[36] Fix | Delete
*
[37] Fix | Delete
* @param WPML_Conditional $wpml_conditional The wpml conditional.
[38] Fix | Delete
* @param Polylang_Conditional $polylang_conditional The polylang conditional.
[39] Fix | Delete
* @param TranslatePress_Conditional $translate_press_conditional The translate press conditional.
[40] Fix | Delete
*/
[41] Fix | Delete
public function __construct( WPML_Conditional $wpml_conditional, Polylang_Conditional $polylang_conditional, TranslatePress_Conditional $translate_press_conditional ) {
[42] Fix | Delete
$this->wpml_conditional = $wpml_conditional;
[43] Fix | Delete
$this->polylang_conditional = $polylang_conditional;
[44] Fix | Delete
$this->translate_press_conditional = $translate_press_conditional;
[45] Fix | Delete
}
[46] Fix | Delete
[47] Fix | Delete
/**
[48] Fix | Delete
* If the integration is activated.
[49] Fix | Delete
*
[50] Fix | Delete
* @return bool If the integration is activated.
[51] Fix | Delete
*/
[52] Fix | Delete
public function is_enabled(): bool {
[53] Fix | Delete
return $this->multilingual_plugin_active();
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Return this object represented by a key value array.
[58] Fix | Delete
*
[59] Fix | Delete
* @return array<string,bool> Returns the name and if the feature is enabled.
[60] Fix | Delete
*/
[61] Fix | Delete
public function to_array(): array {
[62] Fix | Delete
return [ 'multilingualPluginActive' => $this->is_enabled() ];
[63] Fix | Delete
}
[64] Fix | Delete
[65] Fix | Delete
/**
[66] Fix | Delete
* Returns this object represented by a key value structure that is compliant with the script data array.
[67] Fix | Delete
*
[68] Fix | Delete
* @return array<string,bool> Returns the legacy key and if the feature is enabled.
[69] Fix | Delete
*/
[70] Fix | Delete
public function to_legacy_array(): array {
[71] Fix | Delete
return [ 'multilingualPluginActive' => $this->is_enabled() ];
[72] Fix | Delete
}
[73] Fix | Delete
[74] Fix | Delete
/**
[75] Fix | Delete
* Checks whether a multilingual plugin is currently active. Currently, we only check the following plugins:
[76] Fix | Delete
* WPML, Polylang, and TranslatePress.
[77] Fix | Delete
*
[78] Fix | Delete
* @return bool Whether a multilingual plugin is currently active.
[79] Fix | Delete
*/
[80] Fix | Delete
private function multilingual_plugin_active() {
[81] Fix | Delete
$wpml_active = $this->wpml_conditional->is_met();
[82] Fix | Delete
$polylang_active = $this->polylang_conditional->is_met();
[83] Fix | Delete
$translatepress_active = $this->translate_press_conditional->is_met();
[84] Fix | Delete
[85] Fix | Delete
return ( $wpml_active || $polylang_active || $translatepress_active );
[86] Fix | Delete
}
[87] Fix | Delete
}
[88] Fix | Delete
[89] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function