-
Notifications
You must be signed in to change notification settings - Fork 384
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
Fix/864 remove sizes #1045
Closed
mehigh
wants to merge
216
commits into
ampproject:fix/864-remove-sizes
from
xwp:fix/864-remove-sizes
Closed
Fix/864 remove sizes #1045
mehigh
wants to merge
216
commits into
ampproject:fix/864-remove-sizes
from
xwp:fix/864-remove-sizes
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If a <script> or stylesheet gets removed, store it in $removed_assets. There isn't yet a way to report inline scripts. Like <script type="text/javascript">myFunc();</script>. This uses the 'src' attribute to find the plugin or theme.
Iterate through all of the registered callbacks. If a callback is from a plugin and outputs markup, wrap the markup in comments. Later, the sanitizer can identify which plugin any illegal markup is from. Thanks to @westonruter for this strategy.
Also, address a Travis error. Instead of testing for the presence of 'amp-wp,' simply make it 'amp.' This plugin seems to be in the directory 'amp-wp' in the Travis tests.
The plugin is in 'amp-wp' in some Travis tests. So instead of expecting the plugin to be 'amp,' Simply expect it to contain 'amp.'
Add an extra parameter to track_removed(). If $source is passed, store that. Then, if a node is removed, look for the presence of $source.
If the query var of 'validate' is present, Output the previous validation response, like on the post.php page. But also add a 'plugins_with_invalid_output' value. This includes all of the plugins that output markup which had removed elements or attributes.
This might have caused issues, as the order of assignment is different in PHP 7.0. So insted, access the array values.
Substitute all uses of 'remove_invalid_callback' With AMP_Validation_Utils::CALLBACK_KEY.
Mainly use the logic in WP_Hook::apply_filters(). This accounts for the number of accepted args.
In the PHPUnit test class, there's no need to declare the methods statically. Also, this adds assertions for a plugin function that doesn't output anything.
Also, remove add_header(). Adding a response header isn't part of the plan.
After the preprocessors have run, get the validation response. If a plugin output invalid markup, store the response in a custom post type.
Also, add more conditions for updating the error post. If there's already an error post, but there's no error anymore delete the post.
Previously, this was post_type(). Also, pass false as the value for 'public.'
Previously, this was do_validate_front_end(). As Weston mentioned, this is more clear.
Props @westonruter. Only call set_plugin_output() if it's a commment.
Props @westonruter. This also needs to account for themes and mu-plugins.
Before, this was $current_plugin_output. This needs to account for themes and plugins.
On Weston's suggestion, as this can track nested plugins in themes. Also, update PHPUnit tests for this.
At Weston's suggestion, as this needs to apply to themes.
As Weston suggested, started with add_post_meta(). If that is false, get the post meta, And append the new URL to the array.
At Weston's suggestion. For example, <!--before:plugin:amp-->
The means of doing this might need improvement. But this uses regexes, based on the paths to the theme, plugin, and mu-plugin dirs.
In Travis, this plugin is cloned as 'amp-wp'. But developers usually clone it as 'amp'. So remove the '-wp', to avoid errors in Travis.
Mostly resolve in favor of develop. But apply some changes from branch add/842-plugin-validation. Like the constant AMP_Validation_Utils::CALLBACK_KEY, instead of 'remove_invalid_callback'.
…comment markers Fix phpcs in AMP_Base_Sanitizer_Test
This reverts commit a5eeba0.
…OneClassPerFile.MultipleFound
Fix various PHPCS issues
This reverts commit 0c6bd93.
This reverts commit c7c227b.
…_core_blocks_support [Gutenberg] Fix issues with rendering native blocks
Consistently use wp_parse_url(); deprecate AMP_WP_Utils
* Explicitly limit handle_xhr_request to POST requests. * Make sure original status header is sent back in wp_die() call. * Fix reading of amp theme support flag since get_theme_support() returns an array of args. * Add missing paragraph surrounding success message template. * Fix moderation comment to ensure default core string is re-used. * Fix PHP notice in regards to additional comment_live_list theme support flag being present. * Remove obsolete comments. * Simplify success message. * Add phpdoc for amp_comment_posted_message filter. * Pass back success message in same way as error message is returned as named variable. * Add missing tests and introduce \AMP_Theme_Support::send_header() to avoid having to runInSeparateProcess.
Improve default status_code handling
…list-opt-in Do redirect if amp comments_live_list support is not declared; vary comment success message by approval status
Fix enqueueing amp-runtime and handling comment submissions in paired mode
# Conflicts: # includes/class-amp-theme-support.php # tests/test-class-amp-base-sanitizer.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.