• Resolved Ayobami Sodiq

    (@drinoayo)


    Hi,

    Please, I’m unable to access my AMP pages for my posts. It was actually working before but it just stopped working.

    Once is try to access a page with amp e.g [ redundant link removed ]

    It shows this error

    Uncaught Error: Call to a member function setAttribute() on null in /home/globdkbm/public_html/wp-content/plugins/amp/includes/sanitizers/class-amp-dev-mode-sanitizer.php on line 33
    sanitize()
    wp-content/plugins/amp/includes/templates/class-amp-content-sanitizer.php:117
    sanitize_document()
    wp-content/plugins/amp/includes/templates/class-amp-content.php:213
    sanitize()
    wp-content/plugins/amp/includes/templates/class-amp-content.php:132
    transform()
    wp-content/plugins/amp/includes/templates/class-amp-content.php:79
    __construct()
    wp-content/plugins/amp/includes/templates/class-amp-post-template.php:329
    build_post_content()
    wp-content/plugins/amp/includes/templates/class-amp-post-template.php:142
    __construct()
    wp-content/plugins/amp/amp.php:693
    amp_render_post()
    wp-content/plugins/amp/amp.php:641
    amp_render()
    wp-includes/class-wp-hook.php:288
    apply_filters()
    wp-includes/class-wp-hook.php:312
    do_action()
    wp-includes/plugin.php:478
    do_action()
    wp-includes/template-loader.php:13
    require_once()
    wp-blog-header.php:19
    require()
    index.php:17
    There has been a critical error on your website.

    Please what’s the solution to this.

    • This topic was modified 4 years, 8 months ago by Jan Dembowski.

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

Viewing 15 replies - 1 through 15 (of 32 total)
  • @drinoayo Please check and see whether the same issue arises after switching temporarily to transitional mode, or after deleting the plugin and installing once more.

    If that fails can you share the following and we can hopefully assist:
    – Your Site Health information
    – Can you also share any changes you made to your site, such as reader mode template edits, plugin updates or since this issue started occurring.

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @jamesosborne After switching to Transitional mode I got this;

    Transitional mode activated! However, there was an error when checking the AMP validity for your site. URL validation failed to due to the absence of the expected JSON-containing AMP_VALIDATION HTML comment after </body>. This is often 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.

    However, when I checked a page with the AMP, it is working perfectly but at the bottom Footer of this site, I got error code below;

    Fatal error: Uncaught Error: Call to a member function hasAttribute() on null in /home/globdkbm/public_html/wp-content/plugins/amp/includes/class-amp-theme-support.php:2307 Stack trace: #0 /home/globdkbm/public_html/wp-content/plugins/amp/includes/class-amp-theme-support.php(1999): AMP_Theme_Support::prepare_response(‘<!doctype html>…’) #1 [internal function]: AMP_Theme_Support::finish_output_buffering(‘<!doctype html>…’, 9) #2 /home/globdkbm/public_html/wp-includes/functions.php(4552): ob_end_flush() #3 /home/globdkbm/public_html/wp-includes/class-wp-hook.php(288): wp_ob_end_flush_all(”) #4 /home/globdkbm/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #5 /home/globdkbm/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #6 /home/globdkbm/public_html/wp-includes/load.php(947): do_action(‘shutdown’) #7 [internal function]: shutdown_action_hook() #8 {main} thrown in /home/globdkbm/public_html/wp-content/plugins/amp/includes/class-amp-theme-support.php on line 2307

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @jamesosborne For my Site Health information.

    This is it:

    
    ### wp-core ###
    
    version: 5.3.2
    site_language: en_US
    user_language: en_US
    timezone: +00:00
    permalink: /%postname%/
    https_status: true
    user_registration: 0
    default_comment_status: open
    multisite: false
    user_count: 2
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /home/globdkbm/public_html
    wordpress_size: 39.35 MB (41259359 bytes)
    uploads_path: /home/globdkbm/public_html/wp-content/uploads
    uploads_size: 19.81 MB (20768209 bytes)
    themes_path: /home/globdkbm/public_html/wp-content/themes
    themes_size: 84.64 MB (88747031 bytes)
    plugins_path: /home/globdkbm/public_html/wp-content/plugins
    plugins_size: 90.94 MB (95362166 bytes)
    database_size: 3.78 MB (3961459 bytes)
    total_size: 238.51 MB (250098224 bytes)
    
    ### wp-dropins (3) ###
    
    advanced-cache.php: true
    db.php: true
    object-cache.php: true
    
    ### wp-active-theme ###
    
    name: GlobalTimesNGRv5 (jnews)
    version: 6.0.1
    author: Drino
    author_website: (undefined)
    parent_theme: none
    theme_features: menus, automatic-feed-links, title-tag, post-thumbnails, align-wide, customize-selective-refresh-widgets, post-formats, html5, woocommerce, wc-product-gallery-zoom, wc-product-gallery-lightbox, wc-product-gallery-slider, auto-load-next-post, editor-styles, editor-style, amp, widgets
    theme_path: /home/globdkbm/public_html/wp-content/themes/jnews
    
    ### wp-themes-inactive (1) ###
    
    Twenty Twenty: version: 1.1, author: the WordPress team
    
    ### wp-plugins-active (15) ###
    
    AddToAny Share Buttons: version: 1.7.39, author: AddToAny
    AMP: version: 1.4.4, author: AMP Project Contributors
    Head, Footer and Post Injections: version: 3.1.6, author: Stefano Lissa
    JNews - AMP Extender: version: 6.0.0, author: Jegtheme
    JNews - Essential: version: 6.0.0, author: Jegtheme
    JNews - Gallery: version: 6.0.0, author: Jegtheme
    JNews - JSON-LD: version: 6.0.0, author: Jegtheme
    JNews - Meta Header: version: 6.0.0, author: Jegtheme
    OneSignal Push Notifications: version: 2.1.1, author: OneSignal
    Query Monitor: version: 3.5.2, author: John Blackbourn
    Vafpress Post Formats UI: version: 1.5, author: vafpress
    W3 Total Cache: version: 0.13.1, author: BoldGrid
    WPBakery Page Builder: version: 6.1, author: Michael M - WPBakery.com
    WP to Twitter: version: 3.4.4, author: Joseph C Dolson
    Yoast SEO Premium: version: 13.2, author: Team Yoast
    
    ### wp-plugins-inactive (3) ###
    
    Akismet Anti-Spam: version: 4.1.4, author: Automattic
    Jetpack by WordPress.com: version: 8.3, author: Automattic
    MC4WP: Mailchimp for WordPress: version: 4.7.5, author: ibericode
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_Imagick
    imagick_module_version: 1684
    imagemagick_version: ImageMagick 6.9.4-10 Q16 x86_64 2017-11-14 https://www.imagemagick.org
    imagick_limits: 
    	imagick::RESOURCETYPE_AREA: 108 GB
    	imagick::RESOURCETYPE_DISK: 1.844674407371E+19
    	imagick::RESOURCETYPE_FILE: 12288
    	imagick::RESOURCETYPE_MAP: 108 GB
    	imagick::RESOURCETYPE_MEMORY: 54 GB
    	imagick::RESOURCETYPE_THREAD: 1
    gd_version: bundled (2.1.0 compatible)
    ghostscript_version: 8.70
    
    ### wp-server ###
    
    server_architecture: Linux 2.6.32-954.3.5.lve1.4.76.el6.x86_64 x86_64
    httpd_software: Apache
    php_version: 7.3.15 64bit
    php_sapi: litespeed
    max_input_variables: 2500
    time_limit: 30
    memory_limit: 5 G
    max_input_time: -1
    upload_max_size: 2M
    php_post_max_size: 8M
    curl_version: 7.62.0 OpenSSL/1.0.2k
    suhosin: false
    imagick_availability: true
    htaccess_extra_rules: true
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 10.3.22-MariaDB-log-cll-lve
    client_version: 10.3.22-MariaDB
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /home/globdkbm/public_html/wp-content
    WP_PLUGIN_DIR: /home/globdkbm/public_html/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 5 G
    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: utf8mb4
    DB_COLLATE: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    
    

    The most recent plugins on my site are; WP to Twitter and Head, Footer and Post Injections

    Most recent changes on my site; I asked my hosting (Namecheap) Customer Service to help me do these:

    Change my site PHP Memory Limit and WP Memory Limit to 5GB each. However I noticed PHP Post Max Size changed to 8MB from 512MB it was.

    Upgrade my PHP Version to 7.3.15

    I also told them to increase my PHP Max Input Vars to 2500

    @drinoayo I’ve just checked your site and while I can see the AMP URLs loading fine it looks like you may be using another AMP plugin.

    Can you confirm the plugin you are using, or whether everything is working as it should be?

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @jamesosborne I switched to another AMP plugin.. MarfeelPress

    @drinoayo No problem, thanks for the update.

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @jamesosborne please kindly change the link now, I have activated the AMP back.. MarfeelPress isn’t what I need

    @drinoayo thanks for following up and the details. We’re checking with the team about these errors and will come back to you when we have more information.

    Plugin Author Weston Ruter

    (@westonruter)

    @drinoayo Would you please try upgrading to AMP plugin v1.5.0-RC1? There have been many improvements and hardenings to the generation of AMP pages in this latest release which is due out on the www.remarpro.com directory next week. We’re now just doing a final week of testing. If you can test as well that would be helpful.

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @reneesoffice okay thanks

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @westonruter I just tried it.

    Although it worked but I’m seeing this error code at the end of the amp page

    
    
    Fatal error: Uncaught Error: Call to a member function hasAttributes() on null in /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/vendor/ampproject/common/src/Dom/Document.php:656 Stack trace: #0 /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/vendor/ampproject/common/src/Dom/Document.php(389): AmpProject\Dom\Document->normalizeHtmlAttributes() #1 /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/vendor/ampproject/common/src/Dom/Document.php(337): AmpProject\Dom\Document->loadHTMLFragment('<!doctype html>...', 0) #2 /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/vendor/ampproject/common/src/Dom/Document.php(249): AmpProject\Dom\Document->loadHTML('<!doctype html>...') #3 /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/includes/class-amp-theme-support.php(2002): AmpProject\Dom\Document::fromHtml('<!doctype html>...') #4 /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/includes/class-amp-theme-support. in /home/globdkbm/public_html/wp-content/plugins/amp-wp-1.5.0-RC1-built/vendor/ampproject/common/src/Dom/Document.php on line 656
    
    

    My Navigation isn’t working properly as it showing on the AMP page itself instead of it to be showing after clicking the Navigation button.

    My posts featured image is larger.

    My Related Contents on the AMP page is not showing any featured image.

    Here is a link https://globaltimesng.com/breaking-cos-abba-kyari-is-positive-for-covid-19-buhari-tests-negative/amp/. Thanks

    Plugin Author Weston Ruter

    (@westonruter)

    @drinoayo Thanks. One thing, it appears you have installed the 1.5.0-RC1 plugin build incorrectly. To make sure it is properly installed, please uninstall and then on the 1.5.0-RC1 release page, scroll down to download the amp.zip asset and then install that as the plugin. Any error messages should not be mentioning paths like wp-content/plugins/amp-wp-1.5.0-RC1-built but rather just wp-content/plugins/amp. You’re probably getting an admin notice about this as well right now. (Actually, it appears you may have fixed this issue.)

    Now, as for why the error is happening that is another matter.

    I don’t understand why DOMDocument::$documentElement would be null.

    Please try this to help us debug…

    Modify the plugin’s includes/class-amp-theme-support.php file as follows:

    --- a/includes/class-amp-theme-support.php
    +++ b/includes/class-amp-theme-support.php
    @@ -1890,6 +1890,9 @@ class AMP_Theme_Support {
     	 */
     	public static function finish_output_buffering( $response ) {
     		self::$is_output_buffering = false;
    +
    +		return "<!-- start_amp_buffer -->" . $response . '<!-- end_amp_buffer -->';
    +
     		return self::prepare_response( $response );
     	}
    

    Then please share the output of accessing an AMP page (or just let us know to re-check the above link).

    Plugin Author Weston Ruter

    (@westonruter)

    For posterity, here’s the stack trace formatted for readability:

    Fatal error:  Uncaught Error: Call to a member function hasAttributes() on null in …/amp/vendor/ampproject/common/src/Dom/Document.php:656
    Stack trace:
    #0 …/amp/vendor/ampproject/common/src/Dom/Document.php(389): AmpProject\Dom\Document->normalizeHtmlAttributes()
    #1 …/amp/vendor/ampproject/common/src/Dom/Document.php(337): AmpProject\Dom\Document->loadHTMLFragment('<!doctype html>...', 0)
    #2 …/amp/vendor/ampproject/common/src/Dom/Document.php(249): AmpProject\Dom\Document->loadHTML('<!doctype html>...')
    #3 …/amp/includes/class-amp-theme-support.php(2002): AmpProject\Dom\Document::fromHtml('<!doctype html>...')
    #4 …/amp/includes/class-amp-theme-support.php(1893): AMP_Theme_Support::prepare_response('<!doctype html>...')
    #5 [internal function]: AMP_Theme_Support::fi in …/amp/vendor/ampproject/common/src/Dom/Document.php on line 656
    Thread Starter Ayobami Sodiq

    (@drinoayo)

    @westonruter I’m unable to save it.

    I’m seeing this

    Your PHP code changes were rolled back due to an error on line 2511 of file wp-content/plugins/amp/includes/class-amp-theme-support.php. Please fix and try saving again.

    syntax error, unexpected ‘-‘

    Thread Starter Ayobami Sodiq

    (@drinoayo)

    I’m temporarily back to MarfeelPress until there is a better solution

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘I Can’t Access My AMP Pages’ is closed to new replies.