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

Fix/864 remove sizes #1045

Closed
wants to merge 216 commits into from

Conversation

mehigh
Copy link
Contributor

@mehigh mehigh commented Mar 29, 2018

No description provided.

Ryan Kienstra and others added 30 commits February 16, 2018 22:20
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
westonruter and others added 28 commits March 17, 2018 14:55
…_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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants