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

Yoast / wordpress-seo / 6638054992

25 Oct 2023 08:55AM UTC coverage: 49.106%. First build
6638054992

Pull #20653

github

vraja-pro
Merge remote-tracking branch 'origin/feature/upgrade-react-and-tests' into feature/upgrade-react-and-tests
Pull Request #20653: Feature/upgrade react and tests

64 of 157 new or added lines in 34 files covered. (40.76%)

13135 of 26748 relevant lines covered (49.11%)

3.96 hits per line

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

0.0
/admin/class-premium-popup.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 */
7

8
/**
9
 * Class WPSEO_Premium_popup.
10
 */
11
class WPSEO_Premium_Popup {
12

13
        /**
14
         * An unique identifier for the popup
15
         *
16
         * @var string
17
         */
18
        private $identifier = '';
19

20
        /**
21
         * The heading level of the title of the popup.
22
         *
23
         * @var string
24
         */
25
        private $heading_level = '';
26

27
        /**
28
         * The title of the popup.
29
         *
30
         * @var string
31
         */
32
        private $title = '';
33

34
        /**
35
         * The content of the popup.
36
         *
37
         * @var string
38
         */
39
        private $content = '';
40

41
        /**
42
         * The URL for where the button should link to.
43
         *
44
         * @var string
45
         */
46
        private $url = '';
47

48
        /**
49
         * Wpseo_Premium_Popup constructor.
50
         *
51
         * @param string $identifier    An unique identifier for the popup.
52
         * @param string $heading_level The heading level for the title of the popup.
53
         * @param string $title         The title of the popup.
54
         * @param string $content       The content of the popup.
55
         * @param string $url           The URL for where the button should link to.
56
         */
57
        public function __construct( $identifier, $heading_level, $title, $content, $url ) {
58
                $this->identifier    = $identifier;
×
59
                $this->heading_level = $heading_level;
×
60
                $this->title         = $title;
×
61
                $this->content       = $content;
×
62
                $this->url           = $url;
×
63
        }
64

65
        /**
66
         * Returns the premium popup as an HTML string.
67
         *
68
         * @param bool $popup Show this message as a popup show it straight away.
69
         *
70
         * @return string
71
         */
72
        public function get_premium_message( $popup = true ) {
73
                // Don't show in Premium.
74
                if ( defined( 'WPSEO_PREMIUM_FILE' ) ) {
×
75
                        return '';
×
76
                }
77

78
                $assets_uri = trailingslashit( plugin_dir_url( WPSEO_FILE ) );
×
79

80
                /* translators: %s expands to Yoast SEO Premium */
NEW
81
                $cta_text = esc_html( sprintf( __( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' ) );
×
82
                /* translators: Hidden accessibility text. */
83
                $new_tab_message = '<span class="screen-reader-text">' . esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) . '</span>';
×
84
                $caret_icon      = '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
×
85
                $classes         = '';
×
86
                if ( $popup ) {
×
87
                        $classes = ' hidden';
×
88
                }
89
                $micro_copy = __( '1 year free support and updates included!', 'wordpress-seo' );
×
90

91
                $popup = <<<EO_POPUP
×
92
<div id="wpseo-{$this->identifier}-popup" class="wpseo-premium-popup wp-clearfix$classes">
×
93
        <img class="alignright wpseo-premium-popup-icon" src="{$assets_uri}packages/js/images/Yoast_SEO_Icon.svg" width="150" height="150" alt="Yoast SEO"/>
×
94
        <{$this->heading_level} id="wpseo-contact-support-popup-title" class="wpseo-premium-popup-title">{$this->title}</{$this->heading_level}>
×
95
        {$this->content}
×
96
        <a id="wpseo-{$this->identifier}-popup-button" class="yoast-button-upsell" href="{$this->url}" target="_blank">
×
97
                {$cta_text} {$new_tab_message} {$caret_icon}
×
98
        </a><br/>
99
        <small>{$micro_copy}</small>
×
100
</div>
101
EO_POPUP;
×
102

103
                return $popup;
×
104
        }
105
}
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