Skip to content

Commit 8cd2340

Browse files
committed
Merge branch 'release/19.12' into trunk
2 parents f7d3b9a + bc5a465 commit 8cd2340

6 files changed

Lines changed: 134 additions & 20 deletions

File tree

admin/class-admin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function add_action_link( $links, $file ) {
252252
}
253253

254254
// Add link to premium landing page.
255-
$premium_link = '<a style="font-weight: bold;" href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1yb' ) ) . '" target="_blank">' . __( 'Get Premium', 'wordpress-seo' ) . '</a>';
255+
$premium_link = '<a style="font-weight: bold;" href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1yb' ) ) . '" target="_blank" data-action="load-nfd-ctb" data-ctb-id="57d6a568-783c-45e2-a388-847cff155897">' . __( 'Get Premium', 'wordpress-seo' ) . '</a>';
256256
array_unshift( $links, $premium_link );
257257

258258
return $links;

inc/class-wpseo-admin-bar-menu.php

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* @package WPSEO
66
*/
77

8-
use WPSEO_Shortlinker;
98
use Yoast\WP\SEO\Helpers\Product_Helper;
109
use Yoast\WP\SEO\Helpers\Score_Icon_Helper;
1110
use Yoast\WP\SEO\Models\Indexable;
@@ -80,6 +79,13 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
8079
*/
8180
protected $product_helper;
8281

82+
/**
83+
* Holds the shortlinker instance.
84+
*
85+
* @var WPSEO_Shortlinker
86+
*/
87+
protected $shortlinker;
88+
8389
/**
8490
* Whether SEO Score is enabled.
8591
*
@@ -108,12 +114,14 @@ class WPSEO_Admin_Bar_Menu implements WPSEO_WordPress_Integration {
108114
* @param Indexable_Repository|null $indexable_repository Optional. The Indexable_Repository.
109115
* @param Score_Icon_Helper|null $score_icon_helper Optional. The Score_Icon_Helper.
110116
* @param Product_Helper|null $product_helper Optional. The product helper.
117+
* @param WPSEO_Shortlinker|null $shortlinker The shortlinker.
111118
*/
112119
public function __construct(
113120
WPSEO_Admin_Asset_Manager $asset_manager = null,
114121
Indexable_Repository $indexable_repository = null,
115122
Score_Icon_Helper $score_icon_helper = null,
116-
Product_Helper $product_helper = null
123+
Product_Helper $product_helper = null,
124+
WPSEO_Shortlinker $shortlinker = null
117125
) {
118126
if ( ! $asset_manager ) {
119127
$asset_manager = new WPSEO_Admin_Asset_Manager();
@@ -127,11 +135,15 @@ public function __construct(
127135
if ( ! $product_helper ) {
128136
$product_helper = YoastSEO()->helpers->product;
129137
}
138+
if ( ! $shortlinker ) {
139+
$shortlinker = new WPSEO_Shortlinker();
140+
}
130141

131142
$this->product_helper = $product_helper;
132143
$this->asset_manager = $asset_manager;
133144
$this->indexable_repository = $indexable_repository;
134145
$this->score_icon_helper = $score_icon_helper;
146+
$this->shortlinker = $shortlinker;
135147
}
136148

137149
/**
@@ -246,7 +258,7 @@ public function add_menu( WP_Admin_Bar $wp_admin_bar ) {
246258
[
247259
'parent' => self::MENU_IDENTIFIER,
248260
'id' => 'wpseo-frontend-inspector',
249-
'href' => 'https://yoa.st/admin-bar-frontend-inspector',
261+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-frontend-inspector' ),
250262
'title' => __( 'Front-end SEO inspector', 'wordpress-seo' ) . new Premium_Badge_Presenter( 'wpseo-frontend-inspector-badge' ),
251263
'meta' => [
252264
'tabindex' => '0',
@@ -461,17 +473,17 @@ protected function add_seo_tools_submenu( WP_Admin_Bar $wp_admin_bar ) {
461473
[
462474
'id' => 'wpseo-semrush',
463475
'title' => 'Semrush',
464-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-semrush' ),
476+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-semrush' ),
465477
],
466478
[
467479
'id' => 'wpseo-wincher',
468480
'title' => 'Wincher',
469-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-wincher' ),
481+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-wincher' ),
470482
],
471483
[
472484
'id' => 'wpseo-google-trends',
473485
'title' => 'Google trends',
474-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-gtrends' ),
486+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-gtrends' ),
475487
],
476488
];
477489

@@ -498,17 +510,17 @@ protected function add_how_to_submenu( WP_Admin_Bar $wp_admin_bar ) {
498510
[
499511
'id' => 'wpseo-learn-seo',
500512
'title' => __( 'Learn more SEO', 'wordpress-seo' ),
501-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-learn-more-seo' ),
513+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-learn-more-seo' ),
502514
],
503515
[
504516
'id' => 'wpseo-improve-blogpost',
505517
'title' => __( 'Improve your blog post', 'wordpress-seo' ),
506-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-improve-blog-post' ),
518+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-improve-blog-post' ),
507519
],
508520
[
509521
'id' => 'wpseo-write-better-content',
510522
'title' => __( 'Write better content', 'wordpress-seo' ),
511-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-write-better' ),
523+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-write-better' ),
512524
],
513525
];
514526

@@ -535,22 +547,22 @@ protected function add_get_help_submenu( WP_Admin_Bar $wp_admin_bar ) {
535547
[
536548
'id' => 'wpseo-yoast-help',
537549
'title' => __( 'Yoast.com help section', 'wordpress-seo' ),
538-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-yoast-help' ),
550+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-yoast-help' ),
539551
],
540552
[
541553
'id' => 'wpseo-premium-support',
542554
'title' => __( 'Yoast Premium support', 'wordpress-seo' ),
543-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-premium-support' ),
555+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-premium-support' ),
544556
],
545557
[
546558
'id' => 'wpseo-wp-support-forums',
547559
'title' => __( 'WordPress.org support forums', 'wordpress-seo' ),
548-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-wp-support-forums' ),
560+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-wp-support-forums' ),
549561
],
550562
[
551563
'id' => 'wpseo-learn-seo-2',
552564
'title' => __( 'Learn more SEO', 'wordpress-seo' ),
553-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-learn-more-seo-help' ),
565+
'href' => $this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-learn-more-seo-help' ),
554566
],
555567
];
556568

@@ -569,11 +581,14 @@ protected function add_premium_link( WP_Admin_Bar $wp_admin_bar ) {
569581
[
570582
'parent' => self::MENU_IDENTIFIER,
571583
'id' => 'wpseo-get-premium',
572-
'title' => __( 'Get Yoast SEO Premium', 'wordpress-seo' ) . ' &raquo;',
573-
'href' => WPSEO_Shortlinker::get( 'https://yoa.st/admin-bar-get-premium' ),
584+
// Circumvent an issue in the WP admin bar API in order to pass `data` attributes. See https://core.trac.wordpress.org/ticket/38636.
585+
'title' => sprintf(
586+
'<a href="%1$s" target="_blank" data-action="load-nfd-ctb" data-ctb-id="57d6a568-783c-45e2-a388-847cff155897" style="padding:0;">%2$s &raquo;</a>',
587+
$this->shortlinker->build_shortlink( 'https://yoa.st/admin-bar-get-premium' ),
588+
__( 'Get Yoast SEO Premium', 'wordpress-seo' )
589+
),
574590
'meta' => [
575591
'tabindex' => '0',
576-
'target' => '_blank',
577592
],
578593
]
579594
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"typescript": "^4.2.4"
8585
},
8686
"yoast": {
87-
"pluginVersion": "19.12-RC6"
87+
"pluginVersion": "19.12-RC7"
8888
},
8989
"version": "0.0.0"
9090
}

src/deprecated/i18n/i18n-v3.php

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<?php
2+
/**
3+
* Yoast I18n module.
4+
*
5+
* @package Yoast\I18n-module
6+
*/
7+
8+
/**
9+
* This class defines a promo box and checks your translation site's API for stats about it,
10+
* then shows them to the user.
11+
*
12+
* @deprecated 19.12
13+
* @codeCoverageIgnore
14+
* @phpcs:disable PEAR.NamingConventions.ValidClassName.Invalid
15+
*/
16+
class Yoast_I18n_v3 {
17+
18+
/**
19+
* Class constructor.
20+
*
21+
* @deprecated 19.12
22+
* @codeCoverageIgnore
23+
*
24+
* @param array $args Contains the settings for the class.
25+
* @param bool $show_translation_box Whether the translation box should be shown.
26+
*/
27+
public function __construct( $args, $show_translation_box = true ) {
28+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
29+
}
30+
31+
/**
32+
* Returns whether the language is en_US.
33+
*
34+
* @deprecated 19.12
35+
* @codeCoverageIgnore
36+
*
37+
* @param string $language The language to check.
38+
*
39+
* @return bool Returns true if the language is en_US.
40+
*/
41+
protected function is_default_language( $language ) {
42+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
43+
return true;
44+
}
45+
46+
/**
47+
* Returns the i18n_promo message from the i18n_module. Returns en empty string if the promo shouldn't be shown.
48+
*
49+
* @deprecated 19.12
50+
* @codeCoverageIgnore
51+
*
52+
* @access public
53+
*
54+
* @return string The i18n promo message.
55+
*/
56+
public function get_promo_message() {
57+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
58+
return '';
59+
}
60+
61+
/**
62+
* Returns a button that can be used to dismiss the i18n-message.
63+
*
64+
* @deprecated 19.12
65+
* @codeCoverageIgnore
66+
*
67+
* @access private
68+
*
69+
* @return string
70+
*/
71+
public function get_dismiss_i18n_message_button() {
72+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
73+
return '';
74+
}
75+
76+
/**
77+
* Outputs a promo box.
78+
*
79+
* @deprecated 19.12
80+
* @codeCoverageIgnore
81+
*
82+
* @access public
83+
*/
84+
public function promo() {
85+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
86+
}
87+
88+
/**
89+
* The API URL to use when requesting translation information.
90+
*
91+
* @deprecated 19.12
92+
* @codeCoverageIgnore
93+
*
94+
* @param string $api_url The new API URL.
95+
*/
96+
public function set_api_url( $api_url ) {
97+
\_deprecated_function( __METHOD__, 'WPSEO 19.12' );
98+
}
99+
}

wp-seo-main.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* {@internal Nobody should be able to overrule the real version number as this can cause
1616
* serious issues with the options, so no if ( ! defined() ).}}
1717
*/
18-
define( 'WPSEO_VERSION', '19.12-RC6' );
18+
define( 'WPSEO_VERSION', '19.12-RC7' );
1919

2020

2121
if ( ! defined( 'WPSEO_PATH' ) ) {

wp-seo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
* @wordpress-plugin
1010
* Plugin Name: Yoast SEO
11-
* Version: 19.12-RC6
11+
* Version: 19.12-RC7
1212
* Plugin URI: https://yoa.st/1uj
1313
* Description: The first true all-in-one SEO solution for WordPress, including on-page content analysis, XML sitemaps and much more.
1414
* Author: Team Yoast

0 commit comments

Comments
 (0)