Issue
A WordPress website stopped working. Both, front-end and back-end (admin) sites are not loading. Instead, the following message is displayed by a web browser:
There has been a critical error on this website. Please check your site admin email inbox for instructions.
There is nothing relevant in the site’s admin email inbox.
Resolution
To get to the bottom of the issue, first of all, I enabled debug logs in WordPress:
Open wp-config.php file and add the following lines just before /* That’s all, stop editing! Happy blogging. */ comment towards the bottom of the file:
define( ‘WP_DEBUG’, true );
define( ‘WP_DEBUG_DISPLAY’, false );
define( ‘WP_DEBUG_LOG’, true );
Try to load the website and look for the debug.log file in /wp-content folder.
Among other things, I found the following line in the debug.log:
[26-Sep-2022 10:57:33 UTC] PHP Fatal error: Uncaught Error: Call to a member function is_main_query() on null in /srv/websitedomain.com/public/htdocs/wp-content/plugins/the-events-calendar/common/src/Tribe/Context/locations.php:50
This clearly points the finger to “The Events Calendar” plugin. I disabled the plugin by renaming /wp-content/plugins/the-events-calendar folder to the-events-calendar_DISABLED.
The website was now loading with no issues. I navigated to WordPress Admin Plugins section and updated “The Events Calendar” plugin, which resolved the issue.
Remember to disable debug logs and remove debug.log file.
September 2022
WordPress 6.0.2
The Events Calendar 6.0
Leave a Reply