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

Yoast / wordpress-seo / 11f37ccb74cdb9a662c903f27216a1cdf1c8d9ac

19 Aug 2024 07:41AM UTC coverage: 48.692% (-5.4%) from 54.055%
11f37ccb74cdb9a662c903f27216a1cdf1c8d9ac

push

github

web-flow
Merge pull request #21541 from Yoast/fix-elementor-mutation-observer

Only handle editor changes when on the document from our form

7479 of 13543 branches covered (55.22%)

Branch coverage included in aggregate %.

0 of 6 new or added lines in 2 files covered. (0.0%)

4422 existing lines in 144 files now uncovered.

25345 of 53868 relevant lines covered (47.05%)

42392.33 hits per line

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

11.11
/admin/class-gutenberg-compatibility.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Gutenberg_Compatibility
6
 */
7

8
/**
9
 * Class WPSEO_Gutenberg_Compatibility
10
 */
11
class WPSEO_Gutenberg_Compatibility {
12

13
        /**
14
         * The currently released version of Gutenberg.
15
         *
16
         * @var string
17
         */
18
        public const CURRENT_RELEASE = '18.9.0';
19

20
        /**
21
         * The minimally supported version of Gutenberg by the plugin.
22
         *
23
         * @var string
24
         */
25
        public const MINIMUM_SUPPORTED = '18.9.0';
26

27
        /**
28
         * Holds the current version.
29
         *
30
         * @var string
31
         */
32
        protected $current_version = '';
33

34
        /**
35
         * WPSEO_Gutenberg_Compatibility constructor.
36
         */
37
        public function __construct() {
×
38
                $this->current_version = $this->detect_installed_gutenberg_version();
×
39
        }
40

41
        /**
42
         * Determines whether or not Gutenberg is installed.
43
         *
44
         * @return bool Whether or not Gutenberg is installed.
45
         */
UNCOV
46
        public function is_installed() {
×
UNCOV
47
                return $this->current_version !== '';
×
48
        }
49

50
        /**
51
         * Determines whether or not the currently installed version of Gutenberg is below the minimum supported version.
52
         *
53
         * @return bool True if the currently installed version is below the minimum supported version. False otherwise.
54
         */
UNCOV
55
        public function is_below_minimum() {
×
UNCOV
56
                return version_compare( $this->current_version, $this->get_minimum_supported_version(), '<' );
×
57
        }
58

59
        /**
60
         * Gets the currently installed version.
61
         *
62
         * @return string The currently installed version.
63
         */
64
        public function get_installed_version() {
4✔
65
                return $this->current_version;
4✔
66
        }
67

68
        /**
69
         * Determines whether or not the currently installed version of Gutenberg is the latest, fully compatible version.
70
         *
71
         * @return bool Whether or not the currently installed version is fully compatible.
72
         */
UNCOV
73
        public function is_fully_compatible() {
×
UNCOV
74
                return version_compare( $this->current_version, $this->get_latest_release(), '>=' );
×
75
        }
76

77
        /**
78
         * Gets the latest released version of Gutenberg.
79
         *
80
         * @return string The latest release.
81
         */
82
        protected function get_latest_release() {
×
83
                return self::CURRENT_RELEASE;
×
84
        }
85

86
        /**
87
         * Gets the minimum supported version of Gutenberg.
88
         *
89
         * @return string The minumum supported release.
90
         */
91
        protected function get_minimum_supported_version() {
×
92
                return self::MINIMUM_SUPPORTED;
×
93
        }
94

95
        /**
96
         * Detects the currently installed Gutenberg version.
97
         *
98
         * @return string The currently installed Gutenberg version. Empty if the version couldn't be detected.
99
         */
100
        protected function detect_installed_gutenberg_version() {
×
101
                if ( defined( 'GUTENBERG_VERSION' ) ) {
×
102
                        return GUTENBERG_VERSION;
×
103
                }
104

105
                return '';
×
106
        }
107
}
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