• I activated the Transnational mode, and I got the following error message;

    Transitional mode activated! However, there was an error when checking the AMP validity for your site. URL validation failed due to the AMP validation request not returning JSON data. This may be due to a PHP fatal error occurring. Please check your server PHP error logs; to do this you may need to enable WP_DEBUG_LOG. If you are stuck, please search the support forum for possible related topics, or otherwise start a new support topic including the error message, the URL to your site, and your active theme/plugins. Please include your Site Health Info.

    My Site Info:

    
    ### wp-core ###
    
    version: 5.4.2
    site_language: en_ZA
    user_language: en_ZA
    timezone: Africa/Lagos
    permalink: /%postname%/
    https_status: true
    user_registration: 0
    default_comment_status: open
    multisite: false
    user_count: 9
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /home/allscho1/public_html
    wordpress_size: 8.63 GB (9267127336 bytes)
    uploads_path: /home/allscho1/public_html/wp-content/uploads
    uploads_size: 2.76 GB (2964694383 bytes)
    themes_path: /home/allscho1/public_html/wp-content/themes
    themes_size: 11.77 MB (12339756 bytes)
    plugins_path: /home/allscho1/public_html/wp-content/plugins
    plugins_size: 83.31 MB (87354635 bytes)
    database_size: 251.45 MB (263669490 bytes)
    total_size: 11.73 GB (12595185600 bytes)
    
    ### wp-dropins (1) ###
    
    advanced-cache.php: true
    
    ### wp-active-theme ###
    
    name: Magnus by MyThemeShop (mts_magnus)
    version: 1.0.19
    author: MyThemeShop
    author_website: https://mythemeshop.com/
    parent_theme: none
    theme_features: automatic-feed-links, post-thumbnails, menus, wp-block-styles, responsive-embeds, align-wide, html5, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, title-tag, amp, widgets
    theme_path: /home/allscho1/public_html/wp-content/themes/mts_magnus
    
    ### wp-themes-inactive (1) ###
    
    Twenty Twenty: version: 1.4, author: WordPress Team
    
    ### wp-mu-plugins (1) ###
    
    SSO: version: 0.3, author: Garth Mortensen, Mike Hansen
    
    ### wp-plugins-active (26) ###
    
    Ad Inserter: version: 2.6.10, author: Igor Funa
    AMP: version: 1.5.5, author: AMP Project Contributors
    Collapse-O-Matic: version: 1.7.12, author: twinpictures, baden03
    Easy WP SMTP: version: 1.3.9.3, author: wpecommerce, alexanderfoxc
    Embed Any Document: version: 2.6.1, author: Awsm Innovations
    Header Footer Code Manager: version: 1.1.7, author: 99robots
    IOTA Api: author: (undefined), version: (undefined)
    Ivory Search: version: 4.5.1, author: Ivory Search
    MyThemeShop Theme & Plugin Updater: version: 3.0.3, author: MyThemeShop
    My WP Translate: version: 1.0.9, author: MyThemeShop
    Quiz Maker: version: 8.5.6, author: Quiz Maker team
    Really Simple SSL: version: 3.3.4, author: Really Simple Plugins
    Redirection: version: 4.8, author: John Godley
    Simple Custom CSS and JS: version: 3.32.2, author: SilkyPress.com
    Site Kit by Google: version: 1.12.0, author: Google
    Social Media Auto Publish: version: 2.4.1, author: xyzscripts.com
    Social Snap: version: 1.1.8.3, author: Social Snap, LLC
    Table of Contents Plus: version: 2002, author: Michael Tran
    Watu Quiz: version: 3.1.8.1, author: Kiboko Labs
    wpDiscuz: version: 7.0.3, author: gVectors Team
    wpDiscuz - Ads Manager: version: 7.0.1, author: gVectors Team
    wpDiscuz - Google reCAPTCHA: version: 7.0.0, author: gVectors Team
    WPForms Lite: version: 1.6.1, author: WPForms
    WP Responsive Table: version: 1.2.5, author: Processby
    WP Rocket: version: 3.2.4-beta4, author: WP Media
    Yoast SEO: version: 14.5, author: Team Yoast
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_GD
    imagick_module_version: Not available
    imagemagick_version: Not available
    gd_version: 2.2.5
    ghostscript_version: 9.25
    
    ### wp-server ###
    
    server_architecture: Linux 3.10.0-962.3.2.lve1.5.35.el7.x86_64 x86_64
    httpd_software: LiteSpeed
    php_version: 7.4.8 64bit
    php_sapi: litespeed
    max_input_variables: 8000
    time_limit: 360
    memory_limit: 768M
    max_input_time: 240
    upload_max_size: 256M
    php_post_max_size: 256M
    curl_version: 7.62.0 OpenSSL/1.0.2k
    suhosin: false
    imagick_availability: false
    htaccess_extra_rules: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 10.3.23-MariaDB
    client_version: mysqlnd 7.4.8
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/allscho1/public_html/wp-content
    WP_PLUGIN_DIR: /home/allscho1/public_html/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 768M
    WP_DEBUG: false
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: false
    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
    mu-plugins: writable
    
    ### wpforms ###
    
    version: 1.6.1
    license: false
    lite: Nov 16, 2018 @ 2:05am
    total_forms: 2
    total_entries: 99
    
    ### google-site-kit ###
    
    version: 1.12.0
    php_version: 7.4.8
    wp_version: 5.4.2
    reference_url: https://allschool.com.ng
    amp_mode: secondary
    site_status: connected-site
    user_status: authenticated
    active_modules: site-verification, search-console, analytics, pagespeed-insights
    required_scopes: 
    	openid: ✅
    	https://www.googleapis.com/auth/userinfo.profile: ✅
    	https://www.googleapis.com/auth/userinfo.email: ✅
    	https://www.googleapis.com/auth/siteverification: ✅
    	https://www.googleapis.com/auth/webmasters: ✅
    	https://www.googleapis.com/auth/analytics.readonly: ✅
    search_console_property: https://allschool.com.ng/
    analytics_account_id: 1513•••••
    analytics_property_id: UA-1513•••••••
    analytics_profile_id: 2050•••••
    analytics_use_snippet: yes
    
    ### amp_wp ###
    
    amp_mode_enabled: transitional
    amp_templates_enabled: post, is_singular
    amp_serve_all_templates: false
    amp_css_transient_caching_disabled: false
    amp_css_transient_caching_threshold: 5000 transients per day
    amp_css_transient_caching_sampling_range: 14 days
    amp_css_transient_caching_transient_count: 153
    amp_css_transient_caching_time_series: 
    	20200717: 0
    
    

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 25 total)
  • @diraph thanks for reporting and providing these details!

    Could you attempt the below:

    1) Download and install the below mini plugin (instructions toward the bottom):

    https://gist.github.com/westonruter/48e546e4636bec5fafd8a29e0fc7a001

    Once you activate it, visit a post from the frontend and you’ll see two new menu items under the AMP admin bar menu item:

    1) Debug AMP validation response directly
    2) Debug AMP validation response w/ loopback request

    Screenshot: https://jmp.sh/jqb4WzR

    When clicking either of the above if things are working as expected you’ll see valid JSON data being returned in both cases.

    2) Please copy the results of both the above options into a new gist, which you can provide a link to here.

    Thread Starter diraph

    (@diraph)

    Okay. I have done that. CLICK HERE to see the gist

    Thread Starter diraph

    (@diraph)

    I think I should add that basically, on the AMP version of the website, a user can’t add comments. The user cannot also load more comments (for pages with paginated comments).
    Finally, The CSS Usage (when I click on amp from frontend) is between 88% to 99% depending on the page.

    Hope those information are helpful.

    Same problem here… any clue?

    Plugin Author Weston Ruter

    (@westonruter)

    @jorgitobg From looking at the Site Health info that diraph shared above, do you have any of the same plugins running?

    @diraph Thank you for sharing the Gist. Unfortunately the output of “Debug AMP validation response directly” doesn’t show there being any invalid JSON.

    The code in question that is failing for you is this:

    https://github.com/ampproject/amp-wp/blob/f9c514575b3c15fa009257e2f449ea2ee03d5700/includes/validation/class-amp-validation-manager.php#L2122-L2124

    Specifically this code:

    if ( '{' !== substr( $response, 0, 1 ) ) {
    	return new WP_Error( 'response_not_json' );
    }

    Could you please try patching that code as follows:

    if ( '{' !== substr( $response, 0, 1 ) ) {
    	return new WP_Error( 'response_not_json', '', [ 'first_kb' => substr( $response, 0, 1024 ) ] );
    }

    Then you’ll be able to re-access the “Debug AMP validation response w/ loopback request” and the output will indicate what specifically the first kilobyte of the response contained.

    Additionally, if you go into Site Health, are there any tests failing for “loopback requests”?

    • This reply was modified 3 years, 9 months ago by Weston Ruter.
    Thread Starter diraph

    (@diraph)

    Thanks for the response but unfortunately, I don’t know how to patch code.
    Any help on this

    Plugin Author Weston Ruter

    (@westonruter)

    What about in your Site Health, is there any failing tests for loopback requests?

    Thread Starter diraph

    (@diraph)

    No there’s none. The only recommendations there are;
    1. The optional module, imagick, is not installed, or has been disabled.
    2. Object caching is not enabled

    That’s all.

    Plugin Author Weston Ruter

    (@westonruter)

    Instead of patching your code, I’ve patched the debug AMP validation plugin you installed. Please uninstall the current version of the “AMP Debug Validation Request” plugin you have installed and then install this new version (v0.3.0): https://gist.github.com/westonruter/48e546e4636bec5fafd8a29e0fc7a001

    This will include more information about what is in the response when the response_not_json error occurs.

    Then re-check the “Debug AMP validation response w/ loopback request” link.

    Thread Starter diraph

    (@diraph)

    I have uninstalled the plugin and installed the current version.
    Below is the result for the “Debug AMP validation response w/ loopback request”

    {
    “success”: false,
    “results”: {
    “errors”: {
    “response_not_json”: [
    “”
    ]
    },
    “error_data”: {
    “response_not_json”: {
    “first_kb_response”: “”
    }
    }
    }
    }

    • This reply was modified 3 years, 9 months ago by diraph.
    Plugin Author Weston Ruter

    (@westonruter)

    Thank you. So first_kb_response is indeed empty. The next thing I suggest checking is the PHP error log.

    Here is how you can enable that: https://wordpress.org/support/article/debugging-in-wordpress/#wp_debug_log

    Thread Starter diraph

    (@diraph)

    I have gotten the error log. I pasted it as a new gist. See the link to the gist HERE.

    • This reply was modified 3 years, 9 months ago by diraph.
    Thread Starter diraph

    (@diraph)

    I have gotten the error log. I pasted it as a new gist. See the link to the gist HERE.

    After some debuging I found guilty plugin “WP Chat App” from https://ninjateam.org/

    This makes no sense….. any clue?

    Thread Starter diraph

    (@diraph)

    No clue. I don’t even have such plugin in my website

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘There was an error when checking the AMP validity for my site’ is closed to new replies.