Skip to content

PHP Notice: is_amp_endpoint was called incorrectly #15423

@maciejmackowiak

Description

@maciejmackowiak

Steps to reproduce the issue

Hi,
When I'm logged into WP admin and I visit for example the homepage I get this PHP Notice:
Notice: is_amp_endpoint was called <strong>incorrectly</strong>. is_amp_endpoint() was called before the parse_query hook was called. Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 0.4.2.) in /wordpress/wp-includes/functions.php on line 5167

PHP Stack trace:
PHP   1. {main}() /public/index.php:0
PHP   2. require() /public/index.php:23
PHP   3. require_once() /public/wordpress/wp-blog-header.php:13
PHP   4. require_once() /public/wordpress/wp-load.php:42
PHP   5. require_once() /public/wp-config.php:219
PHP   6. do_action() /public/wordpress/wp-settings.php:540
PHP   7. WP_Hook->do_action() /public/wordpress/wp-includes/plugin.php:478
PHP   8. WP_Hook->apply_filters() /public/wordpress/wp-includes/class-wp-hook.php:311
PHP   9. W3TC\Generic_Plugin->init() /public/wordpress/wp-includes/class-wp-hook.php:287
PHP  10. is_admin_bar_showing() /public/wp-content/plugins/w3-total-cache/Generic_Plugin.php:227
PHP  11. apply_filters() /public/wordpress/wp-includes/admin-bar.php:1224
PHP  12. WP_Hook->apply_filters() /public/wordpress/wp-includes/plugin.php:206
PHP  13. Jetpack_AMP_Support::show_admin_bar() /public/wordpress/wp-includes/class-wp-hook.php:287
PHP  14. Jetpack_AMP_Support::is_amp_request() /public/wp-content/plugins/jetpack/3rd-party/class.jetpack-amp-support.php:68
PHP  15. is_amp_endpoint() /public/wp-content/plugins/jetpack/3rd-party/class.jetpack-amp-support.php:104
PHP  16. _doing_it_wrong() /public/wp-content/plugins/amp/includes/amp-helper-functions.php:589
PHP  17. trigger_error() /public/wordpress/wp-includes/functions.php:5167

Any ideas how to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    AMP[Status] Needs Author ReplyWe need more details from you. This label will be auto-added until the PR meets all requirements.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions