I just tried installing this plugin on WordPress 6.7.2 with php-fpm-8.3.17-1.fc41.x86_64, but it doesn’t work. I get the following error in the log when I click “Save Options”.
[2025-02-21 17:15:13] connection.INFO: check_connection_status.failed_to_connect {"error":"wpdc_response_error","message":"An invalid response was returned from Discourse","http_code":"","http_body":""}
There are corresponding errors in /var/log/php-fpm/www-error.log:
[21-Feb-2025 17:14:42 UTC] PHP Warning: Undefined array key "url" in /wordpress/wp-content/plugins/wp-discourse/lib/discourse.php on line 301
I see that the same error is being reported in the “smoke test” at Report - WP-Discourse 2.5.6 - PluginTests.com.
Edit: Nevermind about the undefined url error. It appears that was just an initial error from before the web form was completed. I am still getting the wpdc_response_error repeatedly, however, every time I click the Save Options button.
Edit2: I’m seeing a 403 forbidden on the discourse side, but it isn’t clear to me why the connection from my WordPress site is being forbidden. I can use the same API key successfully with curl.
Completed 403 Forbidden in 33ms (Views: 0.3ms | ActiveRecord: 15.1ms (2 queries, 0 cached) | GC: 2.2ms)
I’m running Discourse 3.5.0.beta1-dev in development mode.
Edit3: I found that there are special WordPress permissions for the API key in this version of Discourse. Using “Granular” instead of “Global” and checking the boxes under WordPress got rid of the 403 Forbidden errors. However, I’m still getting empty/invalid replies sent to WordPress.
Delivering messages [] to client d9fbb33f11ed404bbc361c459802c87d for user 1 (chunked)
I guess I need to use an older version of Discourse with the WordPress plugin. What is the latest version that it works with?