• 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
/admin/views/licenses.php
1
<?php
2
/**
3
 * WPSEO plugin file.
4
 *
5
 * @package WPSEO\Admin
6
 * @since   5.1
7
 */
8

9
use Yoast\WP\SEO\Promotions\Application\Promotion_Manager;
10

11
if ( ! defined( 'WPSEO_VERSION' ) ) {
×
12
        header( 'Status: 403 Forbidden' );
×
13
        header( 'HTTP/1.1 403 Forbidden' );
×
14
        exit();
×
15
}
16

17
do_action( 'wpseo_install_and_activate_addons' );
×
18

19
$premium_extension = [
×
20
        'buyUrl'   => WPSEO_Shortlinker::get( 'https://yoa.st/zz' ),
×
21
        'infoUrl'  => WPSEO_Shortlinker::get( 'https://yoa.st/zy' ),
×
22
        'title'    => 'Yoast SEO Premium',
×
23
        /* translators: %1$s expands to Yoast SEO */
24
        'desc'     => sprintf( __( 'The premium version of %1$s with more features & support.', 'wordpress-seo' ), 'Yoast SEO' ),
×
NEW
25
        'image'    => plugin_dir_url( WPSEO_FILE ) . 'packages/js/images/Yoast_SEO_Icon.svg',
×
26
        'benefits' => [],
×
27
];
×
28

29
$extensions = [
×
30
        WPSEO_Addon_Manager::LOCAL_SLUG => [
×
31
                'buyUrl'        => WPSEO_Shortlinker::get( 'https://yoa.st/zt' ),
×
32
                'infoUrl'       => WPSEO_Shortlinker::get( 'https://yoa.st/zs' ),
×
33
                'title'         => 'Local SEO',
×
34
                'display_title' => __( 'Maximize your visibility for local searches', 'wordpress-seo' ),
×
35
                'desc'          => __( 'Rank better locally and in Google Maps, without breaking a sweat!', 'wordpress-seo' ),
×
36
                'image'         => plugins_url( 'images/local_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
×
37
                'benefits'      => [
×
38
                        __( 'Attract more local customers to your website and physical store', 'wordpress-seo' ),
×
39
                        __( 'Automatically get technical SEO best practices for local businesses', 'wordpress-seo' ),
×
40
                        __( 'Easily add maps, address finders, and opening hours to your content', 'wordpress-seo' ),
×
41
                        __( 'Optimize your business for multiple locations', 'wordpress-seo' ),
×
42
                ],
×
43
        ],
×
44
        WPSEO_Addon_Manager::VIDEO_SLUG => [
×
45
                'buyUrl'        => WPSEO_Shortlinker::get( 'https://yoa.st/zx/' ),
×
46
                'infoUrl'       => WPSEO_Shortlinker::get( 'https://yoa.st/zw/' ),
×
47
                'title'         => 'Video SEO',
×
48
                'display_title' => __( 'Drive more traffic to your videos', 'wordpress-seo' ),
×
49
                'desc'          => __( 'Optimize your videos to show them off in search results and get more clicks!', 'wordpress-seo' ),
×
50
                'image'         => plugins_url( 'images/video_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
×
51
                'benefits'      => [
×
52
                        __( 'Know that Google discovers your videos', 'wordpress-seo' ),
×
53
                        __( 'Load pages faster that include videos', 'wordpress-seo' ),
×
54
                        __( 'Make your videos responsive for all screen sizes', 'wordpress-seo' ),
×
55
                        __( 'Get XML video sitemaps', 'wordpress-seo' ),
×
56
                ],
×
57
        ],
×
58
        WPSEO_Addon_Manager::NEWS_SLUG  => [
×
59
                'buyUrl'        => WPSEO_Shortlinker::get( 'https://yoa.st/zv/' ),
×
60
                'infoUrl'       => WPSEO_Shortlinker::get( 'https://yoa.st/zu/' ),
×
61
                'title'         => 'News SEO',
×
62
                'display_title' => __( 'Rank higher in Google\'s news carousel', 'wordpress-seo' ),
×
63
                'desc'          => __( 'Are you in Google News? Increase your traffic from Google News by optimizing for it!', 'wordpress-seo' ),
×
64
                'image'         => plugins_url( 'images/news_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
×
65
                'benefits'      => [
×
66
                        __( 'Optimize your site for Google News', 'wordpress-seo' ),
×
67
                        __( 'Ping Google on the publication of a new post', 'wordpress-seo' ),
×
68
                        __( 'Add all necessary schema.org markup', 'wordpress-seo' ),
×
69
                        __( 'Get XML news sitemaps', 'wordpress-seo' ),
×
70
                ],
×
71
        ],
×
72
];
×
73

74
// Add Yoast WooCommerce SEO when WooCommerce is active.
75
if ( YoastSEO()->helpers->woocommerce->is_active() ) {
×
76
        $extensions[ WPSEO_Addon_Manager::WOOCOMMERCE_SLUG ] = [
×
77
                'buyUrl'        => WPSEO_Shortlinker::get( 'https://yoa.st/zr' ),
×
78
                'infoUrl'       => WPSEO_Shortlinker::get( 'https://yoa.st/zq' ),
×
79
                'title'         => 'Yoast WooCommerce SEO',
×
80
                'display_title' => __( 'Drive more traffic to your online store', 'wordpress-seo' ),
×
81
                /* translators: %1$s expands to Yoast SEO */
82
                'desc'          => sprintf( __( 'Seamlessly integrate WooCommerce with %1$s and get extra features!', 'wordpress-seo' ), 'Yoast SEO' ),
×
83
                'image'         => plugins_url( 'images/woo_plugin_assistant.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
×
84
                'benefits'      => [
×
85
                        __( 'Write product pages that rank with the enhanced SEO analysis', 'wordpress-seo' ),
×
86
                        __( 'Increase clicks of Google search with rich results', 'wordpress-seo' ),
×
87
                        __( 'Add global identifiers for variable products', 'wordpress-seo' ),
×
88
                        /* translators: %1$s expands to Yoast SEO, %2$s expands to WooCommerce */
89
                        sprintf( __( 'Seamless integration between %1$s and %2$s', 'wordpress-seo' ), 'Yoast SEO', 'WooCommerce' ),
×
90
                ],
×
91
                'buy_button'    => 'WooCommerce SEO',
×
92
        ];
×
93
}
94

95
// The total number of plugins to consider is the length of the array + 1 for Premium.
96
// @phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
97
$number_plugins_total = ( count( $extensions ) + 1 );
×
98
// @phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
99
$number_plugins_active = 0;
×
100

101
$extensions['yoast-seo-plugin-subscription'] = [
×
102
        'buyUrl'        => WPSEO_Shortlinker::get( 'https://yoa.st/premium-page-bundle-buy' ),
×
103
        'infoUrl'       => WPSEO_Shortlinker::get( 'https://yoa.st/premium-page-bundle-info' ),
×
104
        /* translators: used in phrases such as "More information about all the Yoast plugins" */
105
        'title'         => __( 'all the Yoast plugins', 'wordpress-seo' ),
×
106
        'display_title' => __( 'Cover all your SEO bases', 'wordpress-seo' ),
×
107
        'desc'          => '',
×
108
        'image'         => plugins_url( 'images/plugin_subscription.svg?v=' . WPSEO_VERSION, WPSEO_FILE ),
×
109
        'benefits'      => [
×
110
                __( 'Get all 5 Yoast plugins for WordPress with a big discount', 'wordpress-seo' ),
×
111
                __( 'Reach new customers that live near your business', 'wordpress-seo' ),
×
112
                __( 'Drive more traffic with your videos', 'wordpress-seo' ),
×
113
                __( 'Rank higher in Google\'s news carousel', 'wordpress-seo' ),
×
114
                __( 'Drive more traffic to your online store', 'wordpress-seo' ),
×
115

116
        ],
×
117
        /* translators: used in phrases such as "Buy all the Yoast plugins" */
118
        'buy_button'    => __( 'all the Yoast plugins', 'wordpress-seo' ),
×
119
];
×
120

121
$addon_manager                  = new WPSEO_Addon_Manager();
×
122
$has_valid_premium_subscription = YoastSEO()->helpers->product->is_premium() && $addon_manager->has_valid_subscription( WPSEO_Addon_Manager::PREMIUM_SLUG );
×
123

124
/* translators: %1$s expands to Yoast SEO. */
125
$wpseo_extensions_header = sprintf( __( '%1$s Extensions', 'wordpress-seo' ), 'Yoast SEO' );
×
126
$new_tab_message         = sprintf(
×
127
        '<span class="screen-reader-text">%1$s</span>',
×
128
        /* translators: Hidden accessibility text. */
129
        esc_html__( '(Opens in a new browser tab)', 'wordpress-seo' )
×
130
);
×
131

NEW
132
$sale_badge         = '';
×
NEW
133
$premium_sale_badge = '';
×
134

NEW
135
if ( YoastSEO()->classes->get( Promotion_Manager::class )->is( 'black-friday-2023-promotion' ) ) {
×
136
        /* translators: %1$s expands to opening span, %2$s expands to closing span */
NEW
137
        $sale_badge_span = sprintf( esc_html__( '%1$sSALE 30%% OFF!%2$s', 'wordpress-seo' ), '<span>', '</span>' );
×
138

NEW
139
        $sale_badge = '<div class="yoast-seo-premium-extension-sale-badge">' . $sale_badge_span . '</div>';
×
140

NEW
141
        $premium_sale_badge = ( $has_valid_premium_subscription ) ? '' : $sale_badge;
×
142

143
}
144

145
?>
146

147
<div class="wrap yoast wpseo_table_page">
×
148

149
        <h1 id="wpseo-title" class="yoast-h1"><?php echo esc_html( $wpseo_extensions_header ); ?></h1>
150

151
        <div id="extensions">
152
                <section class="yoast-seo-premium-extension">
153
                        <?php echo $premium_sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is already escaped ?>
154
                        <h2>
×
155
                                <?php
156
                                printf(
×
157
                                        /* translators: 1: expands to Yoast SEO Premium */
NEW
158
                                        esc_html__( 'Drive more traffic to your site with %1$s', 'wordpress-seo' ),
×
159
                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
160
                                        $premium_extension['title']
×
161
                                );
×
162
                                ?>
163
                                <img alt="" width="100" height="100" src="<?php echo esc_url( $premium_extension['image'] ); ?>"/>
164
                        </h2>
165
                        <?php
166
                        if ( ! $has_valid_premium_subscription ) :
×
167
                                ?>
168
                                <ul class="yoast-seo-premium-benefits yoast-list--usp">
×
169
                                        <li class="yoast-seo-premium-benefits__item">
×
170
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Be more efficient in creating content', 'wordpress-seo' ); ?></span>
171
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Use AI to create high-quality titles and meta descriptions for posts and pages', 'wordpress-seo' ); ?></span>
172
                                        </li>
173
                                        <li class="yoast-seo-premium-benefits__item">
174
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Reach bigger audiences', 'wordpress-seo' ); ?></span>
175
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Optimize a single post for synonyms and related keyphrases and get extra checks with the Premium SEO analysis', 'wordpress-seo' ); ?></span>
176
                                        </li>
177
                                        <li class="yoast-seo-premium-benefits__item">
178
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Save time on doing SEO', 'wordpress-seo' ); ?></span>
179
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'The Yoast SEO workouts guide you through important routine SEO tasks', 'wordpress-seo' ); ?></span>
180
                                        </li>
181
                                        <li class="yoast-seo-premium-benefits__item">
182
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Improve your internal linking structure', 'wordpress-seo' ); ?></span>
183
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Get tools that tell you where and how to improve internal linking', 'wordpress-seo' ); ?></span>
184
                                        </li>
185
                                        <li class="yoast-seo-premium-benefits__item">
186
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Reduce your site\'s carbon footprint', 'wordpress-seo' ); ?></span>
187
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Save energy by reducing the crawlability of your site without hurting your rankings!', 'wordpress-seo' ); ?></span>
188
                                        </li>
189
                                        <li class="yoast-seo-premium-benefits__item">
190
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Prevents 404s', 'wordpress-seo' ); ?></span>
191
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Easily create and manage redirects when you move or delete content', 'wordpress-seo' ); ?></span>
192
                                        </li>
193
                                        <li class="yoast-seo-premium-benefits__item">
194
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Stand out on social media', 'wordpress-seo' ); ?></span>
195
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Check what your Facebook or Twitter post will look like before posting them', 'wordpress-seo' ); ?></span>
196
                                        </li>
197
                                        <li class="yoast-seo-premium-benefits__item">
198
                                                <span class="yoast-seo-premium-benefits__title"><?php esc_html_e( 'Premium support', 'wordpress-seo' ); ?></span>
199
                                                <span class="yoast-seo-premium-benefits__description"><?php esc_html_e( 'Gain access to our 24/7 support team', 'wordpress-seo' ); ?></span>
200
                                        </li>
201
                                </ul>
202
                        <?php endif; ?>
203
                        <?php if ( $addon_manager->is_installed( WPSEO_Addon_Manager::PREMIUM_SLUG ) ) : ?>
204
                                <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-installed"><?php esc_html_e( 'Installed', 'wordpress-seo' ); ?></div>
205

206
                                <?php
207
                                if ( $has_valid_premium_subscription ) :
×
208
                                        ++$number_plugins_active;
×
209
                                        ?>
210
                                        <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-activated"><?php esc_html_e( 'Activated', 'wordpress-seo' ); ?></div>
211
                                        <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>" class="yoast-link--license">
212
                                                <?php
213
                                                printf(
×
214
                                                        /* translators: %s expands to the extension title */
215
                                                        esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ),
×
216
                                                        esc_html( $premium_extension['title'] )
×
217
                                                );
×
218
                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
219
                                                echo $new_tab_message;
×
220
                                                ?>
221
                                        </a>
×
222
                                <?php else : ?>
223
                                        <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-not-activated"><?php esc_html_e( 'Not activated', 'wordpress-seo' ); ?></div>
224
                                        <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>" class="yoast-link--license">
225
                                                <?php
226
                                                printf(
×
227
                                                        /* translators: %s expands to the extension title */
228
                                                        esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ),
×
229
                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
230
                                                        esc_html( $premium_extension['title'] )
×
231
                                                );
×
232
                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
233
                                                echo $new_tab_message;
×
234
                                                ?>
235
                                        </a>
×
236
                                <?php endif; ?>
237

238
                        <?php else : ?>
239

240
                                <a target="_blank" data-action="load-nfd-ctb" data-ctb-id="f6a84663-465f-4cb5-8ba5-f7a6d72224b2" href="<?php echo esc_url( $premium_extension['buyUrl'] ); ?>" class="yoast-button-upsell">
241
                                        <?php
242
                                        printf(
×
243
                                                /* translators: $s expands to Yoast SEO Premium */
244
                                                esc_html__( 'Buy %s', 'wordpress-seo' ),
×
245
                                                esc_html( $premium_extension['title'] )
×
246
                                        );
×
247
                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
248
                                        echo $new_tab_message;
×
249
                                        echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
×
250
                                        ?>
251
                                </a>
×
252

253
                                <a target="_blank"  href="<?php echo esc_url( $premium_extension['infoUrl'] ); ?>" class="yoast-link--more-info">
254
                                        <?php
255
                                        printf(
×
256
                                                /* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name. */
257
                                                esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
×
258
                                                '<span class="screen-reader-text">',
×
259
                                                '</span>',
×
260
                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
261
                                                $premium_extension['title']
×
262
                                        );
×
263
                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
264
                                        echo $new_tab_message;
×
265
                                        ?>
266
                                </a>
×
267
                        <?php endif; ?>
268
                        <?php if ( ! $has_valid_premium_subscription ) { ?>
269
                                <p>
×
270
                                        <small class="yoast-money-back-guarantee"><?php esc_html_e( 'With 30-day money-back guarantee. No questions asked.', 'wordpress-seo' ); ?></small>
271
                                </p>
272
                        <?php } ?>
273
                </section>
×
274

275
                <hr class="yoast-hr" aria-hidden="true"/>
×
276

277
                <section class="yoast-promo-extensions">
×
278
                        <h2>
×
279
                                <?php
280
                                $yoast_outrank_copy = sprintf( esc_html__( 'Outrank your competitors even further', 'wordpress-seo' ) );
×
281
                                $yoast_outrank_copy = '<span class="yoast-heading-highlight">' . $yoast_outrank_copy . '</span>';
×
282

283
                                printf(
×
284
                                        /* translators: 1: expands to Outrank your competitors even further, 2: expands to Yoast SEO */
285
                                        esc_html__( '%1$s with %2$s extensions', 'wordpress-seo' ),
×
286
                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $yoast_seo_extensions is properly escaped.
287
                                        $yoast_outrank_copy,
×
288
                                        'Yoast SEO'
×
289
                                );
×
290
                                ?>
291
                        </h2>
×
292

293
                        <?php
294
                        foreach ( $extensions as $slug => $extension ) :
×
295

296
                                // Skip the "All the plugins" card if the user has already all the plugins active.
297
                                if ( $slug === 'yoast-seo-plugin-subscription' && $number_plugins_active === $number_plugins_total ) {
×
298
                                        continue;
×
299
                                }
300
                                ?>
301
                                <section class="yoast-promoblock secondary yoast-promo-extension">
×
302
                                        <?php if ( ! $addon_manager->has_valid_subscription( $slug ) || ! $addon_manager->is_installed( $slug ) ) : ?>
303
                                                <?php echo $sale_badge; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output already escaped ?>
304
                                        <?php endif; ?>
305
                                        <h3>
×
306
                                                <img alt="" width="100" height="100" src="<?php echo esc_url( $extension['image'] ); ?>"/>
307
                                                <?php echo esc_html( $extension['display_title'] ); ?>
308
                                        </h3>
×
309
                                        <ul class="yoast-list--usp">
×
310
                                                <?php foreach ( $extension['benefits'] as $benefit ) : ?>
311
                                                        <li><?php echo esc_html( $benefit ); ?></li>
312
                                                <?php endforeach; ?>
313
                                        </ul>
×
314

315
                                        <div class="yoast-button-container">
×
316
                                                <?php if ( $addon_manager->is_installed( $slug ) ) : ?>
317
                                                        <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-installed"><?php esc_html_e( 'Installed', 'wordpress-seo' ); ?></div>
318

319
                                                        <?php
320
                                                        if ( $addon_manager->has_valid_subscription( $slug ) ) :
×
321
                                                                ++$number_plugins_active;
×
322
                                                                ?>
323
                                                                <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-activated"><?php esc_html_e( 'Activated', 'wordpress-seo' ); ?></div>
324
                                                                <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13k' ); ?>" class="yoast-link--license">
325
                                                                        <?php
326
                                                                        printf(
×
327
                                                                                /* translators: %s expands to the extension title */
328
                                                                                esc_html__( 'Manage your %s subscription on MyYoast', 'wordpress-seo' ),
×
329
                                                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
330
                                                                                $extension['title']
×
331
                                                                        );
×
332
                                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
333
                                                                        echo $new_tab_message;
×
334
                                                                        ?>
335
                                                                </a>
×
336
                                                        <?php else : ?>
337
                                                                <div class="yoast-button yoast-button--noarrow yoast-button--extension yoast-button--extension-not-activated"><?php esc_html_e( 'Not activated', 'wordpress-seo' ); ?></div>
338
                                                                <a target="_blank" href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/13i' ); ?>" class="yoast-link--license">
339
                                                                        <?php
340
                                                                        printf(
×
341
                                                                                /* translators: %s expands to the extension title */
342
                                                                                esc_html__( 'Activate %s for your site on MyYoast', 'wordpress-seo' ),
×
343
                                                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
344
                                                                                $extension['title']
×
345
                                                                        );
×
346
                                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
347
                                                                        echo $new_tab_message;
×
348
                                                                        ?>
349
                                                                </a>
×
350
                                                        <?php endif; ?>
351
                                                <?php else : ?>
352
                                                        <a target="_blank" class="yoast-button-upsell" href="<?php echo esc_url( $extension['buyUrl'] ); ?>">
353
                                                                <?php
354
                                                                printf(
×
355
                                                                        /* translators: %s expands to the product name, e.g. "News SEO" or "all the Yoast Plugins" */
356
                                                                        esc_html__( 'Buy %s', 'wordpress-seo' ),
×
357
                                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The possible `get_buy_button` values are hardcoded (buy_button or title); only passed through the WPSEO_Extensions class.
358
                                                                        ( isset( $extension['buy_button'] ) ) ? $extension['buy_button'] : $extension['title']
×
359
                                                                );
×
360
                                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
361
                                                                echo $new_tab_message;
×
362
                                                                echo '<span aria-hidden="true" class="yoast-button-upsell__caret"></span>';
×
363
                                                                ?>
364
                                                        </a>
×
365

366
                                                        <a target="_blank" class="yoast-link--more-info" href="<?php echo esc_url( $extension['infoUrl'] ); ?>">
367
                                                                <?php
368
                                                                printf(
×
369
                                                                        /* translators: Text between 1: and 2: will only be shown to screen readers. 3: expands to the product name, e.g. "News SEO" or "all the Yoast Plugins" */
370
                                                                        esc_html__( 'More information %1$sabout %3$s%2$s', 'wordpress-seo' ),
×
371
                                                                        '<span class="screen-reader-text">',
×
372
                                                                        '</span>',
×
373
                                                                        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: The `get_title` value is hardcoded; only passed through the WPSEO_Extensions class.
374
                                                                        $extension['title']
×
375
                                                                );
×
376
                                                                // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
377
                                                                echo $new_tab_message;
×
378
                                                                ?>
379
                                                        </a>
×
380
                                                <?php endif; ?>
381
                                        </div>
×
382
                                </section>
×
383
                        <?php endforeach; ?>
384
                </section>
×
385
        </div>
×
386

387
</div>
×
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