WordPress dashboard almost inaccessible when Discourse is rebuilding

AI-generated summary

Thiago_Mobilon reported that while rebuilding Discourse to install plugins, the WordPress dashboard became nearly inaccessible, with pages taking over 30 seconds to load. This occurs because WP-Discourse attempts to connect to the Discourse server on every page request—even when Discourse is down or rebuilding—causing PHP timeouts. The issue also affects front-end pages, though with less delay. Thiago_Mobilon questions whether this constant connection is necessary and suggests limiting it to relevant pages and avoiding timeouts. He notes this behavior is new to him despite frequent Discourse rebuilds, and confirms he’s running WordPress and WP-Discourse v2.4.7. angus acknowledges the behavior has existed since the plugin’s launch, explaining it’s typically only noticeable during server outages or rebuilds, and while not a high-priority fix, they’re open to pull requests to improve it.

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.

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.