I have an APO subscription but I'm unable to activate it

I’m unable to activate the APO feature from my Wordpress website or the Clouflare console. I have tried different API keys and created new ones to eliminate that as a cause. The Cloudflare console gives me the error message 'Note: The WordPress plugin was not detected on ‘mywebsitename’

I have deactivated plugins but nothing has solved the problem. This is my current WordPress environment:

Webserver: IIS 10
PHP: 8
Wordpress: 6.2

Active Plugins:
Cloudflare - 4.11.0
Elementor - 3.13
Elementor Pro - 3.12.3
JetEngine - 3.1.4 (it comes with many addons)
Rank Math SEO - 1.0.112
Rank Math SEO PRO - 3.0.34
UpdraftPlus - Backup/Restore - 2.23.3.1
WP Mail SMTP - 3.8.0
All In One WP Security - 5.1.8

All suggestions will be appreciated.

Hi,

Is the domain itself proxied by Cloudflare? You can check that by visiting Cloudflare Dashboard > DNS and checking the A records for your root domain, and see that it is :orange:, and not :grey:.

Yes, the domain is proxied by Cloudflare. I’ve confirmed this.

Do you mind to share your domain name?

Also:

  1. Make sure that no other plugin is blocking Cloudflare Plugin’s access to Cloudflare API.
  2. In case you’re using an API Token instead of the global API Key, make sure your API Token has the adequate permissions.
1 Like

My domain is touchofjapan.com.

I’ve disabled as many plugins as possible without disabling site functionality. My complete list of plugins is listed above. Do you see any that may be causing a problem?

I’m using the global API key now. I still am not connecting to Cloudflare.

Clicking Apply Recommended Cloudflare Settings for WordPress in the Plugin results in the spinner spinning forever.

The Automatic Platform Optimization for WordPress section in Cloudflare optimization still displays the message:

Note: The WordPress plugin was not detected on touchofjapan.com.

Additional Information

I just tried to connect one of our development sites to Cloudflare with the plugin. I disabled and deleted all plugins except Cloudflare. The behavior is the same as above:

Clicking Apply Recommended Cloudflare Settings for WordPress in the Plugin results in the spinner spinning forever.

The Automatic Platform Optimization for WordPress section in Cloudflare optimization still displays the message:

Note: The WordPress plugin was not detected on touchofjapan.com.

Could this be a web server problem? We’re using IIS 10.

No, but if you have already tested disabling them, they shouldn’t be the issue.

Can you please visit your /wp-admin/ area and open the Cloudflare plugin page with Developer Tools open (F12), and see if there are any errors? Check both the Network and Console tabs for any issues that may somehow involve the Cloudflare plugin.

The errors all seem related to Cloudflare

From the console

to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=Cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
/wp-admin/admin-ajax.php?action=cloudflare_proxy:1 Failed to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
/wp-admin/admin-ajax.php?action=cloudflare_proxy:1 Failed to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
compiled.js?ver=4.11.0:50 action ZONES_RAILGUNS_FETCH_ALL_SUCCESS @ 19:53:23.481
DevTools failed to load source map: Could not load content for https://jpconnection.dev/wp-content/plugins/cloudflare/stylesheets/components.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

From the network

to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=Cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
/wp-admin/admin-ajax.php?action=cloudflare_proxy:1 Failed to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=Cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
/wp-admin/admin-ajax.php?action=cloudflare_proxy:1 Failed to load resource: the server responded with a status of 405 ()
/wp-admin/options-ge…=Cloudflare#/home:1 Uncaught SyntaxError: Unexpected token ‘<’, "<!DOCTYPE "... is not valid JSON at JSON.parse ()
at Object.callback (compiled.js?ver=4.11.0:15:1834)
at compiled.js?ver=4.11.0:54:57512
at g.callback (compiled.js?ver=4.11.0:54:63989)
at g. (compiled.js?ver=4.11.0:54:60804)
at r.emit (compiled.js?ver=4.11.0:54:67409)
at n.onreadystatechange (compiled.js?ver=4.11.0:54:64844)
compiled.js?ver=4.11.0:50 action ZONES_RAILGUNS_FETCH_ALL_SUCCESS @ 19:53:23.481
DevTools failed to load source map: Could not load content for https://jpconnection.dev/wp-content/plugins/cloudflare/stylesheets/components.css.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE

The 405 error is confusing. Is Chrome security blocking the Cloudflare plugin with its strict-origin-when-cross-origin?

Request URL: https://touchofjapan.com/wp-admin/admin-ajax.php?action=cloudflare_proxy
Request Method: PATCH
Status Code: 405
Remote Address: 172.67.138.175:443
Referrer Policy: strict-origin-when-cross-origin

I think you’ve now found what the problem is. All the errors above derive from: Failed to load resource: the server responded with a status of 405 (). Your server for some reason is not accepting some requests made by the Cloudflare plugin, which in turn creates a chain of events that results in your Cloudflare plugin never being able to function properly.

When the Cloudflare plugin is installed correctly, all your frontend pages and posts should have a header that it adds:

cf-edge-cache: no-cache returned when visiting the site while logged in.
cf-edge-cache: cache,platform=wordpress returned when visiting while not logged-in.

These headers are added regardless of APO, as long as the plugin is installed and properly running. Your website is not returning those headers.

Now I think you were right in your earlier suspicion. Your server somehow seems not to be accepting HTTP method PATCH or something.

This is not an issue we can help you in this community, as each server has its own technical complications. You need to reach out to your developer or hosting provider and ask them why is it that the server is behaving that way. Perhaps some configuration error.

You may also reach out to other forums, such as Forums | WordPress.org or https://stackoverflow.com.

Thank you for your help. I’ve been chasing this IIS CORS problem for many hours. Unfortunately, I haven’t found the solution yet. I’ll share my solution when/if I find it.

1 Like

My pleasure.

Please do!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.