• Resolved mrcezars

    (@mrcezars)


    [27-Sep-2024 08:11:42 UTC] PHP Notice: Function amp_is_available was called incorrectly. amp_is_available() (or amp_is_request(), formerly is_amp_endpoint()) was called too early and so it will not work properly. WordPress is currently doing the w3tc_footer_comment hook. Calling this function before the wp action means it will not have access to WP_Query and the queried object to determine if it is an AMP response, thus neither the amp_skip_post() filter nor the AMP enabled toggle will be considered. It appears the plugin with slug w3-total-cache is responsible; please contact the author. Please see Debugging in WordPress for more information. (This message was added in version 2.0.0.) in /home/x/x/x.com/public_html/wp-includes/functions.php on line 608

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @mrcezars

    Thank you for reaching out to us, you may be facing an issue as you have added code snippet. Or one of the plugins or theme is using the amp function incorrectly it needs to be hooked with or later actions.

    eg:

    add_action('wp', function() {
        if ( amp_is_request() ) {
           // do something on amp pages
        }
    })

    Since I am seeing w3tc hooks being mentioned in you error, please check the you have activated the AMP extension provided by the w3 total cache plugin.

    1) Login as Admin.
    2) Go to Dashboard->Performance->Extensions
    3) Activate AMP extension.

    (Screenshot)

    Once you activate the Extension, clear your site cache and recheck your AMP page on AMP Test to verify that your AMP page is valid.

    We hope this is helpful!

    Plugin Support Milind More

    (@milindmore22)

    @mrcezars As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Function amp_is_available was called incorrectly’ is closed to new replies.