ampproject / amp-wp

Enable AMP on your WordPress site, the WordPress way.
https://wordpress.org/plugins/amp/
GNU General Public License v2.0
1.79k stars 383 forks source link

TikTok AMP CDN script tag output missing #6637

Closed juniormiranda89 closed 3 years ago

juniormiranda89 commented 3 years ago

Bug Description

The TikTok scipt tag mapping class (like ScriptAmpTwitter) is missing.

Expected Behaviour

This issue is avoiding our Node.js app to render the <script async custom-element="amp-tiktok" src="https://cdn.ampproject.org/v0/amp-tiktok-0.1.js"></script> tag in the header.

Screenshots

No response

PHP Version

7.2

Plugin Version

2.1.4

AMP plugin template mode

Standard, Transitional

WordPress Version

5.8.1

Site Health

wp-core

version: 5.8.1 site_language: pt_BR user_language: pt_BR timezone: America/Fortaleza permalink: /%category%/%postname% https_status: true multisite: false user_registration: 0 blog_public: 1 default_comment_status: open environment_type: production user_count: 16 dotorg_communication: true

wp-paths-sizes

wordpress_path: /var/www/html/wordpress wordpress_size: 48,96 MB (51340880 bytes) uploads_path: /var/www/html/wp-content/uploads uploads_size: 11,05 GB (11864865732 bytes) themes_path: /var/www/html/wp-content/themes themes_size: 28,15 MB (29520571 bytes) plugins_path: /var/www/html/wp-content/plugins plugins_size: 121,48 MB (127386127 bytes) database_size: 705,16 MB (739414884 bytes) total_size: 11,93 GB (12812528194 bytes)

wp-dropins (2)

advanced-cache.php: true object-cache.php: true

wp-active-theme

name: ObX Child (obx-child) version: 1.0.0 author: Anônimo author_website: (undefined) parent_theme: ObX (obx-theme) theme_features: core-block-patterns, widgets-block-editor, automatic-feed-links, title-tag, post-thumbnails, menus, html5, Custom-background, customize-selective-refresh-widgets, custom-logo, custom-header, widgets theme_path: /var/www/html/wp-content/themes/obx-child auto_update: Desativado

wp-parent-theme

name: ObX (obx-theme) version: 1.0.0-alpha.11 author: Eliel Valença author_website: https://elielv.dev/ theme_path: /var/www/html/wp-content/themes/obx-theme auto_update: Desativado

wp-plugins-active (19)

Advanced Custom Fields: version: 5.10.2, author: Delicious Brains, Atualizações automáticas desativadas All in One SEO Pro: version: 4.1.4.4, author: All in One SEO Team, Atualizações automáticas desativadas AMP: version: 2.1.4, author: AMP Project Contributors, Atualizações automáticas desativadas Disney Plus Sanitization: version: 2.0, author: ESVA Digital, Atualizações automáticas desativadas Elementor: version: 3.4.4, author: Elementor.com, Atualizações automáticas desativadas Elementor Pro: version: 3.4.1, author: Elementor.com, Atualizações automáticas desativadas EWWW Image Optimizer: version: 6.2.5, author: Exactly WWW, Atualizações automáticas desativadas NextScripts: SNAP Pro Upgrade Helper: version: 1.5.10, author: NextScripts, Atualizações automáticas desativadas NextScripts: Social Networks Auto-Poster: version: 4.3.20, author: NextScripts (latest version: 4.3.21), Atualizações automáticas desativadas Observatório de Séries Taxonomias: version: 1.0.0, author: Grupo Observatório, Atualizações automáticas desativadas ObX API: version: 1.0.0, author: ESVA, Atualizações automáticas desativadas ObX Static Purge: version: 1.0.0, author: Eliel Valença, Atualizações automáticas desativadas oEmbed Plus: version: 1.6, author: Ayesh Karunaratne, Atualizações automáticas desativadas Redirection: version: 5.1.3, author: John Godley, Atualizações automáticas desativadas Star Plus Sanitization: version: 2.0, author: ESVA Digital, Atualizações automáticas desativadas W3 Total Cache: version: 2.1.8, author: BoldGrid, Atualizações automáticas desativadas Web Stories: version: 1.11.0, author: Google, Atualizações automáticas desativadas WordPress Importer: version: 0.7, author: wordpressdotorg, Atualizações automáticas desativadas Yoast Duplicate Post: version: 4.1.2, author: Enrico Battocchi & Team Yoast, Atualizações automáticas desativadas

wp-plugins-inactive (6)

Delete All Comments of wordpress: version: 4.1, author: Navneet Soni, Atualizações automáticas desativadas Instant Articles for WP: version: 4.2.1, author: Automattic, Dekode, Facebook, Atualizações automáticas desativadas Site Kit by Google: version: 1.42.0, author: Google, Atualizações automáticas desativadas Taxonomy Converter: version: 1.3, author: kristarella, Atualizações automáticas desativadas Term Management Tools: version: 2.0.1, author: theMikeD, scribu, Atualizações automáticas desativadas WP Crontrol: version: 1.10.0, author: John Blackbourn & crontributors, Atualizações automáticas desativadas

wp-media

image_editor: EWWWIO_Imagick_Editor imagick_module_version: 1687 imagemagick_version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org imagick_version: 3.4.4 file_uploads: File uploads is turned off post_max_size: 50M upload_max_filesize: 50M max_effective_size: 50 MB max_file_uploads: 20 gd_version: 2.3.0 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: unknown

wp-server

server_architecture: Linux 5.4.0-1030-aws x86_64 httpd_software: nginx/1.14.0 php_version: 7.2.34-8+ubuntu18.04.1+deb.sury.org+1 64bit php_sapi: fpm-fcgi max_input_variables: 4000 time_limit: 300 memory_limit: 256M max_input_time: 300 upload_max_filesize: 50M php_post_max_size: 50M curl_version: 7.58.0 OpenSSL/1.1.1g suhosin: false imagick_availability: true pretty_permalinks: true

wp-database

extension: mysqli server_version: 5.7.25-log client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 3591daad22de08524295e1bd073aceeff11e6579 $

wp-constants

WP_HOME: https://observatoriodeseries.uol.com.br WP_SITEURL: https://observatoriodeseries.uol.com.br/wordpress WP_CONTENT_DIR: /var/www/html/wp-content WP_PLUGIN_DIR: /var/www/html/wp-content/plugins WP_MEMORY_LIMIT: 256M WP_MAX_MEMORY_LIMIT: 256M WP_DEBUG: false WP_DEBUG_DISPLAY: true WP_DEBUG_LOG: true SCRIPT_DEBUG: false WP_CACHE: true CONCATENATE_SCRIPTS: undefined COMPRESS_SCRIPTS: undefined COMPRESS_CSS: undefined WP_LOCAL_DEV: undefined DB_CHARSET: utf8 DB_COLLATE: undefined

wp-filesystem

wordpress: writable wp-content: writable uploads: writable plugins: writable themes: writable

aioseo (1)

noindexed: Author Archives, Date Archives, Categorias (category)

amp_wp

amp_slug_query_var: amp amp_slug_defined_late: false amp_mode_enabled: standard amp_reader_theme: legacy amp_templates_enabled: is_singular, is_404 amp_serve_all_templates: false amp_css_transient_caching_disabled: n/a amp_css_transient_caching_threshold: 5000 transients per day amp_css_transient_caching_sampling_range: 14 days amp_css_transient_caching_transient_count: undefined amp_css_transient_caching_time_series: amp_libxml_version: 2.9.10

web_stories

web_stories_version: 1.11.0 web_stories_db_version: 3.0.11 web_stories_amp_version: 2.1.4 web_stories_cdn_url: https://wp.stories.google/static/12 web_stories_dev_mode: false web_stories_theme_support: Desabilitado web_stories_enabled_experiments: Right click menus: Ativado Eyedropper: Ativado Video Cache: Ativado web_stories_libxml_version: 2.9.10

Gutenberg Version

No response

OS(s) Affected

No response

Browser(s) Affected

No response

Device(s) Affected

No response

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

westonruter commented 3 years ago

Hi. I don't understand what the problem is. You're using an amp-tiktok element in the page but the AMP CDN script for it is not getting output?

juniormiranda89 commented 3 years ago

Hi, @westonruter.

It's exactly this.

All the other AMP CDN scripts (like amp-twitter) is getting output when needed, except the amp-tiktok script.

westonruter commented 3 years ago

Please share the <amp-tiktok> code you're putting on the page.

westonruter commented 3 years ago

I tried adding this to a Custom HTML block:

<amp-tiktok
  width="325"
  height="575"
  data-src="6718335390845095173"
></amp-tiktok>

When I do so, on an AMP page I see the expected script(s) in v2.1.4:

<script src="https://cdn.ampproject.org/v0/amp-tiktok-0.1.mjs" async="" custom-element="amp-tiktok" type="module" crossorigin="anonymous"></script>
<script async nomodule src="https://cdn.ampproject.org/v0/amp-tiktok-0.1.js" crossorigin="anonymous" custom-element="amp-tiktok"></script>
juniormiranda89 commented 3 years ago

Thank you for the testing, but we are not getting output for amp-tiktok script trought rest on our Node.js app.

Here's one page generated by our Node.js app, that contains one Twitter and one TikTok embed:

https://observatoriodeseries.uol.com.br/netflix/de-teorias-a-memes-segredo-do-sucesso-de-round-6-e-o-povao

The amp-twitter script is getting output as expected, but the amp-tiktok script are not getting output, as you can see on the image below:

image

Do you have some tip about what could be causing this issue?

westonruter commented 3 years ago

How does your Node.js app relate to the AMP plugin for WordPress?

Maybe you're issue is not with the AMP plugin but rather amp-toolbox? Are you using the AutoExtensionImporter transformer in the Node.js AMP Optimizer? Maybe it is out of date.