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

Yoast / wordpress-seo / e2f53222cf97fe912f41d61152981b5b595f5500

01 Jul 2025 09:02AM UTC coverage: 53.694% (+0.9%) from 52.787%
e2f53222cf97fe912f41d61152981b5b595f5500

push

github

YoastBot
Bump version to 25.4 on free

8218 of 14291 branches covered (57.5%)

Branch coverage included in aggregate %.

30333 of 57507 relevant lines covered (52.75%)

41519.48 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\Presenters\Abstract_Presenter;
7
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
8

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

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

22
                $assets_uri              = \trailingslashit( \plugin_dir_url( \WPSEO_FILE ) );
×
23
                $buy_yoast_seo_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/jj' );
×
24
                \ob_start();
×
25
                ?>
26
                        <div class="wpseo_content_cell" id="sidebar-container">
×
27
                                <div id="sidebar" class="yoast-sidebar">
×
28
                                        <div class="wpseo_content_cell_title yoast-sidebar__title">
×
29
                                                <?php
×
30
                                                /* translators: %1$s expands to Yoast */
31
                                                \printf( \esc_html__( '%1$s recommendations for you', 'wordpress-seo' ), 'Yoast' );
×
32
                                                ?>
33
                                        </div>
×
34
                                        <div class="yoast-sidebar__product">
×
35
                                                <figure class="product-image">
×
36
                                                        <figure class="product-image">
×
37
                                                                <img
×
38
                                                                        width="75" height="75"
×
39
                                                                        src="<?php echo \esc_url( $assets_uri . 'packages/js/images/Yoast_SEO_Icon.svg' ); ?>"
×
40
                                                                        class="attachment-full size-full content-visible"
41
                                                                        alt="Yoast SEO logo"
42
                                                                        loading="lazy"
43
                                                                        decoding="asyc"
44
                                                                        fetchpriority="low"
45
                                                                        sizes="(min-width: 1321px) 75px">
46
                                                        </figure>
47
                                                </figure>
48
                                                <?php if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) : ?>
×
49
                                                        <div class="sidebar__sale_banner_container">
×
50
                                                                <div class="sidebar__sale_banner">
×
51
                                                                                <span class="banner_text"><?php echo \esc_html( $title ); ?></span>
×
52
                                                                </div>
53
                                                        </div>
54
                                                <?php endif; ?>
55
                                                <h2 class="yoast-get-premium-title">
×
56
                                                        <?php
×
57
                                                        if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
×
58
                                                                /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
59
                                                                \printf( \esc_html__( '%1$sBuy%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
60
                                                        }
61
                                                        else {
62
                                                                /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
63
                                                                \printf( \esc_html__( '%1$sGet%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
64
                                                        }
65
                                                        ?>
66
                                                </h2>
×
67
                                                <p>
×
68
                                                        <?php
×
69
                                                        if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
×
70
                                                                echo \esc_html__( 'If you were thinking about upgrading, now\'s the time! 30% OFF ends 3rd Dec 11am (CET)', 'wordpress-seo' );
×
71
                                                        }
72
                                                        else {
73
                                                                echo \esc_html__( 'Use AI to generate titles and meta descriptions, automatically redirect deleted pages, get 24/7 support, and much, much more!', 'wordpress-seo' );
×
74
                                                        }
75
                                                        ?>
76
                                                </p>
×
77
                                                <p class="plugin-buy-button">
×
78
                                                        <a class="yoast-button-upsell" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" target="_blank" href="<?php echo \esc_url( $buy_yoast_seo_shortlink ); ?>">
×
79
                                                                <?php
80
                                                                if ( \YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2024-promotion' ) ) {
×
81
                                                                        echo \esc_html__( 'Buy now', 'wordpress-seo' );
×
82
                                                                }
83
                                                                else {
84
                                                                        /* translators: %s expands to Yoast SEO Premium */
85
                                                                        \printf( \esc_html__( 'Get %1$s', 'wordpress-seo' ), 'Yoast SEO Premium' );
×
86
                                                                }
87
                                                                ?>
88
                                                                <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
89
                                                        </a>
×
90
                                                </p>
×
91
                                                <p class="yoast-price-micro-copy">
×
92

93
                                                        <?php
×
94
                                                                echo \esc_html__( '30-day money back guarantee.', 'wordpress-seo' );
×
95
                                                        ?>
96
                                                </p>
×
97
                                                <hr class="yoast-upsell-hr" aria-hidden="true">
×
98
                                                <div class="review-container">
×
99
                                                        <a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
×
100
                                                                <span class="claim">
×
101
                                                                        <?php \esc_html_e( 'Read reviews from real users', 'wordpress-seo' ); ?>
×
102
                                                                </span>
×
103
                                                                <span class="rating">
×
104
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/g2_logo_white_optm.svg' ); ?>">
×
105
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
106
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
107
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
108
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
109
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="20" width="20" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
×
110
                                                                        <span class="rating-text">4.6 / 5</span>
111

112
                                                                </span>
113
                                                        </a>
114
                                                </div>
115
                                        </div>
116
                                </div>
117
                                <div class="yoast-sidebar__section">
118
                                        <h2>
119
                                                <?php
120
                                                \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
121
                                                ?>
122
                                        </h2>
×
123
                                        <p>
×
124
                                                <?php
×
125
                                                $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
126

127
                                                /* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
128
                                                \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>' );
×
129
                                                echo '<br/>';
×
130
                                                \esc_html_e( 'We have both free and premium online courses to learn everything you need to know about SEO.', 'wordpress-seo' );
×
131
                                                ?>
132
                                        </p>
×
133
                                        <p>
×
134
                                                <a href="<?php echo \esc_url( $academy_shortlink ); ?>" target="_blank">
×
135
                                                        <?php
136
                                                        /* translators: %1$s expands to Yoast SEO academy */
137
                                                        \printf( \esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
×
138
                                                        ?>
139
                                                </a>
×
140
                                        </p>
×
141
                                </div>
×
142
                        </div>
×
143
                <?php
×
144
                return \ob_get_clean();
×
145
        }
146
}
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