From fc816580b8ece61794e17b1be86e8405feb56e56 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:23:40 +0200 Subject: [PATCH 01/57] CSS tweaks for admin pages --- css/src/admin/admin.css | 51 ++++++++++++++++++++++++------ css/src/base/colors.css | 8 ++--- css/src/components/collapsible.css | 8 ++--- css/src/components/paper.css | 4 +-- css/src/components/sidebar.css | 8 +++++ css/src/components/tabs.css | 4 +-- 6 files changed, 60 insertions(+), 23 deletions(-) diff --git a/css/src/admin/admin.css b/css/src/admin/admin.css index 18df1c5f069..9e733bdf462 100644 --- a/css/src/admin/admin.css +++ b/css/src/admin/admin.css @@ -1,3 +1,35 @@ +.yoast #wpcontent #wpseo-title { + margin-bottom: 24px; +} + +.yoast #rss textarea { + min-height: 80px; +} + +.yoast-space-after { + margin-bottom: 32px; +} + +.yoast-medium-space-after { + margin-bottom: 16px; +} + +.yoast-small-spacing-after { + margin-bottom: 10px; +} + +.yoast #wpcontent h2.collapsible-header { + margin-bottom: 0; +} + +.toggleable-container { + padding: 16px 16px 0; +} + +.yoast #wpcontent .toggleable-container h3 { + margin-bottom: 24px; +} + .collapsible-header .toggleable-container-icon { float: right; color: var(--yoast-color-default); @@ -5,13 +37,12 @@ } .collapsible-header code { - font-size: 14px; - font-weight: 700; - border: var(--yoast-border-default); + font-size: 16px; + font-weight: normal; color: var(--yoast-color-default); - padding: 5px; - margin: 0 2px; - background: var(--yoast-color-secondary); + padding: 0; + margin: 0 4px; + background: none; } .toggleable-container-hidden { @@ -20,11 +51,11 @@ .yoast-field-group__title code { font-size: 13px; - font-weight: 700; - border: var(--yoast-border-default); + font-weight: normal; color: var(--yoast-color-default); - padding: 3px 5px; - margin: 0 2px; + padding: 0; + margin: 0 4px; + background: none; } .collapsible-header .toggleable-container-trigger { diff --git a/css/src/base/colors.css b/css/src/base/colors.css index 826fb05f289..166413e1aac 100644 --- a/css/src/base/colors.css +++ b/css/src/base/colors.css @@ -18,12 +18,12 @@ --yoast-color-inactive-grey: #9E9E9E; --yoast-color-inactive-grey-light: #f1f1f1; --yoast-color-active-light: #B6CF94; - + --yoast-font-size-default: 14px; - + --yoast-border-default: 1px solid var(--yoast-color-border); - - --yoast-shadow-default: 0px 3px 6px rgba(0, 0, 0, 0.15); + + --yoast-shadow-default: 0 2px 6px rgba(0, 0, 0, 0.15); --yoast-transition-default: all 150ms ease-out; } diff --git a/css/src/components/collapsible.css b/css/src/components/collapsible.css index 8982d61c226..db2a8101019 100644 --- a/css/src/components/collapsible.css +++ b/css/src/components/collapsible.css @@ -1,10 +1,8 @@ .yoast-collapsible { - margin-bottom: 48px; + margin-bottom: 16px; max-width: 600px; position: relative; -} -.yoast-collapsible .collapsible-header { - border-bottom: var(--yoast-border-default); - padding-bottom: 13px; + box-shadow: var(--yoast-shadow-default); + border: var(--yoast-border-default); } diff --git a/css/src/components/paper.css b/css/src/components/paper.css index bfac0522abb..029095d1aa5 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -1,6 +1,6 @@ .yoast-paper { background-color: white; - padding: 24px; + padding: 16px 16px 0; margin-bottom: 32px; box-shadow: var(--yoast-shadow-default); border: var(--yoast-border-default); @@ -37,7 +37,7 @@ .yoast-paper .toggleable-container-trigger { background: none; - border: 0px; + border: 0; width: 100%; text-align: left; color: var(--yoast-color-primary); diff --git a/css/src/components/sidebar.css b/css/src/components/sidebar.css index 02ee3b62605..423fcb191e9 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -44,6 +44,14 @@ margin-bottom: 24px; } +.yoast-sidebar__plugins:last-of-type { + margin-bottom: 0; +} + +.yoast #wpcontent .yoast-sidebar__plugins p { + margin: 0; +} + .yoast-sidebar__plugins-content-left { margin-right: 16px; } diff --git a/css/src/components/tabs.css b/css/src/components/tabs.css index f2fd762063f..9131d27ab60 100644 --- a/css/src/components/tabs.css +++ b/css/src/components/tabs.css @@ -21,7 +21,7 @@ margin-top: 0; padding-top: 3px; padding-left: 16px; - border-bottom: 1px solid var(--yoast-color-border); + border-bottom: 1px solid #cccccc; min-height: 60px; } @@ -32,7 +32,6 @@ border-top: var(--yoast-border-default); border-right: var(--yoast-border-default); border-left: var(--yoast-border-default); - box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15); margin-left: -1px; } @@ -90,6 +89,7 @@ .yoast-tabs__list-item.yoast-tabs__list-item--active { top: 1px; background-color: var(--yoast-color-white); + box-shadow: var(--yoast-shadow-default); z-index: 11; } From 971d899a3850880574da75e6aadea0b9177d1fbb Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:25:13 +0200 Subject: [PATCH 02/57] Restore papers and add spacing --- admin/class-yoast-form.php | 20 ++++++++++++------- admin/pages/tools.php | 2 ++ .../paper-content/author-archive-settings.php | 19 +++++++----------- .../paper-content/breadcrumbs-content.php | 6 +++--- .../general/force-rewrite-title.php | 2 +- .../metas/paper-content/general/homepage.php | 3 +-- .../paper-content/general/knowledge-graph.php | 7 +++++-- .../paper-content/general/title-separator.php | 3 +-- .../metas/paper-content/media-content.php | 8 ++++++-- .../metas/paper-content/post-type-content.php | 4 ++++ .../paper-content/post_type/post-type.php | 4 ++++ admin/views/tabs/metas/taxonomies.php | 2 +- .../tabs/metas/taxonomies/category-url.php | 1 + admin/views/tabs/social/accounts.php | 1 + admin/views/tabs/social/facebook.php | 3 ++- admin/views/tabs/social/pinterest.php | 2 +- admin/views/tabs/social/twitterbox.php | 2 +- admin/views/tool-file-editor.php | 7 +++++-- 18 files changed, 59 insertions(+), 37 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index 1df011b673d..3439240ffdb 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -413,12 +413,19 @@ public function textinput( $var, $label, $attr = [] ) { Yoast_Input_Validation::set_error_descriptions(); $aria_attributes .= Yoast_Input_Validation::get_the_aria_describedby_attribute( $var ); - echo 'is_control_disabled( $var ), true, false ), '/>', ''; + echo 'is_control_disabled( $var ), true, false ), '/>'; + + if ( ! empty( $attr['html_after'] ) ) { + echo $attr['html_after']; + } + + echo ''; echo Yoast_Input_Validation::get_the_error_description( $var ); } @@ -625,7 +632,6 @@ public function media_input( $var, $label ) { ' value="', esc_attr( $id_value ), '"', ' />'; echo ''; - echo '
'; } /** diff --git a/admin/pages/tools.php b/admin/pages/tools.php index 143bcc692a7..e30039b6ec8 100644 --- a/admin/pages/tools.php +++ b/admin/pages/tools.php @@ -69,7 +69,9 @@ echo ''; } else { + echo ''; $tool_pages = [ 'bulk-editor', 'import-export' ]; diff --git a/admin/views/tabs/metas/paper-content/author-archive-settings.php b/admin/views/tabs/metas/paper-content/author-archive-settings.php index 0daa6eaaacb..60ec352dae9 100644 --- a/admin/views/tabs/metas/paper-content/author-archive-settings.php +++ b/admin/views/tabs/metas/paper-content/author-archive-settings.php @@ -18,11 +18,10 @@ true ); -?> +echo '
'; -
+echo '
'; - - -
-'; $author_archives_no_posts_help = new WPSEO_Admin_Help_Button( 'https://yoast.com/show-x-in-search-results/', @@ -50,10 +46,9 @@ $author_archives_no_posts_help ); -?> -
+echo '
'; // noindex-container -'; // space-after $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); @@ -69,5 +64,5 @@ ); $editor->render(); -?> -
+ +echo '
'; // author-archives diff --git a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php index 72303db5f28..0e36ccdf841 100644 --- a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php +++ b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php @@ -33,7 +33,7 @@ $yform->light_switch( 'breadcrumbs-boldlast', __( 'Bold the last page', 'wordpress-seo' ), $yoast_free_breadcrumb_bold_texts ); -echo '

'; +echo '
'; /* * WPSEO_Post_Type::get_accessible_post_types() should *not* be used here. @@ -61,7 +61,6 @@ } unset( $pt ); } -echo '
'; $taxonomies = get_taxonomies( [ @@ -94,8 +93,9 @@ unset( $taxonomies, $post_types ); ?> -
+

+

-

+
light_switch( 'forcerewritetitle', __( 'Force rewrite titles', 'wordpress-seo' ) ); echo '

'; diff --git a/admin/views/tabs/metas/paper-content/general/homepage.php b/admin/views/tabs/metas/paper-content/general/homepage.php index 333f66279e5..8e6366ef119 100644 --- a/admin/views/tabs/metas/paper-content/general/homepage.php +++ b/admin/views/tabs/metas/paper-content/general/homepage.php @@ -8,7 +8,7 @@ */ ?> -

+
-
diff --git a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php index eea37567df5..69b5eaa9990 100644 --- a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php +++ b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php @@ -12,7 +12,7 @@ __( 'Learn more about the knowledge graph setting', 'wordpress-seo' ) ); ?> -
+

textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] ); $yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) ); ?> -

@@ -65,3 +64,7 @@ ?>
+ +
+
+
diff --git a/admin/views/tabs/metas/paper-content/general/title-separator.php b/admin/views/tabs/metas/paper-content/general/title-separator.php index 154549c6b69..6d6e5d7e4bf 100644 --- a/admin/views/tabs/metas/paper-content/general/title-separator.php +++ b/admin/views/tabs/metas/paper-content/general/title-separator.php @@ -12,7 +12,7 @@ __( 'Learn more about the title separator setting', 'wordpress-seo' ) ); ?> -
+

title_separator( 'separator', WPSEO_Option_Titles::get_instance()->get_separator_options_for_display(), $legend, $legend_attr ); ?>
-
diff --git a/admin/views/tabs/metas/paper-content/media-content.php b/admin/views/tabs/metas/paper-content/media-content.php index dd2fe192460..62d19b6b9d8 100644 --- a/admin/views/tabs/metas/paper-content/media-content.php +++ b/admin/views/tabs/metas/paper-content/media-content.php @@ -18,10 +18,14 @@ ); ?> -
+

-

+

', + '' + ); ?>

' . esc_html( sprintf( __( 'Settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . ''; + echo '
'; + $yform->index_switch( 'noindex-ptarchive-' . $wpseo_post_type->name, sprintf( @@ -41,6 +43,8 @@ $view_utils->search_results_setting_help() ); + echo '
'; + $page_type = $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ); $editor = new WPSEO_Replacevar_Editor( diff --git a/admin/views/tabs/metas/paper-content/post_type/post-type.php b/admin/views/tabs/metas/paper-content/post_type/post-type.php index e7abee5bd5e..92bd03e39c6 100644 --- a/admin/views/tabs/metas/paper-content/post_type/post-type.php +++ b/admin/views/tabs/metas/paper-content/post_type/post-type.php @@ -13,6 +13,8 @@ $noindex_option_name = 'noindex-' . $wpseo_post_type->name; +echo '
'; + $yform->index_switch( $noindex_option_name, $wpseo_post_type->labels->name, @@ -30,6 +32,8 @@ sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $wpseo_post_type->labels->name ) ); +echo '
'; + $editor = new WPSEO_Replacevar_Editor( $yform, [ diff --git a/admin/views/tabs/metas/taxonomies.php b/admin/views/tabs/metas/taxonomies.php index d53edc08da5..ae0fc89d26d 100644 --- a/admin/views/tabs/metas/taxonomies.php +++ b/admin/views/tabs/metas/taxonomies.php @@ -46,7 +46,7 @@ unset( $wpseo_taxonomies ); -echo '
'; +echo '
'; printf( '

%s

', esc_html__( 'Category URLs', 'wordpress-seo' ) ); require __DIR__ . '/taxonomies/category-url.php'; echo '
'; diff --git a/admin/views/tabs/metas/taxonomies/category-url.php b/admin/views/tabs/metas/taxonomies/category-url.php index 66dc0e7cce3..79d9789c440 100644 --- a/admin/views/tabs/metas/taxonomies/category-url.php +++ b/admin/views/tabs/metas/taxonomies/category-url.php @@ -7,6 +7,7 @@ * @uses Yoast_Form $yform Form object. */ + $stripcategorybase_help = new WPSEO_Admin_Help_Button( 'https://yoa.st/3yk', esc_html__( 'Help on the category prefix setting', 'wordpress-seo' ) diff --git a/admin/views/tabs/social/accounts.php b/admin/views/tabs/social/accounts.php index 1db14efb6dc..4824f784282 100644 --- a/admin/views/tabs/social/accounts.php +++ b/admin/views/tabs/social/accounts.php @@ -103,4 +103,5 @@ } do_action( 'wpseo_admin_other_section' ); + echo '
'; diff --git a/admin/views/tabs/social/facebook.php b/admin/views/tabs/social/facebook.php index 4652b170c40..a1c3d691b88 100644 --- a/admin/views/tabs/social/facebook.php +++ b/admin/views/tabs/social/facebook.php @@ -12,7 +12,7 @@ header( 'HTTP/1.1 403 Forbidden' ); exit(); } -echo '
'; +echo '
'; echo '

' . esc_html__( 'Facebook settings', 'wordpress-seo' ) . '

'; $yform->light_switch( 'opengraph', __( 'Add Open Graph meta data', 'wordpress-seo' ) ); @@ -63,6 +63,7 @@ $yform->media_input( 'og_default_image', __( 'Image URL', 'wordpress-seo' ) ); ?> +

diff --git a/admin/views/tabs/social/pinterest.php b/admin/views/tabs/social/pinterest.php index 8973ab9b077..37860a6b25f 100644 --- a/admin/views/tabs/social/pinterest.php +++ b/admin/views/tabs/social/pinterest.php @@ -13,7 +13,7 @@ exit(); } -echo '
'; +echo '
'; echo '

' . esc_html__( 'Pinterest settings', 'wordpress-seo' ) . '

'; printf( diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index 3a0dc9630b2..14d00892dc9 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -13,7 +13,7 @@ header( 'HTTP/1.1 403 Forbidden' ); exit(); } -echo '
'; +echo '
'; echo '

' . esc_html__( 'Twitter settings', 'wordpress-seo' ) . '

'; printf( diff --git a/admin/views/tool-file-editor.php b/admin/views/tool-file-editor.php index 7fb4980a3df..41622af906f 100644 --- a/admin/views/tool-file-editor.php +++ b/admin/views/tool-file-editor.php @@ -177,9 +177,11 @@ echo ''; } } -echo '
'; +echo '
'; // yoast-field-group + if ( ! WPSEO_Utils::is_nginx() ) { + echo '
'; echo '

'; printf( /* translators: %s expands to ".htaccess". */ @@ -239,9 +241,10 @@ ); echo '

'; } + echo '

'; // yoast-field-group } -echo '
'; +echo '
'; // yoast-feature if ( is_multisite() ) { $yform->admin_footer( false ); From c9abe78ad1152fb7968e5d37939f9fcc2206ad39 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:25:36 +0200 Subject: [PATCH 03/57] Adjust sidebar upsell spacing --- admin/views/sidebar.php | 141 +++++++++++++++++++--------------------- 1 file changed, 68 insertions(+), 73 deletions(-) diff --git a/admin/views/sidebar.php b/admin/views/sidebar.php index 5beb2e07b5d..dc6886c03c2 100644 --- a/admin/views/sidebar.php +++ b/admin/views/sidebar.php @@ -16,6 +16,7 @@ printf( esc_html__( '%1$s recommendations for you', 'wordpress-seo' ), 'Yoast' ); ?> +


-
-
-

- -

-
- - - + +
+

+ +

+
+ - +
+ + + + + - + +

-

- - " target="_blank"> - -

+ printf( esc_html__( 'Check out %1$s', 'wordpress-seo' ), 'Yoast SEO academy' ); ?>

+ From aca77a898d735094faf51437f41936d3ef2db9f4 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:04 +0200 Subject: [PATCH 04/57] Add the context to field-group --- .../views/tabs/dashboard/webmaster-tools.php | 35 ++++++++----------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/admin/views/tabs/dashboard/webmaster-tools.php b/admin/views/tabs/dashboard/webmaster-tools.php index 76111555bb4..942301ca4c2 100644 --- a/admin/views/tabs/dashboard/webmaster-tools.php +++ b/admin/views/tabs/dashboard/webmaster-tools.php @@ -32,9 +32,7 @@ 'https://www.google.com/webmasters/verification/verification' ); -$yform->textinput( 'baiduverify', __( 'Baidu verification code', 'wordpress-seo' ) ); -echo '

'; -printf( +$context = '

' . sprintf( /* translators: %1$s expands to a link start tag to the Baidu Webmaster Tools site add page, %2$s is the link closing tag. */ esc_html__( 'Get your Baidu verification code in %1$sBaidu Webmaster Tools%2$s.', 'wordpress-seo' ), /** @@ -44,36 +42,33 @@ */ '', '' -); -echo '

'; +) . '

'; +$yform->textinput( 'baiduverify', __( 'Baidu verification code', 'wordpress-seo' ), [ 'html_after' => $context ] ); + -$yform->textinput( 'msverify', __( 'Bing verification code', 'wordpress-seo' ) ); -echo '

'; -printf( +$context = '

' . +sprintf( /* translators: 1: link open tag; 2: link close tag. */ esc_html__( 'Get your Bing verification code in %1$sBing Webmaster Tools%2$s.', 'wordpress-seo' ), '', '' -); -echo '

'; +) . '

'; +$yform->textinput( 'msverify', __( 'Bing verification code', 'wordpress-seo' ), [ 'html_after' => $context ] ); -$yform->textinput( 'googleverify', __( 'Google verification code', 'wordpress-seo' ) ); -echo '

'; -printf( +$context = '

' . sprintf( /* translators: 1: link open tag; 2: link close tag. */ esc_html__( 'Get your Google verification code in %1$sGoogle Search Console%2$s.', 'wordpress-seo' ), '', '' -); -echo '

'; +) . '

'; +$yform->textinput( 'googleverify', __( 'Google verification code', 'wordpress-seo' ), [ 'html_after' => $context ] ); -$yform->textinput( 'yandexverify', __( 'Yandex verification code', 'wordpress-seo' ) ); -echo '

'; -printf( +$context = '

' . sprintf( /* translators: 1: link open tag; 2: link close tag. */ esc_html__( 'Get your Yandex verification code in %1$sYandex Webmaster Tools%2$s.', 'wordpress-seo' ), '', '' -); -echo '

'; +) . '

'; +$yform->textinput( 'yandexverify', __( 'Yandex verification code', 'wordpress-seo' ), [ 'html_after' => $context ] ); + echo '
'; From 0d99207da1cdf386f6b3d1e859e5f1436ed2b0d9 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:22 +0200 Subject: [PATCH 05/57] Add spacing --- .../paper-content/date-archives-settings.php | 64 ++++++++++--------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/date-archives-settings.php b/admin/views/tabs/metas/paper-content/date-archives-settings.php index 9e9aaf9c903..73ea1a9a5c2 100644 --- a/admin/views/tabs/metas/paper-content/date-archives-settings.php +++ b/admin/views/tabs/metas/paper-content/date-archives-settings.php @@ -18,33 +18,37 @@ true ); -?> -
- index_switch( - 'noindex-archive-wpseo', - __( 'date archives', 'wordpress-seo' ), - $date_archives_help - ); - - $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); - $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); - - $editor = new WPSEO_Replacevar_Editor( - $yform, - [ - 'title' => 'title-archive-wpseo', - 'description' => 'metadesc-archive-wpseo', - 'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'date' ), - 'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'date' ), - 'paper_style' => false, - ] - ); - $editor->render(); - ?> -
+echo '
'; + +echo '
'; + +$date_archives_help = new WPSEO_Admin_Help_Button( + 'https://yoa.st/show-x', + esc_html__( 'Help on the date archives search results setting', 'wordpress-seo' ) +); + +$yform->index_switch( + 'noindex-archive-wpseo', + __( 'date archives', 'wordpress-seo' ), + $date_archives_help +); + +echo '
'; // space-after + +$recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); +$editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); + +$editor = new WPSEO_Replacevar_Editor( + $yform, + [ + 'title' => 'title-archive-wpseo', + 'description' => 'metadesc-archive-wpseo', + 'page_type_recommended' => $recommended_replace_vars->determine_for_archive( 'date' ), + 'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( 'date' ), + 'paper_style' => false, + ] +); +$editor->render(); + +echo '
'; // archives-content + From 395392c92805fc2e3c9e105499135fe02b6458d5 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:43 +0200 Subject: [PATCH 06/57] Restore RSS tab header Remove the table-scrollable --- .../views/tabs/metas/paper-content/rss-content.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/admin/views/tabs/metas/paper-content/rss-content.php b/admin/views/tabs/metas/paper-content/rss-content.php index 5cfcfaf72a8..2102f3e13ec 100644 --- a/admin/views/tabs/metas/paper-content/rss-content.php +++ b/admin/views/tabs/metas/paper-content/rss-content.php @@ -7,6 +7,15 @@ * @uses Yoast_Form $yform Form object. */ +$rss_help = new WPSEO_Admin_Help_Button( + 'https://yoa.st/3ym', + __( 'Learn more about the RSS feed setting', 'wordpress-seo' ) +); + +echo '
'; + +echo '

' . esc_html__( 'RSS feed settings', 'wordpress-seo' ) . $rss_help . '

'; + $textarea_atts = [ 'cols' => '50', 'rows' => '5', @@ -19,9 +28,11 @@ __( 'Learn more about the available variables', 'wordpress-seo' ) ); +echo '
'; + echo '

' . esc_html__( 'Available variables', 'wordpress-seo' ) . $rss_variables_help . '

'; ?> - +
From ddee0aab3de485d9ce661579bac746b17fb0b066 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:53 +0200 Subject: [PATCH 07/57] Special pages spacing --- admin/views/tabs/metas/paper-content/special-pages.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/special-pages.php b/admin/views/tabs/metas/paper-content/special-pages.php index d839a5bcaf8..63f78d0392e 100644 --- a/admin/views/tabs/metas/paper-content/special-pages.php +++ b/admin/views/tabs/metas/paper-content/special-pages.php @@ -21,7 +21,7 @@ $editor = new WPSEO_Replacevar_Field( $yform, 'title-search-wpseo', __( 'Search pages', 'wordpress-seo' ), 'search', 'search' ); $editor->render(); -echo '
'; - $editor = new WPSEO_Replacevar_Field( $yform, 'title-404-wpseo', __( '404 pages', 'wordpress-seo' ), '404', '404' ); $editor->render(); + +echo '
'; From b2a09a8290d9e45cd8b3ce318ea18f2d00082f6a Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:27:20 +0200 Subject: [PATCH 08/57] Move the "Show SEO settings" next to other toggle --- .../metas/paper-content/taxonomy-content.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/taxonomy-content.php b/admin/views/tabs/metas/paper-content/taxonomy-content.php index b3330c60698..21e1994694f 100644 --- a/admin/views/tabs/metas/paper-content/taxonomy-content.php +++ b/admin/views/tabs/metas/paper-content/taxonomy-content.php @@ -24,12 +24,24 @@ echo "
"; +echo '
'; + $yform->index_switch( 'noindex-tax-' . $wpseo_taxonomy->name, $title, $view_utils->search_results_setting_help() ); +if ( $wpseo_taxonomy->name !== 'post_format' ) { + $yform->show_hide_switch( + 'display-metabox-tax-' . $wpseo_taxonomy->name, + /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ + sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ) + ); +} + + +echo '
'; // Determine the page type for the term, this is needed for the recommended replacement variables. $page_type = $recommended_replace_vars->determine_for_term( $wpseo_taxonomy->name ); @@ -46,14 +58,6 @@ ); $editor->render(); -if ( $wpseo_taxonomy->name !== 'post_format' ) { - $yform->show_hide_switch( - 'display-metabox-tax-' . $wpseo_taxonomy->name, - /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ - sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ) - ); -} - /** * Allow adding custom checkboxes to the admin meta page - Taxonomies tab. * From 0d3c1d1ec0fc0276c8d540d4311956c5c77f3822 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:27:45 +0200 Subject: [PATCH 09/57] Remove unneeded z-index Which does not play nice with the person-dropdown when selecting a user above. --- js/src/components/LocalSEOUpsell.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/src/components/LocalSEOUpsell.js b/js/src/components/LocalSEOUpsell.js index a956a5d8d56..b8e70e9db8c 100644 --- a/js/src/components/LocalSEOUpsell.js +++ b/js/src/components/LocalSEOUpsell.js @@ -14,7 +14,6 @@ const Container = styled.div` margin: 16px 0; padding: 20px 28px; position: relative; - z-index: 1; &:before { content: ""; background-image: url(${ props => props.backgroundUrl }); From c022cf7f20122d9faa2a15a6a1ce20bf0dbaf090 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:28:06 +0200 Subject: [PATCH 10/57] Use Alert to format the warning when no user is selected --- .../WordPressUserSelectorSearchAppearance.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/js/src/components/WordPressUserSelectorSearchAppearance.js b/js/src/components/WordPressUserSelectorSearchAppearance.js index 00cdf95a403..29b654cc2dc 100644 --- a/js/src/components/WordPressUserSelectorSearchAppearance.js +++ b/js/src/components/WordPressUserSelectorSearchAppearance.js @@ -3,6 +3,7 @@ /* External dependencies */ import { Component, Fragment } from "@wordpress/element"; import { __, sprintf } from "@wordpress/i18n"; +import { Alert } from "@yoast/components"; import interpolateComponents from "interpolate-components"; /* Internal dependencies */ @@ -64,11 +65,9 @@ class WordPressUserSelectorSearchAppearance extends Component { return null; } - return ( -

- { __( "Error: Please select a user below to make your site's meta data complete.", "wordpress-seo" ) } -

- ); + return + { __( "Please select a user below to make your site's meta data complete.", "wordpress-seo" ) } + ; } /** @@ -111,11 +110,13 @@ class WordPressUserSelectorSearchAppearance extends Component { return ( { this.renderError() } +
+
Date: Tue, 30 Jun 2020 15:28:17 +0200 Subject: [PATCH 11/57] Set default Select2 width to 300px --- js/src/initializers/admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/initializers/admin.js b/js/src/initializers/admin.js index ba7c9356d59..0edf91c53ce 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -148,7 +148,7 @@ export default function initAdmin( jQuery ) { * @returns {void} */ function initSelect2() { - var select2Width = "400px"; + var select2Width = "300px"; // Select2 for Twitter card meta data in Settings jQuery( "#twitter_card_type" ).select2( { From 578198e92123e0d8bf965ae05ae71c863d928fc9 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:34:41 +0200 Subject: [PATCH 12/57] Use correct naming className vs class --- js/src/components/WordPressUserSelectorSearchAppearance.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/components/WordPressUserSelectorSearchAppearance.js b/js/src/components/WordPressUserSelectorSearchAppearance.js index 29b654cc2dc..ce661b4cfbd 100644 --- a/js/src/components/WordPressUserSelectorSearchAppearance.js +++ b/js/src/components/WordPressUserSelectorSearchAppearance.js @@ -110,7 +110,7 @@ class WordPressUserSelectorSearchAppearance extends Component { return ( { this.renderError() } -
+
+ +
diff --git a/admin/views/tabs/metas/paper-content/taxonomy-content.php b/admin/views/tabs/metas/paper-content/taxonomy-content.php index 21e1994694f..1eefc713f84 100644 --- a/admin/views/tabs/metas/paper-content/taxonomy-content.php +++ b/admin/views/tabs/metas/paper-content/taxonomy-content.php @@ -24,8 +24,6 @@ echo "
"; -echo '
'; - $yform->index_switch( 'noindex-tax-' . $wpseo_taxonomy->name, $title, @@ -40,9 +38,6 @@ ); } - -echo '
'; - // Determine the page type for the term, this is needed for the recommended replacement variables. $page_type = $recommended_replace_vars->determine_for_term( $wpseo_taxonomy->name ); diff --git a/css/src/admin/admin.css b/css/src/admin/admin.css index 91c050b08ad..b0ab5920413 100644 --- a/css/src/admin/admin.css +++ b/css/src/admin/admin.css @@ -6,6 +6,10 @@ margin-bottom: 32px; } +.yoast-paper.yoast-space-bottom { + padding-bottom: 16px; +} + .yoast-field-group__title code { font-size: 13px; font-weight: normal; diff --git a/css/src/components/collapsible.css b/css/src/components/collapsible.css index 93fe99ac810..35c2e3a0c49 100644 --- a/css/src/components/collapsible.css +++ b/css/src/components/collapsible.css @@ -7,8 +7,15 @@ border: var(--yoast-border-default); } +.yoast #wpcontent .yoast-collapsible h3 { + font-size: 1.4em; + font-weight: 300; + padding-top: 16px; + margin-bottom: 16px; +} + .toggleable-container { - padding: 16px 16px 0; + padding: 0 16px; } .toggleable-container-hidden { @@ -19,10 +26,6 @@ margin-bottom: 0; } -.yoast #wpcontent .toggleable-container h3 { - margin-bottom: 24px; -} - .collapsible-header .toggleable-container-icon { float: right; color: var(--yoast-color-default); @@ -48,3 +51,7 @@ padding: 16px; cursor: pointer; } + +.collapsible-header .toggleable-container-trigger:focus { + outline: 0; +} diff --git a/css/src/components/headings.css b/css/src/components/headings.css index 02878bdd89b..b3fe5a400b3 100644 --- a/css/src/components/headings.css +++ b/css/src/components/headings.css @@ -9,7 +9,7 @@ body.yoast { } .wrap { - margin: 32px 32px 0; + margin: 16px 16px 0; font-size: var(--yoast-font-size-default); color: var(--yoast-color-default); line-height: 1.5; @@ -55,6 +55,6 @@ body.yoast { font-size: 1em; } -.yoast .update-nag{ - margin-left: 32px; +.yoast #wpcontent #wpseo-title { + margin-bottom: 16px; } diff --git a/css/src/components/sidebar.css b/css/src/components/sidebar.css index 423fcb191e9..bcb0f0308bf 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -10,7 +10,15 @@ .yoast-sidebar { max-width: 300px; - margin-top: 40px; + margin-left: 24px; + padding-top: 16px; +} + +.yoast #wpcontent .yoast-sidebar h2 { + padding-top: 5px; + padding-bottom: 8px; + font-size: 1.1em; + font-weight: 400; } .yoast-main { diff --git a/css/src/components/tabs.css b/css/src/components/tabs.css index 9131d27ab60..d7630115f87 100644 --- a/css/src/components/tabs.css +++ b/css/src/components/tabs.css @@ -22,7 +22,7 @@ padding-top: 3px; padding-left: 16px; border-bottom: 1px solid #cccccc; - min-height: 60px; + min-height: 45px; } .yoast-tabs__list-item { @@ -79,7 +79,8 @@ display: block; color: var(--yoast-color-dark); text-decoration: none; - padding: 12px 16px; + padding: 8px 12px; + font-size: 14px; } .yoast-tabs__list-item-link:hover { @@ -104,7 +105,8 @@ .yoast-tabs__list-item--active .yoast-tabs__list-item-link { color: var(--yoast-color-primary); - padding: 16px; + padding: 10px 16px; + font-size: 16px; } @media (max-width: 782px) { From 0f189f48b722a4ac67b768f041f3c2f6aba40473 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 17:34:17 +0200 Subject: [PATCH 15/57] Only show "Single URLs" when there is an archive --- .../tabs/metas/paper-content/post-type-content.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/post-type-content.php b/admin/views/tabs/metas/paper-content/post-type-content.php index 0d20035703d..a68ab124b5e 100644 --- a/admin/views/tabs/metas/paper-content/post-type-content.php +++ b/admin/views/tabs/metas/paper-content/post-type-content.php @@ -13,9 +13,12 @@ $single_label = $wpseo_post_type->labels->singular_name; $paper_style = false; +$has_archive = WPSEO_Post_Type::has_archive( $wpseo_post_type ); /* translators: %s is the singular version of the post type's name. */ -echo '

' . esc_html( sprintf( __( 'Settings for single %s URLs', 'wordpress-seo' ), $wpseo_post_type->labels->singular_name ) ) . '

'; +if ( $has_archive ) { + echo '

' . esc_html( sprintf( __( 'Settings for single %s URLs', 'wordpress-seo' ), $wpseo_post_type->labels->singular_name ) ) . '

'; +} require __DIR__ . '/post_type/post-type.php'; @@ -25,14 +28,12 @@ return; } -if ( WPSEO_Post_Type::has_archive( $wpseo_post_type ) ) { +if ( $has_archive ) { $plural_label = $wpseo_post_type->labels->name; /* translators: %s is the plural version of the post type's name. */ echo '

' . esc_html( sprintf( __( 'Settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . '

'; - echo '
'; - $yform->index_switch( 'noindex-ptarchive-' . $wpseo_post_type->name, sprintf( @@ -43,8 +44,6 @@ $view_utils->search_results_setting_help() ); - echo '
'; - $page_type = $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ); $editor = new WPSEO_Replacevar_Editor( From c156fe3dd8116441d341d5001215922876da9aef Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 17:34:35 +0200 Subject: [PATCH 16/57] Do not expand collapsibles by default --- admin/views/tabs/metas/archives.php | 2 +- admin/views/tabs/metas/post-types.php | 2 +- admin/views/tabs/metas/taxonomies.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/views/tabs/metas/archives.php b/admin/views/tabs/metas/archives.php index 16d96ff6304..85ef0a66d9a 100644 --- a/admin/views/tabs/metas/archives.php +++ b/admin/views/tabs/metas/archives.php @@ -38,7 +38,7 @@ __DIR__ . '/' . $wpseo_archive['view_file'], [ 'collapsible' => true, - 'expanded' => ( $wpseo_archive_index === 0 ), + 'expanded' => false, 'paper_id' => $wpseo_archive['paper_id'], 'recommended_replace_vars' => $recommended_replace_vars, 'editor_specific_replace_vars' => $editor_specific_replace_vars, diff --git a/admin/views/tabs/metas/post-types.php b/admin/views/tabs/metas/post-types.php index 50c569c66d5..9c75ebeb3b6 100644 --- a/admin/views/tabs/metas/post-types.php +++ b/admin/views/tabs/metas/post-types.php @@ -32,7 +32,7 @@ __DIR__ . '/paper-content/post-type-content.php', [ 'collapsible' => true, - 'expanded' => ( $wpseo_post_type_index === 0 ), + 'expanded' => false, 'paper_id' => 'settings-' . $post_type->name, 'view_data' => [ 'wpseo_post_type' => $post_type, diff --git a/admin/views/tabs/metas/taxonomies.php b/admin/views/tabs/metas/taxonomies.php index ae0fc89d26d..d1a4e4d3441 100644 --- a/admin/views/tabs/metas/taxonomies.php +++ b/admin/views/tabs/metas/taxonomies.php @@ -26,7 +26,7 @@ __DIR__ . '/paper-content/taxonomy-content.php', [ 'collapsible' => true, - 'expanded' => ( $wpseo_taxonomy_index === 0 ), + 'expanded' => false, 'paper_id' => 'settings-' . $wpseo_taxonomy->name, 'view_data' => [ 'wpseo_taxonomy' => $wpseo_taxonomy, From c399cd7d81596cb557ef21ec6cee45cea97fbfff Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:20:32 +0200 Subject: [PATCH 17/57] Add more papers to the settings pages --- admin/pages/tools.php | 4 ++++ admin/views/tabs/dashboard/dashboard.php | 19 ++++++++++--------- admin/views/tabs/dashboard/features.php | 4 ++-- .../views/tabs/dashboard/webmaster-tools.php | 2 +- admin/views/tabs/social/accounts.php | 2 +- admin/views/tabs/tool/import-seo.php | 7 +++++-- admin/views/tabs/tool/wpseo-export.php | 3 +-- admin/views/tabs/tool/wpseo-import.php | 4 +++- admin/views/tool-file-editor.php | 14 +++++++------- 9 files changed, 34 insertions(+), 25 deletions(-) diff --git a/admin/pages/tools.php b/admin/pages/tools.php index e30039b6ec8..ce620592ffc 100644 --- a/admin/pages/tools.php +++ b/admin/pages/tools.php @@ -37,6 +37,8 @@ 'desc' => __( 'This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'wordpress-seo' ), ]; + echo '
'; + echo '

'; printf( /* translators: %1$s expands to Yoast SEO */ @@ -67,6 +69,8 @@ echo ''; echo ''; + + echo '

'; // yoast-paper } else { echo '
'; diff --git a/admin/views/tabs/dashboard/dashboard.php b/admin/views/tabs/dashboard/dashboard.php index 0f8055fd324..137f34d0539 100644 --- a/admin/views/tabs/dashboard/dashboard.php +++ b/admin/views/tabs/dashboard/dashboard.php @@ -25,11 +25,10 @@ ?> -
- -
- -
+
+
+ +
@@ -37,8 +36,10 @@
-

-

- -

+
+

+

+ +

+
diff --git a/admin/views/tabs/dashboard/features.php b/admin/views/tabs/dashboard/features.php index 73b69081958..0a58b729eab 100644 --- a/admin/views/tabs/dashboard/features.php +++ b/admin/views/tabs/dashboard/features.php @@ -17,8 +17,8 @@ $yoast_features = new WPSEO_Features(); ?> -

-
+
+

'; +echo '

'; echo '

' . esc_html__( 'Webmaster Tools verification', 'wordpress-seo' ) . $webmaster_tools_help . '

'; $msverify_link = 'https://www.bing.com/toolbox/webmaster/#/Dashboard/?url=' . diff --git a/admin/views/tabs/social/accounts.php b/admin/views/tabs/social/accounts.php index 4824f784282..e1b81f4f5be 100644 --- a/admin/views/tabs/social/accounts.php +++ b/admin/views/tabs/social/accounts.php @@ -12,7 +12,7 @@ header( 'HTTP/1.1 403 Forbidden' ); exit(); } -echo '
'; +echo '
'; $social_profiles_help = new WPSEO_Admin_Help_Button( 'https://yoa.st/3yo', __( 'Learn more about your social profiles settings', 'wordpress-seo' ) diff --git a/admin/views/tabs/tool/import-seo.php b/admin/views/tabs/tool/import-seo.php index 76e4828718d..f278f9a3062 100644 --- a/admin/views/tabs/tool/import-seo.php +++ b/admin/views/tabs/tool/import-seo.php @@ -15,6 +15,7 @@ $import_check = new WPSEO_Import_Plugins_Detector(); $import_check->detect(); if ( count( $import_check->needs_import ) === 0 ) { + echo '
'; echo '

', esc_html__( 'Import from other SEO plugins', 'wordpress-seo' ), '

'; echo '

'; printf( @@ -23,6 +24,7 @@ 'Yoast SEO' ); echo '

'; + echo '
'; // yoast-paper return; } @@ -48,8 +50,9 @@ function wpseo_import_external_select( $name, $plugins ) { } ?> -

-
+
+ +

diff --git a/admin/views/tabs/tool/wpseo-export.php b/admin/views/tabs/tool/wpseo-export.php index 47834567124..257b57b6468 100644 --- a/admin/views/tabs/tool/wpseo-export.php +++ b/admin/views/tabs/tool/wpseo-export.php @@ -14,8 +14,6 @@ /* translators: %1$s expands to Yoast SEO */ $submit_button_value = sprintf( __( 'Export your %1$s settings', 'wordpress-seo' ), 'Yoast SEO' ); -echo '
'; - if ( filter_input( INPUT_POST, 'do_export' ) ) { $export = new WPSEO_Export(); $export->export(); @@ -29,6 +27,7 @@ ); ?> +

-
+ +

+

diff --git a/admin/views/tool-file-editor.php b/admin/views/tool-file-editor.php index 41622af906f..eed6aa50295 100644 --- a/admin/views/tool-file-editor.php +++ b/admin/views/tool-file-editor.php @@ -15,8 +15,6 @@ $robots_file = get_home_path() . 'robots.txt'; $ht_access_file = get_home_path() . '.htaccess'; -echo '
'; - if ( isset( $_POST['create_robots'] ) ) { if ( ! current_user_can( 'edit_files' ) ) { $die_msg = sprintf( @@ -100,6 +98,7 @@ echo '

', esc_html( $msg ), '

'; } // N.B.: "robots.txt" is a fixed file name and should not be translatable. +echo '
'; echo '
'; echo '

robots.txt

'; @@ -116,7 +115,7 @@ echo '

'; printf( - '', + '

', sprintf( /* translators: %s expands to robots.txt. */ esc_attr__( 'Create %s file', 'wordpress-seo' ), @@ -167,7 +166,7 @@ echo '
'; echo '
'; printf( - '

', + '

', sprintf( /* translators: %s expands to robots.txt. */ esc_attr__( 'Save changes to %s', 'wordpress-seo' ), @@ -178,9 +177,11 @@ } } echo '
'; // yoast-field-group +echo '
'; // yoast-paper if ( ! WPSEO_Utils::is_nginx() ) { + echo '
'; echo '
'; echo '

'; printf( @@ -222,7 +223,7 @@ echo '

'; echo '
'; printf( - '

', + '

', sprintf( /* translators: %s expands to ".htaccess". */ esc_attr__( 'Save changes to %s', 'wordpress-seo' ), @@ -242,10 +243,9 @@ echo '

'; } echo '
'; // yoast-field-group + echo '
'; // yoast-paper } -echo '
'; // yoast-feature - if ( is_multisite() ) { $yform->admin_footer( false ); } From bdf0c2269d18477a3d323e68e9e71567596512aa Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:20:52 +0200 Subject: [PATCH 18/57] Move upsells up on the tools page --- css/src/components/sidebar.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/src/components/sidebar.css b/css/src/components/sidebar.css index bcb0f0308bf..3e3212e2228 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -14,6 +14,10 @@ padding-top: 16px; } +.wpseo-admin-page.page-tools .yoast-sidebar { + padding-top: 0; +} + .yoast #wpcontent .yoast-sidebar h2 { padding-top: 5px; padding-bottom: 8px; From 04dea5f708b74d6714eeb91a8fda905a0b901acb Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:32:18 +0200 Subject: [PATCH 19/57] Notification center styling fix --- admin/views/partial-notifications-template.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/admin/views/partial-notifications-template.php b/admin/views/partial-notifications-template.php index 2c9d1d27bf9..f4355903621 100644 --- a/admin/views/partial-notifications-template.php +++ b/admin/views/partial-notifications-template.php @@ -30,7 +30,6 @@ function _yoast_display_notifications( $list, $status ) { $notifications = ''; foreach ( $list as $notification ) { - switch ( $status ) { case 'active': $button = sprintf( @@ -76,12 +75,11 @@ function _yoast_display_notifications( $list, $status ) {
-
- -
+ + Date: Wed, 1 Jul 2020 10:39:29 +0200 Subject: [PATCH 20/57] Remove top padding of first H3 in a paper-content From 3fdf075f26cc458740f1e3c7f4b331b2fc3e5056 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:42:57 +0200 Subject: [PATCH 21/57] Reduce button size --- css/src/components/buttons.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/src/components/buttons.css b/css/src/components/buttons.css index 37ebb2c25dc..6ad4aab2d80 100644 --- a/css/src/components/buttons.css +++ b/css/src/components/buttons.css @@ -1,7 +1,7 @@ .yoast .yoast-button { display: inline-block; position: relative; - padding: 11px 13px 13px; + padding: 10px; text-decoration: none; border-radius: 4px; border: 1px solid rgba(0,0,0, 0.2); From c97aaa0d57eb22c5a70e19c7c3e36476f41eac0f Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 12:38:52 +0200 Subject: [PATCH 22/57] Place the content in the center of the screen --- admin/class-yoast-form.php | 2 +- css/src/admin/admin.css | 5 +++++ css/src/admin/overwrites.css | 2 ++ css/src/components/headings.css | 5 +++++ css/src/components/tabs.css | 1 + 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index 3439240ffdb..c559eeb9e88 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -75,7 +75,7 @@ public function admin_header( $form = true, $option = 'wpseo', $contains_files = */ require_once ABSPATH . 'wp-admin/options-head.php'; ?> -

+

* { + margin-left: auto; + margin-right: auto; +} + .yoast-paper.yoast-space-bottom { padding-bottom: 16px; } diff --git a/css/src/admin/overwrites.css b/css/src/admin/overwrites.css index d159fb8db4f..35a2d72989e 100644 --- a/css/src/admin/overwrites.css +++ b/css/src/admin/overwrites.css @@ -4,4 +4,6 @@ .yoast #wpcontent p.submit { padding-top: 8px; + margin: 0 auto 16px; + max-width: 600px; } diff --git a/css/src/components/headings.css b/css/src/components/headings.css index b3fe5a400b3..31a144eb559 100644 --- a/css/src/components/headings.css +++ b/css/src/components/headings.css @@ -56,5 +56,10 @@ body.yoast { } .yoast #wpcontent #wpseo-title { + text-align: center; margin-bottom: 16px; } + +.yoast #wpcontent .yoast-premium #wpseo-title { + text-align: left; +} diff --git a/css/src/components/tabs.css b/css/src/components/tabs.css index d7630115f87..d9448af3702 100644 --- a/css/src/components/tabs.css +++ b/css/src/components/tabs.css @@ -17,6 +17,7 @@ display: flex; flex-wrap: wrap; align-items: flex-end; + justify-content: center; margin-bottom: 0; margin-top: 0; padding-top: 3px; From 768f9f9e35a88a1c8adf4bbc173179b489cf9159 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 13:02:00 +0200 Subject: [PATCH 23/57] Make switch-labels clickable --- css/src/admin/all.css | 1 + css/src/components/toggle.css | 11 +++++++++++ js/src/initializers/admin.js | 8 ++++++++ 3 files changed, 20 insertions(+) create mode 100644 css/src/components/toggle.css diff --git a/css/src/admin/all.css b/css/src/admin/all.css index 898431d4839..63bb729209f 100644 --- a/css/src/admin/all.css +++ b/css/src/admin/all.css @@ -13,3 +13,4 @@ @import "../components/lists.css"; @import "../components/table.css"; @import "../components/collapsible.css"; +@import "../components/toggle.css"; diff --git a/css/src/components/toggle.css b/css/src/components/toggle.css new file mode 100644 index 00000000000..4f75557ac55 --- /dev/null +++ b/css/src/components/toggle.css @@ -0,0 +1,11 @@ +.yoast-toggle--active, .yoast-toggle--inactive { + cursor: pointer; + user-select: none; +} + +.yoast-toggle--inverse .yoast-toggle__checkbox ~ .yoast-toggle--active:hover, +.yoast-toggle--inverse .yoast-toggle__checkbox ~ .yoast-toggle--inactive:hover, +.yoast-toggle .yoast-toggle__checkbox ~ .yoast-toggle--active:hover, +.yoast-toggle .yoast-toggle__checkbox ~ .yoast-toggle--inactive:hover { + color: var(--yoast-color-default-darker); +} diff --git a/js/src/initializers/admin.js b/js/src/initializers/admin.js index 0edf91c53ce..5db18f0556f 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -227,6 +227,14 @@ export default function initAdmin( jQuery ) { */ wpseoSetTabHash(); + jQuery( '.yoast-toggle--inactive' ).click( function() { + jQuery( this ).parent().find( 'input' ).prop( 'checked', false ).change(); + } ); + + jQuery( '.yoast-toggle--active' ).click( function() { + jQuery( this ).parent().find( 'input' ).prop( 'checked', true ).change(); + } ); + // Toggle the Author archives section. jQuery( "#disable-author" ).change( function() { jQuery( "#author-archives-titles-metas-content" ).toggle( jQuery( this ).is( ":not(:checked)" ) ); From 49e7e9fd594ad0cc571cdd67ce28ac77bd599840 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 13:08:29 +0200 Subject: [PATCH 24/57] Remove duplicate usage-tracking entry --- admin/views/class-yoast-feature-toggles.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/admin/views/class-yoast-feature-toggles.php b/admin/views/class-yoast-feature-toggles.php index 1032569008c..89f76c8e9b1 100644 --- a/admin/views/class-yoast-feature-toggles.php +++ b/admin/views/class-yoast-feature-toggles.php @@ -132,14 +132,9 @@ protected function load_toggles() { (object) [ 'name' => __( 'Usage tracking', 'wordpress-seo' ), 'setting' => 'tracking', - 'label' => sprintf( - /* translators: 1: Yoast SEO */ - __( 'Allow us to track some data about your site to improve our plugin.', 'wordpress-seo' ), - 'Yoast SEO' - ), 'read_more_label' => sprintf( /* translators: 1: Yoast SEO */ - __( 'Read more about what we\'ll track.', 'wordpress-seo' ), + __( 'Allow us to track some data about your site to improve our plugin.', 'wordpress-seo' ), 'Yoast SEO' ), 'read_more_url' => 'https://yoa.st/usage-tracking', From 3d515e090020bbd5a7d23f9a4f0a337af4f5e336 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 16:14:54 +0200 Subject: [PATCH 25/57] Move person/company company alert below heading To restore general sanity when switching. --- .../tabs/metas/paper-content/general/knowledge-graph.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php index d5ea3de5cd1..9d8c7b284d8 100644 --- a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php +++ b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php @@ -36,6 +36,7 @@ $yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false ); ?>
+

-
- +
+ - textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] ); $yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) ); ?> From 96481ce9ec9ac1aa8a4c0a7b2abff920efaf155e Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:17:30 +0200 Subject: [PATCH 26/57] Restore LocalSEO Upsell to company select --- .../tabs/metas/paper-content/general/knowledge-graph.php | 5 +---- js/src/components/LocalSEOUpsell.js | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php index 9d8c7b284d8..a5b69a403be 100644 --- a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php +++ b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php @@ -53,6 +53,7 @@ $yform->textinput( 'company_name', __( 'Organization name', 'wordpress-seo' ), [ 'autocomplete' => 'organization' ] ); $yform->media_input( 'company_logo', __( 'Organization logo', 'wordpress-seo' ) ); ?> +

@@ -63,7 +64,3 @@ ?>
- -
-
-
diff --git a/js/src/components/LocalSEOUpsell.js b/js/src/components/LocalSEOUpsell.js index b8e70e9db8c..2a8858613b0 100644 --- a/js/src/components/LocalSEOUpsell.js +++ b/js/src/components/LocalSEOUpsell.js @@ -14,6 +14,7 @@ const Container = styled.div` margin: 16px 0; padding: 20px 28px; position: relative; + z-index: 1; &:before { content: ""; background-image: url(${ props => props.backgroundUrl }); @@ -40,10 +41,12 @@ const TextContainer = styled.div` `; const Header = styled.h3` + .yoast #wpcontent h3&, && { font-size: 1.15em; font-weight: bold; margin: 4px 0; + color: #333; } `; From e983cba03ea744d538af6672dd834e79f7502244 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:17:52 +0200 Subject: [PATCH 27/57] Fix button pressed padding --- css/src/components/buttons.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/src/components/buttons.css b/css/src/components/buttons.css index 6ad4aab2d80..45d86c3ed96 100644 --- a/css/src/components/buttons.css +++ b/css/src/components/buttons.css @@ -13,7 +13,7 @@ .yoast .yoast-button:active { /* 'Pressed' button state */ box-shadow: none; - padding-bottom: 12px; + padding-bottom: 10px; top: 2px; } From e5f39a58e6a0c1699ab8bbed6128b6171a77b38f Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:18:10 +0200 Subject: [PATCH 28/57] Make the upsell button larger than the regular button --- css/src/components/buttons.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/css/src/components/buttons.css b/css/src/components/buttons.css index 45d86c3ed96..880968773d8 100644 --- a/css/src/components/buttons.css +++ b/css/src/components/buttons.css @@ -55,6 +55,9 @@ .yoast .yoast-button--buy { display: inline-flex; align-items: center; + padding: 12px; + font-size: 16px; + font-weight: 300; color: var(--yoast-color-dark); background-color: var(--yoast-color-sale); } From 18f075de5a810b62215b44a548a3c9dd9a5c5331 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:18:24 +0200 Subject: [PATCH 29/57] Reduce spacing of last paper & feature containers From 922274f0d6a8757d145c2e43066ea2ccd872ad12 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:07:31 +0200 Subject: [PATCH 30/57] Covert twitter card selector to radio-buttons --- admin/views/tabs/social/twitterbox.php | 7 ++++++- inc/options/class-wpseo-option-social.php | 5 ----- js/src/initializers/admin.js | 7 ------- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index 14d00892dc9..a10a7ca9d02 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -29,7 +29,12 @@ echo '
'; -$yform->select( 'twitter_card_type', __( 'The default card type to use', 'wordpress-seo' ), WPSEO_Option_Social::$twitter_card_types ); +$yform->radio( + 'twitter_card_type', + WPSEO_Option_Social::$twitter_card_types, + __( 'The default card type to use', 'wordpress-seo' ) +); + echo '
'; do_action( 'wpseo_admin_twitter_section' ); diff --git a/inc/options/class-wpseo-option-social.php b/inc/options/class-wpseo-option-social.php index eb8760d3650..a0801a53e2f 100644 --- a/inc/options/class-wpseo-option-social.php +++ b/inc/options/class-wpseo-option-social.php @@ -73,11 +73,6 @@ class WPSEO_Option_Social extends WPSEO_Option { public static $twitter_card_types = [ 'summary' => '', 'summary_large_image' => '', - // 'photo' => '', - // 'gallery' => '', - // 'app' => '', - // 'player' => '', - // 'product' => '', ]; /** diff --git a/js/src/initializers/admin.js b/js/src/initializers/admin.js index 5db18f0556f..b7897a614d4 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -150,13 +150,6 @@ export default function initAdmin( jQuery ) { function initSelect2() { var select2Width = "300px"; - // Select2 for Twitter card meta data in Settings - jQuery( "#twitter_card_type" ).select2( { - width: select2Width, - language: wpseoScriptData.userLanguageCode, - dropdownCssClass: "yoast-select__dropdown", - } ); - // Select2 for taxonomy breadcrumbs in Advanced jQuery( "#breadcrumbs select" ).select2( { width: select2Width, From 842ec9ff2893f3f879d8ec846f937169cd8888f1 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:27:13 +0200 Subject: [PATCH 31/57] Convert person/company to radio buttons --- .../paper-content/general/knowledge-graph.php | 8 +++- js/src/initializers/admin.js | 38 ++++++++++++------- 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php index a5b69a403be..84e2b3d30d5 100644 --- a/admin/views/tabs/metas/paper-content/general/knowledge-graph.php +++ b/admin/views/tabs/metas/paper-content/general/knowledge-graph.php @@ -33,8 +33,14 @@ 'company' => __( 'Organization', 'wordpress-seo' ), 'person' => __( 'Person', 'wordpress-seo' ), ]; - $yform->select( 'company_or_person', __( 'Organization or person', 'wordpress-seo' ), $yoast_free_kg_select_options, 'styled', false ); + + $yform->radio( + 'company_or_person', + $yoast_free_kg_select_options, + __( 'Organization or person', 'wordpress-seo' ) + ); ?> +

Date: Thu, 2 Jul 2020 09:31:03 +0200 Subject: [PATCH 32/57] Add full-stops to comments --- admin/pages/tools.php | 2 +- .../tabs/metas/paper-content/author-archive-settings.php | 4 ++-- .../tabs/metas/paper-content/date-archives-settings.php | 4 ++-- admin/views/tabs/metas/paper-content/rss-content.php | 2 +- admin/views/tabs/metas/taxonomies/category-url.php | 1 - admin/views/tabs/tool/import-seo.php | 2 +- admin/views/tool-file-editor.php | 9 +++++---- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/admin/pages/tools.php b/admin/pages/tools.php index ce620592ffc..b9d507759da 100644 --- a/admin/pages/tools.php +++ b/admin/pages/tools.php @@ -70,7 +70,7 @@ echo ''; - echo '
'; // yoast-paper + echo '
'; // yoast-paper. } else { echo '
'; diff --git a/admin/views/tabs/metas/paper-content/author-archive-settings.php b/admin/views/tabs/metas/paper-content/author-archive-settings.php index 642e6fb7004..a0a07af2194 100644 --- a/admin/views/tabs/metas/paper-content/author-archive-settings.php +++ b/admin/views/tabs/metas/paper-content/author-archive-settings.php @@ -44,7 +44,7 @@ $author_archives_no_posts_help ); -echo '
'; // noindex-container +echo '
'; // noindex-container. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); @@ -61,4 +61,4 @@ $editor->render(); -echo '
'; // author-archives +echo '
'; // author-archives. diff --git a/admin/views/tabs/metas/paper-content/date-archives-settings.php b/admin/views/tabs/metas/paper-content/date-archives-settings.php index 73ea1a9a5c2..b338c7fe031 100644 --- a/admin/views/tabs/metas/paper-content/date-archives-settings.php +++ b/admin/views/tabs/metas/paper-content/date-archives-settings.php @@ -33,7 +33,7 @@ $date_archives_help ); -echo '
'; // space-after +echo '
'; // space-after. $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); $editor_specific_replace_vars = new WPSEO_Admin_Editor_Specific_Replace_Vars(); @@ -50,5 +50,5 @@ ); $editor->render(); -echo '
'; // archives-content +echo '
'; // archives-content. diff --git a/admin/views/tabs/metas/paper-content/rss-content.php b/admin/views/tabs/metas/paper-content/rss-content.php index 33faaf2b611..b83bcbac052 100644 --- a/admin/views/tabs/metas/paper-content/rss-content.php +++ b/admin/views/tabs/metas/paper-content/rss-content.php @@ -28,7 +28,7 @@ __( 'Learn more about the available variables', 'wordpress-seo' ) ); -echo '
'; // yoast-paper +echo '
'; // yoast-paper. echo '
'; diff --git a/admin/views/tabs/metas/taxonomies/category-url.php b/admin/views/tabs/metas/taxonomies/category-url.php index 79d9789c440..66dc0e7cce3 100644 --- a/admin/views/tabs/metas/taxonomies/category-url.php +++ b/admin/views/tabs/metas/taxonomies/category-url.php @@ -7,7 +7,6 @@ * @uses Yoast_Form $yform Form object. */ - $stripcategorybase_help = new WPSEO_Admin_Help_Button( 'https://yoa.st/3yk', esc_html__( 'Help on the category prefix setting', 'wordpress-seo' ) diff --git a/admin/views/tabs/tool/import-seo.php b/admin/views/tabs/tool/import-seo.php index f278f9a3062..65944a336a8 100644 --- a/admin/views/tabs/tool/import-seo.php +++ b/admin/views/tabs/tool/import-seo.php @@ -24,7 +24,7 @@ 'Yoast SEO' ); echo '

'; - echo '
'; // yoast-paper + echo '
'; // yoast-paper. return; } diff --git a/admin/views/tool-file-editor.php b/admin/views/tool-file-editor.php index eed6aa50295..426908fc254 100644 --- a/admin/views/tool-file-editor.php +++ b/admin/views/tool-file-editor.php @@ -176,8 +176,9 @@ echo ''; } } -echo '
'; // yoast-field-group -echo '
'; // yoast-paper + +echo '
'; // yoast-field-group. +echo '
'; // yoast-paper. if ( ! WPSEO_Utils::is_nginx() ) { @@ -242,8 +243,8 @@ ); echo '

'; } - echo '
'; // yoast-field-group - echo '
'; // yoast-paper + echo '
'; // yoast-field-group. + echo '
'; // yoast-paper. } if ( is_multisite() ) { From 6101dd94f8aa77c1c7d8da0aec02480d1d5131a1 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:45:33 +0200 Subject: [PATCH 33/57] Fix save settings notification --- admin/class-yoast-form.php | 4 ++-- css/src/admin/admin.css | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index c559eeb9e88..c87d304adf6 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -130,9 +130,9 @@ public function admin_footer( $submit = true, $show_sidebar = true ) { $settings_changed_listener = new WPSEO_Admin_Settings_Changed_Listener(); echo '
'; - submit_button( __( 'Save changes', 'wordpress-seo' ), 'yoast-button yoast-button--primary' ); - $settings_changed_listener->show_success_message(); + + submit_button( __( 'Save changes', 'wordpress-seo' ), 'yoast-button yoast-button--primary' ); echo '
'; echo PHP_EOL . ''; diff --git a/css/src/admin/admin.css b/css/src/admin/admin.css index 81dcca5024b..048ab95f763 100644 --- a/css/src/admin/admin.css +++ b/css/src/admin/admin.css @@ -11,6 +11,13 @@ margin-right: auto; } +#wpseo-submit-container p.wpseo-message { + margin: 0 auto; + padding: 16px 0; + max-width: 600px; + color: #008a00; +} + .yoast-paper.yoast-space-bottom { padding-bottom: 16px; } From f2d6b39800d634dbc32290a8c175cbf2ac54e860 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:49:36 +0200 Subject: [PATCH 34/57] Twitter card wording --- admin/views/tabs/social/twitterbox.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index a10a7ca9d02..5d0ec8192ba 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -21,13 +21,18 @@ esc_html__( 'Twitter uses Open Graph metadata just like Facebook, so be sure to keep the "Add Open Graph meta data" setting on the Facebook tab enabled if you want to optimize your site for Twitter.', 'wordpress-seo' ) ); -$yform->light_switch( 'twitter', __( 'Add Twitter card meta data', 'wordpress-seo' ) ); - echo '

'; esc_html_e( 'Enable this feature if you want Twitter to display a preview with images and a text excerpt when a link to your site is shared.', 'wordpress-seo' ); echo '

'; -echo '
'; +$yform->light_switch( + 'twitter', + __( 'Twitter card meta data', 'wordpress-seo' ), + [ + __( 'Off', 'wordpress-seo' ), + __( 'On', 'wordpress-seo' ), + ], +); $yform->radio( 'twitter_card_type', From d5f3d0d5d6cf722fea6f95f1c71f6134c00c3a3e Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 10:00:27 +0200 Subject: [PATCH 35/57] Hide twitter card settings when feature is disabled --- admin/views/tabs/social/twitterbox.php | 2 ++ js/src/initializers/admin.js | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index 5d0ec8192ba..7f674c783b2 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -34,11 +34,13 @@ ], ); +echo '
'; $yform->radio( 'twitter_card_type', WPSEO_Option_Social::$twitter_card_types, __( 'The default card type to use', 'wordpress-seo' ) ); +echo '
'; // twitter-settings. echo '
'; diff --git a/js/src/initializers/admin.js b/js/src/initializers/admin.js index 148bb613654..447777b9dd4 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -254,6 +254,11 @@ export default function initAdmin( jQuery ) { } } ); + // Toggle the Twitter card settings. + jQuery( "#twitter" ).change( function() { + jQuery( "#wpseo-twitter-settings" ).toggle( jQuery( this ).is( ":checked" ) ); + } ).change(); + // Toggle the Date archives section. jQuery( "#disable-date" ).change( function() { jQuery( "#date-archives-titles-metas-content" ).toggle( jQuery( this ).is( ":not(:checked)" ) ); From 296ef18aed422737b781e78bd64e6607b1e61d7d Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 11:13:10 +0200 Subject: [PATCH 36/57] Capitalize "Premium" --- admin/class-yoast-form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index c87d304adf6..b3b48abe5fd 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -361,7 +361,7 @@ public function light_switch_disabled( $var, $label, $buttons = [], $help = '', '', '', '
', - '', __( 'Upgrade to premium', 'wordpress-seo' ) ,'', + '', __( 'Upgrade to Premium', 'wordpress-seo' ) ,'', '
'; } From a0af2e43aa4a64da074fbaa71f075a010f61ea70 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:13:45 +0200 Subject: [PATCH 37/57] Consistent font-weights --- css/src/components/buttons.css | 2 +- css/src/components/sidebar.css | 6 ++++++ css/src/components/table.css | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/css/src/components/buttons.css b/css/src/components/buttons.css index 880968773d8..99b24e86ee1 100644 --- a/css/src/components/buttons.css +++ b/css/src/components/buttons.css @@ -57,7 +57,7 @@ align-items: center; padding: 12px; font-size: 16px; - font-weight: 300; + font-weight: 500; color: var(--yoast-color-dark); background-color: var(--yoast-color-sale); } diff --git a/css/src/components/sidebar.css b/css/src/components/sidebar.css index 3e3212e2228..2500534377b 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -51,6 +51,12 @@ font-weight: 600; } +.yoast-sidebar li { + position: relative; + margin-left: 18px; + font-weight: 500; +} + .yoast-sidebar__plugins { display: flex; margin-bottom: 24px; diff --git a/css/src/components/table.css b/css/src/components/table.css index b36956acb92..32bbc876ed5 100644 --- a/css/src/components/table.css +++ b/css/src/components/table.css @@ -29,7 +29,7 @@ .yoast .yoast-table th a { color: var(--yoast-color-dark); padding: 0; - font-weight: 500; + font-weight: 300; } .yoast .yoast-table td { From c05451774c80cbd1464cef1b7d077fd2a246e4b7 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:14:00 +0200 Subject: [PATCH 38/57] Remove font overwrite of dismissed warnings From 762d547e8ba1e04d10fd32b203cf5640c908c522 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:19:55 +0200 Subject: [PATCH 39/57] Replace labels Show/Hide with Yes/No --- admin/class-yoast-form.php | 6 ++++-- admin/views/class-view-utils.php | 16 ++++++++++++---- .../metas/paper-content/breadcrumbs-content.php | 9 ++++++++- .../metas/paper-content/post_type/post-type.php | 16 ++++++++++++---- .../metas/paper-content/taxonomy-content.php | 8 ++++++-- 5 files changed, 42 insertions(+), 13 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index b3b48abe5fd..de7461009e2 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -858,12 +858,14 @@ public function index_switch( $var, $label, $help = '' ) { * @param bool $inverse_keys Whether or not the option keys need to be inverted to support older functions. * @param string $help Inline Help that will be printed out before the visible toggles text. * + * @deprecated 15.0 + * * @return void */ public function show_hide_switch( $var, $label, $inverse_keys = false, $help = '' ) { $show_hide_switch = [ - __( 'Hide', 'wordpress-seo' ), - __( 'Show', 'wordpress-seo' ), + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), ]; $this->light_switch( $var, $label, $show_hide_switch, $help, $inverse_keys ); diff --git a/admin/views/class-view-utils.php b/admin/views/class-view-utils.php index 0c908e89d63..7d4a86a4c02 100644 --- a/admin/views/class-view-utils.php +++ b/admin/views/class-view-utils.php @@ -56,14 +56,22 @@ public function show_post_type_settings( $post_type, $paper_style = false ) { $this->search_results_setting_help() ); - $this->form->show_hide_switch( + $this->form->light_switch( 'showdate-' . $post_type->name, - __( 'Date in Google Preview', 'wordpress-seo' ) + __( 'Show date in Google Preview', 'wordpress-seo' ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); - $this->form->show_hide_switch( + $this->form->light_switch( 'display-metabox-pt-' . $post_type->name, - __( 'Show SEO settings for content type', 'wordpress-seo' ) + __( 'Show SEO settings for content type', 'wordpress-seo' ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); diff --git a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php index 0e36ccdf841..2e4becd8498 100644 --- a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php +++ b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php @@ -23,7 +23,14 @@ echo '
'; if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) { - $yform->show_hide_switch( 'breadcrumbs-display-blog-page', __( 'Show Blog page', 'wordpress-seo' ) ); + $yform->light_switch( + 'breadcrumbs-display-blog-page', + __( 'Show Blog page', 'wordpress-seo' ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] + ); } $yoast_free_breadcrumb_bold_texts = [ diff --git a/admin/views/tabs/metas/paper-content/post_type/post-type.php b/admin/views/tabs/metas/paper-content/post_type/post-type.php index e7abee5bd5e..2cc59205201 100644 --- a/admin/views/tabs/metas/paper-content/post_type/post-type.php +++ b/admin/views/tabs/metas/paper-content/post_type/post-type.php @@ -19,15 +19,23 @@ $view_utils->search_results_setting_help() ); -$yform->show_hide_switch( +$yform->light_switch( 'showdate-' . $wpseo_post_type->name, - __( 'Date in Google Preview', 'wordpress-seo' ) + __( 'Show date in Google Preview', 'wordpress-seo' ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); -$yform->show_hide_switch( +$yform->light_switch( 'display-metabox-pt-' . $wpseo_post_type->name, /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ - sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $wpseo_post_type->labels->name ) + sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $wpseo_post_type->labels->name ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); $editor = new WPSEO_Replacevar_Editor( diff --git a/admin/views/tabs/metas/paper-content/taxonomy-content.php b/admin/views/tabs/metas/paper-content/taxonomy-content.php index 1eefc713f84..092c9a6295d 100644 --- a/admin/views/tabs/metas/paper-content/taxonomy-content.php +++ b/admin/views/tabs/metas/paper-content/taxonomy-content.php @@ -31,10 +31,14 @@ ); if ( $wpseo_taxonomy->name !== 'post_format' ) { - $yform->show_hide_switch( + $yform->light_switch( 'display-metabox-tax-' . $wpseo_taxonomy->name, /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ - sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ) + sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ), + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); } From dcd1b7767afdb75b267e46ec08e4648bba27549c Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 11:30:22 +0200 Subject: [PATCH 40/57] Use Show/Hide instead of Yes/No --- admin/class-yoast-form.php | 31 +++++++++---------- admin/views/class-view-utils.php | 16 +++------- .../paper-content/author-archive-settings.php | 5 +-- .../paper-content/breadcrumbs-content.php | 8 ++--- .../paper-content/date-archives-settings.php | 5 +-- .../metas/paper-content/media-content.php | 11 +++---- .../paper-content/post_type/post-type.php | 16 +++------- .../metas/paper-content/taxonomy-content.php | 10 ++---- admin/views/tabs/social/twitterbox.php | 4 --- 9 files changed, 34 insertions(+), 72 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index de7461009e2..e325b5459d4 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -310,9 +310,12 @@ public function light_switch( $var, $label, $buttons = [], $help = '', $inverse $class .= '--inverse'; } - if ( empty( $buttons ) ) { $buttons = [ __( 'Disabled', 'wordpress-seo' ), __( 'Enabled', 'wordpress-seo' ) ]; + + if ( $inverse ) { + $buttons = array_reverse( $buttons ); + } } list( $off_button, $on_button ) = $buttons; @@ -832,21 +835,15 @@ public function toggle_switch( $var, $values, $label, $help = '' ) { * @return void */ public function index_switch( $var, $label, $help = '' ) { - $index_switch_values = [ - __( 'Yes', 'wordpress-seo' ), - __( 'No', 'wordpress-seo' ), - ]; - - $this->light_switch( + $this->show_hide_switch( $var, sprintf( /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ esc_html__( 'Show %s in search results?', 'wordpress-seo' ), esc_html( $label ) ), - $index_switch_values, - $help, - true + true, + $help ); } @@ -858,17 +855,19 @@ public function index_switch( $var, $label, $help = '' ) { * @param bool $inverse_keys Whether or not the option keys need to be inverted to support older functions. * @param string $help Inline Help that will be printed out before the visible toggles text. * - * @deprecated 15.0 - * * @return void */ public function show_hide_switch( $var, $label, $inverse_keys = false, $help = '' ) { - $show_hide_switch = [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), + $labels = [ + __( 'Hide', 'wordpress-seo' ), + __( 'Show', 'wordpress-seo' ), ]; - $this->light_switch( $var, $label, $show_hide_switch, $help, $inverse_keys ); + if ( $inverse_keys ) { + $labels = array_reverse( $labels ); + } + + $this->light_switch( $var, $label, $labels, $help, $inverse_keys ); } /** diff --git a/admin/views/class-view-utils.php b/admin/views/class-view-utils.php index 7d4a86a4c02..0c009623a4f 100644 --- a/admin/views/class-view-utils.php +++ b/admin/views/class-view-utils.php @@ -56,22 +56,14 @@ public function show_post_type_settings( $post_type, $paper_style = false ) { $this->search_results_setting_help() ); - $this->form->light_switch( + $this->form->show_hide_switch( 'showdate-' . $post_type->name, - __( 'Show date in Google Preview', 'wordpress-seo' ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + __( 'Show date in Google Preview', 'wordpress-seo' ) ); - $this->form->light_switch( + $this->form->show_hide_switch( 'display-metabox-pt-' . $post_type->name, - __( 'Show SEO settings for content type', 'wordpress-seo' ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + __( 'Show SEO settings for content type', 'wordpress-seo' ) ); $recommended_replace_vars = new WPSEO_Admin_Recommended_Replace_Vars(); diff --git a/admin/views/tabs/metas/paper-content/author-archive-settings.php b/admin/views/tabs/metas/paper-content/author-archive-settings.php index a0a07af2194..3895b9a5b6e 100644 --- a/admin/views/tabs/metas/paper-content/author-archive-settings.php +++ b/admin/views/tabs/metas/paper-content/author-archive-settings.php @@ -10,10 +10,7 @@ $yform->light_switch( 'disable-author', __( 'Author archives', 'wordpress-seo' ), - [ - __( 'Enabled', 'wordpress-seo' ), - __( 'Disabled', 'wordpress-seo' ), - ], + [], false, true ); diff --git a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php index 2e4becd8498..257f0653528 100644 --- a/admin/views/tabs/metas/paper-content/breadcrumbs-content.php +++ b/admin/views/tabs/metas/paper-content/breadcrumbs-content.php @@ -23,13 +23,9 @@ echo '
'; if ( get_option( 'show_on_front' ) === 'page' && get_option( 'page_for_posts' ) > 0 ) { - $yform->light_switch( + $yform->show_hide_switch( 'breadcrumbs-display-blog-page', - __( 'Show Blog page', 'wordpress-seo' ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + __( 'Show Blog page', 'wordpress-seo' ) ); } diff --git a/admin/views/tabs/metas/paper-content/date-archives-settings.php b/admin/views/tabs/metas/paper-content/date-archives-settings.php index b338c7fe031..ed0c2a9a005 100644 --- a/admin/views/tabs/metas/paper-content/date-archives-settings.php +++ b/admin/views/tabs/metas/paper-content/date-archives-settings.php @@ -10,10 +10,7 @@ $yform->light_switch( 'disable-date', __( 'Date archives', 'wordpress-seo' ), - [ - __( 'Enabled', 'wordpress-seo' ), - __( 'Disabled', 'wordpress-seo' ), - ], + [], false, true ); diff --git a/admin/views/tabs/metas/paper-content/media-content.php b/admin/views/tabs/metas/paper-content/media-content.php index 62d19b6b9d8..3e944c1a602 100644 --- a/admin/views/tabs/metas/paper-content/media-content.php +++ b/admin/views/tabs/metas/paper-content/media-content.php @@ -28,16 +28,13 @@ ); ?>

light_switch( 'disable-attachment', __( 'Redirect attachment URLs to the attachment itself?', 'wordpress-seo' ), - $yoast_free_disable_attachments_texts, - false, - true + [ + __( 'No', 'wordpress-seo' ), + __( 'Yes', 'wordpress-seo' ), + ] ); ?> diff --git a/admin/views/tabs/metas/paper-content/post_type/post-type.php b/admin/views/tabs/metas/paper-content/post_type/post-type.php index 2cc59205201..0ffb3a69d3d 100644 --- a/admin/views/tabs/metas/paper-content/post_type/post-type.php +++ b/admin/views/tabs/metas/paper-content/post_type/post-type.php @@ -19,23 +19,15 @@ $view_utils->search_results_setting_help() ); -$yform->light_switch( +$yform->show_hide_switch( 'showdate-' . $wpseo_post_type->name, - __( 'Show date in Google Preview', 'wordpress-seo' ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + __( 'Show date in Google Preview', 'wordpress-seo' ) ); -$yform->light_switch( +$yform->show_hide_switch( 'display-metabox-pt-' . $wpseo_post_type->name, /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ - sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $wpseo_post_type->labels->name ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $wpseo_post_type->labels->name ) ); $editor = new WPSEO_Replacevar_Editor( diff --git a/admin/views/tabs/metas/paper-content/taxonomy-content.php b/admin/views/tabs/metas/paper-content/taxonomy-content.php index 092c9a6295d..cb814d1cbc0 100644 --- a/admin/views/tabs/metas/paper-content/taxonomy-content.php +++ b/admin/views/tabs/metas/paper-content/taxonomy-content.php @@ -16,7 +16,7 @@ $yform->light_switch( 'disable-post_format', __( 'Format-based archives', 'wordpress-seo' ), - [ __( 'Enabled', 'wordpress-seo' ), __( 'Disabled', 'wordpress-seo' ) ], + [], false, false ); @@ -31,14 +31,10 @@ ); if ( $wpseo_taxonomy->name !== 'post_format' ) { - $yform->light_switch( + $yform->show_hide_switch( 'display-metabox-tax-' . $wpseo_taxonomy->name, /* translators: %s expands to an indexable object's name, like a post type or taxonomy */ - sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ), - [ - __( 'No', 'wordpress-seo' ), - __( 'Yes', 'wordpress-seo' ), - ] + sprintf( __( 'Show SEO settings for %1$s', 'wordpress-seo' ), $title ) ); } diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index 7f674c783b2..320a965e940 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -28,10 +28,6 @@ $yform->light_switch( 'twitter', __( 'Twitter card meta data', 'wordpress-seo' ), - [ - __( 'Off', 'wordpress-seo' ), - __( 'On', 'wordpress-seo' ), - ], ); echo '
'; From 9bfed8f3717d74e90b7ffe41c55a25552e3b8543 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 11:43:35 +0200 Subject: [PATCH 41/57] Move post-type archives to own collapsible --- .../post-type-archive-content.php | 48 +++++++++++++++++++ .../metas/paper-content/post-type-content.php | 42 ---------------- admin/views/tabs/metas/post-types.php | 29 +++++++++++ admin/views/tabs/social/twitterbox.php | 2 +- 4 files changed, 78 insertions(+), 43 deletions(-) create mode 100644 admin/views/tabs/metas/paper-content/post-type-archive-content.php diff --git a/admin/views/tabs/metas/paper-content/post-type-archive-content.php b/admin/views/tabs/metas/paper-content/post-type-archive-content.php new file mode 100644 index 00000000000..11003336264 --- /dev/null +++ b/admin/views/tabs/metas/paper-content/post-type-archive-content.php @@ -0,0 +1,48 @@ +labels->singular_name; +$paper_style = false; +$has_archive = WPSEO_Post_Type::has_archive( $wpseo_post_type ); + + +$plural_label = $wpseo_post_type->labels->name; + +$yform->index_switch( + 'noindex-ptarchive-' . $wpseo_post_type->name, + sprintf( + /* translators: %s expands to the post type's name. */ + __( 'the archive for %s', 'wordpress-seo' ), + $plural_label + ), + $view_utils->search_results_setting_help() +); + +$page_type = $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ); + +$editor = new WPSEO_Replacevar_Editor( + $yform, + [ + 'title' => 'title-ptarchive-' . $wpseo_post_type->name, + 'description' => 'metadesc-ptarchive-' . $wpseo_post_type->name, + 'page_type_recommended' => $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ), + 'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( $wpseo_post_type->name ), + 'paper_style' => false, + ] +); +$editor->render(); + +if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true ) { + echo '

' . __( 'Breadcrumb settings', 'wordpress-seo' ) . '

'; + $yform->textinput( 'bctitle-ptarchive-' . $wpseo_post_type->name, __( 'Breadcrumbs title', 'wordpress-seo' ) ); +} diff --git a/admin/views/tabs/metas/paper-content/post-type-content.php b/admin/views/tabs/metas/paper-content/post-type-content.php index a68ab124b5e..a3c284d53ec 100644 --- a/admin/views/tabs/metas/paper-content/post-type-content.php +++ b/admin/views/tabs/metas/paper-content/post-type-content.php @@ -15,11 +15,6 @@ $paper_style = false; $has_archive = WPSEO_Post_Type::has_archive( $wpseo_post_type ); -/* translators: %s is the singular version of the post type's name. */ -if ( $has_archive ) { - echo '

' . esc_html( sprintf( __( 'Settings for single %s URLs', 'wordpress-seo' ), $wpseo_post_type->labels->singular_name ) ) . '

'; -} - require __DIR__ . '/post_type/post-type.php'; if ( $wpseo_post_type->name === 'product' && WPSEO_Utils::is_woocommerce_active() ) { @@ -28,43 +23,6 @@ return; } -if ( $has_archive ) { - $plural_label = $wpseo_post_type->labels->name; - - /* translators: %s is the plural version of the post type's name. */ - echo '

' . esc_html( sprintf( __( 'Settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . '

'; - - $yform->index_switch( - 'noindex-ptarchive-' . $wpseo_post_type->name, - sprintf( - /* translators: %s expands to the post type's name. */ - __( 'the archive for %s', 'wordpress-seo' ), - $plural_label - ), - $view_utils->search_results_setting_help() - ); - - $page_type = $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ); - - $editor = new WPSEO_Replacevar_Editor( - $yform, - [ - 'title' => 'title-ptarchive-' . $wpseo_post_type->name, - 'description' => 'metadesc-ptarchive-' . $wpseo_post_type->name, - 'page_type_recommended' => $recommended_replace_vars->determine_for_archive( $wpseo_post_type->name ), - 'page_type_specific' => $editor_specific_replace_vars->determine_for_archive( $wpseo_post_type->name ), - 'paper_style' => false, - ] - ); - $editor->render(); - - if ( WPSEO_Options::get( 'breadcrumbs-enable' ) === true ) { - /* translators: %s is the plural version of the post type's name. */ - echo '

' . esc_html( sprintf( __( 'Breadcrumb settings for %s archive', 'wordpress-seo' ), $plural_label ) ) . '

'; - $yform->textinput( 'bctitle-ptarchive-' . $wpseo_post_type->name, __( 'Breadcrumbs title', 'wordpress-seo' ) ); - } -} - /** * Allow adding a custom checkboxes to the admin meta page - Post Types tab. * diff --git a/admin/views/tabs/metas/post-types.php b/admin/views/tabs/metas/post-types.php index 9c75ebeb3b6..2360c05a156 100644 --- a/admin/views/tabs/metas/post-types.php +++ b/admin/views/tabs/metas/post-types.php @@ -47,5 +47,34 @@ ); echo $wpseo_post_type_presenter->get_output(); + + // We're done if there is no archive. + if ( ! WPSEO_Post_Type::has_archive( $post_type ) ) { + continue; + } + + /* translators: %s is the plural version of the post type's name. */ + $label = sprintf( __( '%1$s archives', 'wordpress-seo' ), $post_type->labels->name ); + + $wpseo_post_type_archive_presenter = new WPSEO_Collapsible_Presenter( + $label, + __DIR__ . '/paper-content/post-type-archive-content.php', + [ + 'collapsible' => true, + 'expanded' => false, + 'paper_id' => 'archive-settings-' . $post_type->name, + 'view_data' => [ + 'wpseo_post_type' => $post_type, + 'view_utils' => $view_utils, + 'recommended_replace_vars' => $recommended_replace_vars, + 'editor_specific_replace_vars' => $editor_specific_replace_vars, + ], + 'title' => $label, + 'title_after' => ' (' . esc_html( $post_type->name ) . ')', + 'class' => 'search-appearance', + ] + ); + + echo $wpseo_post_type_archive_presenter->get_output(); } } diff --git a/admin/views/tabs/social/twitterbox.php b/admin/views/tabs/social/twitterbox.php index 320a965e940..73495ce5f7d 100644 --- a/admin/views/tabs/social/twitterbox.php +++ b/admin/views/tabs/social/twitterbox.php @@ -27,7 +27,7 @@ $yform->light_switch( 'twitter', - __( 'Twitter card meta data', 'wordpress-seo' ), + __( 'Twitter card meta data', 'wordpress-seo' ) ); echo '
'; From 8daddabb8b7cdf50f95aa7f98c8452c8a0b8d5c8 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 12:20:23 +0200 Subject: [PATCH 42/57] Dynamically change max-width for containers --- css/src/admin/admin.css | 6 +- css/src/admin/all.css | 2 +- css/src/admin/overwrites.css | 2 +- css/src/base/colors.css | 29 ---------- css/src/base/icons.css | 24 -------- css/src/base/variables.css | 64 ++++++++++++++++++++++ css/src/components/collapsible.css | 2 +- css/src/components/lists.css | 1 - js/src/components/SnippetPreviewSection.js | 2 - 9 files changed, 72 insertions(+), 60 deletions(-) delete mode 100644 css/src/base/colors.css create mode 100644 css/src/base/variables.css diff --git a/css/src/admin/admin.css b/css/src/admin/admin.css index 048ab95f763..6587c5fdce7 100644 --- a/css/src/admin/admin.css +++ b/css/src/admin/admin.css @@ -11,10 +11,14 @@ margin-right: auto; } +.yoast-feature { + max-width: var(--yoast-container-width); +} + #wpseo-submit-container p.wpseo-message { margin: 0 auto; padding: 16px 0; - max-width: 600px; + max-width: var(--yoast-container-width); color: #008a00; } diff --git a/css/src/admin/all.css b/css/src/admin/all.css index 63bb729209f..731996059e4 100644 --- a/css/src/admin/all.css +++ b/css/src/admin/all.css @@ -1,7 +1,7 @@ @import "./admin.css"; @import "./overwrites.css"; -@import "../base/colors.css"; +@import "../base/variables.css"; @import "../base/icons.css"; @import "../components/tabs.css"; diff --git a/css/src/admin/overwrites.css b/css/src/admin/overwrites.css index 35a2d72989e..a05a6500a29 100644 --- a/css/src/admin/overwrites.css +++ b/css/src/admin/overwrites.css @@ -5,5 +5,5 @@ .yoast #wpcontent p.submit { padding-top: 8px; margin: 0 auto 16px; - max-width: 600px; + max-width: var(--yoast-container-width); } diff --git a/css/src/base/colors.css b/css/src/base/colors.css deleted file mode 100644 index 166413e1aac..00000000000 --- a/css/src/base/colors.css +++ /dev/null @@ -1,29 +0,0 @@ -/** CSS selectors instead of SASS. */ -:root { - --yoast-color-default: #404040; - --yoast-color-default-darker: #303030; - --yoast-color-primary: #a4286a; - --yoast-color-secondary: #f7f7f7; - --yoast-color-white: #ffffff; - --yoast-color-primary-darker: #7b1e50; - --yoast-color-secondary-darker: #d9d9d9; - --yoast-color-dark: #303030; - --yoast-color-sale: #fec228; - --yoast-color-sale-darker: #feb601; - --yoast-color-border: rgba(0,0,0, 0.2); - --yoast-color-active: #6EA029; - --yoast-color-inactive: #DC3232; - --yoast-color-link: #006DAC; - --yoast-color-inactive-text: #707070; - --yoast-color-inactive-grey: #9E9E9E; - --yoast-color-inactive-grey-light: #f1f1f1; - --yoast-color-active-light: #B6CF94; - - --yoast-font-size-default: 14px; - - --yoast-border-default: 1px solid var(--yoast-color-border); - - --yoast-shadow-default: 0 2px 6px rgba(0, 0, 0, 0.15); - - --yoast-transition-default: all 150ms ease-out; -} diff --git a/css/src/base/icons.css b/css/src/base/icons.css index 3bfd0d88bcb..af1f175f8d9 100644 --- a/css/src/base/icons.css +++ b/css/src/base/icons.css @@ -1,25 +1,3 @@ -:root { - --yoast-svg-icon-info: url('data:image/svg+xml,'); - --yoast-svg-icon-check: url('data:image/svg+xml,'); - --yoast-svg-icon-check-ok: url('data:image/svg+xml,'); - --yoast-svg-icon-caret-right: url('data:image/svg+xml,'); - --yoast-svg-icon-caret-left: url('data:image/svg+xml,'); - --yoast-svg-icon-eye: url('data:image/svg+xml,'); - --yoast-svg-icon-list: url('data:image/svg+xml,'); - --yoast-svg-icon-key: url('data:image/svg+xml,'); - --yoast-svg-icon-edit: url('data:image/svg+xml,'); - --yoast-svg-icon-yoast: url('data:image/svg+xml,'); - --yoast-svg-icon-yoast-good: url('data:image/svg+xml,'); - --yoast-svg-icon-yoast-ok: url('data:image/svg+xml,'); - --yoast-svg-icon-yoast-bad: url('data:image/svg+xml,'); - --yoast-svg-icon-yoast-noindex: url('data:image/svg+xml,'); - --yoast-svg-icon-sort-up: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='4px' viewBox='0 0 6 4' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort-down%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-280.000000, -763.000000)' fill='%23000000' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-3' transform='translate(50.000000, 17.000000)'%3E%3Cpath d='M38.5046427,8 L43.4953573,8 C43.9441023,8 44.1684747,8.6201736 43.851837,8.98174199 L41.3564796,11.8311883 C41.1593674,12.0562706 40.8406326,12.0562706 40.6456173,11.8311883 L38.148163,8.98174199 C37.8315253,8.6201736 38.0558977,8 38.5046427,8 Z' id='fa-solid:sort-down' transform='translate(41.000000, 10.000000) scale(1, -1) translate(-41.000000, -10.000000) '%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); - --yoast-svg-icon-sort-down: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='4px' viewBox='0 0 6 4' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort-down%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-280.000000, -763.000000)' fill='%23000000' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-3' transform='translate(50.000000, 17.000000)'%3E%3Cpath d='M38.5046427,8 L43.4953573,8 C43.9441023,8 44.1684747,8.6201736 43.851837,8.98174199 L41.3564796,11.8311883 C41.1593674,12.0562706 40.8406326,12.0562706 40.6456173,11.8311883 L38.148163,8.98174199 C37.8315253,8.6201736 38.0558977,8 38.5046427,8 Z' id='fa-solid:sort-down'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); - --yoast-svg-icon-sort: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='9px' viewBox='0 0 6 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort copy%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-729.000000, -760.000000)' fill='%23707070' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-2' transform='translate(477.000000, 17.000000)'%3E%3Cpath d='M60.5046427,10.2234363 L65.4953573,10.2234363 C65.9441023,10.2234363 66.1684747,10.8089676 65.851837,11.1503391 L63.3564796,13.8406179 C63.1593674,14.0531274 62.8406326,14.0531274 62.6456173,13.8406179 L60.148163,11.1503391 C59.8315253,10.8089676 60.0558977,10.2234363 60.5046427,10.2234363 Z M65.851837,7.84966089 L63.3564796,5.15938206 C63.1593674,4.94687265 62.8406326,4.94687265 62.6456173,5.15938206 L60.148163,7.84966089 C59.8315253,8.1910324 60.0558977,8.77656368 60.5046427,8.77656368 L65.4953573,8.77656368 C65.9441023,8.77656368 66.1684747,8.1910324 65.851837,7.84966089 Z' id='fa-solid:sort-copy'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); - --yoast-checkmark--green: url('data:image/svg+xml,'); - --yoast-exclamation-mark: url('data:image/svg+xml,'); -} - .yoast-help { margin-left: 4px; text-decoration: none; @@ -35,5 +13,3 @@ .yoast-help:hover svg { fill: var(--yoast-color-link); } - -/*# sourceMappingURL=icons.css.map */ diff --git a/css/src/base/variables.css b/css/src/base/variables.css new file mode 100644 index 00000000000..8179990b3d8 --- /dev/null +++ b/css/src/base/variables.css @@ -0,0 +1,64 @@ +/** CSS selectors instead of SASS. */ +:root { + /* Colors */ + --yoast-color-default: #404040; + --yoast-color-default-darker: #303030; + --yoast-color-primary: #a4286a; + --yoast-color-secondary: #f7f7f7; + --yoast-color-white: #ffffff; + --yoast-color-primary-darker: #7b1e50; + --yoast-color-secondary-darker: #d9d9d9; + --yoast-color-dark: #303030; + --yoast-color-sale: #fec228; + --yoast-color-sale-darker: #feb601; + --yoast-color-border: rgba(0,0,0, 0.2); + --yoast-color-active: #6EA029; + --yoast-color-inactive: #DC3232; + --yoast-color-link: #006DAC; + --yoast-color-inactive-text: #707070; + --yoast-color-inactive-grey: #9E9E9E; + --yoast-color-inactive-grey-light: #f1f1f1; + --yoast-color-active-light: #B6CF94; + + /* Fonts */ + --yoast-font-size-default: 14px; + + /* Borders */ + --yoast-border-default: 1px solid var(--yoast-color-border); + + /* Shadows */ + --yoast-shadow-default: 0 2px 6px rgba(0, 0, 0, 0.15); + + /* Transitions */ + --yoast-transition-default: all 150ms ease-out; + + /* Images */ + --yoast-svg-icon-info: url('data:image/svg+xml,'); + --yoast-svg-icon-check: url('data:image/svg+xml,'); + --yoast-svg-icon-check-ok: url('data:image/svg+xml,'); + --yoast-svg-icon-caret-right: url('data:image/svg+xml,'); + --yoast-svg-icon-caret-left: url('data:image/svg+xml,'); + --yoast-svg-icon-eye: url('data:image/svg+xml,'); + --yoast-svg-icon-list: url('data:image/svg+xml,'); + --yoast-svg-icon-key: url('data:image/svg+xml,'); + --yoast-svg-icon-edit: url('data:image/svg+xml,'); + --yoast-svg-icon-yoast: url('data:image/svg+xml,'); + --yoast-svg-icon-yoast-good: url('data:image/svg+xml,'); + --yoast-svg-icon-yoast-ok: url('data:image/svg+xml,'); + --yoast-svg-icon-yoast-bad: url('data:image/svg+xml,'); + --yoast-svg-icon-yoast-noindex: url('data:image/svg+xml,'); + --yoast-svg-icon-sort-up: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='4px' viewBox='0 0 6 4' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort-down%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-280.000000, -763.000000)' fill='%23000000' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-3' transform='translate(50.000000, 17.000000)'%3E%3Cpath d='M38.5046427,8 L43.4953573,8 C43.9441023,8 44.1684747,8.6201736 43.851837,8.98174199 L41.3564796,11.8311883 C41.1593674,12.0562706 40.8406326,12.0562706 40.6456173,11.8311883 L38.148163,8.98174199 C37.8315253,8.6201736 38.0558977,8 38.5046427,8 Z' id='fa-solid:sort-down' transform='translate(41.000000, 10.000000) scale(1, -1) translate(-41.000000, -10.000000) '%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); + --yoast-svg-icon-sort-down: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='4px' viewBox='0 0 6 4' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort-down%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-280.000000, -763.000000)' fill='%23000000' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-3' transform='translate(50.000000, 17.000000)'%3E%3Cpath d='M38.5046427,8 L43.4953573,8 C43.9441023,8 44.1684747,8.6201736 43.851837,8.98174199 L41.3564796,11.8311883 C41.1593674,12.0562706 40.8406326,12.0562706 40.6456173,11.8311883 L38.148163,8.98174199 C37.8315253,8.6201736 38.0558977,8 38.5046427,8 Z' id='fa-solid:sort-down'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); + --yoast-svg-icon-sort: url("data:image/svg+xml;charset=utf8,%3C?xml version='1.0' encoding='UTF-8'?%3E%3Csvg width='6px' height='9px' viewBox='0 0 6 9' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Efa-solid:sort copy%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Redirects' transform='translate(-729.000000, -760.000000)' fill='%23707070' fill-rule='nonzero'%3E%3Cg id='Table-1' transform='translate(192.000000, 738.000000)'%3E%3Cg id='Table-bars'%3E%3Cg id='Group-2' transform='translate(477.000000, 17.000000)'%3E%3Cpath d='M60.5046427,10.2234363 L65.4953573,10.2234363 C65.9441023,10.2234363 66.1684747,10.8089676 65.851837,11.1503391 L63.3564796,13.8406179 C63.1593674,14.0531274 62.8406326,14.0531274 62.6456173,13.8406179 L60.148163,11.1503391 C59.8315253,10.8089676 60.0558977,10.2234363 60.5046427,10.2234363 Z M65.851837,7.84966089 L63.3564796,5.15938206 C63.1593674,4.94687265 62.8406326,4.94687265 62.6456173,5.15938206 L60.148163,7.84966089 C59.8315253,8.1910324 60.0558977,8.77656368 60.5046427,8.77656368 L65.4953573,8.77656368 C65.9441023,8.77656368 66.1684747,8.1910324 65.851837,7.84966089 Z' id='fa-solid:sort-copy'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); + --yoast-checkmark--green: url('data:image/svg+xml,'); + --yoast-exclamation-mark: url('data:image/svg+xml,'); + + /* Layout */ + --yoast-container-width: 600px; +} + +@media screen and (min-width: 1400px) { + :root { + --yoast-container-width: 750px; + } +} diff --git a/css/src/components/collapsible.css b/css/src/components/collapsible.css index 35c2e3a0c49..201eb62833a 100644 --- a/css/src/components/collapsible.css +++ b/css/src/components/collapsible.css @@ -1,6 +1,6 @@ .yoast-collapsible { margin-bottom: 16px; - max-width: 600px; + max-width: var(--yoast-container-width); position: relative; box-shadow: var(--yoast-shadow-default); diff --git a/css/src/components/lists.css b/css/src/components/lists.css index 2c9872203a2..ad291f9b424 100644 --- a/css/src/components/lists.css +++ b/css/src/components/lists.css @@ -1,6 +1,5 @@ .yoast-list { margin-left: 22px; - max-width: 600px; } .yoast-list li { diff --git a/js/src/components/SnippetPreviewSection.js b/js/src/components/SnippetPreviewSection.js index cc848ae132b..06b20debb62 100644 --- a/js/src/components/SnippetPreviewSection.js +++ b/js/src/components/SnippetPreviewSection.js @@ -5,8 +5,6 @@ import { StyledSection, StyledHeading, StyledSectionBase } from "@yoast/componen import { getDirectionalStyle as getRtlStyle } from "@yoast/helpers"; const Section = styled( StyledSection )` - max-width: 640px; - &${ StyledSectionBase } { padding: 0; From 447d865f4290ee1e34c085df73363e6ec7505005 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 12:24:31 +0200 Subject: [PATCH 43/57] Convert Category URLs to collapsible --- admin/views/tabs/metas/taxonomies.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/admin/views/tabs/metas/taxonomies.php b/admin/views/tabs/metas/taxonomies.php index d1a4e4d3441..70dec84802b 100644 --- a/admin/views/tabs/metas/taxonomies.php +++ b/admin/views/tabs/metas/taxonomies.php @@ -46,7 +46,19 @@ unset( $wpseo_taxonomies ); -echo '
'; -printf( '

%s

', esc_html__( 'Category URLs', 'wordpress-seo' ) ); -require __DIR__ . '/taxonomies/category-url.php'; -echo '
'; + +$wpseo_taxonomy_presenter = new WPSEO_Collapsible_Presenter( + __( 'Category URLs', 'wordpress-seo' ), + __DIR__ . '/taxonomies/category-url.php', + [ + 'collapsible' => true, + 'expanded' => false, + 'paper_id' => 'taxonomies-category-urls', + ] +); +echo $wpseo_taxonomy_presenter->get_output(); + +//echo '
'; +//printf( '

%s

', esc_html__( 'Category URLs', 'wordpress-seo' ) ); +//require ; +//echo '
'; From 65ce6b17fd2b225be5ebda95042646279e58c9a5 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 13:35:47 +0200 Subject: [PATCH 44/57] Convert Tools page to tabs --- admin/class-collapsible-presenter.php | 2 +- admin/pages/tools.php | 92 ++++----- admin/views/tabs/metas/taxonomies.php | 5 - admin/views/tabs/tool/bulk-editor-table.php | 26 +++ .../views/tabs/tool/file-editor-htaccess.php | 58 ++++++ admin/views/tabs/tool/file-editor-robots.php | 85 ++++++++ admin/views/tabs/tool/import-seo.php | 136 +++++++------ admin/views/tabs/tool/wpseo-export.php | 24 ++- admin/views/tabs/tool/wpseo-import.php | 68 ++++--- admin/views/tool-bulk-editor.php | 59 +++--- admin/views/tool-file-editor.php | 182 ++++-------------- admin/views/tool-import-export.php | 28 +-- admin/views/tools-navigation.php | 37 ++++ css/src/components/collapsible.css | 3 +- css/src/components/sidebar.css | 4 - 15 files changed, 424 insertions(+), 385 deletions(-) create mode 100644 admin/views/tabs/tool/bulk-editor-table.php create mode 100644 admin/views/tabs/tool/file-editor-htaccess.php create mode 100644 admin/views/tabs/tool/file-editor-robots.php create mode 100644 admin/views/tools-navigation.php diff --git a/admin/class-collapsible-presenter.php b/admin/class-collapsible-presenter.php index 6d6459ffba7..8d9eb99444f 100644 --- a/admin/class-collapsible-presenter.php +++ b/admin/class-collapsible-presenter.php @@ -22,7 +22,7 @@ public function __construct( $title, $view_file = '', array $settings = [] ) { $defaults = [ 'paper_id' => null, 'paper_id_prefix' => 'wpseo-', - 'collapsible' => false, + 'collapsible' => true, 'collapsible_header_class' => '', 'expanded' => false, 'help_button' => '', diff --git a/admin/pages/tools.php b/admin/pages/tools.php index b9d507759da..199ffaf9554 100644 --- a/admin/pages/tools.php +++ b/admin/pages/tools.php @@ -12,80 +12,58 @@ } $tool_page = (string) filter_input( INPUT_GET, 'tool' ); +$admin_url = admin_url( 'admin.php?page=wpseo_tools' ); -$yform = Yoast_Form::get_instance(); -$yform->admin_header( false, 'tools' ); +$tools = []; -if ( $tool_page === '' ) { +$tools['general'] = [ + 'title' => __( 'General', 'wordpress-seo' ), + 'href' => '', +]; - $tools = []; +$tools['import-export'] = [ 'title' => __( 'Import and Export', 'wordpress-seo' ) ]; - $tools['import-export'] = [ - 'title' => __( 'Import and Export', 'wordpress-seo' ), - 'desc' => __( 'Import settings from other SEO plugins and export your settings for re-use on (another) blog.', 'wordpress-seo' ), - ]; - - if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) { - $tools['file-editor'] = [ - 'title' => __( 'File editor', 'wordpress-seo' ), - 'desc' => __( 'This tool allows you to quickly change important files for your SEO, like your robots.txt and, if you have one, your .htaccess file.', 'wordpress-seo' ), - ]; - } +if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) { + $tools['file-editor'] = [ 'title' => __( 'File editor', 'wordpress-seo' ) ]; +} - $tools['bulk-editor'] = [ - 'title' => __( 'Bulk editor', 'wordpress-seo' ), - 'desc' => __( 'This tool allows you to quickly change titles and descriptions of your posts and pages without having to go into the editor for each page.', 'wordpress-seo' ), - ]; +$tools['bulk-editor'] = [ 'title' => __( 'Bulk editor', 'wordpress-seo' ) ]; - echo '
'; +$yform = Yoast_Form::get_instance(); +$yform->admin_header( false, 'tools' ); - echo '

'; - printf( - /* translators: %1$s expands to Yoast SEO */ - esc_html__( '%1$s comes with some very powerful built-in tools:', 'wordpress-seo' ), - 'Yoast SEO' - ); - echo '

'; +require_once WPSEO_PATH . 'admin/views/tools-navigation.php'; - echo '
    '; +if ( ! empty( $tool_page ) ) { + $tool_pages = [ 'bulk-editor', 'import-export' ]; + if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) { + $tool_pages[] = 'file-editor'; + } - $admin_url = admin_url( 'admin.php?page=wpseo_tools' ); + if ( in_array( $tool_page, $tool_pages, true ) ) { + require_once WPSEO_PATH . 'admin/views/tool-' . $tool_page . '.php'; + } - foreach ( $tools as $slug => $tool ) { - $href = ( ! empty( $tool['href'] ) ) ? $admin_url . $tool['href'] : add_query_arg( [ 'tool' => $slug ], $admin_url ); - $attr = ( ! empty( $tool['attr'] ) ) ? $tool['attr'] : ''; + $yform->admin_footer( false ); - echo '
  • '; - echo '', esc_html( $tool['title'] ), '
    '; - echo esc_html( $tool['desc'] ); - echo '
  • '; - } + return; +} - /** - * Action: 'wpseo_tools_overview_list_items' - Hook to add additional tools to the overview. - */ - do_action( 'wpseo_tools_overview_list_items' ); +echo '
    '; - echo '
'; +echo '
    '; - echo ''; +$admin_url = admin_url( 'admin.php?page=wpseo_tools' ); - echo '
'; // yoast-paper. -} -else { - echo ''; +/** + * Action: 'wpseo_tools_overview_list_items' - Hook to add additional tools to the overview. + */ +do_action( 'wpseo_tools_overview_list_items' ); - $tool_pages = [ 'bulk-editor', 'import-export' ]; +echo ''; - if ( WPSEO_Utils::allow_system_file_edit() === true && ! is_multisite() ) { - $tool_pages[] = 'file-editor'; - } +echo ''; - if ( in_array( $tool_page, $tool_pages, true ) ) { - require_once WPSEO_PATH . 'admin/views/tool-' . $tool_page . '.php'; - } -} +echo '
'; // yoast-paper. $yform->admin_footer( false ); diff --git a/admin/views/tabs/metas/taxonomies.php b/admin/views/tabs/metas/taxonomies.php index 70dec84802b..f604ede5404 100644 --- a/admin/views/tabs/metas/taxonomies.php +++ b/admin/views/tabs/metas/taxonomies.php @@ -57,8 +57,3 @@ ] ); echo $wpseo_taxonomy_presenter->get_output(); - -//echo '
'; -//printf( '

%s

', esc_html__( 'Category URLs', 'wordpress-seo' ) ); -//require ; -//echo '
'; diff --git a/admin/views/tabs/tool/bulk-editor-table.php b/admin/views/tabs/tool/bulk-editor-table.php new file mode 100644 index 00000000000..946a732558e --- /dev/null +++ b/admin/views/tabs/tool/bulk-editor-table.php @@ -0,0 +1,26 @@ + +
+ show_page(); + ?> +
+ 0 ) { + $contentht = fread( $f, filesize( $ht_access_file ) ); + } + + if ( ! is_writable( $ht_access_file ) ) { + echo '

'; + printf( + /* translators: %s expands to ".htaccess". */ + esc_html__( 'If your %s were writable, you could edit it from here.', 'wordpress-seo' ), + '.htaccess' + ); + echo '

'; + echo '
'; + } + else { + echo '
'; + wp_nonce_field( 'wpseo-htaccess', '_wpnonce', true, true ); + echo '
'; + echo ''; + echo '
'; + echo '
'; + printf( + '

', + sprintf( + /* translators: %s expands to ".htaccess". */ + esc_attr__( 'Save changes to %s', 'wordpress-seo' ), + '.htaccess' + ) + ); + echo '
'; + } +} +else { + echo '

'; + printf( + /* translators: %s expands to ".htaccess". */ + esc_html__( 'If you had a %s file and it was editable, you could edit it from here.', 'wordpress-seo' ), + '.htaccess' + ); + echo '

'; +} diff --git a/admin/views/tabs/tool/file-editor-robots.php b/admin/views/tabs/tool/file-editor-robots.php new file mode 100644 index 00000000000..299c2bdabf3 --- /dev/null +++ b/admin/views/tabs/tool/file-editor-robots.php @@ -0,0 +1,85 @@ +'; + +if ( ! file_exists( $robots_file ) ) { + if ( is_writable( get_home_path() ) ) { + echo '
'; + wp_nonce_field( 'wpseo_create_robots', '_wpnonce', true, true ); + echo '

'; + printf( + /* translators: %s expands to robots.txt. */ + esc_html__( 'You don\'t have a %s file, create one here:', 'wordpress-seo' ), + 'robots.txt' + ); + echo '

'; + + printf( + '

', + sprintf( + /* translators: %s expands to robots.txt. */ + esc_attr__( 'Create %s file', 'wordpress-seo' ), + 'robots.txt' + ) + ); + echo '
'; + } + else { + echo '

'; + printf( + /* translators: %s expands to robots.txt. */ + esc_html__( 'If you had a %s file and it was editable, you could edit it from here.', 'wordpress-seo' ), + 'robots.txt' + ); + echo '

'; + } +} +else { + $f = fopen( $robots_file, 'r' ); + + $content = ''; + if ( filesize( $robots_file ) > 0 ) { + $content = fread( $f, filesize( $robots_file ) ); + } + + if ( ! is_writable( $robots_file ) ) { + echo '

'; + printf( + /* translators: %s expands to robots.txt. */ + esc_html__( 'If your %s were writable, you could edit it from here.', 'wordpress-seo' ), + 'robots.txt' + ); + echo '

'; + echo '
'; + } + else { + echo '
'; + wp_nonce_field( 'wpseo-robotstxt', '_wpnonce', true, true ); + echo '
'; + echo ''; + echo '
'; + echo '
'; + printf( + '

', + sprintf( + /* translators: %s expands to robots.txt. */ + esc_attr__( 'Save changes to %s', 'wordpress-seo' ), + 'robots.txt' + ) + ); + echo '
'; + } +} + +echo '
'; // yoast-field-group. diff --git a/admin/views/tabs/tool/import-seo.php b/admin/views/tabs/tool/import-seo.php index 65944a336a8..fcb6f7e2a79 100644 --- a/admin/views/tabs/tool/import-seo.php +++ b/admin/views/tabs/tool/import-seo.php @@ -15,16 +15,14 @@ $import_check = new WPSEO_Import_Plugins_Detector(); $import_check->detect(); if ( count( $import_check->needs_import ) === 0 ) { - echo '
'; - echo '

', esc_html__( 'Import from other SEO plugins', 'wordpress-seo' ), '

'; echo '

'; printf( /* translators: %s expands to Yoast SEO */ esc_html__( '%s did not detect any plugin data from plugins it can import from.', 'wordpress-seo' ), 'Yoast SEO' ); + echo '

'; - echo '
'; // yoast-paper. return; } @@ -50,82 +48,78 @@ function wpseo_import_external_select( $name, $plugins ) { } ?> -
+

+ +

-

+
+

- +

+
-
-

-

- -

-
- -
-

-

+

+

+

+ +

+
+
needs_import ); ?> -

- -
- needs_import ); - ?> - - -
- -
+ + +
+ +
+ +
+

+

+ +

+
-
-

-

- -

-
+
+

+

+ ', + '' + ); + ?> +

+
-
-

-

+

+

+

+ +

+
+
', - '' - ); + wp_nonce_field( 'wpseo-clean-plugins', '_wpnonce', true, true ); + wpseo_import_external_select( 'clean_external_plugin', $import_check->needs_import ); ?> -

-
- -
-

-

- -

- -
- needs_import ); - ?> - -
- -
+ +
+
diff --git a/admin/views/tabs/tool/wpseo-export.php b/admin/views/tabs/tool/wpseo-export.php index 257b57b6468..78c40e58e92 100644 --- a/admin/views/tabs/tool/wpseo-export.php +++ b/admin/views/tabs/tool/wpseo-export.php @@ -27,16 +27,14 @@ ); ?> -
-

-
- - -

- -

-
-
+

+
+ + +

+ +

+
diff --git a/admin/views/tabs/tool/wpseo-import.php b/admin/views/tabs/tool/wpseo-import.php index 51bc9301ef4..ea4e06a50cb 100644 --- a/admin/views/tabs/tool/wpseo-import.php +++ b/admin/views/tabs/tool/wpseo-import.php @@ -17,40 +17,38 @@ } ?> -
-

- -

+

+ +

-
-
- -
- -
- + +
+ +
+
-
-

- -

- -
+ +
+
+

+ +

+ diff --git a/admin/views/tool-bulk-editor.php b/admin/views/tool-bulk-editor.php index 87c2d137560..356c91d8ec7 100644 --- a/admin/views/tool-bulk-editor.php +++ b/admin/views/tool-bulk-editor.php @@ -76,22 +76,6 @@ function yoast_free_bulk_sanitize_input_fields() { exit; } -/** - * Renders a bulk editor tab. - * - * @param WPSEO_Bulk_List_Table $table The table to render. - * @param string $id The id for the tab. - */ -function wpseo_get_rendered_tab( $table, $id ) { - ?> -
- show_page(); - ?> -
-