• I have cloudflare APO enabled, and it throws the following error in the console:
    Uncaught TypeError: Cannot read property ‘apiFetch’ of undefined

    Is there any way to make CF7 work with APO? I’d love to resolve this issue. It’s 100% caused by it (tested by turning it on and off a couple of times).

    I’d hate to give up APO just because of this… The performance is amazing!

    • This topic was modified 3 years, 6 months ago by lastnoob.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The only solution I’ve seen online was to bypass caching for pages with contact forms, which nobody is happy with ??

    ciao @galbaras

    seems common with that, a lot of users are blaming cloudflare api
    https://community.cloudflare.com/t/enabling-apo-wp-plugin-bad-request/213103

    Specifically it doesn’t seem accessible the wp-api endpoint /contact-form. Could you provide me with a link to a test site? I will do a short test and tell you.

    • This reply was modified 3 years, 4 months ago by Erik.
    • This reply was modified 3 years, 4 months ago by Erik.

    I think the problem is related to using a nonce for submission, not to Cloudflare at all. I’ve had this issue with a caching plugin too.

    so your wp-api contact form endpoint is publicity accessible?

    https://YOURDOMAIN/wp-json/contact-form-7/v1

    (test while you are not logged in)

    Sure. I get successful submissions all the time. I’ve just had issues on sites that don’t use APO, but do use WP Fastest Cache, and they were related to the nonce, as far as I could tell.

    Basically, if a nonce expires after 24 hours, but the page is cached for a week (or 30 days with APO), submissions past the 24-hour mark will fail the nonce verification. This is not a Contact Form 7 limitation. It’s a limitation of using nonces.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    @lastnoob Where can we see the website in question?

    @galbaras non sure about this, as far as i know from v5.4.1 cf7 reloads the form on init if the cache is enabled.

    but I’ll give you the benefit of the doubt and I’m trying to replicate the same issue you have on my blog (since I can’t check one of yours)

    actually i’m using “WP Fastest Cache” (which is a plugin I value and use), the test started 4h ago

    I’ve checked the plugin code and it seems that nonce are only used when WPCF7_VERIFY_NONCE is defined as something that evaluates to true or there’s a wpcf7_verify_nonce filter that sets it to true.

    If this isn’t the case on the OP’s site, then that’s not the problem.

    yes the nonce is certainly not the cause, moreover the form on my blog keeps sending emails after 24 hours. But I was pretty sure of that because I have WP Fastest Cache and CF7 on some sites and it never gave me that problem.

    so why isn’t your site working then? also it is not very fair to come here to ask for help in such a generic way, you should share the link to the site so we can verify.

    I don’t know why wp-rocket and CF apo don’t work but my guess is that if all other caching plugins work and these don’t, the problem is in the last ones, it’s pretty clear. The fact that they are paid does not exclude that they have bugs. and the fact those plugin are paid limits my ability to test them ??

    I know it’s been months but if the OP @lastnoob has still has problems can you show us, I think it can be fixed or avoided.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cloudflare APO compatibility’ is closed to new replies.