Skip to content

Commit

Permalink
Fixed Googel Search bug. 4.0.3 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
sybrew committed Nov 11, 2019
1 parent efbea05 commit 4be3f63
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 67 deletions.
2 changes: 1 addition & 1 deletion autodescription.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: The SEO Framework
* Plugin URI: https://theseoframework.com/
* Description: An automated, advanced, accessible, unbranded and extremely fast SEO solution for your WordPress website.
* Version: 4.0.3-dev-2
* Version: 4.0.3
* Author: The SEO Framework Team
* Author URI: https://theseoframework.com/
* License: GPLv3
Expand Down
17 changes: 17 additions & 0 deletions inc/classes/generate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,23 @@ public function robots_meta( $args = null, $ignore = 0b00 ) {
as $k => $v
) false !== $v and $meta[ $k ] = str_replace( '_', '-', $k ) . ":$v";

/**
* Drop-in Google Search bug patch.
* "When you combine "max-image-preview:none" with either "nofollow" or "noarchive", the page is marked as "noindex"!"
*
* (It's probably defined as `<meta name=robots content=none/>` due to a regex bug at Google)
*
* @link <https://twitter.com/SybreWaaijer/status/1192017921553375232>
* @link <https://kb.theseoframework.com/?p=82>
* @since 4.0.3
* @ignore Do not fix me. Do not place after the filter either; that's redundant, because there are more filters trickling down.
* @TEMP
*/
if ( 'max-image-preview:none' === $meta['max_image_preview'] ) {
if ( $meta['nofollow'] || $meta['noarchive'] )
$meta['max_image_preview'] = '';
}

/**
* Filters the front-end robots array, and strips empty indexes thereafter.
*
Expand Down
16 changes: 14 additions & 2 deletions inc/views/admin/metaboxes/robots-metabox.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@
$this->wrap_fields(
vsprintf(
'<p><label for="%1$s"><strong>%2$s</strong> %5$s</label></p>
<p><select name="%3$s" id="%1$s">%4$s</select></p>',
<p><select name="%3$s" id="%1$s">%4$s</select></p>
<p class=description>%6$s</p>',
[
$this->get_field_id( 'max_snippet_length' ),
esc_html__( 'Maximum text snippet length', 'autodescription' ),
Expand All @@ -161,6 +162,7 @@
'',
false
),
esc_html__( "This directive also imposes a limit on meta descriptions and structured data, which unintentionally restricts the amount of information you can share. Therefore, it's best to use at least a 320 character limit.", 'autodescription' ),
]
),
true
Expand All @@ -186,7 +188,8 @@
$this->wrap_fields(
vsprintf(
'<p><label for="%1$s"><strong>%2$s</strong> %5$s</label></p>
<p><select name="%3$s" id="%1$s">%4$s</select></p>',
<p><select name="%3$s" id="%1$s">%4$s</select></p>
<p class=description>%6$s</p>',
[
$this->get_field_id( 'max_image_preview' ),
esc_html__( 'Maximum image preview size', 'autodescription' ),
Expand All @@ -197,6 +200,15 @@
'',
false
),
$this->convert_markdown(
sprintf(
/* translators: Backticks and hyperlink are Markdown! %s = link to documentation. */
esc_html__( 'The "None, disallow preview" setting will not be used when `nofollow` or `noarchive` are set for a page. This is to work around unexpected deindexing behavior in Google Search. [Learn more](%s).', 'autodescription' ),
'https://kb.theseoframework.com/kb/why-is-max-image-preview-none-purged/'
),
[ 'code', 'a' ],
[ 'a_external' => true ]
),
]
),
true
Expand Down
69 changes: 42 additions & 27 deletions language/autodescription.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the same license as the The SEO Framework package.
msgid ""
msgstr ""
"Project-Id-Version: The SEO Framework 4.0.2\n"
"Project-Id-Version: The SEO Framework 4.0.3\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/autodescription\n"
"POT-Creation-Date: 2019-10-15 01:19:53+00:00\n"
"POT-Creation-Date: 2019-11-11 17:46:56+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -164,33 +164,33 @@ msgstr ""
msgid "Multiple SEO tools have been detected. You should only use one."
msgstr ""

#: inc/classes/admin-pages.class.php:385
#: inc/classes/admin-pages.class.php:390
msgid "Dismiss this notice"
msgstr ""

#: inc/classes/admin-pages.class.php:1036
#: inc/classes/admin-pages.class.php:1041
#: inc/classes/bridges/scripts.class.php:621
msgctxt "Button hover"
msgid "Select social image"
msgstr ""

#: inc/classes/admin-pages.class.php:1047
#: inc/classes/admin-pages.class.php:1052
#: inc/classes/bridges/scripts.class.php:620
msgid "Select Image"
msgstr ""

#: inc/classes/admin-pages.class.php:1093
#: inc/classes/admin-pages.class.php:1098
#: inc/classes/bridges/scripts.class.php:629
msgid "Select Logo"
msgstr ""

#: inc/classes/admin-pages.class.php:1143
#: inc/classes/admin-pages.class.php:1148
msgid "Click to change the counter type"
msgstr ""

#. translators: %s = number

#: inc/classes/admin-pages.class.php:1146
#: inc/classes/admin-pages.class.php:1151
msgid "Characters Used: %s"
msgstr ""

Expand Down Expand Up @@ -1550,7 +1550,7 @@ msgid "This outputs the complete date including hours, minutes, and timezone."
msgstr ""

#: inc/views/admin/metaboxes/general-metabox.php:429
#: inc/views/admin/metaboxes/robots-metabox.php:301
#: inc/views/admin/metaboxes/robots-metabox.php:313
msgid "Post Type Settings"
msgstr ""

Expand All @@ -1567,7 +1567,7 @@ msgid "Select post types which should not receive any SEO optimization whatsoeve
msgstr ""

#: inc/views/admin/metaboxes/general-metabox.php:439
#: inc/views/admin/metaboxes/robots-metabox.php:303
#: inc/views/admin/metaboxes/robots-metabox.php:315
msgid "These settings are applied to the post type pages and their terms. When terms are shared between post types, all their post types should be checked for this to have an effect."
msgstr ""

Expand Down Expand Up @@ -1854,81 +1854,96 @@ msgstr[0] ""
msgstr[1] ""

#: inc/views/admin/metaboxes/robots-metabox.php:133
#: inc/views/admin/metaboxes/robots-metabox.php:217
#: inc/views/admin/metaboxes/robots-metabox.php:229
msgid "Standard directive"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:134
#: inc/views/admin/metaboxes/robots-metabox.php:218
#: inc/views/admin/metaboxes/robots-metabox.php:230
msgid "Granular directive"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:156
#: inc/views/admin/metaboxes/robots-metabox.php:157
msgid "Maximum text snippet length"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:160
#: inc/views/admin/metaboxes/robots-metabox.php:161
msgid "This may limit the text snippet length for all pages on this site."
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:172
#: inc/views/admin/metaboxes/robots-metabox.php:207
#: inc/views/admin/metaboxes/robots-metabox.php:165
msgid "This directive also imposes a limit on meta descriptions and structured data, which unintentionally restricts the amount of information you can share. Therefore, it's best to use at least a 320 character limit."
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:174
msgctxt "quanity: zero"
msgid "None, disallow preview"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:173
#: inc/views/admin/metaboxes/robots-metabox.php:175
msgid "Thumbnail or standard size"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:174
#: inc/views/admin/metaboxes/robots-metabox.php:176
msgid "Large or full size"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:192
#: inc/views/admin/metaboxes/robots-metabox.php:195
msgid "Maximum image preview size"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:196
#: inc/views/admin/metaboxes/robots-metabox.php:199
msgid "This may limit the image preview size for all images from this site."
msgstr ""

#. translators: Backticks and hyperlink are Markdown! %s = link to
#. documentation.

#: inc/views/admin/metaboxes/robots-metabox.php:206
msgid "The \"None, disallow preview\" setting will not be used when `nofollow` or `noarchive` are set for a page. This is to work around unexpected deindexing behavior in Google Search. [Learn more](%s)."
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:218
msgid "Full video preview"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:219
msgctxt "quanity: zero"
msgid "None, still image only"
msgstr ""

#. translators: %d = number

#: inc/views/admin/metaboxes/robots-metabox.php:211
#: inc/views/admin/metaboxes/robots-metabox.php:223
msgid "%d second"
msgid_plural "%d seconds"
msgstr[0] ""
msgstr[1] ""

#: inc/views/admin/metaboxes/robots-metabox.php:240
#: inc/views/admin/metaboxes/robots-metabox.php:252
msgid "Maximum video preview length"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:244
#: inc/views/admin/metaboxes/robots-metabox.php:256
msgid "This may limit the video preview length for all videos on this site."
msgstr ""

#. translators: 1 = noindex/nofollow/noarchive, 2 = Post, Post type, Category
#. archives, the entire site, etc.

#: inc/views/admin/metaboxes/robots-metabox.php:259
#: inc/views/admin/metaboxes/robots-metabox.php:271
msgid "Apply %1$s to %2$s?"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:264
#: inc/views/admin/metaboxes/robots-metabox.php:276
msgid "Robots Settings"
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:289
#: inc/views/admin/metaboxes/robots-metabox.php:301
msgid "Warning: No public site should ever enable this option."
msgstr ""

#: inc/views/admin/metaboxes/robots-metabox.php:308
#: inc/views/admin/metaboxes/robots-metabox.php:320
msgid "Warning: No site should enable these options for Posts and Pages."
msgstr ""

Expand Down
45 changes: 8 additions & 37 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
=== The SEO Framework ===
Contributors: Cybr
Tags: SEO, XML Sitemap, Google, Open Graph, Schema.org, Twitter
Tags: seo, xml sitemap, google search, open graph, schema.org, twitter card, performance
Requires at least: 4.9.0
Tested up to: 5.3
Requires PHP: 5.6.0
Stable tag: 4.0.2
Stable tag: 4.0.3
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -188,7 +188,7 @@ We'll try to get back to you within 72 hours. Typically, we reply within a day.
Any input is much appreciated, and everything will be considered.
Please visit the [GitHub project page](https://github.com/sybrew/the-seo-framework) to submit issues or even pull requests.

Learn more [about contribute](https://tsf.fyi/contributing).
Learn more [about contributing](https://tsf.fyi/contributing).

= What do the colors tell me? =

Expand Down Expand Up @@ -229,40 +229,11 @@ If you wish to display breadcrumbs, then your theme should provide this. Alterna

= 4.0.3 =

**For everyone**

* **Improved:**
* **Accessibility:**
* Focussing an SEO Bar item will now add a high-contrast inner-ring.
* You can now dismiss notices with your keyboard, by hitting "return".
* **Styling:**
* In response to the WP 5.3 update, we rounded the tabs on the settings page. Enjoy!
* We added support for "info" notice types.
* The dismiss icon is now centered better for most notifications.
* **PHP:** We alleviated one deprecation notice with the upcoming PHP v7.4 update.
* **Performance:** The Google and Bing sitemap pinging URLs now enforce HTTPS. So, we updated the pinging URLs to prevent a redirect.
* **Other:** On upgrade, the plugin now tests for the WordPress version for compatibility, instead of the WordPress database version.
* **Compatibility:** The primary term selection for WooCommerce's products is now respected for both the link and breadcrumbs output.
* **Other:**
* **For the copyright directive brought in v4.0.2:**
* An option for videos was wrongly described as "None, disallow preview"; it should've been "None, still image only".
* The output was done in a non-Google way; yet, due to standards, it was still effective.
* TODO The output seems to affect other meta tags, such as the description meta tag. As such, we added a warning next to the text-snippet limit.
* TODO We disabled the "none" option for the restrictive image directive, because there's a bug on Google Search that makes it conflict with `nofollow` and `noarchive`.
* For more information, see [this tweet](https://twitter.com/SybreWaaijer/status/1192017921553375232).
* **Fixed:**
* Empty terms can now be asserted for post type support again. With that, for example, redirects from empty categories works again.
* On RTL-enabled websites, the save buttons are alligned correctly again.

**For translators**

* **Updated:**
* We added and updated a few strings.
* TODO The POT translation file.

**For developers**

* `the_seo_framework()->convert_markdown()` now handles nested strong/em conversions gracefully.
Google Search has a new bug in their parser, which causes pages to be deindexed unintentionally when a specific combination of robots-settings are used. To work around this bug, we changed how the recently introduced copyright directive settings work.

For more information, see our KB entry on why the [Maximum Image Preview Size setting may now be ignored](https://kb.theseoframework.com/?p=82).

We also fixed three bugs and added [minor improvements](https://theseoframework.com/?p=3379#detailed).

= 4.0.2 =

Expand Down

1 comment on commit 4be3f63

@sybrew
Copy link
Owner Author

@sybrew sybrew commented on 4be3f63 Nov 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, that'd be Google, not Googel. 😅

Please sign in to comment.