Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor storage of validation errors to use taxonomy terms #1093

Merged
merged 58 commits into from
May 29, 2018

Commits on Apr 30, 2018

  1. Configuration menu
    Copy the full SHA
    2d5a341 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1105fe3 View commit details
    Browse the repository at this point in the history
  3. Add filtering of validation errors by status

    * Add get_validation_error_count() method.
    * Add removable_query_args to prevent persisting on page
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    36cf381 View commit details
    Browse the repository at this point in the history
  4. Add views for filtering invalid URLs by which contain specific error …

    …statuses
    
    * Add recognition of amp_validation_error_status query var for amp_invalid_url post queries.
    * Indicate in the list of errors on a given invalid URL post which are new, ignored, or acknowledged.
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    044d3c2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    95487df View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    212171f View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    65999ea View commit details
    Browse the repository at this point in the history
  8. Ensure checkboxes for validation error terms are always shown; block …

    …deletion of non-zero-count terms
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    c482b37 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    a6d2f70 View commit details
    Browse the repository at this point in the history
  10. Hide irrelevant published status from invalid URL post list

    Add query vars to removable list
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    546c163 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    52f4cdd View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8f31472 View commit details
    Browse the repository at this point in the history
  13. Remove scheme/host from invalid AMP URLs in list table; show URL as h…

    …eading on edit post screen
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    1e1516d View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    1cb4a69 View commit details
    Browse the repository at this point in the history
  15. Only show count of new validation errors that have associated URLs in…

    … admin menu
    
    Improve column widths for validation errors; hide overflow for details
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    aadadaf View commit details
    Browse the repository at this point in the history
  16. Remove script dependency object from enqueued_script validation error

    The before/after inline data is too variable and can cause many duplicate validation errors to accumulate
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    f885262 View commit details
    Browse the repository at this point in the history
  17. Prevent showing AMP validation notice on edit post screen when all va…

    …lidation errors have been ignored
    
    * Eliminate duplicated logic parsing post_content to obtain validation errors.
    * Change "Details" link to "Review Errors" link in edit post screen notice; explain impact of having non-ignored AMP validation errors. Add debug link to notice in Gutenberg.
    * Add debug_link to amp_validity REST field.
    * Introduce get_invalid_url_validation_errors method as model getter.
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    7af2db5 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    03bf406 View commit details
    Browse the repository at this point in the history
  19. Allow the validation_error_callback to return false to prevent saniti…

    …zation where relevant
    
    * Move debug code into AMP_Validation_Utils class.
    * Remove disable_invalid_removal sanitizer arg in favor of validation_error_callback
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    c5e4202 View commit details
    Browse the repository at this point in the history
  20. Improve handling of validation errors in style sanitizer

    * Run amp_content_sanitizers filter late to apply after sanitizers have been added.
    * Wrap any existing validation_error_callback functions which have been supplied to do the handling of the validation error.
    * Pass flag to style sanitizer to locate_sources to ensure sources are available for reporting when they'll be needed.
    * Add handle_validation_error and set_current_node methods to reduce duplication.
    * Fix inclusion of property_value in validation_error.
    * Pass debug flag to AMP_Validation_Utils upon init.
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    3916d2e View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    fd22331 View commit details
    Browse the repository at this point in the history
  22. Preserve validation error sources when coming from multiple origins

    * A validation error (like an enqueued script) can come from multiple sources, so these need to be stored separately from the validation error itself. Additionally, the sources will not be available when doing validation at runtime.
    * Move storage of sources from term meta to the invalid URL post, where the actual error occurs.
    * Remove sources column from validation error term list table. Remove now-invalid searching from term meta.
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    5341f2b View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    efc6661 View commit details
    Browse the repository at this point in the history
  24. Improve handling of validation errors for enqueued scripts

    * Eliminate enqueued_script validation error in favor of merging sources into invalid_element errors
    * Add source information for inline scripts attached to enqueued scripts.
    * Account for enqueueing script bundles (where src is false).
    * Capture inline script contents in validation errors. Fixes #1031.
    westonruter committed Apr 30, 2018
    Configuration menu
    Copy the full SHA
    8348190 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2018

  1. Prevent serving AMP when there are non-sanitized validation errors

    * Automatically redirect to non-AMP version when validation errors aren't sanitized
    * Remove amp attribute when in canonical
    * Introduce AMP_Base_Sanitizer::should_sanitize_validation_error() which is responsible for preparing validation error and calling validation_error_callback.
    * Add amp_validation_error filter for plugins to customize the properties in a validation error for a given node.
    * Add amp_validation_error_sanitized filter so plugins can customization whether a given validation error should be sanitized.
    * Keep track of whether a validation error was sanitized, and return whether there are any non-sanitized validation errors via AMP_Validation_Utils::has_blocking_validation_errors().
    * Introduce AMP_Base_Sanitizer::prepare_validation_error() for each sanitizer to have control over how its validation errors are constructed.
    * Call add_validation_callback unconditionally instead of adding via filters.
    * Simplify AMP_Base_Sanitizer::remove_invalid_child() and AMP_Base_Sanitizer::remove_invalid_attribute() now that validation_error_callback is always present.
    * Warn and delete validation_error_callback arg passed into prepare_response.
    * Add $exit param to AMP_Theme_Support::redirect_canonical_amp() for use in output buffer callback.
    * Update dev-lib to fix trailing-slash problem with directory constants.
    * Remove obsolete SCRIPTS_PLACEHOLDER constant.
    westonruter committed May 2, 2018
    Configuration menu
    Copy the full SHA
    85989eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    159d808 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2018

  1. Configuration menu
    Copy the full SHA
    7048994 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c0d724 View commit details
    Browse the repository at this point in the history

Commits on May 22, 2018

  1. Split up AMP_Validation_Utils into AMP_Validation_Manager, AMP_Invali…

    …d_URL_Post_Type, and AMP_Validation_Error_Taxonomy
    westonruter committed May 22, 2018
    Configuration menu
    Copy the full SHA
    99759b0 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2018

  1. Prevent redirecting to canonical when doing validation of paired AMP

    * Pass missing node when reporting excessive_css validation error
    * Fix accumulation of validation errors.
    * Handle case where sources are null in get_invalid_url_validation_errors().
    * Make sure sources are always excluded when computing term slug.
    * Defer adding widget callbacks to when widgets are registered.
    * Remove majority of messages from validation errors to allow then to be dynamically computed later.
    * Normalize illegal_css_at_rule validation errors.
    * Improve unrecognized_css validation errors.
    westonruter committed May 23, 2018
    Configuration menu
    Copy the full SHA
    de5c323 View commit details
    Browse the repository at this point in the history

Commits on May 25, 2018

  1. Configuration menu
    Copy the full SHA
    c9a33b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d30ab72 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    13c14a9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    71d36e7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4cf66ba View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9dde322 View commit details
    Browse the repository at this point in the history
  7. Remove debug links since not helpful; let view links include param to…

    … prevent auto-redirect to non-AMP version
    westonruter committed May 25, 2018
    Configuration menu
    Copy the full SHA
    9a79f05 View commit details
    Browse the repository at this point in the history

Commits on May 26, 2018

  1. Configuration menu
    Copy the full SHA
    932ec66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a92355 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c58f897 View commit details
    Browse the repository at this point in the history

Commits on May 27, 2018

  1. Eliminate debug param in favor of explicitly requesting to preserve s…

    …ource comments
    
    * Introduce amp_preserve_source_comments query param.
    * Rename locate_sources arg to should_locate_sources.
    * Remove debug flag for preventing sanitization on all validation errors.
    * Rename add_validation_hooks method to add_validation_error_sourcing.
    westonruter committed May 27, 2018
    Configuration menu
    Copy the full SHA
    e00e16d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6cd5e7e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9d159d5 View commit details
    Browse the repository at this point in the history
  4. Prevent cached stylesheet validation errors from being reported twice…

    … when sanitization status changes
    westonruter committed May 27, 2018
    Configuration menu
    Copy the full SHA
    7869b63 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1f315a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    85a0585 View commit details
    Browse the repository at this point in the history
  7. Remove process_markup method from validation manager

    Fix additional static analysis issues
    westonruter committed May 27, 2018
    Configuration menu
    Copy the full SHA
    7c0a02d View commit details
    Browse the repository at this point in the history
  8. Eliminate cookie authentication requirement to do frontend validation

    Allow passing nonce instead of auth cookie to with amp_validate requests.
    westonruter committed May 27, 2018
    Configuration menu
    Copy the full SHA
    90eff4f View commit details
    Browse the repository at this point in the history

Commits on May 28, 2018

  1. Configuration menu
    Copy the full SHA
    69055c0 View commit details
    Browse the repository at this point in the history
  2. Add previewability to validation error status changes for invalid URL

    Let statuses be changed in bulk on invalid URL screen
    westonruter committed May 28, 2018
    Configuration menu
    Copy the full SHA
    f17df99 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2018

  1. Vary parsed stylesheet cache by validation error status overrides

    * Use wp_json_encode() instead or serialize().
    * Ensure window opened for previewing validation error term status changes to have consistent name.
    * Use VALIDATION_ERROR_TERM_STATUS_QUERY_VAR constant.
    westonruter committed May 29, 2018
    Configuration menu
    Copy the full SHA
    f960f62 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    439bca5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f29eaa2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c3db57e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2b1985a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a4312b4 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cfa8bf5 View commit details
    Browse the repository at this point in the history
  8. Combine isset() checks

    westonruter committed May 29, 2018
    Configuration menu
    Copy the full SHA
    543b935 View commit details
    Browse the repository at this point in the history