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

Yoast / wordpress-seo / e6a7e0b80499bdb8a730b54214937f6933fbef32

21 Aug 2025 12:15PM UTC coverage: 41.435%. First build
e6a7e0b80499bdb8a730b54214937f6933fbef32

Pull #22507

github

web-flow
Merge 4876d7f1c into bff8b27b5
Pull Request #22507: Add the Black Friday announcement modal

2331 of 8826 branches covered (26.41%)

Branch coverage included in aggregate %.

23 of 69 new or added lines in 8 files covered. (33.33%)

21982 of 49851 relevant lines covered (44.1%)

4.68 hits per line

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

76.92
/src/introductions/application/black-friday-announcement.php
1
<?php
2

3

4
namespace Yoast\WP\SEO\Introductions\Application;
5

6
use Yoast\WP\SEO\Helpers\Current_Page_Helper;
7
use Yoast\WP\SEO\Helpers\Product_Helper;
8
use Yoast\WP\SEO\Introductions\Domain\Introduction_Interface;
9
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
10

11
/**
12
 * Represents the introduction for the Black Friday announcement.
13
 */
14
class Black_Friday_Announcement implements Introduction_Interface {
15

16
        public const ID = 'black-friday-announcement';
17

18
        /**
19
         * Holds the current page helper.
20
         *
21
         * @var Current_Page_Helper
22
         */
23
        private $current_page_helper;
24

25
        /**
26
         * Holds the promotion manager.
27
         *
28
         * @var Promotion_Manager
29
         */
30
        private $promotion_manager;
31

32
        /**
33
         * Holds the product helper.
34
         *
35
         * @var Product_Helper
36
         */
37
        private $product_helper;
38

39
        /**
40
         * Constructs the introduction.
41
         *
42
         * @param Current_Page_Helper $current_page_helper The current page helper.
43
         * @param Promotion_Manager   $promotion_manager   The promotion manager.
44
         * @param Product_Helper      $product_helper      The product helper.
45
         */
46
        public function __construct(
2✔
47
                Current_Page_Helper $current_page_helper,
48
                Promotion_Manager $promotion_manager,
49
                Product_Helper $product_helper
50
        ) {
51
                $this->current_page_helper = $current_page_helper;
2✔
52
                $this->promotion_manager   = $promotion_manager;
2✔
53
                $this->product_helper      = $product_helper;
2✔
54
        }
55

56
        /**
57
         * Returns the ID.
58
         *
59
         * @return string The ID.
60
         */
61
        public function get_id() {
2✔
62
                return self::ID;
2✔
63
        }
64

65
        /**
66
         * Returns the name of the introduction.
67
         *
68
         * @return string The name.
69
         */
NEW
70
        public function get_name() {
×
NEW
71
                \_deprecated_function( __METHOD__, 'Yoast SEO Premium 21.6', 'Please use get_id() instead' );
×
72

NEW
73
                return self::ID;
×
74
        }
75

76
        /**
77
         * Returns the requested pagination priority. Lower means earlier.
78
         *
79
         * @return int The priority.
80
         */
81
        public function get_priority() {
2✔
82
                return 10;
2✔
83
        }
84

85
        /**
86
         * Returns whether this introduction should show.
87
         *
88
         * @return bool Whether this introduction should show.
89
         */
90
        public function should_show() {
8✔
91
                return $this->current_page_helper->is_yoast_seo_page() && ! $this->product_helper->is_premium() && $this->promotion_manager->is( 'black-friday-promotion' );
8✔
92
        }
93
}
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