Why I Upgraded My WordPress Website To PHP 7.2 And What Happened - Profitable Online Marketing For Business

Table of Contents

Why I Upgraded My WordPress Website To PHP 7.2 And What Happened – Profitable Online Marketing For Business

Upgrading My Website: My Case Study

I’ve been meaning to update my website for a while.

But you know, my parents were nursery people and we had the worst garden in the street! You never get around to it.

So here’s my website Online Business Builders. It’s on shared hosting operating on PHP 5.6 with caching. I’ve done some things to try and make it go faster.

It’s loading at about 4 seconds with a performance grade D. And there are a number of reds there in terms of things I need to do on the Pingdom tools test.

There’s a pretty similar result for another page.

You have to do all this analysis page by page.

But nearly four seconds again, and a whole lot of red results on that one as well.

I also tested it on the Google page speed tools. Below, you can see the mobile version of the website sitting there on the right. And Google gives a 36 out of 100 and a slow rating. So it needs to be fixed.

And I’ve just bitten the bullet on it to get it done.

The Upgrade Path Was Not Straightforward

Now, this should be easy for me, I’ve got access to the Cpanel. I just go into the PHP selector and click on that little drop-down and change it to 7.3 and set as current. Right and all done – simple. Not so fast!

But before you do that on your own website, you might want to yourself or get your developer to install the plugin called PHP Compatibility Checker to see whether your website is compatible with the upgraded versions of PHP. That one will give you a warning if there’s going to be a problem.

For me, I’ve got access to the Cpanel. I just switch it to 7.2 and see what happens.

And what happened was this fatal error. The website completely goes offline and stopped operating.

So simple, put it back to 5.6. And now I’m faced with the issue of what do I have to do?

The Process For Your Upgrade

What If A PHP Upgrade Breaks The Site?

So the process you need to go through if your website isn’t compatible with PHP7.1+ is that you basically need to take a backup of the website and go and check what’s stopping it being compatible.

That could be a plugin. It could be a theme, or it could be some other coding on the website. And you don’t want to be doing that in a live environment. You want to take it off onto a development version of the site and upgrade it.  This is covered in more detail in this video from Themeisle

That’s basically what I’ve done with my website. I’ve taken the website (copy) off onto my development VPN server that’s based here in Sydney on Vultur, which is a really good server and it goes really fast.

I’ve upgraded the theme from an old Builder Theme to Generate Press Premium (which is light and fast) and I’ve taken some of the plugins out and reinstalled some others and actually adjusted the look at the website because I’ve been meaning to do that for a while.

It was the theme that was stopping it operating in this case.

What Was The Result Of The PHP And Site Upgrade?

So speed-wise it’s gone from nearly four seconds to just under half a second in load time. A 10 times improvement from all of those changes and performance grade B. I’ve done nothing else but change the theme, change a couple of plugins and leave it at that.

It’s running on a different server, the VPN server, and it’s running better software and thus 10 times improvement in speed.

Testing it with Google lighthouse. It’s gone from 38 to 75 out of 100 on mobile. This was on my development server.

At this stage, I hadn’t installed it on the live domain yet. And from the desktop point of view, it’s gone to 84 from what was in the 70s somewhere.

So a vast improvement.

Remember this was running on a VPN, which is a fast server here based in Sydney.

Moving The Site To Live On Shared Hosting Slowed It Down

I moved it to (my live domain) on my shared hosting because I wanted to see what the impact was on the shared hosting server.

The load speed was still performance Grade B but it went from 0.44 seconds to 1.72 seconds.  Nearly five times slower and kind of half the time of the original site.

Another page here on the website also has a load time of just under one second.

So one or two seconds is OK.  But very likely I’m not going to leave it there (on the shared hosting).  I’m going to move it to the VPS hosting permanently and operate the site from there.

I like 0.4 seconds better than 0.7 seconds and I certainly like it better than 1.7 seconds for the other page.

This content was originally published here.