• Resolved umlucasribeiro

    (@umlucasribeiro)


    Hello everyone,

    I hope you’re doing well. I’m currently facing an issue on my WordPress website and I could really use some assistance. Whenever I access a web story with a URL ending in “/amp/”, I encounter a 500 error. However, when I access the same web story URL without the “/amp/” ending, the error doesn’t occur.

    With wp_debug enabled, I’m seeing the following error message:

    Fatal error: Uncaught Error: Call to a member function setAttribute() on null in /var/www/html/wp-content/plugins/web-stories/includes/AMP/Traits/Sanitization_Utils.php:52 Stack trace: #0 /var/www/html/wp-content/plugins/web-stories/includes/AMP/Integration/AMP_Story_Sanitizer.php(52): Google\Web_Stories\AMP\Integration\AMP_Story_Sanitizer->transform_html_start_tag() #1 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(135): Google\Web_Stories\AMP\Integration\AMP_Story_Sanitizer->sanitize() #2 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(100): AMPforWP\AMPVendor\AMP_Content_Sanitizer::sanitize() #3 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(60): AMPforWP\AMPVendor\AMP_Content->sanitize() #4 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-content.php(26): AMPforWP\AMPVendor\AMP_Content->transform() #5 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-post-template.php(328): AMPforWP\AMPVendor\AMP_Content->__construct() #6 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/includes/class-amp-post-template.php(122): AMPforWP\AMPVendor\AMP_Post_Template->build_post_content() #7 /var/www/html/wp-content/plugins/accelerated-mobile-pages/includes/vendor/amp/amp.php(94): AMPforWP\AMPVendor\AMP_Post_Template->__construct() #8 /var/www/html/wp-includes/class-wp-hook.php(310): AMPforWP\AMPVendor\amp_render() #9 /var/www/html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters() #10 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action() #11 /var/www/html/wp-includes/template-loader.php(13): do_action() #12 /var/www/html/wp-blog-header.php(19): require_once('...') #13 /var/www/html/index.php(17): require('...') #14 {main} thrown in /var/www/html/wp-content/plugins/web-stories/includes/AMP/Traits/Sanitization_Utils.php on line 52
    

    It seems that the error is originating from the “Sanitization_Utils.php” file within the “web-stories” plugin. The error occurs when the URL ends with “/amp/”. Interestingly, this error is not present when the URL doesn’t have the “/amp/” ending.

    I’m not entirely sure what might be causing this issue. If anyone has encountered a similar problem or has any insights into a possible solution, I would greatly appreciate your assistance.

    Thank you in advance for your time and help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Pascal Birchler

    (@swissspidy)

    Hi there

    It looks like the AMP for WP plugin is adding the /amp/ suffix to your permalinks. That seems a bit non-standard, plus it doesn’t really make sense as Web Stories are always AMP anyway.

    The error indicates that your HTML document is malformed, so I’d recommend trying to disable the AMP for WP plugin for the web-story post type. The Web Stories plugin already handles AMP sanitization, so there’s no need for the other plugin to handle this.

    Thread Starter umlucasribeiro

    (@umlucasribeiro)

    I’m pleased to inform you that the issue has been resolved! I’d like to extend my gratitude to your comment. Your explanation was right on target.

    Here’s the situation: I was using the Penci AMP plugin along with the Soledad theme. (included when I bought Soledad theme).
    I realized that it didn’t provide an option to disable AMP functionality in web-stories pages.
    In light of this, I made the decision to migrate to the AMP for WP plugin.

    To address the compatibility concerns between AMP and the Soledad theme, I successfully resolved the problem by disabling the “story” option under Custom Post Types within the general settings of the AMP for WP plugin. This course of action was taken after navigating to the “Settings” menu in the AMP for WP plugin.

    My intention is to share the steps I took to resolve this issue, in order to assist others who might encounter a similar situation. By documenting the solution, I hope to provide a useful resource for individuals facing the same challenge, eliminating the need for redundant discussions on the topic.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error 500 When Web Stories URL Ends with “/amp/”’ is closed to new replies.