• Resolved mbeerli

    (@mbeerli)


    Running WP 5.1 (your plugin states compatible up to 5.0.3)
    When trying to enable the paired mode or native mode I get the following error:
    Paired mode activated! However, there was an error when checking the AMP validity for your site. Internal Server Error

    So I switched back to classic.

    When looking at the error.log file:

    [27-Feb-2019 06:04:05 UTC] PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/…/wp-includes/query.php:28
    Stack trace:
    #0 /home/…/wp-content/plugins/amp/includes/amp-helper-functions.php(264): get_query_var(‘amp’, false)
    #1 /home/…/wp-content/plugins/w3-total-cache/Extension_Amp_Plugin.php(31): is_amp_endpoint()
    #2 /home/…/wp-content/plugins/w3-total-cache/Extension_Amp_Plugin.php(81): W3TC\Extension_Amp_Plugin->is_amp_endpoint()
    #3 /home/…/wp-includes/class-wp-hook.php(286): W3TC\Extension_Amp_Plugin->w3tc_footer_comment(Array)
    #4 /home/…/wp-includes/plugin.php(208): WP_Hook->apply_filters(Array, Array)
    #5 /home/…/wp-content/plugins/w3-total-cache/Generic_Plugin.php(512): apply_filters(‘w3tc_footer_com…’, Array)
    #6 [internal function]: W3TC\Generic_Plugin->ob_callback(‘<!DOCTYPE html>…’, 9)
    #7 /home/…/wp-includes/functions.php(4212): ob_end_flush()
    #8 /home/…/wp-includes/class-wp-hook.php(286): wp_ob_end_flush_all(”)
    #9 /home/…/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #10 /home/…/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #11 /home/…/wp-includes/load.php(788): do_action(‘shutdown’)
    #12 [internal function]: shutdown_action_hook()
    #13 {main}

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

    (@swissspidy)

    Hi there

    Since W3 Total Cache is involved, have you tried temporarily disabling that plugin to see if this error still exists? It sounds like W3 Total Cache messes with the global WP_Query object in WordPress, which messes with functionality in the AMP plugin.

    Thread Starter mbeerli

    (@mbeerli)

    with W3 Total cache disabled.
    When switching AMP to paired, still getting
    Paired mode activated! However, there was an error when checking the AMP validity for your site. Internal Server Error

    Is it possible that it is the following?
    [27-Feb-2019 10:38:41 UTC] PHP Recoverable fatal error: Object of class Closure could not be converted to string in /home/…/wp-content/plugins/widget-options/includes/widgets/extras.php on line 135

    Plugin Author Pascal Birchler

    (@swissspidy)

    The error is again unrelated to the AMP plugin itself as it’s caused by the Widget Options plugin you are using.

    The AMP validation in our plugin does basically just open your website like regular user would and check for potential issues. This way it might bring some errors to surface that you might normally not see because error display is turned off on your site.

    I just had a brief look at file in question, and the Widget Options plugin seems to not handle some widgets properly. This has been previously reported to the developer of Widget Options, see https://github.com/phpbits/widget-options/issues/30. I recommend you to file a bug report with that plugin so that they can fix the issue on their end.

    Thread Starter mbeerli

    (@mbeerli)

    I filed a bug also with Widget Options plugin.
    Then I disabled Widget Options and tried AMP again.
    Yet another PHP fatal error on the theme this time. Just in case I supplied the trace also to the theme maker.
    No fatal errors at all without AMP. Ok in classic mode but not in paired mode.
    My conclusion, there is something not right with AMP. 2 other plugins and a theme have php fatal errors. Hard to believe its everybody else.

    Plugin Author Weston Ruter

    (@westonruter)

    I think there may be something we could address in the AMP plugin here. From the stack trace I can see w3-total-cache/Extension_Amp_Plugin.php is calling is_amp_endpoint() and then the fatal error happens. We shouldn’t let calling our function ever result in a fatal error.

    Plugin Author Weston Ruter

    (@westonruter)

    Plugin Author Weston Ruter

    (@westonruter)

    I’ve opened a PR to prevent the fatal error from happening. Instead it will issue a _doing_it_wrong() notice: https://github.com/ampproject/amp-wp/pull/1930

    The plugin author should make sure they don’t call is_amp_endpoint() before the wp action happens.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘php Fatal Error enabling paired mode’ is closed to new replies.