Version Description
Release Date: June 15th, 2021
Yoast SEO 16.5 is out today! This release comes with a number of fixes and enhancements. For instance, easier social media settings, better understanding of the Turkish and Czech languages and improvements to the breadcrumbs schema output. Read all about it in our release post!
Enhancements:
- Improves passive voice recognition for Turkish.
- Improves accuracy of the Czech passive voice assessment by separating clauses based on punctuation marks, and by expanding the list of stopwords.
- Changes the breadcrumbs schema output so Google can understand it better.
- Moves the social settings for the homepage from the Social > Facebook tab, to Search Appearance > General.
- Improves the organization of the Search Appearance > General tab, with distinct collapsibles for the Title Separator, the Homepage settings and the Schema.org settings.
- Introduces a notice to be displayed in Search Appearance > General in place of the Social settings for the Homepage when Open Graph is disabled.
- Introduces an image validation warning for the Homepage social image and the Default social image to warn about unsupported file extensions.
- Improves spacing, headings and toggle labels in the Search Appearance settings, and makes the forms more consistent.
- Less is more: removes a whole bunch of ads from the Yoast SEO admin screens.
- Optimizes subscription validations made by Premium add-ons.
- Improves the truncation of the
primary_focus_keyword
field in the database to handle multibyte characters. Props to rickhurst. - Introduces a partial integration of the Yoast SEO meta box in the Web Stories WordPress editor. Props to swissspidy.
Bugfixes:
- Fixes a bug where
max-image-preview:large
would be output in the robots meta tag in combination withnoimage
.
Other:
- Moves the 'Force rewrite titles' toggle into a separate paper in the General Search Appearance settings.
Download this release
Release Info
Developer | Yoast |
Plugin | Yoast SEO |
Version | 16.5 |
Comparing to | |
See all releases |
Code changes from version 16.4 to 16.5
- admin/class-admin-editor-specific-replace-vars.php +1 -1
- admin/class-admin-init.php +5 -2
- admin/class-gutenberg-compatibility.php +2 -2
- admin/class-premium-upsell-admin-block.php +2 -1
- admin/class-yoast-form.php +6 -5
- admin/formatter/class-post-metabox-formatter.php +76 -17
- admin/formatter/class-term-metabox-formatter.php +81 -13
- admin/menu/class-replacevar-editor.php +13 -2
- admin/views/class-view-utils.php +59 -24
- admin/views/form/fieldset.php +0 -27
- admin/views/sidebar.php +4 -85
- admin/views/tabs/dashboard/features.php +1 -1
- admin/views/tabs/dashboard/integrations.php +1 -1
- admin/views/tabs/metas/archives.php +8 -3
- admin/views/tabs/metas/general.php +63 -7
- admin/views/tabs/metas/paper-content/author-archive-settings.php +2 -2
- admin/views/tabs/metas/paper-content/date-archives-settings.php +2 -2
- admin/views/tabs/metas/paper-content/front-page-content.php +65 -0
- admin/views/tabs/metas/paper-content/general-content.php +0 -12
- admin/views/tabs/metas/paper-content/general/force-rewrite-title.php +8 -16
- admin/views/tabs/metas/paper-content/general/homepage.php +36 -42
- admin/views/tabs/metas/paper-content/general/knowledge-graph.php +52 -70
- admin/views/tabs/metas/paper-content/general/title-separator.php +7 -23
- admin/views/tabs/metas/paper-content/post-type-content.php +10 -8
- admin/views/tabs/metas/paper-content/post_type/post-type.php +7 -15
- admin/views/tabs/metas/paper-content/post_type/woocommerce-shop-page.php +5 -4
- admin/views/tabs/metas/paper-content/taxonomy-content.php +2 -2
- admin/views/tabs/metas/post-types.php +4 -0
- admin/views/tabs/metas/taxonomies.php +3 -0
- admin/views/tabs/metas/taxonomies/category-url.php +1 -1
- admin/views/tabs/network/features.php +1 -1
- admin/views/tabs/network/integrations.php +1 -1
- admin/views/tabs/social/facebook.php +25 -58
- admin/views/tabs/social/twitterbox.php +1 -1
- css/dist/{admin-global-1640-rtl.css → admin-global-1650-rtl.css} +1 -1
- css/dist/{admin-global-1640.css → admin-global-1650.css} +1 -1
- css/dist/{adminbar-1640-rtl.css → adminbar-1650-rtl.css} +0 -0
- css/dist/{adminbar-1640.css → adminbar-1650.css} +0 -0
- css/dist/{alerts-1640-rtl.css → alerts-1650-rtl.css} +0 -0
- css/dist/{alerts-1640.css → alerts-1650.css} +0 -0
- css/dist/badge-1640-rtl.css +0 -1
- css/dist/badge-1640.css +0 -1
- css/dist/badge-1650-rtl.css +1 -0
- css/dist/badge-1650.css +1 -0
- css/dist/{dashboard-1640-rtl.css → dashboard-1650-rtl.css} +0 -0
- css/dist/{dashboard-1640.css → dashboard-1650.css} +0 -0
- css/dist/{edit-page-1640-rtl.css → edit-page-1650-rtl.css} +0 -0
- css/dist/{edit-page-1640.css → edit-page-1650.css} +0 -0
- css/dist/{elementor-1640-rtl.css → elementor-1650-rtl.css} +0 -0
- css/dist/{elementor-1640.css → elementor-1650.css} +0 -0
- css/dist/{featured-image-1640-rtl.css → featured-image-1650-rtl.css} +0 -0
- css/dist/{featured-image-1640.css → featured-image-1650.css} +0 -0
- css/dist/{filter-explanation-1640-rtl.css → filter-explanation-1650-rtl.css} +0 -0
- css/dist/{filter-explanation-1640.css → filter-explanation-1650.css} +0 -0
- css/dist/{icons-1640-rtl.css → icons-1650-rtl.css} +0 -0
- css/dist/{icons-1640.css → icons-1650.css} +0 -0
- css/dist/{inside-editor-1640-rtl.css → inside-editor-1650-rtl.css} +0 -0
- css/dist/{inside-editor-1640.css → inside-editor-1650.css} +0 -0
- css/dist/{metabox-1640-rtl.css → metabox-1650-rtl.css} +0 -0
- css/dist/{metabox-1640.css → metabox-1650.css} +0 -0
- css/dist/{metabox-primary-category-1640-rtl.css → metabox-primary-category-1650-rtl.css} +0 -0
- css/dist/{metabox-primary-category-1640.css → metabox-primary-category-1650.css} +0 -0
- css/dist/{modal-1640-rtl.css → modal-1650-rtl.css} +0 -0
- css/dist/{modal-1640.css → modal-1650.css} +0 -0
- css/dist/{monorepo-1640-rtl.css → monorepo-1650-rtl.css} +1 -1
- css/dist/{monorepo-1640.css → monorepo-1650.css} +1 -1
- css/dist/{notifications-1640-rtl.css → notifications-1650-rtl.css} +0 -0
- css/dist/{notifications-1640.css → notifications-1650.css} +0 -0
- css/dist/{schema-blocks-1640-rtl.css → schema-blocks-1650-rtl.css} +1 -1
- css/dist/{schema-blocks-1640.css → schema-blocks-1650.css} +1 -1
- css/dist/{score_icon-1640-rtl.css → score_icon-1650-rtl.css} +0 -0
- css/dist/{score_icon-1640.css → score_icon-1650.css} +0 -0
- css/dist/search-appearance-1640-rtl.css +0 -1
- css/dist/search-appearance-1640.css +0 -1
- css/dist/search-appearance-1650-rtl.css +1 -0
- css/dist/search-appearance-1650.css +1 -0
- css/dist/{structured-data-blocks-1640-rtl.css → structured-data-blocks-1650-rtl.css} +0 -0
- css/dist/{structured-data-blocks-1640.css → structured-data-blocks-1650.css} +0 -0
- css/dist/{toggle-switch-1640-rtl.css → toggle-switch-1650-rtl.css} +1 -1
- css/dist/{toggle-switch-1640.css → toggle-switch-1650.css} +1 -1
- css/dist/{wpseo-dismissible-1640-rtl.css → wpseo-dismissible-1650-rtl.css} +0 -0
- css/dist/{wpseo-dismissible-1640.css → wpseo-dismissible-1650.css} +0 -0
- css/dist/{yoast-components-1640-rtl.css → yoast-components-1650-rtl.css} +0 -0
- css/dist/{yoast-components-1640.css → yoast-components-1650.css} +0 -0
- css/dist/{yoast-extensions-1640-rtl.css → yoast-extensions-1650-rtl.css} +0 -0
- css/dist/{yoast-extensions-1640.css → yoast-extensions-1650.css} +0 -0
- css/dist/{yst_plugin_tools-1640-rtl.css → yst_plugin_tools-1650-rtl.css} +1 -1
- css/dist/{yst_plugin_tools-1640.css → yst_plugin_tools-1650.css} +1 -1
- css/dist/{yst_seo_score-1640-rtl.css → yst_seo_score-1650-rtl.css} +0 -0
- css/dist/{yst_seo_score-1640.css → yst_seo_score-1650.css} +0 -0
- inc/class-my-yoast-api-request.php +1 -0
- inc/class-upgrade.php +92 -0
- inc/options/class-wpseo-option-titles.php +16 -13
- js/dist/{addon-installation-1640.js → addon-installation-1650.js} +2 -2
- js/dist/{admin-global-1640.js → admin-global-1650.js} +0 -0
- js/dist/{analysis-worker-1640.js → analysis-worker-1650.js} +0 -0
- js/dist/{api-client-1640.js → api-client-1650.js} +0 -0
- js/dist/{block-editor-1640.js → block-editor-1650.js} +16 -16
- js/dist/{bulk-editor-1640.js → bulk-editor-1650.js} +0 -0
- js/dist/{classic-editor-1640.js → classic-editor-1650.js} +15 -15
- js/dist/{configuration-wizard-1640.js → configuration-wizard-1650.js} +0 -1
admin/class-admin-editor-specific-replace-vars.php
CHANGED
@@ -27,7 +27,7 @@ class WPSEO_Admin_Editor_Specific_Replace_Vars {
|
|
27 |
// Taxonomies.
|
28 |
'category' => [ 'term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy' ],
|
29 |
'post_tag' => [ 'term_title', 'term_description', 'tag_description' ],
|
30 |
-
'post_format' => [],
|
31 |
// Custom taxonomy.
|
32 |
'term-in-custom-taxonomy' => [ 'term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy' ],
|
33 |
|
27 |
// Taxonomies.
|
28 |
'category' => [ 'term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy' ],
|
29 |
'post_tag' => [ 'term_title', 'term_description', 'tag_description' ],
|
30 |
+
'post_format' => [ 'term_title' ],
|
31 |
// Custom taxonomy.
|
32 |
'term-in-custom-taxonomy' => [ 'term_title', 'term_description', 'category_description', 'parent_title', 'term_hierarchy' ],
|
33 |
|
admin/class-admin-init.php
CHANGED
@@ -231,10 +231,13 @@ class WPSEO_Admin_Init {
|
|
231 |
// For backwards compatabilty, this still needs a global, for now...
|
232 |
$GLOBALS['wpseo_admin_pages'] = new WPSEO_Admin_Pages();
|
233 |
|
|
|
234 |
// Only register the yoast i18n when the page is a Yoast SEO page.
|
235 |
-
if ( WPSEO_Utils::is_yoast_seo_free_page(
|
236 |
$this->register_i18n_promo_class();
|
237 |
-
$
|
|
|
|
|
238 |
}
|
239 |
}
|
240 |
}
|
231 |
// For backwards compatabilty, this still needs a global, for now...
|
232 |
$GLOBALS['wpseo_admin_pages'] = new WPSEO_Admin_Pages();
|
233 |
|
234 |
+
$page = filter_input( INPUT_GET, 'page' );
|
235 |
// Only register the yoast i18n when the page is a Yoast SEO page.
|
236 |
+
if ( WPSEO_Utils::is_yoast_seo_free_page( $page ) ) {
|
237 |
$this->register_i18n_promo_class();
|
238 |
+
if ( $page !== 'wpseo_titles' ) {
|
239 |
+
$this->register_premium_upsell_admin_block();
|
240 |
+
}
|
241 |
}
|
242 |
}
|
243 |
}
|
admin/class-gutenberg-compatibility.php
CHANGED
@@ -15,14 +15,14 @@ class WPSEO_Gutenberg_Compatibility {
|
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
-
const CURRENT_RELEASE = '10.
|
19 |
|
20 |
/**
|
21 |
* The minimally supported version of Gutenberg by the plugin.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
-
const MINIMUM_SUPPORTED = '10.
|
26 |
|
27 |
/**
|
28 |
* Holds the current version.
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
+
const CURRENT_RELEASE = '10.8.0';
|
19 |
|
20 |
/**
|
21 |
* The minimally supported version of Gutenberg by the plugin.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
+
const MINIMUM_SUPPORTED = '10.8.0';
|
26 |
|
27 |
/**
|
28 |
* Holds the current version.
|
admin/class-premium-upsell-admin-block.php
CHANGED
@@ -48,7 +48,8 @@ class WPSEO_Premium_Upsell_Admin_Block {
|
|
48 |
* @return void
|
49 |
*/
|
50 |
public function render() {
|
51 |
-
$
|
|
|
52 |
|
53 |
$arguments = [
|
54 |
'<strong>' . esc_html__( 'Multiple keyphrases', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Increase your SEO reach', 'wordpress-seo' ),
|
48 |
* @return void
|
49 |
*/
|
50 |
public function render() {
|
51 |
+
$page = filter_input( INPUT_GET, 'page' );
|
52 |
+
$url = add_query_arg( [ 'screen' => $page ], WPSEO_Shortlinker::get( 'https://yoa.st/17h' ) );
|
53 |
|
54 |
$arguments = [
|
55 |
'<strong>' . esc_html__( 'Multiple keyphrases', 'wordpress-seo' ) . '</strong>: ' . esc_html__( 'Increase your SEO reach', 'wordpress-seo' ),
|
admin/class-yoast-form.php
CHANGED
@@ -327,6 +327,7 @@ class Yoast_Form {
|
|
327 |
* @param bool $reverse Reverse order of buttons (default true).
|
328 |
* @param string $help Inline Help that will be printed out before the toggle.
|
329 |
* @param bool $strong Whether the visual label is displayed in strong text. Default is false.
|
|
|
330 |
* @param array $attr Extra attributes to add to the light switch.
|
331 |
*/
|
332 |
public function light_switch( $var, $label, $buttons = [], $reverse = true, $help = '', $strong = false, $attr = [] ) {
|
@@ -851,8 +852,8 @@ class Yoast_Form {
|
|
851 |
$attr = wp_parse_args( $attr, $defaults );
|
852 |
|
853 |
$index_switch_values = [
|
854 |
-
'off' => __( '
|
855 |
-
'on' => __( '
|
856 |
];
|
857 |
|
858 |
$is_disabled = ( isset( $attr['disabled'] ) && $attr['disabled'] );
|
@@ -863,7 +864,7 @@ class Yoast_Form {
|
|
863 |
sprintf(
|
864 |
/* translators: %s expands to an indexable object's name, like a post type or taxonomy */
|
865 |
esc_html__( 'Show %s in search results?', 'wordpress-seo' ),
|
866 |
-
|
867 |
),
|
868 |
$help,
|
869 |
[ 'disabled' => $is_disabled ]
|
@@ -891,8 +892,8 @@ class Yoast_Form {
|
|
891 |
$off_key = ( $inverse_keys ) ? 'on' : 'off';
|
892 |
|
893 |
$show_hide_switch = [
|
894 |
-
$on_key => __( '
|
895 |
-
$off_key => __( '
|
896 |
];
|
897 |
|
898 |
$is_disabled = ( isset( $attr['disabled'] ) && $attr['disabled'] );
|
327 |
* @param bool $reverse Reverse order of buttons (default true).
|
328 |
* @param string $help Inline Help that will be printed out before the toggle.
|
329 |
* @param bool $strong Whether the visual label is displayed in strong text. Default is false.
|
330 |
+
* Starting from Yoast SEO 16.5, the visual label is forced to bold via CSS.
|
331 |
* @param array $attr Extra attributes to add to the light switch.
|
332 |
*/
|
333 |
public function light_switch( $var, $label, $buttons = [], $reverse = true, $help = '', $strong = false, $attr = [] ) {
|
852 |
$attr = wp_parse_args( $attr, $defaults );
|
853 |
|
854 |
$index_switch_values = [
|
855 |
+
'off' => __( 'On', 'wordpress-seo' ),
|
856 |
+
'on' => __( 'Off', 'wordpress-seo' ),
|
857 |
];
|
858 |
|
859 |
$is_disabled = ( isset( $attr['disabled'] ) && $attr['disabled'] );
|
864 |
sprintf(
|
865 |
/* translators: %s expands to an indexable object's name, like a post type or taxonomy */
|
866 |
esc_html__( 'Show %s in search results?', 'wordpress-seo' ),
|
867 |
+
esc_html( $label )
|
868 |
),
|
869 |
$help,
|
870 |
[ 'disabled' => $is_disabled ]
|
892 |
$off_key = ( $inverse_keys ) ? 'on' : 'off';
|
893 |
|
894 |
$show_hide_switch = [
|
895 |
+
$on_key => __( 'On', 'wordpress-seo' ),
|
896 |
+
$off_key => __( 'Off', 'wordpress-seo' ),
|
897 |
];
|
898 |
|
899 |
$is_disabled = ( isset( $attr['disabled'] ) && $attr['disabled'] );
|
admin/formatter/class-post-metabox-formatter.php
CHANGED
@@ -24,6 +24,13 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
24 |
*/
|
25 |
private $permalink;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Constructor.
|
29 |
*
|
@@ -34,6 +41,20 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
34 |
public function __construct( $post, array $options, $structure ) {
|
35 |
$this->post = $post;
|
36 |
$this->permalink = $structure;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
|
39 |
/**
|
@@ -52,11 +73,15 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
52 |
|
53 |
if ( $this->post instanceof WP_Post ) {
|
54 |
$values_to_set = [
|
55 |
-
'keyword_usage'
|
56 |
-
'title_template'
|
57 |
-
'
|
58 |
-
'
|
59 |
-
'
|
|
|
|
|
|
|
|
|
60 |
];
|
61 |
|
62 |
$values = ( $values_to_set + $values );
|
@@ -71,14 +96,7 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
71 |
* @return string|null The image URL for the social preview.
|
72 |
*/
|
73 |
protected function get_image_url() {
|
74 |
-
|
75 |
-
|
76 |
-
if ( has_post_thumbnail( $post_id ) ) {
|
77 |
-
$featured_image_info = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'thumbnail' );
|
78 |
-
return isset( $featured_image_info[0] ) ? $featured_image_info[0] : null;
|
79 |
-
}
|
80 |
-
|
81 |
-
return WPSEO_Image_Utils::get_first_usable_content_image_for_post( $post_id );
|
82 |
}
|
83 |
|
84 |
/**
|
@@ -175,13 +193,15 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
175 |
/**
|
176 |
* Retrieves the title template.
|
177 |
*
|
|
|
|
|
178 |
* @return string The title template.
|
179 |
*/
|
180 |
-
private function get_title_template() {
|
181 |
$title = $this->get_template( 'title' );
|
182 |
|
183 |
-
if ( $title === '' ) {
|
184 |
-
return '%%title%% %%sep%% %%sitename%%';
|
185 |
}
|
186 |
|
187 |
return $title;
|
@@ -190,12 +210,51 @@ class WPSEO_Post_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
190 |
/**
|
191 |
* Retrieves the metadesc template.
|
192 |
*
|
193 |
-
* @return string
|
194 |
*/
|
195 |
private function get_metadesc_template() {
|
196 |
return $this->get_template( 'metadesc' );
|
197 |
}
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
/**
|
200 |
* Retrieves a template.
|
201 |
*
|
24 |
*/
|
25 |
private $permalink;
|
26 |
|
27 |
+
/**
|
28 |
+
* Whether we must return social templates values.
|
29 |
+
*
|
30 |
+
* @var bool
|
31 |
+
*/
|
32 |
+
private $use_social_templates = false;
|
33 |
+
|
34 |
/**
|
35 |
* Constructor.
|
36 |
*
|
41 |
public function __construct( $post, array $options, $structure ) {
|
42 |
$this->post = $post;
|
43 |
$this->permalink = $structure;
|
44 |
+
|
45 |
+
$this->use_social_templates = $this->use_social_templates();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Determines whether the social templates should be used.
|
50 |
+
*
|
51 |
+
* @return bool Whether the social templates should be used.
|
52 |
+
*/
|
53 |
+
public function use_social_templates() {
|
54 |
+
return YoastSEO()->helpers->product->is_premium()
|
55 |
+
&& defined( 'WPSEO_PREMIUM_VERSION' )
|
56 |
+
&& version_compare( WPSEO_PREMIUM_VERSION, '16.5-RC0', '>=' )
|
57 |
+
&& WPSEO_Options::get( 'opengraph', false ) === true;
|
58 |
}
|
59 |
|
60 |
/**
|
73 |
|
74 |
if ( $this->post instanceof WP_Post ) {
|
75 |
$values_to_set = [
|
76 |
+
'keyword_usage' => $this->get_focus_keyword_usage(),
|
77 |
+
'title_template' => $this->get_title_template(),
|
78 |
+
'title_template_no_fallback' => $this->get_title_template( false ),
|
79 |
+
'metadesc_template' => $this->get_metadesc_template(),
|
80 |
+
'metaDescriptionDate' => $this->get_metadesc_date(),
|
81 |
+
'first_content_image' => $this->get_image_url(),
|
82 |
+
'social_title_template' => $this->get_social_title_template(),
|
83 |
+
'social_description_template' => $this->get_social_description_template(),
|
84 |
+
'social_image_template' => $this->get_social_image_template(),
|
85 |
];
|
86 |
|
87 |
$values = ( $values_to_set + $values );
|
96 |
* @return string|null The image URL for the social preview.
|
97 |
*/
|
98 |
protected function get_image_url() {
|
99 |
+
return WPSEO_Image_Utils::get_first_usable_content_image_for_post( $this->post->ID );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
/**
|
193 |
/**
|
194 |
* Retrieves the title template.
|
195 |
*
|
196 |
+
* @param bool $fallback Whether to return the hardcoded fallback if the template value is empty.
|
197 |
+
*
|
198 |
* @return string The title template.
|
199 |
*/
|
200 |
+
private function get_title_template( $fallback = true ) {
|
201 |
$title = $this->get_template( 'title' );
|
202 |
|
203 |
+
if ( $title === '' && $fallback === true ) {
|
204 |
+
return '%%title%% %%page%% %%sep%% %%sitename%%';
|
205 |
}
|
206 |
|
207 |
return $title;
|
210 |
/**
|
211 |
* Retrieves the metadesc template.
|
212 |
*
|
213 |
+
* @return string The metadesc template.
|
214 |
*/
|
215 |
private function get_metadesc_template() {
|
216 |
return $this->get_template( 'metadesc' );
|
217 |
}
|
218 |
|
219 |
+
/**
|
220 |
+
* Retrieves the social title template.
|
221 |
+
*
|
222 |
+
* @return string The social title template.
|
223 |
+
*/
|
224 |
+
private function get_social_title_template() {
|
225 |
+
if ( $this->use_social_templates ) {
|
226 |
+
return $this->get_template( 'social-title' );
|
227 |
+
}
|
228 |
+
|
229 |
+
return '';
|
230 |
+
}
|
231 |
+
|
232 |
+
/**
|
233 |
+
* Retrieves the social description template.
|
234 |
+
*
|
235 |
+
* @return string The social description template.
|
236 |
+
*/
|
237 |
+
private function get_social_description_template() {
|
238 |
+
if ( $this->use_social_templates ) {
|
239 |
+
return $this->get_template( 'social-description' );
|
240 |
+
}
|
241 |
+
|
242 |
+
return '';
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Retrieves the social image template.
|
247 |
+
*
|
248 |
+
* @return string The social description template.
|
249 |
+
*/
|
250 |
+
private function get_social_image_template() {
|
251 |
+
if ( $this->use_social_templates ) {
|
252 |
+
return $this->get_template( 'social-image-url' );
|
253 |
+
}
|
254 |
+
|
255 |
+
return '';
|
256 |
+
}
|
257 |
+
|
258 |
/**
|
259 |
* Retrieves a template.
|
260 |
*
|
admin/formatter/class-term-metabox-formatter.php
CHANGED
@@ -24,6 +24,13 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
24 |
*/
|
25 |
private $taxonomy;
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
/**
|
28 |
* Array with the WPSEO_Titles options.
|
29 |
*
|
@@ -40,6 +47,20 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
40 |
public function __construct( $taxonomy, $term ) {
|
41 |
$this->taxonomy = $taxonomy;
|
42 |
$this->term = $term;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
}
|
44 |
|
45 |
/**
|
@@ -53,15 +74,19 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
53 |
// Todo: a column needs to be added on the termpages to add a filter for the keyword, so this can be used in the focus keyphrase doubles.
|
54 |
if ( is_object( $this->term ) && property_exists( $this->term, 'taxonomy' ) ) {
|
55 |
$values = [
|
56 |
-
'search_url'
|
57 |
-
'post_edit_url'
|
58 |
-
'base_url'
|
59 |
-
'taxonomy'
|
60 |
-
'keyword_usage'
|
61 |
-
'title_template'
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
|
|
|
|
|
|
|
|
65 |
];
|
66 |
}
|
67 |
|
@@ -126,13 +151,17 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
126 |
/**
|
127 |
* Retrieves the title template.
|
128 |
*
|
|
|
|
|
129 |
* @return string The title template.
|
130 |
*/
|
131 |
-
private function get_title_template() {
|
132 |
$title = $this->get_template( 'title' );
|
133 |
|
134 |
-
if ( $title === '' ) {
|
135 |
-
|
|
|
|
|
136 |
}
|
137 |
|
138 |
return $title;
|
@@ -141,12 +170,51 @@ class WPSEO_Term_Metabox_Formatter implements WPSEO_Metabox_Formatter_Interface
|
|
141 |
/**
|
142 |
* Retrieves the metadesc template.
|
143 |
*
|
144 |
-
* @return string
|
145 |
*/
|
146 |
private function get_metadesc_template() {
|
147 |
return $this->get_template( 'metadesc' );
|
148 |
}
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
/**
|
151 |
* Retrieves a template.
|
152 |
*
|
24 |
*/
|
25 |
private $taxonomy;
|
26 |
|
27 |
+
/**
|
28 |
+
* Whether we must return social templates values.
|
29 |
+
*
|
30 |
+
* @var bool
|
31 |
+
*/
|
32 |
+
private $use_social_templates = false;
|
33 |
+
|
34 |
/**
|
35 |
* Array with the WPSEO_Titles options.
|
36 |
*
|
47 |
public function __construct( $taxonomy, $term ) {
|
48 |
$this->taxonomy = $taxonomy;
|
49 |
$this->term = $term;
|
50 |
+
|
51 |
+
$this->use_social_templates = $this->use_social_templates();
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Determines whether the social templates should be used.
|
56 |
+
*
|
57 |
+
* @return bool Whether the social templates should be used.
|
58 |
+
*/
|
59 |
+
public function use_social_templates() {
|
60 |
+
return YoastSEO()->helpers->product->is_premium()
|
61 |
+
&& defined( 'WPSEO_PREMIUM_VERSION' )
|
62 |
+
&& version_compare( WPSEO_PREMIUM_VERSION, '16.5-RC0', '>=' )
|
63 |
+
&& WPSEO_Options::get( 'opengraph', false ) === true;
|
64 |
}
|
65 |
|
66 |
/**
|
74 |
// Todo: a column needs to be added on the termpages to add a filter for the keyword, so this can be used in the focus keyphrase doubles.
|
75 |
if ( is_object( $this->term ) && property_exists( $this->term, 'taxonomy' ) ) {
|
76 |
$values = [
|
77 |
+
'search_url' => $this->search_url(),
|
78 |
+
'post_edit_url' => $this->edit_url(),
|
79 |
+
'base_url' => $this->base_url_for_js(),
|
80 |
+
'taxonomy' => $this->term->taxonomy,
|
81 |
+
'keyword_usage' => $this->get_focus_keyword_usage(),
|
82 |
+
'title_template' => $this->get_title_template(),
|
83 |
+
'title_template_no_fallback' => $this->get_title_template( false ),
|
84 |
+
'metadesc_template' => $this->get_metadesc_template(),
|
85 |
+
'first_content_image' => $this->get_image_url(),
|
86 |
+
'semrushIntegrationActive' => 0,
|
87 |
+
'social_title_template' => $this->get_social_title_template(),
|
88 |
+
'social_description_template' => $this->get_social_description_template(),
|
89 |
+
'social_image_template' => $this->get_social_image_template(),
|
90 |
];
|
91 |
}
|
92 |
|
151 |
/**
|
152 |
* Retrieves the title template.
|
153 |
*
|
154 |
+
* @param bool $fallback Whether to return the hardcoded fallback if the template value is empty.
|
155 |
+
*
|
156 |
* @return string The title template.
|
157 |
*/
|
158 |
+
private function get_title_template( $fallback = true ) {
|
159 |
$title = $this->get_template( 'title' );
|
160 |
|
161 |
+
if ( $title === '' && $fallback === true ) {
|
162 |
+
/* translators: %s expands to the variable used for term title. */
|
163 |
+
$archives = sprintf( __( '%s Archives', 'wordpress-seo' ), '%%term_title%%' );
|
164 |
+
return $archives . ' %%page%% %%sep%% %%sitename%%';
|
165 |
}
|
166 |
|
167 |
return $title;
|
170 |
/**
|
171 |
* Retrieves the metadesc template.
|
172 |
*
|
173 |
+
* @return string The metadesc template.
|
174 |
*/
|
175 |
private function get_metadesc_template() {
|
176 |
return $this->get_template( 'metadesc' );
|
177 |
}
|
178 |
|
179 |
+
/**
|
180 |
+
* Retrieves the social title template.
|
181 |
+
*
|
182 |
+
* @return string The social title template.
|
183 |
+
*/
|
184 |
+
private function get_social_title_template() {
|
185 |
+
if ( $this->use_social_templates ) {
|
186 |
+
return $this->get_template( 'social-title' );
|
187 |
+
}
|
188 |
+
|
189 |
+
return '';
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Retrieves the social description template.
|
194 |
+
*
|
195 |
+
* @return string The social description template.
|
196 |
+
*/
|
197 |
+
private function get_social_description_template() {
|
198 |
+
if ( $this->use_social_templates ) {
|
199 |
+
return $this->get_template( 'social-description' );
|
200 |
+
}
|
201 |
+
|
202 |
+
return '';
|
203 |
+
}
|
204 |
+
|
205 |
+
/**
|
206 |
+
* Retrieves the social image template.
|
207 |
+
*
|
208 |
+
* @return string The social description template.
|
209 |
+
*/
|
210 |
+
private function get_social_image_template() {
|
211 |
+
if ( $this->use_social_templates ) {
|
212 |
+
return $this->get_template( 'social-image-url' );
|
213 |
+
}
|
214 |
+
|
215 |
+
return '';
|
216 |
+
}
|
217 |
+
|
218 |
/**
|
219 |
* Retrieves a template.
|
220 |
*
|
admin/menu/class-replacevar-editor.php
CHANGED
@@ -30,6 +30,7 @@ class WPSEO_Replacevar_Editor {
|
|
30 |
* @type string $label_description Optional. The label to use for the description field.
|
31 |
* @type string $description_placeholder Optional. The placeholder text to use for the description field.
|
32 |
* @type bool $has_new_badge Optional. Whether to show the "New" badge.
|
|
|
33 |
* }
|
34 |
*/
|
35 |
private $arguments;
|
@@ -50,6 +51,7 @@ class WPSEO_Replacevar_Editor {
|
|
50 |
* @type string $label_description Optional. The label to use for the description field.
|
51 |
* @type string $description_placeholder Optional. The placeholder text to use for the description field.
|
52 |
* @type bool $has_new_badge Optional. Whether to show the "New" badge.
|
|
|
53 |
* }
|
54 |
*/
|
55 |
public function __construct( Yoast_Form $yform, $arguments ) {
|
@@ -61,6 +63,8 @@ class WPSEO_Replacevar_Editor {
|
|
61 |
'label_description' => '',
|
62 |
'description_placeholder' => '',
|
63 |
'has_new_badge' => false,
|
|
|
|
|
64 |
]
|
65 |
);
|
66 |
|
@@ -77,6 +81,8 @@ class WPSEO_Replacevar_Editor {
|
|
77 |
'label_description' => (string) $arguments['label_description'],
|
78 |
'description_placeholder' => (string) $arguments['description_placeholder'],
|
79 |
'has_new_badge' => (bool) $arguments['has_new_badge'],
|
|
|
|
|
80 |
];
|
81 |
}
|
82 |
|
@@ -102,7 +108,10 @@ class WPSEO_Replacevar_Editor {
|
|
102 |
data-react-replacevar-label-title="%6$s"
|
103 |
data-react-replacevar-label-description="%7$s"
|
104 |
data-react-replacevar-description-placeholder="%8$s"
|
105 |
-
data-react-replacevar-has-new-badge="%9$s"
|
|
|
|
|
|
|
106 |
esc_attr( $this->arguments['title'] ),
|
107 |
esc_attr( $this->arguments['description'] ),
|
108 |
esc_attr( $this->arguments['page_type_recommended'] ),
|
@@ -111,7 +120,9 @@ class WPSEO_Replacevar_Editor {
|
|
111 |
esc_attr( $this->arguments['label_title'] ),
|
112 |
esc_attr( $this->arguments['label_description'] ),
|
113 |
esc_attr( $this->arguments['description_placeholder'] ),
|
114 |
-
esc_attr( $this->arguments['has_new_badge'] )
|
|
|
|
|
115 |
);
|
116 |
}
|
117 |
|
30 |
* @type string $label_description Optional. The label to use for the description field.
|
31 |
* @type string $description_placeholder Optional. The placeholder text to use for the description field.
|
32 |
* @type bool $has_new_badge Optional. Whether to show the "New" badge.
|
33 |
+
* @type bool $has_premium_badge Optional. Whether to show the "Premium" badge.
|
34 |
* }
|
35 |
*/
|
36 |
private $arguments;
|
51 |
* @type string $label_description Optional. The label to use for the description field.
|
52 |
* @type string $description_placeholder Optional. The placeholder text to use for the description field.
|
53 |
* @type bool $has_new_badge Optional. Whether to show the "New" badge.
|
54 |
+
* @type bool $has_premium_badge Optional. Whether to show the "Premium" badge.
|
55 |
* }
|
56 |
*/
|
57 |
public function __construct( Yoast_Form $yform, $arguments ) {
|
63 |
'label_description' => '',
|
64 |
'description_placeholder' => '',
|
65 |
'has_new_badge' => false,
|
66 |
+
'is_disabled' => false,
|
67 |
+
'has_premium_badge' => false,
|
68 |
]
|
69 |
);
|
70 |
|
81 |
'label_description' => (string) $arguments['label_description'],
|
82 |
'description_placeholder' => (string) $arguments['description_placeholder'],
|
83 |
'has_new_badge' => (bool) $arguments['has_new_badge'],
|
84 |
+
'is_disabled' => (bool) $arguments['is_disabled'],
|
85 |
+
'has_premium_badge' => (bool) $arguments['has_premium_badge'],
|
86 |
];
|
87 |
}
|
88 |
|
108 |
data-react-replacevar-label-title="%6$s"
|
109 |
data-react-replacevar-label-description="%7$s"
|
110 |
data-react-replacevar-description-placeholder="%8$s"
|
111 |
+
data-react-replacevar-has-new-badge="%9$s"
|
112 |
+
data-react-replacevar-is-disabled="%10$s"
|
113 |
+
data-react-replacevar-has-premium-badge="%11$s"
|
114 |
+
></div>',
|
115 |
esc_attr( $this->arguments['title'] ),
|
116 |
esc_attr( $this->arguments['description'] ),
|
117 |
esc_attr( $this->arguments['page_type_recommended'] ),
|
120 |
esc_attr( $this->arguments['label_title'] ),
|
121 |
esc_attr( $this->arguments['label_description'] ),
|
122 |
esc_attr( $this->arguments['description_placeholder'] ),
|
123 |
+
esc_attr( $this->arguments['has_new_badge'] ),
|
124 |
+
esc_attr( $this->arguments['is_disabled'] ),
|
125 |
+
esc_attr( $this->arguments['has_premium_badge'] )
|
126 |
);
|
127 |
}
|
128 |
|
admin/views/class-view-utils.php
CHANGED
@@ -69,56 +69,91 @@ class Yoast_View_Utils {
|
|
69 |
/**
|
70 |
* Generates the OpenGraph disabled alert, depending on whether the OpenGraph feature is disabled.
|
71 |
*
|
72 |
-
* @param string $type The type of message. Can be altered to taxonomies or archives. Empty string by default.
|
73 |
*
|
74 |
* @return string The alert. Returns an empty string if the setting is enabled.
|
75 |
*/
|
76 |
public function generate_opengraph_disabled_alert( $type = '' ) {
|
77 |
$is_enabled = WPSEO_Options::get( 'opengraph', true );
|
78 |
|
79 |
-
if ( $is_enabled
|
80 |
return '';
|
81 |
}
|
82 |
|
83 |
-
$message =
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
|
|
|
|
|
|
91 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
|
93 |
if ( $type === 'taxonomies' ) {
|
94 |
-
|
95 |
/* translators: 1: link open tag; 2: link close tag. */
|
96 |
-
|
97 |
-
'The social
|
98 |
'wordpress-seo'
|
99 |
),
|
100 |
-
'<a href="' .
|
101 |
'</a>'
|
102 |
);
|
103 |
}
|
104 |
|
105 |
if ( $type === 'archives' ) {
|
106 |
-
|
107 |
/* translators: 1: link open tag; 2: link close tag. */
|
108 |
-
|
109 |
-
'The social
|
110 |
'wordpress-seo'
|
111 |
),
|
112 |
-
'<a href="' .
|
113 |
'</a>'
|
114 |
);
|
115 |
}
|
116 |
|
117 |
-
|
118 |
-
|
119 |
-
return sprintf(
|
120 |
-
'<div class="yoast-measure padded">%s</div>',
|
121 |
-
$alert->present()
|
122 |
-
);
|
123 |
}
|
124 |
}
|
69 |
/**
|
70 |
* Generates the OpenGraph disabled alert, depending on whether the OpenGraph feature is disabled.
|
71 |
*
|
72 |
+
* @param string $type The type of message. Can be altered to homepage, taxonomies or archives. Empty string by default.
|
73 |
*
|
74 |
* @return string The alert. Returns an empty string if the setting is enabled.
|
75 |
*/
|
76 |
public function generate_opengraph_disabled_alert( $type = '' ) {
|
77 |
$is_enabled = WPSEO_Options::get( 'opengraph', true );
|
78 |
|
79 |
+
if ( $is_enabled ) {
|
80 |
return '';
|
81 |
}
|
82 |
|
83 |
+
$message = $this->generate_opengraph_disabled_alert_text( $type );
|
84 |
+
|
85 |
+
if ( empty( $message ) ) {
|
86 |
+
return '';
|
87 |
+
}
|
88 |
+
|
89 |
+
$alert = new Alert_Presenter( $message, 'info' );
|
90 |
+
|
91 |
+
return sprintf(
|
92 |
+
'<div class="yoast-measure padded">%s</div>',
|
93 |
+
$alert->present()
|
94 |
);
|
95 |
+
}
|
96 |
+
|
97 |
+
/**
|
98 |
+
* Generates the OpenGraph disabled alert text.
|
99 |
+
*
|
100 |
+
* @param string $type The type of message. Can be altered to homepage, taxonomies or archives. Empty string by default.
|
101 |
+
*
|
102 |
+
* @return string The alert. Returns an empty string if the setting is enabled.
|
103 |
+
*/
|
104 |
+
private function generate_opengraph_disabled_alert_text( $type ) {
|
105 |
+
if ( $type === 'homepage' ) {
|
106 |
+
return sprintf(
|
107 |
+
/* translators: 1: link open tag; 2: link close tag. */
|
108 |
+
esc_html__(
|
109 |
+
'The social appearance settings for your homepage require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
110 |
+
'wordpress-seo'
|
111 |
+
),
|
112 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
113 |
+
'</a>'
|
114 |
+
);
|
115 |
+
}
|
116 |
+
|
117 |
+
if ( ! YoastSEO()->helpers->product->is_premium() ) {
|
118 |
+
return '';
|
119 |
+
}
|
120 |
+
|
121 |
+
if ( $type === '' ) {
|
122 |
+
return sprintf(
|
123 |
+
/* translators: 1: link open tag; 2: link close tag. */
|
124 |
+
esc_html__(
|
125 |
+
'The social appearance settings for content types require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
126 |
+
'wordpress-seo'
|
127 |
+
),
|
128 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
129 |
+
'</a>'
|
130 |
+
);
|
131 |
+
}
|
132 |
|
133 |
if ( $type === 'taxonomies' ) {
|
134 |
+
return sprintf(
|
135 |
/* translators: 1: link open tag; 2: link close tag. */
|
136 |
+
esc_html__(
|
137 |
+
'The social appearance settings for taxonomies require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
138 |
'wordpress-seo'
|
139 |
),
|
140 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
141 |
'</a>'
|
142 |
);
|
143 |
}
|
144 |
|
145 |
if ( $type === 'archives' ) {
|
146 |
+
return sprintf(
|
147 |
/* translators: 1: link open tag; 2: link close tag. */
|
148 |
+
esc_html__(
|
149 |
+
'The social appearance settings for archives require Open Graph metadata (which is currently disabled). You can enable this in the %1$s‘Social’ settings under the ‘Facebook’ tab%2$s.',
|
150 |
'wordpress-seo'
|
151 |
),
|
152 |
+
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_social#top#facebook' ) ) . '">',
|
153 |
'</a>'
|
154 |
);
|
155 |
}
|
156 |
|
157 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
}
|
admin/views/form/fieldset.php
DELETED
@@ -1,27 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WPSEO plugin file.
|
4 |
-
*
|
5 |
-
* @package WPSEO\Admin
|
6 |
-
*
|
7 |
-
* @uses string $id ID attribute for the fieldset.
|
8 |
-
* @uses string $attributes Additional attributes for the fieldset.
|
9 |
-
* @uses string $legend_attributes Additional attributes for the legend.
|
10 |
-
* @uses string $legend_content The legend text.
|
11 |
-
* @uses string $content The fieldset content, i.e. a set of logically grouped form controls.
|
12 |
-
*/
|
13 |
-
|
14 |
-
_deprecated_file( __FILE__, '11.9' );
|
15 |
-
|
16 |
-
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
17 |
-
header( 'Status: 403 Forbidden' );
|
18 |
-
header( 'HTTP/1.1 403 Forbidden' );
|
19 |
-
exit();
|
20 |
-
}
|
21 |
-
|
22 |
-
?>
|
23 |
-
|
24 |
-
<fieldset id="<?php echo esc_attr( $id ); ?>"<?php echo $attributes; ?>>
|
25 |
-
<legend id="<?php echo esc_attr( $id . '-legend' ); ?>"<?php echo $legend_attributes; ?>><?php echo esc_html( $legend_content ); ?></legend>
|
26 |
-
<?php echo $content; ?>
|
27 |
-
</fieldset>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/sidebar.php
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
|
8 |
$wpseo_plugin_dir_url = plugin_dir_url( WPSEO_FILE );
|
9 |
$new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
10 |
-
|
11 |
?>
|
12 |
<div class="wpseo_content_cell" id="sidebar-container">
|
13 |
<div id="sidebar" class="yoast-sidebar">
|
@@ -40,7 +40,7 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
|
40 |
</ul>
|
41 |
|
42 |
<a id="wpseo-premium-button" class="yoast-button-upsell"
|
43 |
-
href="<?php WPSEO_Shortlinker::
|
44 |
<?php
|
45 |
/* translators: %s expands to Yoast SEO Premium */
|
46 |
printf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
@@ -50,74 +50,6 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
|
50 |
?>
|
51 |
</a><br>
|
52 |
</div>
|
53 |
-
<div class="yoast-sidebar__product-list">
|
54 |
-
<div class="yoast-sidebar__section">
|
55 |
-
<h2>
|
56 |
-
<?php
|
57 |
-
/* translators: %s expands to Yoast SEO */
|
58 |
-
printf( esc_html__( 'Extend %s', 'wordpress-seo' ), 'Yoast SEO' );
|
59 |
-
?>
|
60 |
-
</h2>
|
61 |
-
<div class="wp-clearfix">
|
62 |
-
<p>
|
63 |
-
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jq' ); ?>" target="_blank">
|
64 |
-
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/local_plugin_assistant.svg' ); ?>"
|
65 |
-
alt="">
|
66 |
-
<strong>Be found on Google Maps!</strong>
|
67 |
-
<?php
|
68 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
|
69 |
-
echo $new_tab_message;
|
70 |
-
?>
|
71 |
-
</a><br>
|
72 |
-
<?php esc_html_e( 'Our Local SEO plugin will help you rank in Google Maps and local results.', 'wordpress-seo' ); ?>
|
73 |
-
</p>
|
74 |
-
</div>
|
75 |
-
<div class="wp-clearfix">
|
76 |
-
<p>
|
77 |
-
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jo' ); ?>" target="_blank">
|
78 |
-
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/video_plugin_assistant.svg' ); ?>"
|
79 |
-
class="alignleft"
|
80 |
-
alt="">
|
81 |
-
<strong>Rank in Google Video</strong>
|
82 |
-
<?php
|
83 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
|
84 |
-
echo $new_tab_message;
|
85 |
-
?>
|
86 |
-
</a><br>
|
87 |
-
<?php esc_html_e( 'Make sure your videos rank and are easy to share with our Video SEO plugin.', 'wordpress-seo' ); ?>
|
88 |
-
</p>
|
89 |
-
</div>
|
90 |
-
<div class="wp-clearfix">
|
91 |
-
<p>
|
92 |
-
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jp' ); ?>" target="_blank">
|
93 |
-
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/woo_plugin_assistant.svg' ); ?>"
|
94 |
-
alt="">
|
95 |
-
<strong>WooCommerce SEO</strong>
|
96 |
-
<?php
|
97 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
|
98 |
-
echo $new_tab_message;
|
99 |
-
?>
|
100 |
-
</a><br>
|
101 |
-
<?php esc_html_e( 'Optimize your shop\'s SEO and sell more products!', 'wordpress-seo' ); ?>
|
102 |
-
</p>
|
103 |
-
</div>
|
104 |
-
<div class="wp-clearfix">
|
105 |
-
<p>
|
106 |
-
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jr' ); ?>" target="_blank">
|
107 |
-
<img src="<?php echo esc_url( $wpseo_plugin_dir_url . 'images/news_plugin_assistant.svg' ); ?>"
|
108 |
-
class="alignleft"
|
109 |
-
alt="">
|
110 |
-
<strong>Rank in Google News</strong>
|
111 |
-
<?php
|
112 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
|
113 |
-
echo $new_tab_message;
|
114 |
-
?>
|
115 |
-
</a><br>
|
116 |
-
<?php esc_html_e( 'Start to optimize your site for Google News traffic today!', 'wordpress-seo' ); ?>
|
117 |
-
</p>
|
118 |
-
</div>
|
119 |
-
</div>
|
120 |
-
</div>
|
121 |
<div class="yoast-sidebar__section">
|
122 |
<h2>
|
123 |
<?php
|
@@ -126,7 +58,7 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
|
126 |
</h2>
|
127 |
<p>
|
128 |
<?php
|
129 |
-
$url = WPSEO_Shortlinker::get( 'https://yoa.st/3t6' );
|
130 |
|
131 |
/* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
|
132 |
printf( esc_html__( 'Want to learn SEO from Team Yoast? Check out our %1$s!', 'wordpress-seo' ), '<a href="' . esc_url( $url ) . '"><strong>Yoast SEO academy</strong></a>' );
|
@@ -135,7 +67,7 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
|
135 |
?>
|
136 |
</p>
|
137 |
<p>
|
138 |
-
<a href="<?php
|
139 |
<?php
|
140 |
/* translators: %1$s expands to Yoast SEO academy */
|
141 |
printf( esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
|
@@ -143,18 +75,5 @@ $new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
|
143 |
</a>
|
144 |
</p>
|
145 |
</div>
|
146 |
-
<div class="yoast-sidebar__section">
|
147 |
-
<h2><?php esc_html_e( 'Remove these ads?', 'wordpress-seo' ); ?></h2>
|
148 |
-
<p>
|
149 |
-
<a href="<?php WPSEO_Shortlinker::show( 'https://yoa.st/jy' ); ?>" target="_blank">
|
150 |
-
<?php
|
151 |
-
/* translators: %s expands to Yoast SEO Premium */
|
152 |
-
printf( esc_html__( 'Upgrade to %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
153 |
-
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: $new_tab_message is properly escaped.
|
154 |
-
echo $new_tab_message;
|
155 |
-
?>
|
156 |
-
</a>
|
157 |
-
</p>
|
158 |
-
</div>
|
159 |
</div>
|
160 |
</div>
|
7 |
|
8 |
$wpseo_plugin_dir_url = plugin_dir_url( WPSEO_FILE );
|
9 |
$new_tab_message = WPSEO_Admin_Utils::get_new_tab_message();
|
10 |
+
$wpseo_page = filter_input( INPUT_GET, 'page' );
|
11 |
?>
|
12 |
<div class="wpseo_content_cell" id="sidebar-container">
|
13 |
<div id="sidebar" class="yoast-sidebar">
|
40 |
</ul>
|
41 |
|
42 |
<a id="wpseo-premium-button" class="yoast-button-upsell"
|
43 |
+
href="<?php echo esc_url( add_query_arg( [ 'screen' => $wpseo_page ], WPSEO_Shortlinker::get( 'https://yoa.st/jj' ) ) ); ?>" target="_blank">
|
44 |
<?php
|
45 |
/* translators: %s expands to Yoast SEO Premium */
|
46 |
printf( esc_html__( 'Get %s', 'wordpress-seo' ), 'Yoast SEO Premium' );
|
50 |
?>
|
51 |
</a><br>
|
52 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
<div class="yoast-sidebar__section">
|
54 |
<h2>
|
55 |
<?php
|
58 |
</h2>
|
59 |
<p>
|
60 |
<?php
|
61 |
+
$url = add_query_arg( [ 'screen' => $wpseo_page ], WPSEO_Shortlinker::get( 'https://yoa.st/3t6' ) );
|
62 |
|
63 |
/* translators: %1$s expands to Yoast SEO academy, which is a clickable link. */
|
64 |
printf( esc_html__( 'Want to learn SEO from Team Yoast? Check out our %1$s!', 'wordpress-seo' ), '<a href="' . esc_url( $url ) . '"><strong>Yoast SEO academy</strong></a>' );
|
67 |
?>
|
68 |
</p>
|
69 |
<p>
|
70 |
+
<a href="<?php echo esc_url( $url ); ?>" target="_blank">
|
71 |
<?php
|
72 |
/* translators: %1$s expands to Yoast SEO academy */
|
73 |
printf( esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' );
|
75 |
</a>
|
76 |
</p>
|
77 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
</div>
|
79 |
</div>
|
admin/views/tabs/dashboard/features.php
CHANGED
@@ -52,7 +52,7 @@ $feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
|
|
52 |
'on' => __( 'On', 'wordpress-seo' ),
|
53 |
'off' => __( 'Off', 'wordpress-seo' ),
|
54 |
],
|
55 |
-
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
58 |
|
52 |
'on' => __( 'On', 'wordpress-seo' ),
|
53 |
'off' => __( 'Off', 'wordpress-seo' ),
|
54 |
],
|
55 |
+
$feature->name,
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
58 |
|
admin/views/tabs/dashboard/integrations.php
CHANGED
@@ -54,7 +54,7 @@ $integration_toggles = Yoast_Integration_Toggles::instance()->get_all();
|
|
54 |
'on' => __( 'On', 'wordpress-seo' ),
|
55 |
'off' => __( 'Off', 'wordpress-seo' ),
|
56 |
],
|
57 |
-
|
58 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
59 |
);
|
60 |
|
54 |
'on' => __( 'On', 'wordpress-seo' ),
|
55 |
'off' => __( 'Off', 'wordpress-seo' ),
|
56 |
],
|
57 |
+
$integration->name,
|
58 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
59 |
);
|
60 |
|
admin/views/tabs/metas/archives.php
CHANGED
@@ -16,24 +16,29 @@ require __DIR__ . '/archives/help.php';
|
|
16 |
|
17 |
$wpseo_archives = [
|
18 |
[
|
19 |
-
'title' => esc_html__( 'Author archives
|
20 |
'view_file' => 'paper-content/author-archive-settings.php',
|
21 |
'paper_id' => 'settings-author-archives',
|
22 |
],
|
23 |
[
|
24 |
-
'title' => esc_html__( 'Date archives
|
25 |
'view_file' => 'paper-content/date-archives-settings.php',
|
26 |
'paper_id' => 'settings-date-archives',
|
27 |
],
|
28 |
[
|
29 |
-
'title' => esc_html__( 'Special
|
30 |
'view_file' => 'paper-content/special-pages.php',
|
31 |
'paper_id' => 'settings-special-pages',
|
32 |
],
|
33 |
];
|
34 |
|
|
|
35 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
36 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
|
|
|
|
|
|
|
|
37 |
|
38 |
foreach ( $wpseo_archives as $wpseo_archive_index => $wpseo_archive ) {
|
39 |
$wpseo_archive_presenter = new WPSEO_Paper_Presenter(
|
16 |
|
17 |
$wpseo_archives = [
|
18 |
[
|
19 |
+
'title' => esc_html__( 'Author archives', 'wordpress-seo' ),
|
20 |
'view_file' => 'paper-content/author-archive-settings.php',
|
21 |
'paper_id' => 'settings-author-archives',
|
22 |
],
|
23 |
[
|
24 |
+
'title' => esc_html__( 'Date archives', 'wordpress-seo' ),
|
25 |
'view_file' => 'paper-content/date-archives-settings.php',
|
26 |
'paper_id' => 'settings-date-archives',
|
27 |
],
|
28 |
[
|
29 |
+
'title' => esc_html__( 'Special pages', 'wordpress-seo' ),
|
30 |
'view_file' => 'paper-content/special-pages.php',
|
31 |
'paper_id' => 'settings-special-pages',
|
32 |
],
|
33 |
];
|
34 |
|
35 |
+
$view_utils = new Yoast_View_Utils();
|
36 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
37 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
38 |
+
$opengraph_disabled_alert = $view_utils->generate_opengraph_disabled_alert( 'archives' );
|
39 |
+
|
40 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the generate_opengraph_disabled_alert() method.
|
41 |
+
echo $opengraph_disabled_alert;
|
42 |
|
43 |
foreach ( $wpseo_archives as $wpseo_archive_index => $wpseo_archive ) {
|
44 |
$wpseo_archive_presenter = new WPSEO_Paper_Presenter(
|
admin/views/tabs/metas/general.php
CHANGED
@@ -11,14 +11,70 @@ if ( ! defined( 'WPSEO_VERSION' ) ) {
|
|
11 |
exit();
|
12 |
}
|
13 |
|
14 |
-
|
15 |
-
'',
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
[
|
18 |
-
'
|
19 |
-
'
|
|
|
|
|
|
|
20 |
]
|
21 |
);
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
exit();
|
12 |
}
|
13 |
|
14 |
+
if ( ! current_theme_supports( 'title-tag' ) ) {
|
15 |
+
$wpseo_rewrite_titles_title = esc_html__( 'Rewrite titles', 'wordpress-seo' );
|
16 |
+
$wpseo_rewrite_titles_presenter = new WPSEO_Paper_Presenter(
|
17 |
+
$wpseo_rewrite_titles_title,
|
18 |
+
__DIR__ . '/paper-content/general/force-rewrite-title.php',
|
19 |
+
[
|
20 |
+
'collapsible' => true,
|
21 |
+
'expanded' => true,
|
22 |
+
'paper_id' => 'settings-general-rewrite-titles',
|
23 |
+
'title' => $wpseo_rewrite_titles_title,
|
24 |
+
'class' => 'search-appearance',
|
25 |
+
]
|
26 |
+
);
|
27 |
+
// phpcs:ignore WordPress.Security.EscapeOutput -- output contains HTML and we assume it's properly escape on object creation.
|
28 |
+
echo $wpseo_rewrite_titles_presenter->get_output();
|
29 |
+
}
|
30 |
+
|
31 |
+
$wpseo_title_separator_title = esc_html__( 'Title Separator', 'wordpress-seo' );
|
32 |
+
$wpseo_title_separator_presenter = new WPSEO_Paper_Presenter(
|
33 |
+
$wpseo_title_separator_title,
|
34 |
+
__DIR__ . '/paper-content/general/title-separator.php',
|
35 |
+
[
|
36 |
+
'collapsible' => true,
|
37 |
+
'expanded' => true,
|
38 |
+
'paper_id' => 'settings-general-title-separator',
|
39 |
+
'title' => $wpseo_title_separator_title,
|
40 |
+
'class' => 'search-appearance',
|
41 |
+
]
|
42 |
+
);
|
43 |
+
// phpcs:ignore WordPress.Security.EscapeOutput -- output contains HTML and we assume it's properly escape on object creation.
|
44 |
+
echo $wpseo_title_separator_presenter->get_output();
|
45 |
+
|
46 |
+
if ( get_option( 'show_on_front' ) === 'posts' ) {
|
47 |
+
$wpseo_homepage_title = esc_html__( 'Homepage', 'wordpress-seo' );
|
48 |
+
}
|
49 |
+
else {
|
50 |
+
$wpseo_homepage_title = esc_html__( 'Homepage & Posts page', 'wordpress-seo' );
|
51 |
+
}
|
52 |
+
|
53 |
+
$wpseo_homepage_presenter = new WPSEO_Paper_Presenter(
|
54 |
+
$wpseo_homepage_title,
|
55 |
+
__DIR__ . '/paper-content/general/homepage.php',
|
56 |
[
|
57 |
+
'collapsible' => true,
|
58 |
+
'expanded' => true,
|
59 |
+
'paper_id' => 'settings-general-homepage',
|
60 |
+
'title' => $wpseo_homepage_title,
|
61 |
+
'class' => 'search-appearance',
|
62 |
]
|
63 |
);
|
64 |
+
// phpcs:ignore WordPress.Security.EscapeOutput -- output contains HTML and we assume it's properly escape on object creation.
|
65 |
+
echo $wpseo_homepage_presenter->get_output();
|
66 |
|
67 |
+
$wpseo_knowledge_graph_title = esc_html__( 'Knowledge Graph & Schema.org', 'wordpress-seo' );
|
68 |
+
$wpseo_knowledge_graph_presenter = new WPSEO_Paper_Presenter(
|
69 |
+
$wpseo_knowledge_graph_title,
|
70 |
+
__DIR__ . '/paper-content/general/knowledge-graph.php',
|
71 |
+
[
|
72 |
+
'collapsible' => true,
|
73 |
+
'expanded' => true,
|
74 |
+
'paper_id' => 'settings-general-knowledge-graph',
|
75 |
+
'title' => $wpseo_knowledge_graph_title,
|
76 |
+
'class' => 'search-appearance',
|
77 |
+
]
|
78 |
+
);
|
79 |
+
// phpcs:ignore WordPress.Security.EscapeOutput -- output contains HTML and we assume it's properly escape on object creation.
|
80 |
+
echo $wpseo_knowledge_graph_presenter->get_output();
|
admin/views/tabs/metas/paper-content/author-archive-settings.php
CHANGED
@@ -10,8 +10,8 @@
|
|
10 |
$yform->toggle_switch(
|
11 |
'disable-author',
|
12 |
[
|
13 |
-
'off' => __( '
|
14 |
-
'on' => __( '
|
15 |
],
|
16 |
__( 'Author archives', 'wordpress-seo' )
|
17 |
);
|
10 |
$yform->toggle_switch(
|
11 |
'disable-author',
|
12 |
[
|
13 |
+
'off' => __( 'On', 'wordpress-seo' ),
|
14 |
+
'on' => __( 'Off', 'wordpress-seo' ),
|
15 |
],
|
16 |
__( 'Author archives', 'wordpress-seo' )
|
17 |
);
|
admin/views/tabs/metas/paper-content/date-archives-settings.php
CHANGED
@@ -10,8 +10,8 @@
|
|
10 |
$yform->toggle_switch(
|
11 |
'disable-date',
|
12 |
[
|
13 |
-
'off' => __( '
|
14 |
-
'on' => __( '
|
15 |
],
|
16 |
__( 'Date archives', 'wordpress-seo' )
|
17 |
);
|
10 |
$yform->toggle_switch(
|
11 |
'disable-date',
|
12 |
[
|
13 |
+
'off' => __( 'On', 'wordpress-seo' ),
|
14 |
+
'on' => __( 'Off', 'wordpress-seo' ),
|
15 |
],
|
16 |
__( 'Date archives', 'wordpress-seo' )
|
17 |
);
|
admin/views/tabs/metas/paper-content/front-page-content.php
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WPSEO plugin file.
|
4 |
+
*
|
5 |
+
* @package WPSEO\Admin\Views\PaperContent
|
6 |
+
*
|
7 |
+
* @uses Yoast_Form $yform Form object.
|
8 |
+
* @uses WP_Taxonomy $wpseo_post_type
|
9 |
+
* @uses Yoast_View_Utils $view_utils
|
10 |
+
* @uses WPSEO_Admin_Recommended_Replace_Vars $recommended_replace_vars
|
11 |
+
*/
|
12 |
+
|
13 |
+
use Yoast\WP\SEO\Presenters\Admin\Badge_Presenter;
|
14 |
+
|
15 |
+
$view_utils = new Yoast_View_Utils();
|
16 |
+
$opengraph_disabled_alert = $view_utils->generate_opengraph_disabled_alert( 'homepage' );
|
17 |
+
|
18 |
+
if ( ! empty( $opengraph_disabled_alert ) ) {
|
19 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the generate_opengraph_disabled_alert() method.
|
20 |
+
echo $opengraph_disabled_alert;
|
21 |
+
}
|
22 |
+
else {
|
23 |
+
echo '<div class="yoast-settings-section">';
|
24 |
+
|
25 |
+
echo '<div class="social-settings-heading-container">';
|
26 |
+
echo '<h3 class="social-settings-heading">' . \esc_html__( 'Social settings', 'wordpress-seo' ) . '</h3>';
|
27 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the Badge_Presenter.
|
28 |
+
echo new Badge_Presenter( 'global-templates-homepage', '', 'global-templates' );
|
29 |
+
echo '</div>';
|
30 |
+
|
31 |
+
echo '<p>' . esc_html__( 'These are the image, title and description used when a link to your homepage is shared on social media.', 'wordpress-seo' ) . '</p>';
|
32 |
+
|
33 |
+
printf(
|
34 |
+
'<div
|
35 |
+
id="%1$s"
|
36 |
+
data-react-image-portal
|
37 |
+
data-react-image-portal-target-image="%2$s"
|
38 |
+
data-react-image-portal-target-image-id="%3$s"
|
39 |
+
data-react-image-portal-has-image-validation="%4$s"
|
40 |
+
></div>',
|
41 |
+
'yoast-og-frontpage-image-select',
|
42 |
+
'open_graph_frontpage_image',
|
43 |
+
'open_graph_frontpage_image_id',
|
44 |
+
true
|
45 |
+
);
|
46 |
+
|
47 |
+
$yform->hidden( 'open_graph_frontpage_image', 'open_graph_frontpage_image' );
|
48 |
+
$yform->hidden( 'open_graph_frontpage_image_id', 'open_graph_frontpage_image_id' );
|
49 |
+
|
50 |
+
$editor = new WPSEO_Replacevar_Editor(
|
51 |
+
$yform,
|
52 |
+
[
|
53 |
+
'title' => 'open_graph_frontpage_title',
|
54 |
+
'description' => 'open_graph_frontpage_desc',
|
55 |
+
'page_type_recommended' => 'homepage',
|
56 |
+
'page_type_specific' => 'page',
|
57 |
+
'paper_style' => false,
|
58 |
+
'label_title' => __( 'Social title', 'wordpress-seo' ),
|
59 |
+
'label_description' => __( 'Social description', 'wordpress-seo' ),
|
60 |
+
'description_placeholder' => __( 'Modify your social description by editing it right here.', 'wordpress-seo' ),
|
61 |
+
]
|
62 |
+
);
|
63 |
+
$editor->render();
|
64 |
+
echo '</div>';
|
65 |
+
}
|
admin/views/tabs/metas/paper-content/general-content.php
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WPSEO plugin file.
|
4 |
-
*
|
5 |
-
* @package WPSEO\Admin\Views\Media
|
6 |
-
*/
|
7 |
-
|
8 |
-
// To improve readability, this tab has been divided into separate blocks, included below.
|
9 |
-
require __DIR__ . '/general/force-rewrite-title.php';
|
10 |
-
require __DIR__ . '/general/title-separator.php';
|
11 |
-
require __DIR__ . '/general/homepage.php';
|
12 |
-
require __DIR__ . '/general/knowledge-graph.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/tabs/metas/paper-content/general/force-rewrite-title.php
CHANGED
@@ -7,19 +7,11 @@
|
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
esc_html__( '%1$s has auto-detected whether it needs to force rewrite the titles for your pages, if you think it\'s wrong and you know what you\'re doing, you can change the setting here.', 'wordpress-seo' ),
|
19 |
-
'Yoast SEO'
|
20 |
-
);
|
21 |
-
echo '</p>';
|
22 |
-
?>
|
23 |
-
</div>
|
24 |
-
<?php
|
25 |
-
}
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
$yform->light_switch( 'forcerewritetitle', __( 'Force rewrite titles', 'wordpress-seo' ) );
|
11 |
+
echo '<p class="description">';
|
12 |
+
printf(
|
13 |
+
/* translators: %1$s expands to Yoast SEO */
|
14 |
+
esc_html__( '%1$s has auto-detected whether it needs to force rewrite the titles for your pages, if you think it\'s wrong and you know what you\'re doing, you can change the setting here.', 'wordpress-seo' ),
|
15 |
+
'Yoast SEO'
|
16 |
+
);
|
17 |
+
echo '</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/tabs/metas/paper-content/general/homepage.php
CHANGED
@@ -4,57 +4,51 @@
|
|
4 |
*
|
5 |
* @package WPSEO\Admin\Views\General
|
6 |
*
|
7 |
-
* @uses
|
8 |
*/
|
9 |
|
10 |
-
|
11 |
-
<div class="
|
12 |
-
<?php
|
13 |
-
if ( get_option( 'show_on_front' ) === 'posts' ) {
|
14 |
-
$homepage_help = new WPSEO_Admin_Help_Panel(
|
15 |
-
'search-appearance-homepage',
|
16 |
-
__( 'Learn more about the homepage setting', 'wordpress-seo' ),
|
17 |
-
__( 'This is what shows in the search results when people find your homepage. This means this is probably what they see when they search for your brand name.', 'wordpress-seo' ),
|
18 |
-
'has-wrapper'
|
19 |
-
);
|
20 |
|
21 |
-
|
22 |
-
echo '<h2 class="help-button-inline">', esc_html__( 'Homepage', 'wordpress-seo' ), $homepage_help->get_button_html(), '</h2>';
|
23 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_panel_html() output is properly escaped.
|
24 |
-
echo $homepage_help->get_panel_html();
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
}
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
echo '<p>';
|
41 |
printf(
|
42 |
/* translators: 1: link open tag; 2: link close tag. */
|
43 |
-
esc_html__( 'You can determine the title and description for the
|
44 |
-
'<a href="' . esc_url( get_edit_post_link(
|
45 |
'</a>'
|
46 |
);
|
47 |
echo '</p>';
|
48 |
-
if ( get_option( 'page_for_posts' ) > 0 ) {
|
49 |
-
echo '<p>';
|
50 |
-
printf(
|
51 |
-
/* translators: 1: link open tag; 2: link close tag. */
|
52 |
-
esc_html__( 'You can determine the title and description for the posts page by %1$sediting the posts page itself%2$s.', 'wordpress-seo' ),
|
53 |
-
'<a href="' . esc_url( get_edit_post_link( get_option( 'page_for_posts' ) ) ) . '">',
|
54 |
-
'</a>'
|
55 |
-
);
|
56 |
-
echo '</p>';
|
57 |
-
}
|
58 |
}
|
59 |
-
|
60 |
-
</div>
|
4 |
*
|
5 |
* @package WPSEO\Admin\Views\General
|
6 |
*
|
7 |
+
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
if ( get_option( 'show_on_front' ) === 'posts' ) {
|
11 |
+
echo '<div class="yoast-settings-section">';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
echo esc_html__( 'This is what shows in the search results when people find your homepage. This means this is probably what they see when they search for your brand name.', 'wordpress-seo' );
|
|
|
|
|
|
|
14 |
|
15 |
+
$editor = new WPSEO_Replacevar_Editor(
|
16 |
+
$yform,
|
17 |
+
[
|
18 |
+
'title' => 'title-home-wpseo',
|
19 |
+
'description' => 'metadesc-home-wpseo',
|
20 |
+
'page_type_recommended' => 'homepage',
|
21 |
+
'page_type_specific' => 'page',
|
22 |
+
'paper_style' => false,
|
23 |
+
]
|
24 |
+
);
|
25 |
+
$editor->render();
|
26 |
+
echo '</div>';
|
27 |
+
|
28 |
+
require __DIR__ . '/../front-page-content.php';
|
29 |
+
}
|
30 |
+
else {
|
31 |
+
$wpseo_page_on_front = get_option( 'page_on_front' );
|
32 |
+
$wpseo_page_for_posts = get_option( 'page_for_posts' );
|
33 |
+
if ( empty( $wpseo_page_on_front ) ) {
|
34 |
+
$wpseo_page_on_front = $wpseo_page_for_posts;
|
35 |
}
|
36 |
+
|
37 |
+
printf(
|
38 |
+
/* translators: 1: link open tag; 2: link close tag. */
|
39 |
+
esc_html__( 'You can determine the title and description for the homepage by %1$sediting the homepage itself%2$s.', 'wordpress-seo' ),
|
40 |
+
'<a href="' . esc_url( get_edit_post_link( $wpseo_page_on_front ) ) . '">',
|
41 |
+
'</a>'
|
42 |
+
);
|
43 |
+
|
44 |
+
if ( $wpseo_page_for_posts > 0 ) {
|
45 |
echo '<p>';
|
46 |
printf(
|
47 |
/* translators: 1: link open tag; 2: link close tag. */
|
48 |
+
esc_html__( 'You can determine the title and description for the posts page by %1$sediting the posts page itself%2$s.', 'wordpress-seo' ),
|
49 |
+
'<a href="' . esc_url( get_edit_post_link( $wpseo_page_for_posts ) ) . '">',
|
50 |
'</a>'
|
51 |
);
|
52 |
echo '</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
+
}
|
|
admin/views/tabs/metas/paper-content/general/knowledge-graph.php
CHANGED
@@ -7,81 +7,63 @@
|
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
-
|
11 |
-
'
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
__( 'This data is shown as metadata in your site. It is intended to appear in %1$sGoogle\'s Knowledge Graph%2$s. You can be either an organization, or a person.', 'wordpress-seo' ),
|
16 |
-
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1-p' ) ) . '" target="_blank" rel="noopener noreferrer">',
|
17 |
-
'</a>'
|
18 |
-
),
|
19 |
-
'has-wrapper'
|
20 |
);
|
21 |
-
?>
|
22 |
-
<div class="tab-block">
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
<?php
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Filter: 'wpseo_knowledge_graph_setting_msg' - Allows adding a message above these settings.
|
36 |
-
*
|
37 |
-
* @api string unsigned Message.
|
38 |
*/
|
39 |
-
$
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
<p>
|
45 |
-
<?php esc_html_e( 'Choose whether the site represents an organization or a person.', 'wordpress-seo' ); ?>
|
46 |
-
</p>
|
47 |
-
<?php
|
48 |
-
$yoast_free_kg_select_options = [
|
49 |
-
'company' => __( 'Organization', 'wordpress-seo' ),
|
50 |
-
'person' => __( 'Person', 'wordpress-seo' ),
|
51 |
-
];
|
52 |
-
$yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false );
|
53 |
-
?>
|
54 |
-
<div id="knowledge-graph-company">
|
55 |
-
<h3><?php esc_html_e( 'Organization', 'wordpress-seo' ); ?></h3>
|
56 |
<?php
|
57 |
-
|
58 |
-
* Render the `knowledge-graph-company-warning` div when the company name or logo are not set.
|
59 |
-
* This div is used as React render root in `js/src/search-appearance.js`.
|
60 |
-
*/
|
61 |
-
$yoast_seo_company_name = WPSEO_Options::get( 'company_name', '' );
|
62 |
-
$yoast_seo_company_logo = WPSEO_Options::get( 'company_logo', '' );
|
63 |
-
if ( empty( $yoast_seo_company_name ) || empty( $yoast_seo_company_logo ) ) :
|
64 |
-
?>
|
65 |
-
<div id="knowledge-graph-company-warning"></div>
|
66 |
-
<?php
|
67 |
-
endif;
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
</div>
|
87 |
</div>
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
echo sprintf(
|
11 |
+
/* translators: %1$s opens the link to the Yoast.com article about Google's Knowledge Graph, %2$s closes the link, */
|
12 |
+
esc_html__( 'This data is shown as metadata in your site. It is intended to appear in %1$sGoogle\'s Knowledge Graph%2$s. You can be either an organization, or a person.', 'wordpress-seo' ),
|
13 |
+
'<a href="' . esc_url( WPSEO_Shortlinker::get( 'https://yoa.st/1-p' ) ) . '" target="_blank" rel="noopener noreferrer">',
|
14 |
+
'</a>'
|
|
|
|
|
|
|
|
|
|
|
15 |
);
|
|
|
|
|
16 |
|
17 |
+
/**
|
18 |
+
* Filter: 'wpseo_knowledge_graph_setting_msg' - Allows adding a message above these settings.
|
19 |
+
*
|
20 |
+
* @api string unsigned Message.
|
21 |
+
*/
|
22 |
+
$message = apply_filters( 'wpseo_knowledge_graph_setting_msg', '' );
|
23 |
+
if ( ! empty( $message ) ) {
|
24 |
+
echo '<p><strong>', esc_html( $message ), '</strong></p>';
|
25 |
+
}
|
26 |
+
?>
|
27 |
+
<p>
|
28 |
+
<?php esc_html_e( 'Choose whether the site represents an organization or a person.', 'wordpress-seo' ); ?>
|
29 |
+
</p>
|
30 |
+
<?php
|
31 |
+
$yoast_free_kg_select_options = [
|
32 |
+
'company' => __( 'Organization', 'wordpress-seo' ),
|
33 |
+
'person' => __( 'Person', 'wordpress-seo' ),
|
34 |
+
];
|
35 |
+
$yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false );
|
36 |
+
?>
|
37 |
+
<div id="knowledge-graph-company">
|
38 |
+
<h3><?php esc_html_e( 'Organization', 'wordpress-seo' ); ?></h3>
|
39 |
<?php
|
40 |
+
/*
|
41 |
+
* Render the `knowledge-graph-company-warning` div when the company name or logo are not set.
|
42 |
+
* This div is used as React render root in `js/src/search-appearance.js`.
|
|
|
|
|
|
|
|
|
43 |
*/
|
44 |
+
$yoast_seo_company_name = WPSEO_Options::get( 'company_name', '' );
|
45 |
+
$yoast_seo_company_logo = WPSEO_Options::get( 'company_logo', '' );
|
46 |
+
if ( empty( $yoast_seo_company_name ) || empty( $yoast_seo_company_logo ) ) :
|
47 |
+
?>
|
48 |
+
<div id="knowledge-graph-company-warning"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
<?php
|
50 |
+
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
+
$yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] );
|
53 |
+
$yform->hidden( 'company_logo', 'company_logo' );
|
54 |
+
$yform->hidden( 'company_logo_id', 'company_logo_id' );
|
55 |
+
?>
|
56 |
+
<div id="yoast-organization-image-select"></div>
|
57 |
+
<div id="wpseo-local-seo-upsell"></div>
|
58 |
+
</div>
|
59 |
+
<div id="knowledge-graph-person">
|
60 |
+
<h3><?php esc_html_e( 'Personal info', 'wordpress-seo' ); ?></h3>
|
61 |
|
62 |
+
<div id="wpseo-person-selector"></div>
|
63 |
+
<div id="yoast-person-image-select"></div>
|
64 |
+
<?php
|
65 |
+
$yform->hidden( 'person_logo', 'person_logo' );
|
66 |
+
$yform->hidden( 'person_logo_id', 'person_logo_id' );
|
67 |
+
$yform->hidden( 'company_or_person_user_id', 'person_id' );
|
68 |
+
?>
|
|
|
69 |
</div>
|
admin/views/tabs/metas/paper-content/general/title-separator.php
CHANGED
@@ -4,28 +4,12 @@
|
|
4 |
*
|
5 |
* @package WPSEO\Admin\Views\General
|
6 |
*
|
7 |
-
* @uses
|
8 |
*/
|
9 |
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
?>
|
17 |
-
<div class="tab-block">
|
18 |
-
<h2 class="help-button-inline">
|
19 |
-
<?php
|
20 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_button_html() output is properly escaped.
|
21 |
-
echo esc_html__( 'Title Separator', 'wordpress-seo' ) . $title_separator_help->get_button_html();
|
22 |
-
?>
|
23 |
-
</h2>
|
24 |
-
<?php
|
25 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_panel_html() output is properly escaped.
|
26 |
-
echo $title_separator_help->get_panel_html();
|
27 |
-
$legend = __( 'Title separator symbol', 'wordpress-seo' );
|
28 |
-
$legend_attr = [ 'class' => 'radiogroup screen-reader-text' ];
|
29 |
-
$yform->radio( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options_for_display(), $legend, $legend_attr );
|
30 |
-
?>
|
31 |
-
</div>
|
4 |
*
|
5 |
* @package WPSEO\Admin\Views\General
|
6 |
*
|
7 |
+
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
echo esc_html__( 'Choose the symbol to use as your title separator. This will display, for instance, between your post title and site name. Symbols are shown in the size they\'ll appear in the search results.', 'wordpress-seo' );
|
11 |
+
|
12 |
+
$legend = __( 'Title separator symbol', 'wordpress-seo' );
|
13 |
+
$legend_attr = [ 'class' => 'radiogroup screen-reader-text' ];
|
14 |
+
$yform->radio( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options_for_display(), $legend, $legend_attr );
|
15 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/views/tabs/metas/paper-content/post-type-content.php
CHANGED
@@ -15,7 +15,7 @@ $single_label = $wpseo_post_type->labels->singular_name;
|
|
15 |
$paper_style = false;
|
16 |
|
17 |
/* translators: %s is the singular version of the post type's name. */
|
18 |
-
echo '<h3>' . esc_html( sprintf( __( '
|
19 |
|
20 |
require __DIR__ . '/post_type/post-type.php';
|
21 |
|
@@ -37,7 +37,7 @@ if ( WPSEO_Post_Type::has_archive( $wpseo_post_type ) ) {
|
|
37 |
$plural_label = $wpseo_post_type->labels->name;
|
38 |
|
39 |
/* translators: %s is the plural version of the post type's name. */
|
40 |
-
echo '<h3>' . esc_html( sprintf( __( '
|
41 |
|
42 |
echo '<div class="yoast-settings-section">';
|
43 |
|
@@ -73,6 +73,14 @@ if ( WPSEO_Post_Type::has_archive( $wpseo_post_type ) ) {
|
|
73 |
|
74 |
echo '</div>';
|
75 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
/**
|
77 |
* Allow adding custom fields to the admin meta page at the end of the archive settings for a post type - Content Types tab.
|
78 |
*
|
@@ -80,12 +88,6 @@ if ( WPSEO_Post_Type::has_archive( $wpseo_post_type ) ) {
|
|
80 |
* @param string $name The post type name.
|
81 |
*/
|
82 |
do_action( 'Yoast\WP\SEO\admin_post_types_archive', $yform, $wpseo_post_type->name );
|
83 |
-
|
84 |
-
if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true ) {
|
85 |
-
/* translators: %s is the plural version of the post type's name. */
|
86 |
-
echo '<h4>' . esc_html( sprintf( __( 'Breadcrumb settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . '</h4>';
|
87 |
-
$yform->textinput( 'bctitle-ptarchive-' . $wpseo_post_type->name, __( 'Breadcrumbs title', 'wordpress-seo' ) );
|
88 |
-
}
|
89 |
}
|
90 |
|
91 |
/**
|
15 |
$paper_style = false;
|
16 |
|
17 |
/* translators: %s is the singular version of the post type's name. */
|
18 |
+
echo '<h3>' . esc_html( sprintf( __( 'Single %s settings', 'wordpress-seo' ), $wpseo_post_type->labels->singular_name ) ) . '</h3>';
|
19 |
|
20 |
require __DIR__ . '/post_type/post-type.php';
|
21 |
|
37 |
$plural_label = $wpseo_post_type->labels->name;
|
38 |
|
39 |
/* translators: %s is the plural version of the post type's name. */
|
40 |
+
echo '<h3>' . esc_html( sprintf( __( '%s archive settings', 'wordpress-seo' ), $plural_label ) ) . '</h3>';
|
41 |
|
42 |
echo '<div class="yoast-settings-section">';
|
43 |
|
73 |
|
74 |
echo '</div>';
|
75 |
|
76 |
+
if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true ) {
|
77 |
+
echo '<div class="yoast-settings-section">';
|
78 |
+
|
79 |
+
$yform->textinput_extra_content( 'bctitle-ptarchive-' . $wpseo_post_type->name, __( 'Breadcrumbs title', 'wordpress-seo' ) );
|
80 |
+
|
81 |
+
echo '</div>';
|
82 |
+
}
|
83 |
+
|
84 |
/**
|
85 |
* Allow adding custom fields to the admin meta page at the end of the archive settings for a post type - Content Types tab.
|
86 |
*
|
88 |
* @param string $name The post type name.
|
89 |
*/
|
90 |
do_action( 'Yoast\WP\SEO\admin_post_types_archive', $yform, $wpseo_post_type->name );
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
}
|
92 |
|
93 |
/**
|
admin/views/tabs/metas/paper-content/post_type/post-type.php
CHANGED
@@ -27,7 +27,7 @@ $yform->index_switch(
|
|
27 |
$yform->show_hide_switch(
|
28 |
'display-metabox-pt-' . $wpseo_post_type->name,
|
29 |
/* translators: %s expands to an indexable object's name, like a post type or taxonomy */
|
30 |
-
sprintf( esc_html__( 'Show SEO settings for %1$s', 'wordpress-seo' ),
|
31 |
);
|
32 |
|
33 |
echo '</div>';
|
@@ -48,14 +48,6 @@ $editor->render();
|
|
48 |
|
49 |
echo '</div>';
|
50 |
|
51 |
-
/**
|
52 |
-
* Allow adding custom fields to the admin meta page - Content Types tab.
|
53 |
-
*
|
54 |
-
* @param Yoast_Form $yform The Yoast_Form object.
|
55 |
-
* @param string $name The post type name.
|
56 |
-
*/
|
57 |
-
do_action( 'Yoast\WP\SEO\admin_post_types_meta', $yform, $wpseo_post_type->name );
|
58 |
-
|
59 |
echo '<div class="yoast-settings-section">';
|
60 |
|
61 |
// Schema settings.
|
@@ -68,12 +60,12 @@ if ( $wpseo_post_type->name !== 'page' && $article_helper->is_author_supported(
|
|
68 |
}
|
69 |
printf(
|
70 |
'<div class="yoast-schema-settings-container" data-schema-settings data-schema-settings-post-type="%1$s" data-schema-settings-post-type-name="%2$s" data-schema-settings-page-type-field-id="%3$s" data-schema-settings-article-type-field-id="%4$s" data-schema-settings-page-type-default="%5$s" data-schema-settings-article-type-default="%6$s"></div>',
|
71 |
-
$wpseo_post_type->name,
|
72 |
-
$wpseo_post_type->labels->name,
|
73 |
-
'hidden_' . $schema_page_type_option,
|
74 |
-
'hidden_' . $schema_article_type_option,
|
75 |
-
WPSEO_Options::get_default( 'wpseo_titles', $schema_page_type_option ),
|
76 |
-
WPSEO_Options::get_default( 'wpseo_titles', $schema_article_type_option )
|
77 |
);
|
78 |
|
79 |
echo '</div>';
|
27 |
$yform->show_hide_switch(
|
28 |
'display-metabox-pt-' . $wpseo_post_type->name,
|
29 |
/* translators: %s expands to an indexable object's name, like a post type or taxonomy */
|
30 |
+
sprintf( esc_html__( 'Show SEO settings for %1$s?', 'wordpress-seo' ), $wpseo_post_type->labels->name )
|
31 |
);
|
32 |
|
33 |
echo '</div>';
|
48 |
|
49 |
echo '</div>';
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
echo '<div class="yoast-settings-section">';
|
52 |
|
53 |
// Schema settings.
|
60 |
}
|
61 |
printf(
|
62 |
'<div class="yoast-schema-settings-container" data-schema-settings data-schema-settings-post-type="%1$s" data-schema-settings-post-type-name="%2$s" data-schema-settings-page-type-field-id="%3$s" data-schema-settings-article-type-field-id="%4$s" data-schema-settings-page-type-default="%5$s" data-schema-settings-article-type-default="%6$s"></div>',
|
63 |
+
esc_attr( $wpseo_post_type->name ),
|
64 |
+
esc_attr( $wpseo_post_type->labels->name ),
|
65 |
+
esc_attr( 'hidden_' . $schema_page_type_option ),
|
66 |
+
esc_attr( 'hidden_' . $schema_article_type_option ),
|
67 |
+
esc_attr( WPSEO_Options::get_default( 'wpseo_titles', $schema_page_type_option ) ),
|
68 |
+
esc_attr( WPSEO_Options::get_default( 'wpseo_titles', $schema_article_type_option ) )
|
69 |
);
|
70 |
|
71 |
echo '</div>';
|
admin/views/tabs/metas/paper-content/post_type/woocommerce-shop-page.php
CHANGED
@@ -7,17 +7,18 @@
|
|
7 |
* @uses WP_Post_Type $wpseo_post_type
|
8 |
*/
|
9 |
|
10 |
-
$description =
|
11 |
|
12 |
if ( YoastSEO()->helpers->woocommerce->get_shop_page_id() !== -1 ) {
|
13 |
$description = sprintf(
|
14 |
/* translators: %1$s expands to an opening anchor tag, %2$s expands to a closing anchor tag. */
|
15 |
-
|
16 |
'<a href="' . esc_url( get_edit_post_link( YoastSEO()->helpers->woocommerce->get_shop_page_id() ) ) . '">',
|
17 |
'</a>'
|
18 |
);
|
19 |
}
|
20 |
|
21 |
/* translators: %s expands to the post type name. */
|
22 |
-
echo '<h3>'
|
23 |
-
|
|
7 |
* @uses WP_Post_Type $wpseo_post_type
|
8 |
*/
|
9 |
|
10 |
+
$description = esc_html__( 'You haven\'t set a Shop page in your WooCommerce settings. Please do this first.', 'wordpress-seo' );
|
11 |
|
12 |
if ( YoastSEO()->helpers->woocommerce->get_shop_page_id() !== -1 ) {
|
13 |
$description = sprintf(
|
14 |
/* translators: %1$s expands to an opening anchor tag, %2$s expands to a closing anchor tag. */
|
15 |
+
esc_html__( 'You can edit the SEO meta-data for this custom type on the %1$sShop page%2$s.', 'wordpress-seo' ),
|
16 |
'<a href="' . esc_url( get_edit_post_link( YoastSEO()->helpers->woocommerce->get_shop_page_id() ) ) . '">',
|
17 |
'</a>'
|
18 |
);
|
19 |
}
|
20 |
|
21 |
/* translators: %s expands to the post type name. */
|
22 |
+
echo '<h3>', esc_html( sprintf( __( 'Settings for %s archive', 'wordpress-seo' ), $wpseo_post_type->labels->name ) ), '</h3>';
|
23 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Reason: Output is properly escaped already, see above.
|
24 |
+
echo '<p>', $description, '</p>';
|
admin/views/tabs/metas/paper-content/taxonomy-content.php
CHANGED
@@ -16,7 +16,7 @@ if ( $wpseo_taxonomy->name === 'post_format' ) {
|
|
16 |
$yform->light_switch(
|
17 |
'disable-post_format',
|
18 |
__( 'Format-based archives', 'wordpress-seo' ),
|
19 |
-
[ __( '
|
20 |
false
|
21 |
);
|
22 |
}
|
@@ -36,7 +36,7 @@ if ( $wpseo_taxonomy->name !== 'post_format' ) {
|
|
36 |
$yform->show_hide_switch(
|
37 |
'display-metabox-tax-' . $wpseo_taxonomy->name,
|
38 |
/* translators: %s: Expands to an indexable object's name, like a post type or taxonomy. */
|
39 |
-
sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ),
|
40 |
);
|
41 |
}
|
42 |
|
16 |
$yform->light_switch(
|
17 |
'disable-post_format',
|
18 |
__( 'Format-based archives', 'wordpress-seo' ),
|
19 |
+
[ __( 'On', 'wordpress-seo' ), __( 'Off', 'wordpress-seo' ) ],
|
20 |
false
|
21 |
);
|
22 |
}
|
36 |
$yform->show_hide_switch(
|
37 |
'display-metabox-tax-' . $wpseo_taxonomy->name,
|
38 |
/* translators: %s: Expands to an indexable object's name, like a post type or taxonomy. */
|
39 |
+
sprintf( __( 'Show SEO settings for %1$s?', 'wordpress-seo' ), $title )
|
40 |
);
|
41 |
}
|
42 |
|
admin/views/tabs/metas/post-types.php
CHANGED
@@ -28,6 +28,10 @@ echo '</p>';
|
|
28 |
$view_utils = new Yoast_View_Utils();
|
29 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
30 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
|
|
|
|
|
|
|
|
31 |
|
32 |
if ( is_array( $wpseo_post_types ) && $wpseo_post_types !== [] ) {
|
33 |
foreach ( array_values( $wpseo_post_types ) as $wpseo_post_type_index => $yoast_seo_post_type ) {
|
28 |
$view_utils = new Yoast_View_Utils();
|
29 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
30 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
31 |
+
$opengraph_disabled_alert = $view_utils->generate_opengraph_disabled_alert();
|
32 |
+
|
33 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the generate_opengraph_disabled_alert() method.
|
34 |
+
echo $opengraph_disabled_alert;
|
35 |
|
36 |
if ( is_array( $wpseo_post_types ) && $wpseo_post_types !== [] ) {
|
37 |
foreach ( array_values( $wpseo_post_types ) as $wpseo_post_type_index => $yoast_seo_post_type ) {
|
admin/views/tabs/metas/taxonomies.php
CHANGED
@@ -17,6 +17,9 @@ if ( is_array( $wpseo_taxonomies ) && $wpseo_taxonomies !== [] ) {
|
|
17 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
18 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
19 |
|
|
|
|
|
|
|
20 |
// Explicitly hide all the core taxonomies we never want to do stuff for.
|
21 |
$wpseo_taxonomies = array_diff_key( $wpseo_taxonomies, array_flip( [ 'link_category', 'nav_menu' ] ) );
|
22 |
|
17 |
$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars();
|
18 |
$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars();
|
19 |
|
20 |
+
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Is correctly escaped in the generate_opengraph_disabled_alert() method.
|
21 |
+
echo $view_utils->generate_opengraph_disabled_alert( 'taxonomies' );
|
22 |
+
|
23 |
// Explicitly hide all the core taxonomies we never want to do stuff for.
|
24 |
$wpseo_taxonomies = array_diff_key( $wpseo_taxonomies, array_flip( [ 'link_category', 'nav_menu' ] ) );
|
25 |
|
admin/views/tabs/metas/taxonomies/category-url.php
CHANGED
@@ -21,7 +21,7 @@ $stripcategorybase_help = new WPSEO_Admin_Help_Panel(
|
|
21 |
|
22 |
$yform->light_switch(
|
23 |
'stripcategorybase',
|
24 |
-
__( 'Remove the categories prefix', 'wordpress-seo' ),
|
25 |
$remove_buttons,
|
26 |
false,
|
27 |
$stripcategorybase_help->get_button_html() . $stripcategorybase_help->get_panel_html()
|
21 |
|
22 |
$yform->light_switch(
|
23 |
'stripcategorybase',
|
24 |
+
__( 'Remove the categories prefix?', 'wordpress-seo' ),
|
25 |
$remove_buttons,
|
26 |
false,
|
27 |
$stripcategorybase_help->get_button_html() . $stripcategorybase_help->get_panel_html()
|
admin/views/tabs/network/features.php
CHANGED
@@ -52,7 +52,7 @@ $feature_toggles = Yoast_Feature_Toggles::instance()->get_all();
|
|
52 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
53 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
54 |
],
|
55 |
-
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
58 |
}
|
52 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
53 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
54 |
],
|
55 |
+
$feature->name,
|
56 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
57 |
);
|
58 |
}
|
admin/views/tabs/network/integrations.php
CHANGED
@@ -54,7 +54,7 @@ $integration_toggles = Yoast_Integration_Toggles::instance()->get_all();
|
|
54 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
55 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
56 |
],
|
57 |
-
|
58 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
59 |
);
|
60 |
}
|
54 |
'on' => __( 'Allow Control', 'wordpress-seo' ),
|
55 |
'off' => __( 'Disable', 'wordpress-seo' ),
|
56 |
],
|
57 |
+
$integration->name,
|
58 |
$feature_help->get_button_html() . $feature_help->get_panel_html()
|
59 |
);
|
60 |
}
|
admin/views/tabs/social/facebook.php
CHANGED
@@ -7,87 +7,54 @@
|
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
|
|
|
|
10 |
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
11 |
header( 'Status: 403 Forbidden' );
|
12 |
header( 'HTTP/1.1 403 Forbidden' );
|
13 |
exit();
|
14 |
}
|
15 |
|
16 |
-
echo '<h2>' .
|
17 |
|
18 |
-
$yform->light_switch( 'opengraph',
|
19 |
|
20 |
?>
|
21 |
<p>
|
22 |
<?php
|
23 |
-
|
24 |
?>
|
25 |
</p>
|
26 |
|
27 |
<div id="wpseo-opengraph-settings" style="display: none;">
|
28 |
-
<?php
|
29 |
-
|
30 |
-
if ( get_option( 'show_on_front' ) === 'posts' ) {
|
31 |
-
$social_facebook_frontpage_help = new WPSEO_Admin_Help_Panel(
|
32 |
-
'social-facebook-frontpage',
|
33 |
-
esc_html__( 'Learn more about the title separator setting', 'wordpress-seo' ),
|
34 |
-
esc_html__( 'These are the title, description and image used in the Open Graph meta tags on the front page of your site.', 'wordpress-seo' ),
|
35 |
-
'has-wrapper'
|
36 |
-
);
|
37 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_button_html() output is properly escaped.
|
38 |
-
echo '<h2 class="help-button-inline">' . esc_html__( 'Frontpage settings', 'wordpress-seo' ) . $social_facebook_frontpage_help->get_button_html() . '</h2>';
|
39 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_panel_html() output is properly escaped.
|
40 |
-
echo $social_facebook_frontpage_help->get_panel_html();
|
41 |
-
|
42 |
-
$yform->hidden( 'og_frontpage_image', 'og_frontpage_image' );
|
43 |
-
$yform->hidden( 'og_frontpage_image_id', 'og_frontpage_image_id' );
|
44 |
-
?>
|
45 |
-
<div id="yoast-og-frontpage-image-select"></div>
|
46 |
<?php
|
47 |
-
$
|
48 |
-
|
49 |
-
|
50 |
-
|
|
|
|
|
51 |
|
52 |
-
|
53 |
-
$homepage_meta_description = WPSEO_Options::get( 'metadesc-home-wpseo' );
|
54 |
-
if ( ! empty( $homepage_meta_description ) ) {
|
55 |
-
$copy_home_meta_desc_help = new WPSEO_Admin_Help_Panel(
|
56 |
-
'copy-home-meda-desc',
|
57 |
-
esc_html__( 'Help on copying the home meta description', 'wordpress-seo' ),
|
58 |
-
sprintf(
|
59 |
-
/* translators: 1: link open tag; 2: link close tag., 3: the translated label of the button */
|
60 |
-
esc_html__( 'Click the "%3$s" button to use the meta description already set in the %1$sSearch Appearance Homepage%2$s setting.', 'wordpress-seo' ),
|
61 |
-
'<a href="' . esc_url( admin_url( 'admin.php?page=wpseo_titles' ) ) . '">',
|
62 |
-
'</a>',
|
63 |
-
// $copy_home_description_button_label is escaped above.
|
64 |
-
$copy_home_description_button_label
|
65 |
-
)
|
66 |
-
);
|
67 |
|
68 |
-
|
69 |
-
|
70 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- $copy_home_description_button_label is escaped above.
|
71 |
-
'<button type="button" id="copy-home-meta-description" class="button">', $copy_home_description_button_label, '</button>' .
|
72 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_button_html() output is properly escaped.
|
73 |
-
$copy_home_meta_desc_help->get_button_html() .
|
74 |
-
// phpcs:ignore WordPress.Security.EscapeOutput -- get_panel_html() output is properly escaped.
|
75 |
-
$copy_home_meta_desc_help->get_panel_html() .
|
76 |
-
'</div>';
|
77 |
-
}
|
78 |
-
}
|
79 |
|
80 |
-
|
|
|
|
|
|
|
81 |
|
82 |
-
|
83 |
-
$yform->hidden( 'og_default_image_id', 'og_default_image_id' );
|
84 |
|
85 |
-
|
|
|
|
|
86 |
<p>
|
87 |
-
<?php
|
88 |
</p>
|
89 |
-
<div id="yoast-og-default-image-select"></div>
|
90 |
</div>
|
91 |
<?php
|
92 |
|
93 |
-
|
7 |
* @uses Yoast_Form $yform Form object.
|
8 |
*/
|
9 |
|
10 |
+
use Yoast\WP\SEO\Presenters\Admin\Alert_Presenter;
|
11 |
+
|
12 |
if ( ! defined( 'WPSEO_VERSION' ) ) {
|
13 |
header( 'Status: 403 |