The joys of updating plugins! Sometime everything goes without a hitch and you’re blissfully unaware that underlying code has changed and bugs have been squashed. Then come the days when you get fatal errors that cause your website to fail. Great! Today I caught this error aftering updating a couple of plugins for a client >
Fatal error: Uncaught Error: Call to undefined function trailingslashit0 in /home/customer/theirdomain.com/public_html/wp-includes/class-wp-textdomain-registry.php:103
Luckily most errors will tell you what’s wrong and their location, so you have some chance of fixing it.
As I couldn’t log into the site itself, I had to log in to the host to access the website backend environment. I navigated to the File Manager and located the class-wp-textdomain-registry.php file in the folder. Sure enough line 103 had code with trailingslashit – a fitting name to be honest, depending how you read it 🙂
A quick Google search and I came across a fix on Stack Overflow – my go to place when encountering code errors. This forum is so helpful and I’ve saved many a site with their suggestions.
A word of caution – always take a copy of code before you change it, in case it makes the issue worse or creates another problem.
This error had been reported a few times, but this is the post I found and referred to:
I edited line 103 and bingo the site was back, although it was stuck in the maintenance mode loop. Irritating!
How to get out of a WordPress briefly unavailable for maintenance loop?
If you see the “briefly unavailable for scheduled maintenance check back in a minute” WordPress message then something has happened to interrupt the updating process – for some reason WordPress hasn’t erased the .maintenance file.
The fastest way to get out of this loop is to get WordPress out of maintenance mode by manually deleted the .maintenance file! You can get to this file by using a File Transfer Protocol (FTP) client or cPanel and File Manager.
Use FTP to take WordPress out of Maintenance Mode
- Access your site’s root directory via FTP (using a client like FileZilla).
- Once connected to the server you will see a list of your site’s files under the public_html folder.
- Find the .maintenance file. Then right click and delete it.
Yes it’s that easy! Refresh your site and that message should be gone. If the maintenance file isn’t there it may be ‘hidden’. To see if this is the case you can click on Server > Force showing hidden files at the top of your FileZilla window. Done.
Use cPanel and File Manager to take WordPress out of Maintenance Mode
If your hosts uses cPanel then you can access the site’s root directoy via File Manager and delete the .maintenance file this way.
- Log into cPanel, go to File Manager and find the /public_html folder for your site.
- You will see the .maintenance file there and can right click on it and delete it.
- Refresh your WordPress site and the maintenance message should be gone. Poof, done!
If for any reason the .maintenance file isn’t where it should be, look for the wp-activate.php file. Open the file and look for this changing the value from ‘true’ to ‘false’:
define( 'WP_INSTALLING', false );
Then save your file and close. Refresh your site and it should be good to go. Yahoo! Your site is back.
How to prevent WordPress unavailable for scheduled maintenance message
- Don’t close your browser windows whilst updates are running.
- Don’t run too many updates all at once – do them one at a time!
- Use a staging site to test updates before running them on your live site.
If this error happens to you a lot when updating, look at your hosting plan memory. It could be limiting your site flow because your storage is low or the server is slow to respond. A better hosting plan may resolve this issue.