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

Yoast / wordpress-seo / 1804e81ca8334a8249d1793e09909a51f45bcae8

02 Dec 2025 10:44AM UTC coverage: 53.063%. First build
1804e81ca8334a8249d1793e09909a51f45bcae8

push

github

web-flow
Merge pull request #22775 from Yoast/enrico/sidebar-ad-improvements

Improve sidebar ads

8697 of 16064 branches covered (54.14%)

Branch coverage included in aggregate %.

0 of 48 new or added lines in 2 files covered. (0.0%)

32415 of 61413 relevant lines covered (52.78%)

46951.54 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() {
×
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

NEW
38
                                <div class="yoast-sidebar__product<?php echo ( $is_woocommerce_active ) ? ' woocommerce' : ''; ?>">
×
39
                                        <figure class="product-image">
40
                                                <figure class="product-image">
41
                                                        <img
42
                                                                width="64" height="64"
43
                                                                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' ); ?>"
×
44
                                                                class="attachment-full size-full content-visible"
45
                                                                alt="Yoast SEO logo"
46
                                                                loading="lazy"
47
                                                                decoding="async"
48
                                                                fetchpriority="low"
49
                                                                sizes="(min-width: 1321px) 64">
50
                                                </figure>
51
                                        </figure>
52
                                        <?php
53
                                        if (
54
                                                \YoastSEO()->classes->get( Promotion_Manager::class )
×
55
                                                        ->is( 'black-friday-promotion' ) ) :
×
56
                                                ?>
57
                                                <div class="sidebar__sale_banner_container">
×
58
                                                        <div class="sidebar__sale_banner">
×
59
                                                                <span class="banner_text"><?php echo \esc_html( $title ); ?></span>
×
60
                                                        </div>
61
                                                </div>
62
                                        <?php endif; ?>
63
                                        <h2 class="yoast-get-premium-title">
×
64
                                                <?php
×
65
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
66
                                                        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' );
×
67
                                                ?>
68
                                        </h2>
×
NEW
69
                                        <div>
×
NEW
70
                                                <p class="info-header">
×
NEW
71
                                                <?php
×
NEW
72
                                                        echo ( $is_woocommerce_active ) ? \esc_html__( 'SEO that scales with your product catalog.', 'wordpress-seo' ) : \esc_html__( 'Spend less time on SEO tasks!', 'wordpress-seo' );
×
73
                                                ?>
NEW
74
                                                </p>
×
NEW
75
                                                <p class="info">
×
NEW
76
                                                <?php
×
NEW
77
                                                echo ( $is_woocommerce_active ) ? \esc_html__( 'SEO that scales with your product catalog.', 'wordpress-seo' ) : \esc_html__( 'Optimize your site faster, smarter, and with more confidence', 'wordpress-seo' );
×
78
                                                ?>
NEW
79
                                                </p>
×
NEW
80
                                                <ul class="yoast-features-list">
×
NEW
81
                                                <?php
×
NEW
82
                                                echo '<li>' . \esc_html__( 'Create optimized SEO titles & meta descriptions in seconds', 'wordpress-seo' ) . '</li>';
×
NEW
83
                                                echo '<li>' . \esc_html__( 'Apply AI suggestions to improve content in 1 click', 'wordpress-seo' ) . '</li>';
×
NEW
84
                                                echo '<li>' . \esc_html__( 'Manage redirects with ease and without extra plugins', 'wordpress-seo' ) . '</li>';
×
NEW
85
                                                echo '<li>' . \esc_html__( 'Optimize pages for multiple keywords with guidance', 'wordpress-seo' ) . '</li>';
×
86
                                                ?>
NEW
87
                                                </ul>
×
NEW
88
                                                <p class="plugin-buy-button">
×
NEW
89
                                                        <a class="yoast-button-upsell" data-action="load-nfd-ctb"
×
90
                                                        data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank"
×
91
                                                        href="<?php echo \esc_url( $shortlink ); ?>">
×
92
                                                        <?php
93
                                                        if (
94
                                                                \YoastSEO()->classes->get( Promotion_Manager::class )
×
95
                                                                        ->is( 'black-friday-promotion' ) ) {
×
96
                                                                echo \esc_html__( 'Buy now for 30% off', 'wordpress-seo' );
×
97
                                                        }
98
                                                        else {
NEW
99
                                                                \printf(
×
100
                                                                        /* translators: %s expands to "Yoast SEO Premium". */
NEW
101
                                                                        \esc_html__( 'Get %s', 'wordpress-seo' ),
×
NEW
102
                                                                        'Yoast SEO Premium'
×
NEW
103
                                                                );
×
104
                                                        }
105
                                                        ?>
106
                                                        <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
NEW
107
                                                        </a>
×
NEW
108
                                                </p>
×
NEW
109
                                                <p class="yoast-price-micro-copy">
×
NEW
110
                                                        <?php
×
NEW
111
                                                                echo \esc_html__( 'Less friction. Faster publishing.', 'wordpress-seo' );
×
112
                                                        ?>
NEW
113
                                                </p>
×
NEW
114
                                                <hr class="yoast-upsell-hr" aria-hidden="true">
×
NEW
115
                                                <ul class="yoast-guarantees-list">
×
NEW
116
                                                        <li>
×
NEW
117
                                                                <?php
×
NEW
118
                                                                echo \esc_html__( '30-day money back guarantee', 'wordpress-seo' );
×
119
                                                                ?>
NEW
120
                                                        </li>
×
NEW
121
                                                        <li>
×
NEW
122
                                                                <?php
×
NEW
123
                                                                echo \esc_html__( '24/7 support', 'wordpress-seo' );
×
124
                                                                ?>
NEW
125
                                                        </li>
×
NEW
126
                                                </ul>
×
127
                                        </div>
×
128
                                </div>
×
129
                        </div>
×
130
                        <div class="yoast-sidebar__section">
×
131
                                <h2>
×
132
                                        <?php
×
133
                                        \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
134
                                        ?>
135
                                </h2>
×
136
                                <p>
×
137
                                        <?php
×
138
                                        $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
139

140
                                        /* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
141
                                        \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>' );
×
142
                                        echo '<br/>';
×
143
                                        \esc_html_e( 'We have both free and premium online courses to learn everything you need to know about SEO.', 'wordpress-seo' );
×
144
                                        ?>
145
                                </p>
×
146
                                <p>
×
147
                                        <a href="<?php echo \esc_url( $academy_shortlink ); ?>" style="font-weight: 500" target="_blank">
×
148
                                                <?php
149
                                                /* translators: %1$s expands to Yoast SEO academy */
150
                                                \printf( \esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
×
151
                                                ?>
152
                                                <span class="screen-reader-text">
×
153
                                                        <?php
×
154
                                                        /* translators: Hidden accessibility text. */
155
                                                        \printf( \esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' ) );
×
156
                                                        ?>
157
                                                </span>
×
158
                                                <img
×
159
                                                        src='data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="10" height="9" viewBox="0 0 10 9" fill="none"><path d="M3.99951 1.49988H1.99951C1.44723 1.49988 0.999512 1.94759 0.999512 2.49988V7.49988C0.999512 8.05216 1.44723 8.49988 1.99951 8.49988H6.99951C7.5518 8.49988 7.99951 8.05216 7.99951 7.49988V5.49988M5.99951 0.499878H8.99951M8.99951 0.499878V3.49988M8.99951 0.499878L3.99951 5.49988" stroke="%230085ba" stroke-linecap="round" stroke-linejoin="round"/></svg>'
×
160
                                                        alt="" aria-hidden="true" width="10" height="9"
×
161
                                                />
×
162
                                        </a>
×
163
                                </p>
×
164
                        </div>
×
165
                </div>
×
166
                <?php
×
167
                return \ob_get_clean();
×
168
        }
169
}
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