Cloudflare APO not working with newest version of wordpress

What is the name of the domain?

What is the error number?

APO will not enable

What is the error message?

There is none, settings will not save when hitting enable

What is the issue you’re encountering

APO simply not working. Disabled all other cache plugins, installed APO plugin, signed in with Email and API token. Plugin ENABLE toggle wont save its setting of being “ON” and cloudflare does not see the plugin as installed. I’m running the newest version of wordpress.

What steps have you taken to resolve the issue?

Disabled ALL plugins that do any kind of caching and proceeded to activate just this plugin.Cloudflare simply will not see the APO plugin installed. Name servers are cloudflare. Right now i’m using Super Cache for cloudflare but its not using my APO license.

What are the steps to reproduce the issue?

Disable all Plugins, Enable only Cloudflare plugin. (toggle wont stay on)

May I ask which version of WordPress are you currently running? :thinking:

Do you see any error code?

Checking the HTTP headers of your Website which loads pretty fast and fine from me end, I do see Cloudflare APO is present and working:

cf-apo-via: tcache
cf-cache-status: HIT
cf-edge-cache: cache, platform=wordpress

May I ask if you’re still experiencing an issue?

1 Like

Thank you for getting back to me! I ended up canceling the subscription so i have a couple weeks to get it sorted if i want to resubscribe.

I added the headers manually. The plugin was installed and setup however the Cloudflare dashboard never saw the plugin as “installed” so i was unable to activate it. I have it loading quickly at the moment just from local cache and using cloudflare caching.

I was a bit frustrated and got nowhere with Cloudflare support.

To be clear when i say activate it, i mean activate the toggle switch inside the plugin. Every time i went to Enable and reloaded the page it would simply show disabled. I was never able to Enable APO via the plugin.

Thank you for feedback information.

I am sorry to hear this. I understand where from does your frustation came at that particular moment.

Hm, this sounds to me that there is either some kind of a conflict with some part of the JS code od JS scripts.

Furthermore, if not, then I’d suspect the origin cache might play a part in such behaviour.

Otherwise, I’d cross-check and double-check the settings under the Caching tab at
Cloudflare Dashboard for Browser Cache TTL and any other Cache Rules which I might use. Hopefully, the Cloudflare wasn’t caching the WP Admin dashboard as so called “full-page cache”.
The Browser Cache TTL should be set to “Respect Existing Headers” (might be left on default → 4 hours TTL).
Cache → Purge Everything at Cloudflare dashboard.

If you haven’t used any other caching plugin for your WordPress instance, such as W3TC, Super Page Cache, etc., and even if the origin host/server wasn’t LiteSpeed Cache or any other, we could go further for troubleshooting if the APO subscription was paid and activated at the Cloudflare dashboard.

Nevertheless, if possible I’d monitor the Developer Console (F12) and the Network tab for any possible requests if they’re in someway and somewhat being blocked while authentication with API Token for the login.

Dropping helpful articles, maybe we missed some step:

Thank you! I looked through those pages. I followed instructions disabling ALL cache plugins and “mini FI” plugins. Anything that caches has been disabled. I also am in development mode on Cloudflare and the cache rules are set to obey origin headers.

The option below after enabling the plugin will not stay toggled. I toggle to enable, leave the page and come back and it shows disabled again.

Any further assistance would be most helpful.

Improve the performance of your WordPress site. Automatic Platform Optimization for WordPress serves your WordPress site from Cloudflare’s edge network and caches third party fonts. Get the benefits of a static site without any changes to how you manage your site. This results in consistent, fast TTFB and content loading faster.

For more information about how APO provides better performance to your WordPress site, see this support article.

Note: Changing Cache By Device Type setting will invalidate Cache. The setting is applied to all hostnames

Note: APO runs against the following list of hostnames:

dezzidesigns.com, www.dezzidesigns.com

Developer look - Errors

action ZONES_ENTITLEMENTS @ 12:40:54.652
/wp-admin/options-ge…=cloudflare#/home:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received

compiled.js?ver=4.12.8:54
PATCH https://dezzidesigns.com/wp-admin/admin-ajax.php?action=cloudflare_proxy 405 (Method Not Allowed)

VM1531:1 Uncaught
SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.12.8:15:2052)
at compiled.js?ver=4.12.8:54:57512
at g.callback (compiled.js?ver=4.12.8:54:63989)
at g. (compiled.js?ver=4.12.8:54:60804)
at r.emit (compiled.js?ver=4.12.8:54:67409)
at n.onreadystatechange (compiled.js?ver=4.12.8:54:64844)

compiled.js?ver=4.12.8:54
PATCH https://dezzidesigns.com/wp-admin/admin-ajax.php?action=cloudflare_proxy 405 (Method Not Allowed)
VM1532:1 Uncaught
SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.12.8:15:2052)
at compiled.js?ver=4.12.8:54:57512
at g.callback (compiled.js?ver=4.12.8:54:63989)
at g. (compiled.js?ver=4.12.8:54:60804)
at r.emit (compiled.js?ver=4.12.8:54:67409)
at n.onreadystatechange (compiled.js?ver=4.12.8:54:64844)
compiled.js?ver=4.12.8:54
PATCH https://dezzidesigns.com/wp-admin/admin-ajax.php?action=cloudflare_proxy 405 (Method Not Allowed)
VM1533:1 Uncaught
SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.12.8:15:2052)
at compiled.js?ver=4.12.8:54:57512
at g.callback (compiled.js?ver=4.12.8:54:63989)
at g. (compiled.js?ver=4.12.8:54:60804)
at r.emit (compiled.js?ver=4.12.8:54:67409)
at n.onreadystatechange (compiled.js?ver=4.12.8:54:64844)

SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.12.8:15:2052)

Narrowed it down to the compiled.js in the stylesheet folder of the cloudflare plugin. What do i do now? lol

The specific line it highlights is as follows

        t && t.text && (t.body = JSON.parse(t.text)),

The cloudflare Proxy error

Request URL:
https://dezzidesigns.com/wp-admin/admin-ajax.php?action=cloudflare_proxy
Request Method:
PATCH
Status Code:
405 Method Not Allowed
Remote Address:
104.21.37.99:443
Referrer Policy:
strict-origin-when-cross-origin
access-control-allow-origin:
*
allow:
GET, HEAD, OPTIONS, TRACE
alt-svc:
h3=“:443”; ma=86400
cache-control:
max-age=31536000, s-maxage=86400, must-revalidate
cf-apo-via:
tcache
cf-cache-status:
DYNAMIC
cf-edge-cache:
cache, platform=wordpress
cf-ray:
8b6dbe301b2c9e64-SJC
content-type:
text/html
date:
Wed, 21 Aug 2024 21:33:41 GMT
nel:
{“success_fraction”:0,“report_to”:“cf-nel”,“max_age”:604800}
referrer-policy:
SAMEORIGIN
report-to:
{“endpoints”:[{“url”:“https://a.nel.cloudflare.com/report/v4?s=Pu9HoCqaoS28FgyIK%2FdyB3XV4zk2KOY9ciJbIusRR%2FV4CxH51Urk2QKikuAkAqcK22RrY8Zow139YzG1ShR3A%2BKnpzFBOSZO90LhMzHyoO0Bqa5Gwk6nKU9UM2d9ftmZjvqY”}],“group”:“cf-nel”,“max_age”:604800}
server:
cloudflare
strict-transport-security:
max-age=31536000; includeSubDomains; preload
x-content-type-options:
nosniff
x-frame-options:
ORIGIN
x-xss-protection:
1; mode-block
:authority:
dezzidesigns.com
:method:
PATCH
:path:
/wp-admin/admin-ajax.php?action=cloudflare_proxy
:scheme:
https
accept:
/
accept-encoding:
gzip, deflate, br, zstd
accept-language:
en-US,en;q=0.9
content-length:
158
content-type:
application/json

Well being that no one else responded, and have not provided more details i will just give up lol. It runs fast enough. Shame on cloudflare for having such a broken ■■■ plugin. There is posts all over about how broken it is lol.

Newest version of wordpress
Windows Server 2019 IIS
PHP 8.3.10NTS

Thank you for feedback.

I’ll give it a try today during the day and see if I could recreate the same scenario and get same behaviour :thinking:

Will setup the same environment and try out.

1 Like

Sounds good! I have disabled for now and am using the supercache plugin for cloudflare. I’m getting 0 issues from that. Would have been nice to utilize APO. Let me know if you find anything out.

This topic was automatically closed after 15 days. New replies are no longer allowed.