WP Discourse Plugin Error

Every time I update my site crashes because of an error in the WP Discourse plugin. I have learned to fix it myself but it would be great if I didn’t have to after every update.

The lib/plugin-utilities.php file needs to be included in the'lib/utilities.php file, otherwise it gives the error:

Trait 'WPDiscourse\Shared\PluginUtilities' not found in .../public/wp-content/plugins/wp-discourse/lib/utilities.php on line 17

I am not sure if this is because of my setup or others are facing this as well. I am running php7.4.

My fix is just to include the file before that line:
In lib/utiities.php:
Screenshot 2023-01-02 at 11.18.12
l

2 Likes

This is related to your setup, as the Utilities class does in fact use the PluginUtilities trait (you can see it in your screenshot there), which is required elsewhere in the plugin.

Your issue may be that the WP Discourse plugin is not being loaded properly and you’re attempting to use the Utilities class in a code snippet. Do you have any custom code using WP Discourse Utilities? Is the WP Discourse plugin currently “Activated”?

5 Likes

Yes that was it, I included it in the code snippet and that fixed the issue. Thanks a lot!

2 Likes

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