• 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
/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() {
NEW
20
                $title = \__( 'BLACK FRIDAY - 30% OFF', '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-2023-promotion' ) ) : ?>
NEW
49
                                                        <div class="sidebar__sale_banner_container">
×
NEW
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
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
58
                                                        \printf( \esc_html__( '%1$sGet%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
59
                                                        ?>
60
                                                </h2>
×
61
                                                <p>
×
62
                                                        <?php
NEW
63
                                                        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' );
×
64
                                                        ?>
65
                                                </p>
×
66
                                                <?php if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) : ?>
NEW
67
                                                        <div class="sidebar__sale_text">
×
NEW
68
                                                                <p>
×
69
                                                                        <?php
70
                                                                        /* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
NEW
71
                                                                        \printf( \esc_html__( '%1$s SAVE 30%% %2$s on your 12 month subscription', 'wordpress-seo' ), '<strong>', '</strong>' );
×
72
                                                                        ?>
NEW
73
                                                                </p>
×
NEW
74
                                                        </div>
×
75
                                                <?php endif; ?>
76
                                                <p class="plugin-buy-button">
×
77
                                                        <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 ); ?>">
78
                                                                <?php
NEW
79
                                                                if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
×
NEW
80
                                                                        echo \esc_html__( 'Claim your 30% off now!', 'wordpress-seo' );
×
81
                                                                }
82
                                                                else {
83
                                                                        /* translators: %s expands to Yoast SEO Premium */
NEW
84
                                                                        \printf( \esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
×
85
                                                                }
86
                                                                ?>
87
                                                                <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
88
                                                        </a>
×
89
                                                </p>
×
90
                                                <div class="review-container">
×
91
                                                        <a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
×
NEW
92
                                                                <span class="claim">
×
93
                                                                        <?php \esc_html_e( 'Read reviews from real users', 'wordpress-seo' ); ?>
NEW
94
                                                                </span>
×
95
                                                                <span class="rating">
×
96
                                                                        <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' ); ?>">
97
                                                                        <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' ); ?>">
98
                                                                        <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' ); ?>">
99
                                                                        <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' ); ?>">
100
                                                                        <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' ); ?>">
101
                                                                        <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' ); ?>">
102
                                                                        <span class="rating-text">4.6 / 5</span>
103

104
                                                                </span>
105
                                                        </a>
106
                                                </div>
107
                                        </div>
108
                                </div>
109
                                <div class="yoast-sidebar__section">
110
                                        <h2>
111
                                                <?php
112
                                                \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
113
                                                ?>
114
                                        </h2>
×
115
                                        <p>
×
116
                                                <?php
117
                                                $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
118

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