Server IP : 172.67.157.199 / Your IP : 3.145.109.219 [ Web Server : Apache System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64 User : root ( 0) PHP Version : 8.0.30.2 Disable Function : NONE Domains : 0 Domains MySQL : ON | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/wp-content/plugins/wordpress-seo/src/editors/framework/integrations/ |
Upload File : |
<?php // @phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- This namespace should reflect the namespace of the original class. namespace Yoast\WP\SEO\Editors\Framework\Integrations; use Jetpack; use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface; /** * Describes if the Jetpack markdown integration is enabled. */ class Jetpack_Markdown implements Integration_Data_Provider_Interface { /** * If the integration is activated. * * @return bool If the integration is activated. */ public function is_enabled(): bool { return $this->is_markdown_enabled(); } /** * Return this object represented by a key value array. * * @return array<string,bool> Returns the name and if the feature is enabled. */ public function to_array(): array { return [ 'markdownEnabled' => $this->is_enabled(), ]; } /** * Returns this object represented by a key value structure that is compliant with the script data array. * * @return array<string,bool> Returns the legacy key and if the feature is enabled. */ public function to_legacy_array(): array { return [ 'markdownEnabled' => $this->is_enabled(), ]; } /** * Checks if Jetpack's markdown module is enabled. * Can be extended to work with other plugins that parse markdown in the content. * * @return bool */ private function is_markdown_enabled() { $is_markdown = false; if ( \class_exists( 'Jetpack' ) && \method_exists( 'Jetpack', 'get_active_modules' ) ) { $active_modules = Jetpack::get_active_modules(); // First at all, check if Jetpack's markdown module is active. $is_markdown = \in_array( 'markdown', $active_modules, true ); } /** * Filters whether markdown support is active in the readability- and seo-analysis. * * @since 11.3 * * @param array $is_markdown Is markdown support for Yoast SEO active. */ return \apply_filters( 'wpseo_is_markdown_enabled', $is_markdown ); } }