Cloudflare WP plugin connection issue

Hi guys.

I’m having problems getting the wordpress plugin to connect to cloudflare after moving to a new host (VPS server). It used to work on the previous host. It seems to accept the global api key but it hangs like this:

Can someone advise as to how to debug it or what to try?

May I ask do you get and see any error in the developer console of your Web browser?
Are you running any other plugins which could possibly block any WordPress API or other request?

  • do you have many Websites/domains on your CF account to “scrape” and “load-up” the correct one as needed?

May I curiously ask, can you manage your Website through the Cloudflare interface, or actually need the plugin for some tweaks using WordPress dashboard?

May I ask have you allowed Cloudflare IPs to connect to your new host by following the below article and guidelines?:

1 Like

Thanks for the your reply @fritexvz.
There are indeed some errors in the developer console:

WebSocket connection to ‘wss://public-api.wordpress.com/pinghub/wpcom/me/newest-note-data’ failed:

compiled.js?ver=4.5.1:20 GET https://[removed_host]/wp-admin/admin-ajax.php?action=cloudflare_proxy&proxyURL=zones&proxyURLType=CLIENT 500

Uncaught TypeError: Cannot read property ‘status’ of undefined

Full output: ?v=2.0:16 WebSocket connection to 'wss://public-api.wordpress.com/pinghub/wpcom/ - Pastebin.com

The first error is present on all wordpress pages it seems.

The reason I need the plugin is I’m using APO and cloudflare recommends only using it with the plugin.

All IPs should be allowed through to Apache at this point.

<Directory /var/www/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted

As far as I can tell no plugins that would restrict API calls are installed. I’ve tried disabling a few to no avail.

@zorglub Thank you very much for detailed answer and feedback info.

Hm, not sure if this is in some kind combination.
Haven’t used both at the same time, but I would kindly recommend to patiently wait as I am tagging @yevgen who could possibly know more information about it and help here.

Due to this error, may I ask are you using WordPress.com or WP.me, or JetPack?

May I ask what are your SSL settings at Cloudflare dashboard for your domain?
As far as using wss would require HTTPS (SSL certificate) connection at your domain, meaning your origin host should have a valid and installed SSL certificate (Cloudflare SSL/TLS settings should be set to Full Strict).

Thanks again for your help @fritexvz. It’s much appreciated.

The APO I’m using is this: https://developers.cloudflare.com/automatic-platform-optimization/
That may have been unclear.

In the how to get started section here https://blog.cloudflare.com/automatic-platform-optimizations-starting-with-wordpress/#the-benefits-of-automatic-platform-optimization they recommend using the plugin to enable it.

There is a certbot generated SSL cert installed on the site and cloudflare SSL/TLS encryption mode is “Full (strict)”

I’m not using any of those but JetPack was previously installed.

I’ve checked the apache error log but didn’t see anything related there.
I’ve tried disabling all modules except cloudflare but it still doesn’t work.

Ok, I managed to make it work.
After some debugging I saw this in the log:
Uncaught Error: Call to undefined function Symfony\Polyfill\Intl\Idn\mb_chr() in the log which means that php-mbstring was not installed. So I went ahead and intalled that and it solved the problem.

Thanks for all the help.

1 Like