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

[WIP] Add AMP_Script_Sanitizer to automatically detect and replace known scripts #1127

Closed
wants to merge 5 commits into from

Conversation

amedina
Copy link
Member

@amedina amedina commented May 7, 2018

WordPress users very commonly add script tags to Custom HTML widgets and directly to theme templates to show ads, add analytics, etc. Assuming that the vast majority of these scripts are very templated (e.g. including via Google Tag Manager), then it should be possible to reliably identify each script and extract the relevant information to convert to AMP. This pull request addresses this.

Fixes #1032

@amedina amedina changed the title [WIP] Add AMP_Script_Sanitizer class and register it [WIP] Add AMP_Script_Sanitizer to automatically detect and replace known scripts May 30, 2018
@postphotos
Copy link
Contributor

Hi @amedina, this is a great idea and should help many sites as they enable AMP! Thanks for sharing this PR.

@swissspidy
Copy link
Collaborator

Just stumbled upon this and realized that the Site Kit plugin has similar script detection for Google Analytics and Google Tag Manager. So there is some overlap at the moment.

@westonruter
Copy link
Member

@swissspidy I don't think this is going to go anywhere, since it is not scalable. Better to let Site Kit and other plugins focus on their respective domains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add script sanitizer to convert the most common scripts to AMP
4 participants