WordPress dashboard almost inaccessible when Discourse is rebuilding

I was rebuilding Discourse to install new plugins, and then the WordPress dashboard started taking more than 30 seconds to load any page.

Apparently, WP-Discourse tries to access the Discourse server on every page load, no matter which page is being requested. If the Discourse server is down, WP-Discourse waits for the PHP to timeout, before releasing the connection.

The same thing happens when the home or singlepage are requested. The difference is that it doesn’t wait 30 seconds (i didn’t counted, but it took less time).

  1. Is it really necessary for WP-Discourse to call Discourse’s server on every request? This behavior adds a lot of lag to the WordPress site, even if Discourse is responding in time. It should be limited for the pages where it is really necessary.
  2. When calling Discourse, WP-Discourse should not wait for the PHP to timeout before releasing the connection

I don’t know if this is something new, but i don’t remember to see it happening before. I rebuild discourse every time there’s a new update and this is the first time i noticed this behavior.

My WordPress is updated and WP-Discourse is in v2.4.7.

1 Like

Hey @Thiago_Mobilon,

WP Discourse attempts to connect to Discourse when you load the admin panel. This has been in place since the plugin first launched. You may notice it in a scenario like the one you experienced, but as you allude, this is relatively rare. We will look at improving it in the future, but it’s not near the top of the agenda.

We’d be open to a PR along those lines though.

1 Like