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

Yoast / wordpress-seo / 5066322038

pending completion
5066322038

push

github

GitHub
Merge pull request #20316 from Yoast/JRF/ghactions-run-more-selectively

2550 of 29012 relevant lines covered (8.79%)

0.32 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

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

13
        /**
14
         * Presents the sidebar.
15
         *
16
         * @return string The sidebar HTML.
17
         */
18
        public function present() {
19
                $assets_uri              = \trailingslashit( \plugin_dir_url( \WPSEO_FILE ) );
×
20
                $buy_yoast_seo_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/jj' );
×
21
                \ob_start();
×
22
                ?>
23
                        <div class="wpseo_content_cell" id="sidebar-container">
×
24
                                <div id="sidebar" class="yoast-sidebar">
×
25
                                        <div class="wpseo_content_cell_title yoast-sidebar__title">
×
26
                                                <?php
×
27
                                                /* translators: %1$s expands to Yoast */
28
                                                \printf( \esc_html__( '%1$s recommendations for you', 'wordpress-seo' ), 'Yoast' );
×
29
                                                ?>
30
                                        </div>
×
31
                                        <div class="yoast-sidebar__product">
×
32
                                                <figure class="product-image">
×
33
                                                        <figure class="product-image">
×
34
                                                                <img
×
35
                                                                        width="75" height="75"
×
36
                                                                        src="<?php echo \esc_url( $assets_uri . 'packages/js/images/Yoast_SEO_Icon.svg' ); ?>"
×
37
                                                                        class="attachment-full size-full content-visible"
38
                                                                        alt="Yoast SEO logo"
39
                                                                        loading="lazy"
40
                                                                        decoding="asyc"
41
                                                                        fetchpriority="low"
42
                                                                        sizes="(min-width: 1321px) 75px">
43
                                                        </figure>
44
                                                </figure>
45
                                                <h2 class="yoast-get-premium-title">
46
                                                        <?php
47
                                                        /* translators: %1$s and %2$s expand to a span wrap to avoid linebreaks. %3$s expands to "Yoast SEO Premium". */
48
                                                        \printf( \esc_html__( '%1$sGet%2$s %3$s', 'wordpress-seo' ), '<span>', '</span>', 'Yoast SEO Premium' );
×
49
                                                        ?>
50
                                                </h2>
×
51
                                                <p>
×
52
                                                        <?php
×
53
                                                        /* translators: %1$s expands to an opening strong tag, %2$s expands to a closing strong tag */
54
                                                        \printf( \esc_html__( 'Be the first to get %1$snew features & tools%2$s, before everyone else. Get %1$s 24/7 support%2$s and boost your website’s visibility.', 'wordpress-seo' ), '<strong>', '</strong>' );
×
55
                                                        ?>
56
                                                </p>
×
57
                                                <p class="plugin-buy-button">
×
58
                                                        <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 ); ?>">
×
59
                                                                <?php
60
                                                                /* translators: %s expands to Yoast SEO Premium */
61
                                                                \printf( \esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
×
62
                                                                ?>
63
                                                                <span aria-hidden="true" class="yoast-button-upsell__caret"></span>
×
64
                                                        </a>
×
65
                                                </p>
×
66
                                                <div class="review-container">
×
67
                                                        <a href="https://www.g2.com/products/yoast-yoast/reviews" target="_blank" rel="noopener">
×
68
                                                                <h3 class="title">
×
69
                                                                        <?php \esc_html_e( 'Read reviews from real users', 'wordpress-seo' ); ?>
×
70
                                                                </h3>
×
71
                                                                <span class="rating">
×
72
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/logo-g2-white.svg' ); ?>">
×
73
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
74
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
75
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
76
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-star.svg' ); ?>">
×
77
                                                                        <img alt="" loading="lazy" fetchpriority="low" decoding="async" height="22" width="22" src="<?php echo \esc_url( $assets_uri . 'packages/js/images/star-rating-half.svg' ); ?>">
×
78
                                                                        <span class="rating-text">4.6 / 5</span>
79

80
                                                                </span>
81
                                                        </a>
82
                                                </div>
83
                                        </div>
84
                                </div>
85
                                <div class="yoast-sidebar__section">
86
                                        <h2>
87
                                                <?php
88
                                                \esc_html_e( 'Learn SEO', 'wordpress-seo' );
×
89
                                                ?>
90
                                        </h2>
×
91
                                        <p>
×
92
                                                <?php
×
93
                                                $academy_shortlink = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
×
94

95
                                                /* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
96
                                                \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>' );
×
97
                                                echo '<br/>';
×
98
                                                \esc_html_e( 'We have both free and premium online courses to learn everything you need to know about SEO.', 'wordpress-seo' );
×
99
                                                ?>
100
                                        </p>
×
101
                                        <p>
×
102
                                                <a href="<?php echo \esc_url( $academy_shortlink ); ?>" target="_blank">
×
103
                                                        <?php
104
                                                        /* translators: %1$s expands to Yoast SEO academy */
105
                                                        \printf( \esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
×
106
                                                        ?>
107
                                                </a>
×
108
                                        </p>
×
109
                                </div>
×
110
                        </div>
×
111
                <?php
×
112
                return \ob_get_clean();
×
113
        }
114
}
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