• Resolved hopetommola

    (@hopetommola)


    The following error occurs whenever I activate AMP, with debugging on.

    
    Notice: amp_is_available was called incorrectly. <code>amp_is_available()</code> (or <code>amp_is_request()</code>, formerly <code>is_amp_endpoint()</code>) was called too early and so it will not work properly. WordPress is currently doing the <code>the_content</code> hook. Calling this function before the <code>wp</code> action means it will not have access to <code>WP_Query</code> and the queried object to determine if it is an AMP response, thus neither the <code>amp_skip_post()</code> filter nor the AMP enabled toggle will be considered. It appears the plugin with slug <code>jetpack</code> is responsible; please contact the author. Please see Debugging in WordPress for more information. (This message was added in version 2.0.0.) in /data/blog/wp-includes/functions.php on line 5311
    

    I’ve shared it with Jetpack support, and they stated the following:

    For spera.hope.edu, it looks like your xmlrpc.php file (which is needed for Jetpack to work properly) is being redirected or blocked by something:

    https://spera.hope.edu/xmlrpc.php?for=jetpack

    As you can see, it just immediately sends you to https://127.0.0.1 instead of loading. This file is used by Jetpack and other plugins and apps to connect to your site. It must return the following exact message:

    XML-RPC server accepts POST requests only.
    You can see a working example here: https://jetpack.com/xmlrpc.php

    To which we replied that we currently “allow” xmlrpc.php access from the Jetpack whitelist ips shown here: https://jetpack.com/support/hosting-faq/

    I wanted to bring this to your attention, since it’s actually coming from AMP.
    Any insights? Thoughts?
    Thx
    CT

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

    (@milindmore22)

    Hello @hopetommola

    As mentioned by jetpack support your xmlrpc.php request is being redirected to 127.0.0.1, it may be due to a redirection rule applied for security purpose, you may want to check with your hosting support or check the .htacess file for such rules.

    Also, I would like to note that your site is generating amphtml tag (<link rel="amphtml">) with the 404 links possibly another rewrite rule?

    eg: check source code of below URL.

    URL: https://spera.hope.edu/2020/on-four-continents-helping-agencies-encourage-foster-care/

    404 link in amphtml: https://spera.hope.edu/2020/on-four-continents-helping-agencies-encourage-foster-care/amp

    One of the plugin or theme you may be using which modifies the content is calling amp_is_available function too early.

    Can you please send us your site health info using this form so we can investigate this further.

    Thread Starter hopetommola

    (@hopetommola)

    We have the following in place:
    #<Files xmlrpc.php>
    #Order allow,deny
    #Allow from 192.0.64.1/192.0.127.254
    #Allow from 122.248.245.244/32
    #Allow from 54.217.201.243/32
    #Allow from 54.232.116.4/32
    #Allow from 192.0.80.0/20
    #Allow from 192.0.96.0/20
    #Allow from 192.0.112.0/20
    #Allow from 195.234.108.0/22

    #Deny from all
    #Satisfy All
    #ErrorDocument 403 https://127.0.0.1/
    #</Files>

    Which is intended to stop all traffic to xmlrpc.php unless from those IP addresses / ranges. The IPs were acquired here: https://jetpack.com/support/hosting-faq/

    Are there any IP ranges which need to be whitelisted in order for the AMP plugin to work? I will look into the AMP theme issue.

    Thx
    CT

    Plugin Support Milind More

    (@milindmore22)

    Hello @hopetommola

    Yes, those are correct rules I verified that your site has been connected to the jetpack ( you can verify it here)

    Regarding the AMP plugin activation error, please send us your site health info using this form so we can investigate this further.

    Plugin Support Milind More

    (@milindmore22)

    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 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Error when debugging is on, and AMP active’ is closed to new replies.