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

Yoast / wordpress-seo / 329e7257b699570577e9617a4ea672714686da15

26 Jan 2026 07:52AM UTC coverage: 52.923% (-0.4%) from 53.35%
329e7257b699570577e9617a4ea672714686da15

Pull #22888

github

web-flow
Merge 00d428c6c into ff2f33de1
Pull Request #22888: Add integration tests for analytics adapter

8393 of 15825 branches covered (53.04%)

Branch coverage included in aggregate %.

32383 of 61223 relevant lines covered (52.89%)

47097.05 hits per line

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

63.16
/src/editors/framework/integrations/wincher.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 Yoast\WP\SEO\Editors\Domain\Integrations\Integration_Data_Provider_Interface;
7
use Yoast\WP\SEO\Helpers\Options_Helper;
8
use Yoast\WP\SEO\Helpers\Wincher_Helper;
9

10
/**
11
 * Describes if the Wincher integration is enabled.
12
 */
13
class Wincher implements Integration_Data_Provider_Interface {
14

15
        /**
16
         * The Wincher helper.
17
         *
18
         * @var Wincher_Helper
19
         */
20
        private $wincher_helper;
21

22
        /**
23
         * The options helper.
24
         *
25
         * @var Options_Helper
26
         */
27
        private $options_helper;
28

29
        /**
30
         * The constructor.
31
         *
32
         * @param Wincher_Helper $wincher_helper The Wincher helper.
33
         * @param Options_Helper $options_helper The options helper.
34
         */
35
        public function __construct( Wincher_Helper $wincher_helper, Options_Helper $options_helper ) {
4✔
36
                $this->wincher_helper = $wincher_helper;
4✔
37
                $this->options_helper = $options_helper;
4✔
38
        }
39

40
        /**
41
         * If the integration is activated.
42
         *
43
         * @return bool If the integration is activated.
44
         */
45
        public function is_enabled(): bool {
4✔
46
                return $this->wincher_helper->is_active();
4✔
47
        }
48

49
        /**
50
         * Return this object represented by a key value array.
51
         *
52
         * @return array<string, bool> Returns the name and if the feature is enabled.
53
         */
54
        public function to_array(): array {
×
55
                return [
×
56
                        'active'            => $this->is_enabled(),
×
57
                        'loginStatus'       => $this->is_enabled() && $this->wincher_helper->login_status(),
×
58
                        'websiteId'         => $this->options_helper->get( 'wincher_website_id', '' ),
×
59
                        'autoAddKeyphrases' => $this->options_helper->get( 'wincher_automatically_add_keyphrases', false ),
×
60
                ];
×
61
        }
62

63
        /**
64
         * Returns this object represented by a key value structure that is compliant with the script data array.
65
         *
66
         * @return array<string, bool> Returns the legacy key and if the feature is enabled.
67
         */
68
        public function to_legacy_array(): array {
2✔
69
                return [
2✔
70
                        'wincherIntegrationActive' => $this->is_enabled(),
2✔
71
                        'wincherLoginStatus'       => $this->is_enabled() && $this->wincher_helper->login_status(),
2✔
72
                        'wincherWebsiteId'         => $this->options_helper->get( 'wincher_website_id', '' ),
2✔
73
                        'wincherAutoAddKeyphrases' => $this->options_helper->get( 'wincher_automatically_add_keyphrases', false ),
2✔
74
                ];
2✔
75
        }
76
}
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