From 83d362ab66a34757506f362a2058a0cb9f2eb659 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:23:40 +0200 Subject: [PATCH 01/46] CSS tweaks for admin pages --- css/src/admin/admin.css | 54 ++++++++++++++++++++++++------ css/src/base/colors.css | 8 ++--- css/src/components/collapsible.css | 8 ++--- css/src/components/headings.css | 7 +++- css/src/components/paper.css | 24 +++++++++++-- css/src/components/sidebar.css | 16 +++++++++ css/src/components/tabs.css | 4 +-- 7 files changed, 96 insertions(+), 25 deletions(-) diff --git a/css/src/admin/admin.css b/css/src/admin/admin.css index aa5aede3696..c54a63d6dba 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 { @@ -34,7 +65,8 @@ border: 0; background: none; color: var(--yoast-primary-color); - padding-bottom: 16px; + padding: 16px; + cursor: pointer; } #wpseo_progressbar { 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/headings.css b/css/src/components/headings.css index ff2e438897a..0c4896b1b48 100644 --- a/css/src/components/headings.css +++ b/css/src/components/headings.css @@ -23,7 +23,7 @@ body.yoast { .yoast #wpcontent .h1, .yoast #wpcontent .h2, .yoast #wpcontent .h3 { - font-weight: 400; + font-weight: 300; color: var(--yoast-color-primary); padding: 0; margin-top: 0; @@ -31,6 +31,11 @@ body.yoast { line-height: 1.2; } +.yoast #wpcontent h3, +.yoast #wpcontent .h3 { + font-weight: 400; +} + .yoast #wpcontent h1, .yoast #wpcontent .h1 { font-size: 1.7em; margin-bottom: 1.34em; diff --git a/css/src/components/paper.css b/css/src/components/paper.css index 3b61d904a1e..a36df0e3e45 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); @@ -9,9 +9,29 @@ box-sizing: border-box; } +.yoast #wpcontent p.submit { + padding-top: 8px; +} + +.yoast-paper:last-of-type { + margin-bottom: 24px; +} + +.yoast-feature:last-of-type { + margin-bottom: 24px; +} + +.yoast-paper--bottom { + padding-bottom: 16px; +} + +.yoast #wpcontent .yoast-paper h2 { + margin-bottom: 32px; +} + .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 154c910de88..36128320f52 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -18,6 +18,14 @@ .yoast-sidebar { max-width: 300px; margin-left: 24px; + padding-top: 32px; +} + +.yoast #wpcontent .yoast-sidebar h2 { + padding-top: 5px; + padding-bottom: 8px; + font-size: 1.1em; + font-weight: 400; } .yoast-main { @@ -54,6 +62,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 a77df4dc995611e85454acf8b6280957699f8534 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:25:13 +0200 Subject: [PATCH 02/46] Restore papers and add spacing --- admin/class-yoast-form.php | 9 +++++++-- admin/pages/tools.php | 2 ++ admin/views/tabs/metas/breadcrumbs.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 +++++-- 19 files changed, 54 insertions(+), 33 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index cd43a58c887..ad84b8f12ce 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -421,7 +421,13 @@ public function textinput( $var, $label, $attr = [] ) { id="', esc_attr( $var ), '" name="', esc_attr( $this->option_name ), '[', esc_attr( $var ), ']" value="', esc_attr( $val ), '"', - disabled( $this->is_control_disabled( $var ), true, false ), '/>', ''; + disabled( $this->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 ); } @@ -628,7 +634,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/breadcrumbs.php b/admin/views/tabs/metas/breadcrumbs.php index 9458d3db66f..6f6e6686031 100644 --- a/admin/views/tabs/metas/breadcrumbs.php +++ b/admin/views/tabs/metas/breadcrumbs.php @@ -11,7 +11,7 @@ exit(); } -$wpseo_breadcrumbs_presenter = new WPSEO_Collapsible_Presenter( +$wpseo_breadcrumbs_presenter = new WPSEO_Paper_Presenter( esc_html__( 'Breadcrumbs settings', 'wordpress-seo' ), __DIR__ . '/paper-content/breadcrumbs-content.php', [ 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 7c01562ae61..1d593922cef 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 6e74b7c7780..e341b96d29f 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 60069bdd706..71f7892cd9f 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' ) . '

'; printf( '

%s

', @@ -62,6 +62,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 4492e2a790e6f0ece9c3ad4141a2569442f24cd6 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:25:36 +0200 Subject: [PATCH 03/46] 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 3ef95ae61ec..70941e63a43 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 194502669c8a3d17af890eefece4d90a7c2c8792 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:04 +0200 Subject: [PATCH 04/46] 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 ca54309e884a779f1555351565224831fd8b5500 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:22 +0200 Subject: [PATCH 05/46] 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 86da66326a11ed51ec43909d2db31eabd2ee4b02 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:43 +0200 Subject: [PATCH 06/46] 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 f3ed70b072758d934b613bf38737ee1ec0e95ecc Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:26:53 +0200 Subject: [PATCH 07/46] 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 df90995114f84c526c1246d1abef0fbf8c32defe Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:27:20 +0200 Subject: [PATCH 08/46] 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 db57feb97f3..a8500df3947 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 1ce66eb945a1b10fcfa7488f444a84ebc3d9cdf8 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:27:45 +0200 Subject: [PATCH 09/46] 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 4fdd6f23dd998b332dcb1356b7d802f79dd6edd4 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:28:06 +0200 Subject: [PATCH 10/46] 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/46] 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 3af1089587e..17b28f7b990 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 a4f2c74377b8c2880feb475317925fced56beb1f Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 15:34:41 +0200 Subject: [PATCH 12/46] 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 a8500df3947..ebaf255fc80 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 65ecfd7edaa..e6271962f3e 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 69dc5301d4f..3557a61066f 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,5 +55,5 @@ body.yoast { } .yoast #wpcontent #wpseo-title { - margin-bottom: 24px; + margin-bottom: 16px; } diff --git a/css/src/components/paper.css b/css/src/components/paper.css index a7a42769172..4b263967d6b 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -1,7 +1,7 @@ .yoast-paper { background-color: white; padding: 16px 16px 0; - margin-bottom: 32px; + margin-bottom: 16px; box-shadow: var(--yoast-shadow-default); border: var(--yoast-border-default); max-width: 600px; @@ -10,7 +10,7 @@ } .yoast #wpcontent .yoast-paper h2 { - margin-bottom: 32px; + margin-bottom: 16px; } .yoast-paper:last-of-type { diff --git a/css/src/components/sidebar.css b/css/src/components/sidebar.css index 36128320f52..0a78adc9a1e 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -18,7 +18,7 @@ .yoast-sidebar { max-width: 300px; margin-left: 24px; - padding-top: 32px; + padding-top: 16px; } .yoast #wpcontent .yoast-sidebar h2 { 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 462ae268429cc97c5173aabd2963384008752072 Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 17:34:17 +0200 Subject: [PATCH 15/46] 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 18acc0a27ab..24fa54611c1 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 4cb0fe32a2db632dc0e489a7fc508d76dfba70fd Mon Sep 17 00:00:00 2001 From: Jip Date: Tue, 30 Jun 2020 17:34:35 +0200 Subject: [PATCH 16/46] 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 94b2e0992b7e96f9323ce2628f7f789818c63782 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:20:32 +0200 Subject: [PATCH 17/46] Add more papers to the settings pages --- admin/pages/tools.php | 4 ++++ admin/views/tabs/dashboard/dashboard.php | 13 +++++++------ admin/views/tabs/dashboard/features.php | 4 ++-- admin/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, 31 insertions(+), 22 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 a73a50cdbae..137f34d0539 100644 --- a/admin/views/tabs/dashboard/dashboard.php +++ b/admin/views/tabs/dashboard/dashboard.php @@ -25,20 +25,21 @@ ?> -
- -
- -
+
+
+ +
-
+
+

+
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 c1e04d3466ef6a25d431b76dbbad8f5ab4a7494b Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:20:52 +0200 Subject: [PATCH 18/46] 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 0a78adc9a1e..87d2c2b8897 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -21,6 +21,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 2110146dae83e8106327b4826d7abb17d22bfe48 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:32:18 +0200 Subject: [PATCH 19/46] Notification center styling fix --- admin/views/partial-notifications-template.php | 12 +++++------- css/src/components/paper.css | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/admin/views/partial-notifications-template.php b/admin/views/partial-notifications-template.php index eabfea25580..86c0ed16efb 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( @@ -77,12 +76,11 @@ function _yoast_display_notifications( $list, $status ) {
-
- -
+ + Date: Wed, 1 Jul 2020 10:39:29 +0200 Subject: [PATCH 20/46] Remove top padding of first H3 in a paper-content --- css/src/components/paper.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/css/src/components/paper.css b/css/src/components/paper.css index f6cba966915..0ab641024ad 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -65,6 +65,10 @@ margin-bottom: 24px; } +.yoast #wpcontent .paper-container h3:first-child { + padding-top: 0; +} + .yoast-paper__item .yoast-notification { position: relative; margin-left: 22px; From 36f3d48ff6027bbfefece9271f0f187bc83ff3b8 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 10:42:57 +0200 Subject: [PATCH 21/46] 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 d01af240097..ec98d9bc2eb 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 db1948dda8757b8e0e9a4664e98480466b6bc187 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 12:38:52 +0200 Subject: [PATCH 22/46] 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/paper.css | 2 +- css/src/components/tabs.css | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index ad84b8f12ce..6921b694bbc 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 3557a61066f..679e682be8e 100644 --- a/css/src/components/headings.css +++ b/css/src/components/headings.css @@ -55,5 +55,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/paper.css b/css/src/components/paper.css index 0ab641024ad..9a11ce3a6b4 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -1,12 +1,12 @@ .yoast-paper { background-color: white; padding: 16px 16px 0; - margin-bottom: 16px; box-shadow: var(--yoast-shadow-default); border: var(--yoast-border-default); max-width: 600px; position: relative; box-sizing: border-box; + margin: 0 auto 16px; } .yoast #wpcontent .yoast-paper h2 { 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 ff4eb2f5b3689bcc0e13de42ab3a27528f45e159 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 13:02:00 +0200 Subject: [PATCH 23/46] 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 17b28f7b990..f5cbaa862d7 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -207,6 +207,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 f77c5e53c546909fdc337d55ebdeaeeebb4471b7 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 13:08:29 +0200 Subject: [PATCH 24/46] Remove duplicate usage-tracking entry --- admin/views/class-yoast-feature-toggles.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/admin/views/class-yoast-feature-toggles.php b/admin/views/class-yoast-feature-toggles.php index 083f078c801..89f76c8e9b1 100644 --- a/admin/views/class-yoast-feature-toggles.php +++ b/admin/views/class-yoast-feature-toggles.php @@ -140,22 +140,6 @@ protected function load_toggles() { 'read_more_url' => 'https://yoa.st/usage-tracking', 'order' => 95, ], - (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' ), - 'Yoast SEO' - ), - 'read_more_url' => 'https://yoa.st/usage-tracking', - 'order' => 95, - ], (object) [ 'name' => __( 'REST API: Head endpoint', 'wordpress-seo' ), 'setting' => 'enable_headless_rest_endpoints', From 5e0dd312282d3c60ad29af2bc53e5640ed9bb936 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 16:14:54 +0200 Subject: [PATCH 25/46] 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 d565ef76f9b4dba1816bc01fd67437b490f6d9d6 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:17:30 +0200 Subject: [PATCH 26/46] 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 a930030855e9cbe4b8b8058c56f3c5a6f5a25ae3 Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:17:52 +0200 Subject: [PATCH 27/46] 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 ec98d9bc2eb..3391a179012 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 796d49c5619905c04d16d69f8ccd98151eb36c2f Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:18:10 +0200 Subject: [PATCH 28/46] 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 3391a179012..3bd6df83460 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 c2106b55329500d893db66bcb0c966a7b0db177f Mon Sep 17 00:00:00 2001 From: Jip Date: Wed, 1 Jul 2020 17:18:24 +0200 Subject: [PATCH 29/46] Reduce spacing of last paper & feature containers --- css/src/components/paper.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/src/components/paper.css b/css/src/components/paper.css index 9a11ce3a6b4..cacc33c5bdd 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -14,11 +14,11 @@ } .yoast-paper:last-of-type { - margin-bottom: 24px; + margin-bottom: 16px; } .yoast-feature:last-of-type { - margin-bottom: 24px; + margin-bottom: 16px; } .yoast-paper--bottom { From 6bdebc4f244bd77f3c8ea6fa583590690e5a6cde Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:07:31 +0200 Subject: [PATCH 30/46] 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 f5cbaa862d7..8b3d007485c 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 c855a9c6f62ce7b1e68b5f1337d2e37c71cb594d Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:27:13 +0200 Subject: [PATCH 31/46] 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/46] 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 beaa45ae9cea53af0be744be06f7aeeec4b5f836 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:45:33 +0200 Subject: [PATCH 33/46] 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 6921b694bbc..c4b19e55adf 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 7693469b931..14fb1fc40db 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 ee09446792793428e5ebd01e3477ab64e1b24c38 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 09:49:36 +0200 Subject: [PATCH 34/46] 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 a58e69ccdc05daa11ca6f7f9f9b198a002179258 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 10:00:27 +0200 Subject: [PATCH 35/46] 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 8b2a544156f..69131046396 100644 --- a/js/src/initializers/admin.js +++ b/js/src/initializers/admin.js @@ -218,6 +218,11 @@ export default function initAdmin( jQuery ) { jQuery( "#noindex-author-noposts-wpseo-container" ).toggle( jQuery( this ).is( ":not(:checked)" ) ); } ).change(); + // 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 c43937a83a33d5e0409d1d6d50f0365fdd7cb8d9 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 11:13:10 +0200 Subject: [PATCH 36/46] 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 c4b19e55adf..acbbe8505da 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -363,7 +363,7 @@ public function light_switch_disabled( $var, $label, $buttons = [], $help = '', '', '', '
', - '', __( 'Upgrade to premium', 'wordpress-seo' ) ,'', + '', __( 'Upgrade to Premium', 'wordpress-seo' ) ,'', '
'; } From 2a32dccdc5e5ce7e3358899efd9e5b65a603bac8 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:13:45 +0200 Subject: [PATCH 37/46] Consistent font-weights --- css/src/components/buttons.css | 2 +- css/src/components/sidebar.css | 2 +- css/src/components/table.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/css/src/components/buttons.css b/css/src/components/buttons.css index 3bd6df83460..b12b84bd932 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 87d2c2b8897..49ed8ad8a5f 100644 --- a/css/src/components/sidebar.css +++ b/css/src/components/sidebar.css @@ -51,7 +51,7 @@ .yoast-sidebar li { position: relative; margin-left: 18px; - font-weight: 600; + font-weight: 500; } .yoast-sidebar li::before { 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 71e9b44b88008c538c83df082a19b0e0949dcf70 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:14:00 +0200 Subject: [PATCH 38/46] Remove font overwrite of dismissed warnings --- css/src/components/paper.css | 1 - 1 file changed, 1 deletion(-) diff --git a/css/src/components/paper.css b/css/src/components/paper.css index cacc33c5bdd..27dffbf28d1 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -44,7 +44,6 @@ } .yoast-paper #yoast-warnings-dismissed .collapsible-header { - font-size: 16px; padding-bottom: 0; border: 0; margin-bottom: 0; From 143b996276c4df31889fdc70cb363829e66aef67 Mon Sep 17 00:00:00 2001 From: Jip Date: Thu, 2 Jul 2020 12:19:55 +0200 Subject: [PATCH 39/46] 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 acbbe8505da..0713a7f2f68 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -856,12 +856,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 1d593922cef..63db1271379 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 ebaf255fc80..4b8e5406f60 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 1d6f4fc05f8f48644b0e023d7ec96326c567fe33 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 11:30:22 +0200 Subject: [PATCH 40/46] 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 | 10 +++--- .../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(+), 71 deletions(-) diff --git a/admin/class-yoast-form.php b/admin/class-yoast-form.php index 0713a7f2f68..f431683c018 100644 --- a/admin/class-yoast-form.php +++ b/admin/class-yoast-form.php @@ -312,9 +312,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; @@ -830,21 +833,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 ); } @@ -856,17 +853,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 63db1271379..59fc1cfcbcb 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 e341b96d29f..3e944c1a602 100644 --- a/admin/views/tabs/metas/paper-content/media-content.php +++ b/admin/views/tabs/metas/paper-content/media-content.php @@ -28,15 +28,13 @@ ); ?>

light_switch( 'disable-attachment', __( 'Redirect attachment URLs to the attachment itself?', 'wordpress-seo' ), - $yoast_free_disable_attachments_texts, - false + [ + __( '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 4b8e5406f60..ac1800b26b0 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, true ); @@ -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 9624f5284011cdcb4ecc3f4f47162d5335b5f721 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 11:43:35 +0200 Subject: [PATCH 41/46] 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 24fa54611c1..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 f4bbf716f07953ee9946b942d18ee84827a86607 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 12:20:23 +0200 Subject: [PATCH 42/46] 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 | 3 +- css/src/components/paper.css | 2 +- js/src/components/SnippetPreviewSection.js | 2 - 10 files changed, 74 insertions(+), 62 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 14fb1fc40db..809418ffef0 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 f9ec5242632..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 3d90783a90d..0a2aa16787a 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 { @@ -51,4 +50,4 @@ position: absolute; left: -20px; top: 5px; -} \ No newline at end of file +} diff --git a/css/src/components/paper.css b/css/src/components/paper.css index 27dffbf28d1..ea35e87356e 100644 --- a/css/src/components/paper.css +++ b/css/src/components/paper.css @@ -3,7 +3,7 @@ padding: 16px 16px 0; box-shadow: var(--yoast-shadow-default); border: var(--yoast-border-default); - max-width: 600px; + max-width: var(--yoast-container-width); position: relative; box-sizing: border-box; margin: 0 auto 16px; diff --git a/js/src/components/SnippetPreviewSection.js b/js/src/components/SnippetPreviewSection.js index 9a439291d89..3993f6cc5ae 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; padding-bottom: 16px; From 9e543cc059f59bbdbba7bb60daa686e55c7f024b Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 12:24:31 +0200 Subject: [PATCH 43/46] 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 87eb5ba3189d8f0abbb43ceab6ec2cf82afb5a70 Mon Sep 17 00:00:00 2001 From: Jip Date: Fri, 3 Jul 2020 13:35:47 +0200 Subject: [PATCH 44/46] 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(); - ?> -
-