Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for "amp_is_enabled" added too late. #5615

Closed
coolrecep opened this issue Nov 20, 2020 · 5 comments
Closed

Filter for "amp_is_enabled" added too late. #5615

coolrecep opened this issue Nov 20, 2020 · 5 comments
Assignees
Labels
Support Help with setup, implementation, or "How do I?" questions.

Comments

@coolrecep
Copy link

coolrecep commented Nov 20, 2020

Bug Description

This error appears on WP admin panel after updating to 2.0.7 in WP debug mode:

Notice: add_filter hatalı çağırıldı. Filter for "amp_is_enabled" added too late. To disable AMP, this filter must be added before the "plugins_loaded" action. Daha fazla bilgi için lütfen WordPress hata ayıklama adresine bakın. (Bu mesaj 2.0 sürümünde eklendi.) in /home/technopa/public_html/wp-includes/functions.php on line 5229

Warning: Cannot modify header information - headers already sent by (output started at /home/technopa/public_html/wp-includes/functions.php:5229) in /home/technopa/public_html/wp-includes/functions.php on line 6274

Warning: Cannot modify header information - headers already sent by (output started at /home/technopa/public_html/wp-includes/functions.php:5229) in /home/technopa/public_html/wp-admin/includes/misc.php on line 1310

Warning: Cannot modify header information - headers already sent by (output started at /home/technopa/public_html/wp-includes/functions.php:5229) in /home/technopa/public_html/wp-admin/admin-header.php on line 9

Expected Behaviour

No error.

Steps to reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Screenshots

image

Additional context

  • WordPress version: 5.5.3
  • Plugin version: 2.0.7
  • Gutenberg plugin version (if applicable):
  • AMP plugin template mode: Transitional
  • PHP version: 7.4
  • OS: Centos 7.9
  • Browser: [e.g. chrome, safari] Chrome 87
  • Device: [e.g. iPhone6] Desktop
    NewsMag Theme

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@jamesozzie
Copy link
Collaborator

To try and determine if it's a theme or plugin is calling amp_is_enabled too late can you install the Health Check & Troubleshooting plugin?

When you enable the plugins "Troubleshooting" mode it will switch to a core WordPress theme and deactivate all plugins for you only, as a logged in administrator. You can then activate the amp plugin while in troubleshooting mode. From there you can activate your current theme and check for the same issue, or alternatively check your plugins by enabling one by one.

The issue also came up previously in the plugins support forums, from a user who had another TagDiv theme active. Let us know once you check.

@jamesozzie jamesozzie added the Support Help with setup, implementation, or "How do I?" questions. label Nov 20, 2020
@jamesozzie jamesozzie self-assigned this Nov 20, 2020
@coolrecep
Copy link
Author

This is the result in Troubleshooting mode with all the 3rd party themes and plugins disabled.

`Notice: add_filter hatalı çağırıldı. Filter for "amp_is_enabled" added too late. To disable AMP, this filter must be added before the "plugins_loaded" action. Daha fazla bilgi için lütfen WordPress hata ayıklama adresine bakın. (Bu mesaj 2.0 sürümünde eklendi.) in /home/technopa/public_html/wp-includes/functions.php on line 5229

Warning: Use of undefined constant TDC_PATH_LEGACY - assumed 'TDC_PATH_LEGACY' (this will throw an Error in a future version of PHP) in /home/technopa/public_html/wp-content/plugins/td-composer/td-composer.php on line 114`

I think it is a TagDiv issue. TD Composer is theirs AFAIK.

@westonruter
Copy link
Member

Good find. I also identified TagDiv Mobile Theme as being the cause in a support topic: https://wordpress.org/support/topic/issue-with-amp-added-too-late/

We should help facilitate this in the same way we did for calling is_amp_endpoint() too early. We did this in #5289. I've also used that logic in #5558 to identify the theme/plugin responsible for adding a custom URL structure.

@coolrecep
Copy link
Author

After being told that TagDiv themes cause the isseue, I disbaled TagDiv Mobile Theme and the issue was fixed. After that I found the thread with your reply and pasted here. Credit is yours. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

3 participants