Remove validation handling option#3545
Conversation
|
|
||
| <?php if ( $forced_sanitization ) : ?> | ||
| <div class="notice notice-info notice-alt inline"> | ||
| <p><?php esc_html_e( 'Your install is configured via a theme or plugin to automatically sanitize any AMP validation error that is encountered.', 'amp' ); ?></p> |
There was a problem hiding this comment.
@westonruter Is this information still needed? This comes from a different filter: 'amp_validation_error_sanitized'.
There was a problem hiding this comment.
Good question. No, this is not needed anymore because it was only needed to explain why the checkbox is not displayed. Now that we are getting rid of the checkbox, there is no need for it.
| } elseif ( AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === $template_mode ) { | ||
| $message = sprintf( | ||
| /* translators: %s is a link to the AMP settings screen */ | ||
| __( 'The site is using transitional AMP mode without auto-sanitization, the validation errors found require action and influence which pages are shown in AMP. For automatically handling the errors turn on auto-sanitization from <a href="%s">Validation Handling settings</a>.', 'amp' ), |
There was a problem hiding this comment.
@westonruter Do we still need a notice/description to explain how transitional mode works?
There was a problem hiding this comment.
Not here I think. I was never super happy with how we ended up adding permanent notices to the compatibility tool screens. I think the mode description should be restricted to the settings screen, or else explain contextually for each validated URL that AMP is not going to be available on it. Although we do have this to some degree currently:
| esc_url( admin_url( 'admin.php?page=' . AMP_Options_Manager::OPTION_NAME ) ) | ||
| ); | ||
| } else { | ||
| $message = __( 'The site is using AMP reader mode, your theme templates are not used and the errors below are irrelevant.', 'amp' ); |
There was a problem hiding this comment.
@westonruter Do we still need a notice/description to explain how reader mode works?
There was a problem hiding this comment.
The compatibility tool isn't directly accessible in Reader mode, so such users most likely won't even land here. Otherwise, the information about the modes should be fleshed out on the settings screen, IMO.
* Supply boolean as first arg to filter, unconditional based on mode. * Remove now-unnecessary special cade auto-acceptance logic for stories. * Update plugin version references from 1.3.1 to 1.4. * Add phpdoc.
|
|
||
| <?php if ( $forced_sanitization ) : ?> | ||
| <div class="notice notice-info notice-alt inline"> | ||
| <p><?php esc_html_e( 'Your install is configured via a theme or plugin to automatically sanitize any AMP validation error that is encountered.', 'amp' ); ?></p> |
There was a problem hiding this comment.
Good question. No, this is not needed anymore because it was only needed to explain why the checkbox is not displayed. Now that we are getting rid of the checkbox, there is no need for it.
| } elseif ( AMP_Theme_Support::TRANSITIONAL_MODE_SLUG === $template_mode ) { | ||
| $message = sprintf( | ||
| /* translators: %s is a link to the AMP settings screen */ | ||
| __( 'The site is using transitional AMP mode without auto-sanitization, the validation errors found require action and influence which pages are shown in AMP. For automatically handling the errors turn on auto-sanitization from <a href="%s">Validation Handling settings</a>.', 'amp' ), |
There was a problem hiding this comment.
Not here I think. I was never super happy with how we ended up adding permanent notices to the compatibility tool screens. I think the mode description should be restricted to the settings screen, or else explain contextually for each validated URL that AMP is not going to be available on it. Although we do have this to some degree currently:
| esc_url( admin_url( 'admin.php?page=' . AMP_Options_Manager::OPTION_NAME ) ) | ||
| ); | ||
| } else { | ||
| $message = __( 'The site is using AMP reader mode, your theme templates are not used and the errors below are irrelevant.', 'amp' ); |
There was a problem hiding this comment.
The compatibility tool isn't directly accessible in Reader mode, so such users most likely won't even land here. Otherwise, the information about the modes should be fleshed out on the settings screen, IMO.
|
Nice work. This is a great and sweeping change. |

Summary
auto_accept_sanitizationoptionAMP_Validation_Manage::is_sanitization_auto_accepted()filterable viaamp_validation_error_default_sanitized. See https://gist.github.com/westonruter/c1496d668b2a73a44aa423e6547a59b7.Fixes #3350.
Checklist