Updating WordPress: What is “PHP” and what does it have to do with WordPress?
Quick intro — PHP is a programming “language” which powers a large number of websites you see on the internet. You don’t see any special “PHP powers” visibly on your browser, because everything that happens will happen on the server where your website is hosted. So, when you open your Google Chrome or Firefox browser and type in the address of your WordPress website, your browser sends the request to the server, which in turn sends your request to the “PHP engine” running there. The PHP engine gets your web page processed, and sends you back the HTML code which gets displayed on your browser.
Now, what does that have to do with WordPress?
WordPress, in all its magnanimity, is a “software” which is primarily written using PHP. WordPress uses what is called an “Application Programming Interface” (API, in short), which is coded using PHP. (Think of it like chocolate ice cream. You call it chocolate ice cream, but chocolate cannot happen without the underlying cocoa, sugar, milk and butter).
Now, let’s talk about updates. “You should keep your WordPress website updated” — you would have heard this a hundred times if you have run a WordPress site fairly long enough. When you have a public-facing WordPress website or application on the internet, the following should always be kept up to date (which goes up in that order):
- Your plugins and themes (software)
- Your WordPress core files (software)
- Your server software (PHP software, to be specific)
- Your server’s operating system (usually Linux or Windows)
- Your server’s hardware
Don’t be alarmed, because most of the work here is done by your web hosting provider, and any reputed ones will make sure that they are on top of this. They take care of updating the hardware and operating system, and also provide you with the latest version of PHP on your server. But it’s your job to make sure that your WordPress is making use of the latest version of PHP.
Whoa, why is that my job? I don’t know anything about PHP.
Most users have more than one website running on the same hosting space. Some of them are WordPress based, while others are created using other features of PHP. In the last few years, there has been a large number of changes done in PHP. There have even been significant differences in the way your website’s code talks to the database to get you the required information. Compared to the old ways, the latest version is more secure and less prone to external hacks.
Unfortunately, there are many applications that still use the old code, and the owners have never thought of upgrading it. Some of these are monoliths that still powers entire businesses, even though they’re vulnerable to hacks. Your host can easily push the latest software from their end, but it would break these applications and it may not be an easy fix. So, in all fairness, it’s a conscious call by the hosting service providers to let the users decide.
Ok, so what should I do now?
Let’s take the top-down approach. First, make sure that your themes and plugins are updated. Then go for the WordPress core files. Doing these two steps is pretty easy, and you can update these directly from your WordPress dashboard.
But a word of caution — if you have got your own customizations done to the third-party plugins or themes that you use, or if your WordPress version is way old (that is, if you are currently running a very old version of WordPress), test your changes first by creating a “staging site”.
A staging site is a copy of your existing website running under a different domain or a folder. You can test your upgrades on the staging site and see if anything breaks before you attempt the upgrade on your public-facing site.
WP-Engine’s “PHP Compatibility Checker” is a great plugin to check if your plugins and themes are compatible with the latest version of PHP.
Next, the PHP version. If you have WordPress 5.2 or above and your site is using a lower version of PHP, you would usually see a notice on your WordPress dashboard — which looks something like this:
Another easy way to check your PHP version is the “Display PHP Version” plugin, which you can get from the Plugin directory (just search for “Display PHP Version” under Appearance > Plugins, and it will show up), or you can download it’s latest version from here. The only thing this plugin does is to show you the version of PHP that powers your WordPress site on your Dashboard (see image below).
If you see a version below 7.0, then you should look at upgrading it.
How do I get my site to use the latest PHP version?
If you’ve come this far, then you can now check if your host does provide you with the latest PHP software. You can check this by logging into your cPanel. I have a quick video below which shows how it is done on Hostgator’s cPanel. For most hosting providers with a cPanel, the process is similar.
What if I don’t see anything above 5.x?
This is when you contact your host. It’s quite rare nowadays that you won’t find a higher PHP version installed on your server. But if you don’t, you should contact your host immediately. Chances are that you’re on an old server, and they didn’t bother to move you because, well, you didn’t ask. Ideally, they should upgrade all servers, but sometimes the underlying hardware does not support the latest version of the Operating System (Linux, for example). But that said, it is not a valid excuse to not get you upgraded.
Maintaining a website is not an easy job, but the merits are quite good. You can concentrate on your business without having to worry about your website getting hacked or taken down if you keep a few of these things under check. If you’re not tech-savvy, don’t worry — with WordPress, there is a large enough community of developers to provide you support. You can always employ a WordPress Professional to get the best results.