In this Episode 9 of Ask Paulie Anything, we’re going to discuss WordPress Automatic Updates, how they work, and how they can go wrong and stop working altogether.
WordPress Automatic Updates causes a lot of confusion for a lot of people. Why? Because they don’t always work.
When someone turns on Automatic Updates for any of their plugins, or they’re using Shield to modify Automatic Updates, even if the updates for that plugin or WordPress itself become available, it doesn’t automatically update. When that happens, people think that Shield is not working.
We’re going to explain why that’s not, in fact, the case. But, before we do that, we need to understand Automatic Updates for WordPress a little bit.
[0:51] –What Are Automatic Updates For WordPress And How Do They Work?
Automatic Updates for WordPress has been around for a long time. It’s stable and works very well.
How does WordPress know that there are updates available for your plugins?
Automatic Updates relies on the WordPress cron. The WordPress cron performs automatic tasks in a background.
It doesn’t interrupt the normal flow of a website – it runs in the background so no one is impacted by it.
The WordPress cron is a little tricky because:
- it can break;
- there could be an error; or
- … whatever the case may be it can not run automatically
Very often the cron doesn’t actually run, and that means that updates are not checked properly, and Automatic Updates which relies on the update detection aren’t automatically run.
What Can Go Wrong With Automatic Updates?
There are a lot of things that can go wrong with Automatic Updates, and just because you turn them on with a plugin like Shield, for example, doesn’t mean that they’ll work.
We’re going to discuss a few things that can go wrong with Automatic Updates and explain how to address the issues.
[2:06] – Your WordPress cron is not working
This is the #1 reason why Automatic Updates are not working.
To address that issue, we added a very simple cron in the Shield v6.7 release, so you could look on the Dashboard of Shield to see when was the last time the simple cron run.
That would tell you whether or not your crons are, in general, working. It doesn’t mean that all your crons are working but it means that your WP cron system is probably OK.
[2:36] – Your Automatic Updates system is broken
When WordPress does an Automatic Update it, first of all, needs to know the update is available. That update detection cron only works when someone visits your site. With a low traffic site, those automated crons won’t actually run for a while.
So, when someone visits your site and triggers the Update checking, the cron tries has a look to see if there’re any plugin updates. If it finds the updates, then the cron needs to run again, to actually automatically install those updates.
Can we specify when exactly those updates are going to run?
No, we can’t, because WordPress looks to see if there’re updates available and then the cron has to be executed again to implement those updates.
While you can turn it on, you can’t specify when exactly those crons are going to run.
Unless you’ve had visitors to trigger those automated crons, they won’t actually even get run.
[3:27] – Your plugins/themes turn Automatic Updates off
One of the beautiful things about WordPress is that everybody can write plugins for it.
You may have plugins on your site (maybe you run another security plugin) that are also telling WordPress to run Automatic Updates or to not. We’ve even seen some themes which turn Automatic Updates off.
While Shield can say “Yes, run Automatic Updates”, you could also have another plugin saying “No, don’t run it”.
The way to find that out is to dig into your plugins and themes a little bit further to see whether or not they’re interfering.
[4:08] – You’ve got PHP defines set within your wp-config file
Another quite important factor which may be stopping your updates is having PHP defines set.
There is a page on the WordPress Codex that highlights what these defines are.
These are hard-coded defines usually set in your wp-config, or sometimes in your themes’ functions.php
, that will actually completely disable the WordPress Automatic Updates system or disable them for the WordPress core, for example.
There are several PHP defines and the best way to know what they are is to look at the link above, have a look what those defines are and then go to your functions.php
or your wp-config.php
file and see if they’re in there. If they’re there, then remove or leave them – whatever you prefer.
So, that’s basically Automatic Updates.
If it’s not working, Shield or whatever security plugin you’re using to control it, isn’t likely broken.
It’s your:
- Automatic Updates system broken
- Crons
- Other plugins interfering with it
- You’ve got defines set within your wp-config
Questions and Comments
I hope that helps.
If you have any questions about this, leave your comments below or join our Facebook group to let us know what you think.
If you have your own question, you can always submit it by using the form below.
Cheers! 🙂