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

Yoast / wordpress-seo / facc8f018e2384ec4943ce98eecb050104439f58

27 Aug 2025 02:15PM UTC coverage: 53.206% (-0.07%) from 53.276%
facc8f018e2384ec4943ce98eecb050104439f58

push

github

web-flow
Merge pull request #22535 from Yoast/feature/bf-2025-c

Feature/bf 2025 c

8344 of 15215 branches covered (54.84%)

Branch coverage included in aggregate %.

34 of 172 new or added lines in 36 files covered. (19.77%)

9 existing lines in 6 files now uncovered.

31641 of 59937 relevant lines covered (52.79%)

39836.33 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() {
×
NEW
21
                $title = \__( 'BLACK FRIDAY | 30% OFF', 'wordpress-seo' );
×
22

23
                $assets_uri            = \trailingslashit( \plugin_dir_url( \WPSEO_FILE ) );
×
24
                $is_woocommerce_active = ( new WooCommerce_Conditional() )->is_met();
×
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">
×
30
                        <div id="sidebar" class="yoast-sidebar">
×
31
                                <div class="wpseo_content_cell_title yoast-sidebar__title">
×
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"
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 )
×
NEW
56
                                                        ->is( 'black-friday-promotion' ) ) :
×
57
                                                ?>
58
                                                <div class="sidebar__sale_banner_container">
×
59
                                                        <div class="sidebar__sale_banner">
×
60
                                                                <span class="banner_text"><?php echo \esc_html( $title ); ?></span>
×
61
                                                        </div>
62
                                                </div>
63
                                        <?php endif; ?>
64
                                        <h2 class="yoast-get-premium-title">
×
65
                                                <?php
×
66
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
67
                                                        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' );
×
68
                                                ?>
UNCOV
69
                                        </h2>
×
NEW
70
                                        <span> 
×
UNCOV
71
                                        <?php
×
NEW
72
                                                echo ( $is_woocommerce_active ) ? \esc_html__( 'SEO that scales with your product catalog.', 'wordpress-seo' ) : \esc_html__( 'Now with Local, News & Video SEO + 1 Google Docs seat!', 'wordpress-seo' );
×
73
                                                echo '<ul>';
×
74
                                                echo '<li>' . \esc_html__( 'AI tools included', 'wordpress-seo' ) . '</li>';
×
75
                                                echo '<li>';
×
76
                                                /* translators: %1$s expands to "Yoast SEO academy". */
77
                                                \printf( \esc_html__( '%1$s access', 'wordpress-seo' ), 'Yoast SEO academy' );
×
78
                                                echo '</li>';
×
79
                                                echo '<li>' . \esc_html__( '24/7 support', 'wordpress-seo' ) . '</li>';
×
80
                                                echo '</ul>';
×
81
                                        ?>
UNCOV
82
                                        <p class="plugin-buy-button">
×
83
                                                <a class="yoast-button-upsell" data-action="load-nfd-ctb"
×
84
                                                        data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank"
×
85
                                                        href="<?php echo \esc_url( $shortlink ); ?>">
×
86
                                                        <?php
87
                                                        if (
88
                                                                \YoastSEO()->classes->get( Promotion_Manager::class )
×
NEW
89
                                                                        ->is( 'black-friday-promotion' ) ) {
×
NEW
90
                                                                echo \esc_html__( 'Buy now for 30% off', 'wordpress-seo' );
×
91
                                                        }
92
                                                        else {
93
                                                                echo \esc_html__( 'Buy now', 'wordpress-seo' );
×
94
                                                        }
95
                                                        ?>
96
                                                        <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
97
                                                </a>
×
98
                                        </p>
×
99
                                        <p class="yoast-price-micro-copy">
×
UNCOV
100
                                                <?php
×
NEW
101
                                                        echo \esc_html__( '30-day money back guarantee.', 'wordpress-seo' );
×
102
                                                ?>
103
                                        </p>
×
104
                                        <hr class="yoast-upsell-hr" aria-hidden="true">
×
105
                                        <div class="review-container">
×
106
                                                <a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
×
107
                                                                <span class="rating">
×
108
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22"
×
109
                                                                                width="22"
×
110
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/g2_logo_white_optm.svg' ); ?>">
×
111
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
112
                                                                                width="20"
113
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
114
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
115
                                                                                width="20"
116
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
117
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
118
                                                                                width="20"
119
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
120
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
121
                                                                                width="20"
122
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
123
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20"
124
                                                                                width="20"
125
                                                                                src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
×
126
                                                                        <span class="rating-text">4.6 / 5</span>
127

128
                                                                </span>
129
                                                </a>
130
                                        </div>
131
                                </div>
132
                        </div>
133
                        <div class="yoast-sidebar__section">
134
                                <h2>
135
                                        <?php
136
                                        \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
137
                                        ?>
138
                                </h2>
×
139
                                <p>
×
140
                                        <?php
×
141
                                        $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
142

143
                                        /* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
144
                                        \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>' );
×
145
                                        echo '<br/>';
×
146
                                        \esc_html_e( 'We have both free and premium online courses to learn everything you need to know about SEO.', 'wordpress-seo' );
×
147
                                        ?>
148
                                </p>
×
149
                                <p>
×
150
                                        <a href="<?php echo \esc_url( $academy_shortlink ); ?>" target="_blank">
×
151
                                                <?php
152
                                                /* translators: %1$s expands to Yoast SEO academy */
153
                                                \printf( \esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
×
154
                                                ?>
155
                                        </a>
×
156
                                </p>
×
157
                        </div>
×
158
                </div>
×
159
                <?php
×
160
                return \ob_get_clean();
×
161
        }
162
}
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