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

Yoast / wordpress-seo / df2c7c31e75a4f396e24da4943e4c7156eded2a8

30 Mar 2026 10:21AM UTC coverage: 49.857%. First build
df2c7c31e75a4f396e24da4943e4c7156eded2a8

Pull #23062

github

web-flow
Merge 83ef1fcd8 into 3432a7d1a
Pull Request #23062: Register Yoast SEO abilities about analysis scores

41 of 239 new or added lines in 5 files covered. (17.15%)

19311 of 38733 relevant lines covered (49.86%)

4.03 hits per line

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

68.75
/src/abilities/infrastructure/enabled-analysis-features-checker.php
1
<?php
2

3
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4
namespace Yoast\WP\SEO\Abilities\Infrastructure;
5

6
use Yoast\WP\SEO\Editors\Application\Analysis_Features\Enabled_Analysis_Features_Repository;
7
use Yoast\WP\SEO\Editors\Framework\Inclusive_Language_Analysis;
8
use Yoast\WP\SEO\Editors\Framework\Keyphrase_Analysis;
9
use Yoast\WP\SEO\Editors\Framework\Readability_Analysis;
10
use Yoast\WP\SEO\Helpers\Language_Helper;
11

12
/**
13
 * Checks whether analysis features are enabled.
14
 */
15
class Enabled_Analysis_Features_Checker {
16

17
        /**
18
         * The enabled analysis features repository.
19
         *
20
         * @var Enabled_Analysis_Features_Repository
21
         */
22
        private $enabled_analysis_features_repository;
23

24
        /**
25
         * The language helper.
26
         *
27
         * @var Language_Helper
28
         */
29
        private $language_helper;
30

31
        /**
32
         * Constructor.
33
         *
34
         * @param Enabled_Analysis_Features_Repository $enabled_analysis_features_repository The enabled analysis features repository.
35
         * @param Language_Helper                      $language_helper                      The language helper.
36
         */
NEW
37
        public function __construct(
×
38
                Enabled_Analysis_Features_Repository $enabled_analysis_features_repository,
39
                Language_Helper $language_helper
40
        ) {
NEW
41
                $this->enabled_analysis_features_repository = $enabled_analysis_features_repository;
×
NEW
42
                $this->language_helper                      = $language_helper;
×
43
        }
44

45
        /**
46
         * Checks if the SEO (keyphrase) analysis feature is enabled.
47
         *
48
         * @return bool Whether the feature is enabled.
49
         */
50
        public function is_keyword_analysis_enabled(): bool {
6✔
51
                $features = $this->get_enabled_features();
6✔
52

53
                return isset( $features[ Keyphrase_Analysis::NAME ] ) && $features[ Keyphrase_Analysis::NAME ] !== false;
6✔
54
        }
55

56
        /**
57
         * Checks if the readability (content) analysis feature is enabled.
58
         *
59
         * @return bool Whether the feature is enabled.
60
         */
61
        public function is_content_analysis_enabled(): bool {
4✔
62
                $features = $this->get_enabled_features();
4✔
63

64
                return isset( $features[ Readability_Analysis::NAME ] ) && $features[ Readability_Analysis::NAME ] !== false;
4✔
65
        }
66

67
        /**
68
         * Checks if the inclusive language analysis feature is enabled.
69
         *
70
         * @return bool Whether the feature is enabled.
71
         */
72
        public function is_inclusive_language_enabled(): bool {
8✔
73
                $features = $this->get_enabled_features();
8✔
74

75
                return isset( $features[ Inclusive_Language_Analysis::NAME ] )
8✔
76
                        && $features[ Inclusive_Language_Analysis::NAME ] !== false
8✔
77
                        && $this->language_helper->has_inclusive_language_support( $this->language_helper->get_language() );
8✔
78
        }
79

80
        /**
81
         * Retrieves the enabled features as an array.
82
         *
83
         * @return array<string, bool> The enabled features.
84
         */
NEW
85
        private function get_enabled_features(): array {
×
NEW
86
                return $this->enabled_analysis_features_repository->get_enabled_features()->to_array();
×
87
        }
88
}
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