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

Yoast / wordpress-seo / dd6e866a9e6d253114633104d9e3858d807178ba

19 Jun 2024 10:03AM UTC coverage: 48.628% (-4.3%) from 52.936%
dd6e866a9e6d253114633104d9e3858d807178ba

push

github

web-flow
Merge pull request #21431 from Yoast/21429-update-copy-in-the-introduction-and-consent-modals

Updates the copy for the introduction and consent modals

7441 of 13454 branches covered (55.31%)

Branch coverage included in aggregate %.

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

3718 existing lines in 107 files now uncovered.

25100 of 53464 relevant lines covered (46.95%)

62392.47 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.5.0';
19

20
        /**
21
         * The minimally supported version of Gutenberg by the plugin.
22
         *
23
         * @var string
24
         */
25
        public const MINIMUM_SUPPORTED = '18.5.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() {
2✔
65
                return $this->current_version;
2✔
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

© 2025 Coveralls, Inc