• Resolved Amy Collins

    (@amycollins96)


    Hello Support Team,

    Since installing the latest AMP update, my website shows the following warning messages on the top of the header of all pages:

    Warning: Use of undefined constant AMP_QUERY_VAR – assumed ‘AMP_QUERY_VAR’ (this will throw an Error in a future version of PHP) in /home/horoscopezodaic/public_html/wp-content/plugins/snax/includes/plugins/amp/amp.php on line 26

    Warning: Use of undefined constant AMP_QUERY_VAR – assumed ‘AMP_QUERY_VAR’ (this will throw an Error in a future version of PHP) in /home/horoscopezodaic/public_html/wp-content/plugins/snax/includes/plugins/amp/amp.php on line 27

    Warning: Use of undefined constant AMP_QUERY_VAR – assumed ‘AMP_QUERY_VAR’ (this will throw an Error in a future version of PHP) in /home/horoscopezodaic/public_html/wp-content/plugins/snax/includes/plugins/amp/amp.php on line 28

    How can we solve the issue?

    Thanks

    • This topic was modified 4 years, 3 months ago by Amy Collins. Reason: Changed the page URL

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for getting in touch. This warning looks to be coming from the snax plugin used on your site. As this seems to be a plugin included with your active theme and a feature of your reader mode templates I would suggest checking with the developer for any updates on this.

    You can also remove this warning from appearing on your front end by setting the below as per this guide:
    define( 'WP_DEBUG_DISPLAY', false );

    Plugin Author Weston Ruter

    (@westonruter)

    And as an alternative to turning off displaying warnings, you can instead add this to your wp-config.php:

    define( 'AMP_QUERY_VAR', 'amp' );

    This will prevent the warning from being raised in the first place. But Snax shouldn’t be trying to read from this constant so early. This is something you should report to the Snax plugin authors. You can see the bug is coming from their code not the AMP plugin.

    Plugin Author Weston Ruter

    (@westonruter)

    Snax should be using the amp_get_slug() function instead of the AMP_QUERY_VAR constant anyway.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Showing Warning after the update’ is closed to new replies.