• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / wordpress-seo / bd19b056d0e3aeba531997bbd20f1153cb192a7f

21 Apr 2025 03:51PM UTC coverage: 52.286% (-2.2%) from 54.437%
bd19b056d0e3aeba531997bbd20f1153cb192a7f

Pull #22151

github

web-flow
Merge 1492b0a05 into 7346229f6
Pull Request #22151: 439 UI library stepper improvement

7803 of 13852 branches covered (56.33%)

Branch coverage included in aggregate %.

5 of 5 new or added lines in 1 file covered. (100.0%)

2223 existing lines in 188 files now uncovered.

28850 of 56249 relevant lines covered (51.29%)

42373.78 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

62.5
/src/editors/framework/integrations/jetpack-markdown.php
1
<?php
2

3
// @phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- This namespace should reflect the namespace of the original class.
4
namespace Yoast\WP\SEO\Editors\Framework\Integrations;
5

6
use Jetpack;
7
use Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface;
8

9
/**
10
 * Describes if the Jetpack markdown integration is enabled.
11
 */
12
class Jetpack_Markdown implements Integration_Data_Provider_Interface {
13

14
        /**
15
         * If the integration is activated.
16
         *
17
         * @return bool If the integration is activated.
18
         */
19
        public function is_enabled(): bool {
2✔
20
                return $this->is_markdown_enabled();
2✔
21
        }
22

23
        /**
24
         * Return this object represented by a key value array.
25
         *
26
         * @return array<string, bool> Returns the name and if the feature is enabled.
27
         */
28
        public function to_array(): array {
×
UNCOV
29
                return [
×
30
                        'markdownEnabled' => $this->is_enabled(),
×
UNCOV
31
                ];
×
32
        }
33

34
        /**
35
         * Returns this object represented by a key value structure that is compliant with the script data array.
36
         *
37
         * @return array<string, bool> Returns the legacy key and if the feature is enabled.
38
         */
39
        public function to_legacy_array(): array {
2✔
40
                return [
2✔
41
                        'markdownEnabled' => $this->is_enabled(),
2✔
42
                ];
2✔
43
        }
44

45
        /**
46
         * Checks if Jetpack's markdown module is enabled.
47
         * Can be extended to work with other plugins that parse markdown in the content.
48
         *
49
         * @return bool
50
         */
51
        private function is_markdown_enabled() {
2✔
52
                $is_markdown = false;
2✔
53

54
                if ( \class_exists( 'Jetpack' ) && \method_exists( 'Jetpack', 'get_active_modules' ) ) {
2✔
55
                        $active_modules = Jetpack::get_active_modules();
×
56

57
                        // First at all, check if Jetpack's markdown module is active.
58
                        $is_markdown = \in_array( 'markdown', $active_modules, true );
×
59
                }
60

61
                /**
62
                 * Filters whether markdown support is active in the readability- and seo-analysis.
63
                 *
64
                 * @since 11.3
65
                 *
66
                 * @param array $is_markdown Is markdown support for Yoast SEO active.
67
                 */
68
                return \apply_filters( 'wpseo_is_markdown_enabled', $is_markdown );
2✔
69
        }
70
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc