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: jetpack-markdown.php
<?php
[0] Fix | Delete
[1] Fix | Delete
// @phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- This namespace should reflect the namespace of the original class.
[2] Fix | Delete
namespace Yoast\WP\SEO\Editors\Framework\Integrations;
[3] Fix | Delete
[4] Fix | Delete
use Jetpack;
[5] Fix | Delete
use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface;
[6] Fix | Delete
[7] Fix | Delete
/**
[8] Fix | Delete
* Describes if the Jetpack markdown integration is enabled.
[9] Fix | Delete
*/
[10] Fix | Delete
class Jetpack_Markdown implements Integration_Data_Provider_Interface {
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* If the integration is activated.
[14] Fix | Delete
*
[15] Fix | Delete
* @return bool If the integration is activated.
[16] Fix | Delete
*/
[17] Fix | Delete
public function is_enabled(): bool {
[18] Fix | Delete
return $this->is_markdown_enabled();
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Return this object represented by a key value array.
[23] Fix | Delete
*
[24] Fix | Delete
* @return array<string,bool> Returns the name and if the feature is enabled.
[25] Fix | Delete
*/
[26] Fix | Delete
public function to_array(): array {
[27] Fix | Delete
return [
[28] Fix | Delete
'markdownEnabled' => $this->is_enabled(),
[29] Fix | Delete
];
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Returns this object represented by a key value structure that is compliant with the script data array.
[34] Fix | Delete
*
[35] Fix | Delete
* @return array<string,bool> Returns the legacy key and if the feature is enabled.
[36] Fix | Delete
*/
[37] Fix | Delete
public function to_legacy_array(): array {
[38] Fix | Delete
return [
[39] Fix | Delete
'markdownEnabled' => $this->is_enabled(),
[40] Fix | Delete
];
[41] Fix | Delete
}
[42] Fix | Delete
[43] Fix | Delete
/**
[44] Fix | Delete
* Checks if Jetpack's markdown module is enabled.
[45] Fix | Delete
* Can be extended to work with other plugins that parse markdown in the content.
[46] Fix | Delete
*
[47] Fix | Delete
* @return bool
[48] Fix | Delete
*/
[49] Fix | Delete
private function is_markdown_enabled() {
[50] Fix | Delete
$is_markdown = false;
[51] Fix | Delete
[52] Fix | Delete
if ( \class_exists( 'Jetpack' ) && \method_exists( 'Jetpack', 'get_active_modules' ) ) {
[53] Fix | Delete
$active_modules = Jetpack::get_active_modules();
[54] Fix | Delete
[55] Fix | Delete
// First at all, check if Jetpack's markdown module is active.
[56] Fix | Delete
$is_markdown = \in_array( 'markdown', $active_modules, true );
[57] Fix | Delete
}
[58] Fix | Delete
[59] Fix | Delete
/**
[60] Fix | Delete
* Filters whether markdown support is active in the readability- and seo-analysis.
[61] Fix | Delete
*
[62] Fix | Delete
* @since 11.3
[63] Fix | Delete
*
[64] Fix | Delete
* @param array $is_markdown Is markdown support for Yoast SEO active.
[65] Fix | Delete
*/
[66] Fix | Delete
return \apply_filters( 'wpseo_is_markdown_enabled', $is_markdown );
[67] Fix | Delete
}
[68] Fix | Delete
}
[69] Fix | Delete
[70] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function