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

Yoast / wordpress-seo / 07ede00b851a4d772f8c4dea47e6335593a19b03

12 Aug 2025 12:16PM UTC coverage: 52.835% (-0.07%) from 52.906%
07ede00b851a4d772f8c4dea47e6335593a19b03

Pull #22489

github

web-flow
Merge 9a1e897e1 into c0dcdb8c1
Pull Request #22489: Stops showing the introduction modals in the FTC

8340 of 15135 branches covered (55.1%)

Branch coverage included in aggregate %.

2 of 13 new or added lines in 2 files covered. (15.38%)

139 existing lines in 13 files now uncovered.

31240 of 59778 relevant lines covered (52.26%)

39942.25 hits per line

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

0.0
/src/presenters/admin/sidebar-presenter.php
1
<?php
2

3
namespace Yoast\WP\SEO\Presenters\Admin;
4

5
use WPSEO_Shortlinker;
6
use Yoast\WP\SEO\Conditionals\WooCommerce_Conditional;
7
use Yoast\WP\SEO\Presenters\Abstract_Presenter;
8
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
9

10
/**
11
 * Presenter class for the Yoast SEO sidebar.
12
 */
13
class Sidebar_Presenter extends Abstract_Presenter {
14

15
        /**
16
         * Presents the sidebar.
17
         *
18
         * @return string The sidebar HTML.
19
         */
20
        public function present() {
×
UNCOV
21
                $title = \__( '30% OFF - BLACK FRIDAY', 'wordpress-seo' );
×
22

23
                $assets_uri            = \trailingslashit( \plugin_dir_url( \WPSEO_FILE ) );
×
24
                $is_woocommerce_active = ( new WooCommerce_Conditional() )->is_met();
×
UNCOV
25
                $shortlink             = ( $is_woocommerce_active ) ? WPSEO_Shortlinker::get( 'https://yoa.st/admin-sidebar-upsell-woocommerce' ) : WPSEO_Shortlinker::get( 'https://yoa.st/jj' );
×
26

27
                \ob_start();
×
28
                ?>
29
                <div class="wpseo_content_cell" id="sidebar-container">
×
UNCOV
30
                        <div id="sidebar" class="yoast-sidebar">
×
31
                                <div class="wpseo_content_cell_title yoast-sidebar__title">
×
UNCOV
32
                                        <?php
×
33
                                        /* translators: %1$s expands to Yoast */
34
                                        \printf( \esc_html__( '%1$s recommendations for you', 'wordpress-seo' ), 'Yoast' );
×
35
                                        ?>
36
                                </div>
×
37

38
                                <div class="yoast-sidebar__product"
×
39
                                        style="background-color: <?php echo ( $is_woocommerce_active ) ? 'rgb(14, 30, 101)' : 'rgb(166, 30, 105)'; ?>;">
×
40
                                        <figure class="product-image">
41
                                                <figure class="product-image">
42
                                                        <img
43
                                                                width="64" height="64"
UNCOV
44
                                                                src="<?php echo ( $is_woocommerce_active ) ? \esc_url( $assets_uri . 'packages/js/images/woo-seo-logo-new.svg' ) : \esc_url( $assets_uri . 'packages/js/images/yoast-premium-logo-new.svg' ); ?>"
×
45
                                                                class="attachment-full size-full content-visible"
46
                                                                alt="Yoast SEO logo"
47
                                                                loading="lazy"
48
                                                                decoding="async"
49
                                                                fetchpriority="low"
50
                                                                sizes="(min-width: 1321px) 64">
51
                                                </figure>
52
                                        </figure>
53
                                        <?php
54
                                        if (
55
                                                \YoastSEO()->classes->get( Promotion_Manager::class )
×
56
                                                        ->is( 'black-friday-2024-promotion' ) ) :
×
57
                                                ?>
UNCOV
58
                                                <div class="sidebar__sale_banner_container">
×
59
                                                        <div class="sidebar__sale_banner">
×
UNCOV
60
                                                                <span class="banner_text"><?php echo \esc_html( $title ); ?></span>
×
61
                                                        </div>
62
                                                </div>
63
                                        <?php endif; ?>
UNCOV
64
                                        <h2 class="yoast-get-premium-title">
×
UNCOV
65
                                                <?php
×
66
                                                if (
67
                                                        \YoastSEO()->classes->get( Promotion_Manager::class )
×
68
                                                                ->is( 'black-friday-2024-promotion' ) ) {
×
69
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
70
                                                        \printf( \esc_html__( '%1$sBuy%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
71
                                                }
72
                                                else {
73
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
UNCOV
74
                                                        echo ( $is_woocommerce_active ) ? \sprintf( \esc_html__( '%1$s%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast WooCommerce SEO' ) : \sprintf( \esc_html__( '%1$s%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
75
                                                }
76
                                                ?>
77
                                        </h2>
×
78
                                        <span> <?php echo \esc_html__( 'Now with Local, News & Video SEO + 1 Google Docs seat!', 'wordpress-seo' ); ?></span>
×
79
                                        <?php
80
                                        if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
×
81
                                                echo '<p>';
×
UNCOV
82
                                                echo \esc_html__( 'If you were thinking about upgrading, now\'s the time! 30% OFF ends 3rd Dec 11am (CET)', 'wordpress-seo' );
×
UNCOV
83
                                                echo '</p>';
×
84
                                        }
85
                                        else {
UNCOV
86
                                                echo '<ul>';
×
UNCOV
87
                                                echo '<li>' . \esc_html__( 'AI tools included', 'wordpress-seo' ) . '</li>';
×
88
                                                echo '<li>';
×
89
                                                /* translators: %1$s expands to "Yoast SEO academy". */
90
                                                \printf( \esc_html__( '%1$s access', 'wordpress-seo' ), 'Yoast SEO academy' );
×
91
                                                echo '</li>';
×
UNCOV
92
                                                echo '<li>' . \esc_html__( '24/7 support', 'wordpress-seo' ) . '</li>';
×
93
                                                echo '</ul>';
×
94
                                        }
95
                                        ?>
96
                                        <p class="plugin-buy-button">
×
97
                                                <a class="yoast-button-upsell" data-action="load-nfd-ctb"
×
98
                                                        data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank"
×
99
                                                        href="<?php echo \esc_url( $shortlink ); ?>">
×
100
                                                        <?php
101
                                                        if (
102
                                                                \YoastSEO()->classes->get( Promotion_Manager::class )
×
103
                                                                        ->is( 'black-friday-2024-promotion' ) ) {
×
104
                                                                echo \esc_html__( 'Buy now', 'wordpress-seo' );
×
105
                                                        }
106
                                                        else {
107
                                                                echo \esc_html__( 'Buy now', 'wordpress-seo' );
×
108
                                                        }
109
                                                        ?>
UNCOV
110
                                                        <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
UNCOV
111
                                                </a>
×
UNCOV
112
                                        </p>
×
UNCOV
113
                                        <p class="yoast-price-micro-copy">
×
114

UNCOV
115
                                                <?php
×
UNCOV
116
                                                echo \esc_html__( '30-day money back guarantee.', 'wordpress-seo' );
×
117
                                                ?>
UNCOV
118
                                        </p>
×
UNCOV
119
                                        <hr class="yoast-upsell-hr" aria-hidden="true">
×
120
                                        <div class="review-container">
×
UNCOV
121
                                                <a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
×
122
                                                                <span class="rating">
×
123
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22"
×
124
                                                                                width="22"
×
125
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/g2_logo_white_optm.svg' ); ?>">
×
126
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
127
                                                                                width="20"
128
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
129
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
130
                                                                                width="20"
UNCOV
131
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
132
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
133
                                                                                width="20"
134
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
135
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
136
                                                                                width="20"
137
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
138
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
139
                                                                                width="20"
140
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
×
141
                                                                        <span class="rating-text">4.6 / 5</span>
142

143
                                                                </span>
144
                                                </a>
145
                                        </div>
146
                                </div>
147
                        </div>
148
                        <div class="yoast-sidebar__section">
149
                                <h2>
150
                                        <?php
UNCOV
151
                                        \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
152
                                        ?>
UNCOV
153
                                </h2>
×
UNCOV
154
                                <p>
×
UNCOV
155
                                        <?php
×
UNCOV
156
                                        $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
157

158
                                        /* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
UNCOV
159
                                        \printf( \esc_html__( 'Want to learn SEO from Team Yoast? Check out our %1$s!', 'wordpress-seo' ), '<a href="' . \esc_url( $academy_shortlink ) . '" target="_blank"><strong>Yoast SEO academy</strong></a>' );
×
UNCOV
160
                                        echo '<br/>';
×
UNCOV
161
                                        \esc_html_e( 'We have both free and premium online courses to learn everything you need to know about SEO.', 'wordpress-seo' );
×
162
                                        ?>
UNCOV
163
                                </p>
×
UNCOV
164
                                <p>
×
UNCOV
165
                                        <a href="<?php echo \esc_url( $academy_shortlink ); ?>" target="_blank">
×
166
                                                <?php
167
                                                /* translators: %1$s expands to Yoast SEO academy */
UNCOV
168
                                                \printf( \esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
×
169
                                                ?>
UNCOV
170
                                        </a>
×
UNCOV
171
                                </p>
×
UNCOV
172
                        </div>
×
UNCOV
173
                </div>
×
UNCOV
174
                <?php
×
UNCOV
175
                return \ob_get_clean();
×
176
        }
177
}
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