• Hello,

    We have a plugin called Team Booking that creates a calendar that uses Ajax to open up a series of Modals where users can book a class time (see page link). Recently the Ajax requests have been failing. I don’t get any WordFence specific errors but when I disable WordFence the Ajax requests work again. Interestingly, the Ajax always works when I am logged in as a Admin to WordPress. It doesn’t work when I’m in Chrome Incognito mode. In the Chrome Dev Tools the following errors are shown after a few seconds:
    POST https://thatsmydog.com/wp-admin/admin-ajax.php net::ERR_SPDY_PROTOCOL_ERROR
    XHR failed loading: POST “https://thatsmydog.com/wp-admin/admin-ajax.php”

    I’ve tried Firefox and Edge and while the same problem happens, no errors are shown in the consoles for those browsers. I’ve also changed the firewall to learning mode with no effect. The site runs through Cloudflare and I’ve tried purging the cache there with no effect. Any insight would be welcome.

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

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hello,
    Since there is no Wordfence error message showed up and this request can’t be seen in the Live Traffic log (listed under “Blocked By Firewall”), then I can’t see a possibility that this could be a Wordfence firewall related issue.

    According to your Cloudflare’s plan, you might consider disabling the HTTP/2 or SPDY temporary to see if this fixes this issue, as I noticed there was a similar issue discussed here suggesting that as a diagnostic step.

    Thanks.

    Thread Starter vpjm3.0

    (@vpjm30)

    Thanks for the response.

    I thought it was weird too that I wasn’t getting any WordFence errors but when I deactivate WordFence, the ajax works every time without fail. This would seem to tell me that it is in fact something to do with WordFence. I tried pausing Cloudflare but this had no effect either. I put the firewall into learning mode and this did nothing either. At this point I’m just about ready to deactivate WordFence for good even though I really don’t want to.

    I just checked the Diagnostics tab and there was this for the “Connecting back to this site” entry under the “Connectivity” header:
    wp_remote_post() test back to this server failed! Response was: 404 Not Found

    Does anyone have any ideas?

    • This reply was modified 7 years, 1 month ago by vpjm3.0.
    • This reply was modified 7 years, 1 month ago by vpjm3.0.
    • This reply was modified 7 years, 1 month ago by vpjm3.0.
    • This reply was modified 7 years, 1 month ago by vpjm3.0.
    Thread Starter vpjm3.0

    (@vpjm30)

    I’m convinced this is somehow related to WordFence because I ended up removing the Advanced firewall and just going with the basic firewall and now everything seems to be working again. It seems like something with the configuration of the advanced firewall was causing problems. I would prefer to run the advanced firewall but I guess the basic is better than nothing.

    Hello vpjm30!
    Please go to (Wordfence > Tools => Diagnostics) and click on “Send Report by Email” button at the top of the page, you can send the report to “alaa [at] wordfence [dot] com”, make sure to include your forum username, we expect this report to reveal some reasons for this issue.

    Also, it will be very helpful to attach the server error log (PHP error log is much better), especially when this error happens again, you can reach out to your hosting provider to locate the path for these log files.

    Thanks.

    klav

    (@klav)

    Same issue here. Wordfence is preventing session/headers being set via ajax call. Not seeing anything in live traffic or diagnostics. No server log errors either.

    I do want to add that ‘Learning Mode’ acts the same as if the firewall was enabled. It’s blocking these ajax calls as well, with no diagnostic data coming in.

    • This reply was modified 7 years ago by klav.
    wfalaa

    (@wfalaa)

    @klav why you think Wordfence is behind this?

    klav

    (@klav)

    @wfalaa because it doesn’t work when Wordfence Firewall is Enabled, but works when it’s Disabled.

    wfalaa

    (@wfalaa)

    Hi @klav
    Please follow the same instructions I mentioned here, our team would like to check that diagnostics report to see what’s going on, make sure to mention your forum username.

    Thanks.

    klav

    (@klav)

    @wfalaa — Sent. Thanks!!

    wfalaa

    (@wfalaa)

    @klav are you sure you sent it “alaa [at] wordfence [dot] com” and mentioned your username “klav” there? I can’t find this email, please resend it again.

    Thanks.

    klav

    (@klav)

    Sorry, I had sent it to the default email that was listed there. Just sent again to the correct address with ‘klav’ in the notes. Thanks!

    I had turned the firewall off last Thursday evening, so you may have to look back a bit if it is a full report.

    • This reply was modified 7 years ago by klav.
    wfalaa

    (@wfalaa)

    Hi @klav
    Some extra information is needed, please let me know:
    – You aren’t using Cloudflare, are you?
    – Are you getting the same “ERR_SPDY_PROTOCOL_ERROR” response in the console?
    – I need to know some examples of ajax requests that you have hard time with, are they related to certain plugin?
    – Is the ajax request working fine while logged in as admin?

    Thanks.

    klav

    (@klav)

    Hi @wfalaa

    – You aren’t using Cloudflare, are you?
    No, we are not using Cloudflare

    – Are you getting the same “ERR_SPDY_PROTOCOL_ERROR” response in the console?
    I am not seeing this

    – I need to know some examples of ajax requests that you have hard time with, are they related to certain plugin?
    Can I email you pastebins to alaa [at] wordfence [dot] com?

    – Is the ajax request working fine while logged in as admin?
    Results are the same when logged in or not

    wfalaa

    (@wfalaa)

    Hi @klav
    Thanks for your reply, you can share more details about these ajax requests via the email you mentioned above.

    Thanks.

    Hi guys, I’ve been battling with this for weeks now and had no joy. For me, it’s a theme that whenever I try to load the media gallery or add images I get a 500 for admin-ajax.php which crashes the server every time. Theme devs looked and say it’s not theme as they can’t replicate. Host isn’t much help either as if I switch theme to 2017 I have no issue.

    I use WordFence and CloudFlare. I duplicated the live site to a dev site on the same server which doesn’t have WF, but is on CF but not turned off (no orange cloud on dns) and it doesn’t have the same issue so likely to not be server related.

    Did you manage to get anywhere?

    Thanks in advance!

    • This reply was modified 6 years, 12 months ago by thegrbteam.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Ajax Not Working’ is closed to new replies.