cat staring at computer screen

Image formats and the end of PHP 7.4

Change is a constant of life and websites. Here are 2 noteworthy changes: WebP images and the end of PHP 7.4. 

The first you should embrace. The other you really must embrace. Because you want your website to be around long past the end of this year.

Let’s start with the should embrace one:

Website image formats: WebP and SVG

WebP

WordPress 6.1 coming this fall will use the WebP image format as the default format for core image sizes. Please see the update note at the end of this section.

In my last news article, I wrote about the WebP image format and why we should be using it on our websites now.

The new twist is that WebP will become the default image format in WordPress 6.1, at least for core image sizes. 

If your website has custom image sizes defined or if you want more granular control over image compression, you’ll still want to use an image processing plugin, like my favorite EWWW.

Using WebP in core is still good news, because it will speed up image handling in WordPress out of the gate and should help deliver higher quality images at smaller sizes.

Takeaway: If you want all the benefits of the WebP image format now, then implement it with a plugin. You’ll save space and see faster image loads, all while delivering great image quality. What’s not to like?

UPDATE: According to the latest reports, WebP as default image format was pulled from the next WordPress release. It appears there were lingering issues with implementation. Not an issue with the image format itself — my recommendation is still that you move to using WebP for images on your website. Because it does produce better image quality with smaller file size.

SVG

There’s another image format that isn’t currently natively supported by WordPress, but may be in the not so distant future: SVG.

SVG is a file format that handles vector images (think graphics and logos) very effectively. The files are very small. But much more importantly, they scale to any size while still remaining super sharp.

So what’s not to like?

Well, a SVG image is a text file that instructs the browser how to draw the image. Because it’s text, it’s also possible to insert malicious code into the file. So it could be an entry point for malware or hacking. 

That’s also why WordPress so far hasn’t natively supported the SVG format. Instead we’ve relied on plugins, like SVG Support, for this capability. And set rules for which users can upload SVG images, to prevent security issues.

Even with that limitation, I and many other web designers and developers have relied on SVG files for logos and graphics on websites for years. Because we like the small files and that the image is always razor sharp. No more fuzzy logos.

When WordPress ultimately includes native support for SVG files, we expect there will be scanning of the uploaded file to keep malware out.

Takeaway: Want logos and icons on your website to look stunning at any screen size? You should definitely use the svg image format for those types of images.

PHP 7.4 End Of Life in November

Which version of PHP is running your website and why should you care?

PHP is the programming language that powers WordPress websites (and many other websites as well). Like any programming language, it can be subject to hacking or malware attacks. Because if someone can get to the PHP files on your website, they can totally take over and reprogram the site. Which is very bad.

For that reason, every website needs to be running a current version of PHP. One that is regularly updated to patch any security flaws. The current version of PHP is 8.x (x because there are a few minor versions).

Currently PHP 7.4 is the most used version. But it’s End of Life and security updates will end at the end of November this year.

After that date, there will be no more security updates. Any vulnerabilities discovered will then remain unpatched and ready for some attacker to exploit.

So of course as a website owner, you should make sure that your website is on a server that supports PHP 8.x.

Here’s how you can find out which version of PHP your WordPress website uses:

  • From your WordPress Dashboard, in Tools, find “Site Health”. Click on “Info” and “Server”. Check for your PHP version.
  • Log in to your Hosting Control Panel. There should be a section showing what software is running on your server, allowing you to find out the version of PHP in use. It may also show other versions of PHP available to you.
  • Contact your hosting provider. They can check your hosting account and tell you what version of PHP your website is using.

With all support for PHP 7.4 ending, our WordPress websites should use PHP 8.x. 

However, a lot of things are changed in PHP 8 and a website that runs fine in PHP 7.4 or earlier may well experience some broken features when upgraded to PHP 8.x. 

For that reason, I strongly recommend testing any PHP upgrade on a copy of the website. Not the live one. 

That way, when something breaks, you can fix it without the live website being down. Once you know that the copy of the website runs fine in PHP 8.x, you can upgrade the live website.

One more thing

If for some reason your hosting company can’t or won’t make PHP 8.x available to you, it’s time to find another hosting company. I’ve seen hosting companies offer only old versions of PHP and claim that it’s okay, because they’ve “hardened” the PHP. Don’t fall for it. Find hosting with a current version of PHP. 

Takeaway: Upgrading PHP to version 8.x is not really optional. Sure, hosting companies continue to offer old, outdated versions of PHP and your website will continue to work running one of them. But there are no security updates for those old versions. Ever. So you’ll be inviting hacking and malware. Not a good scenario.

Summing it up

Updating image formats is an easy change. Although it might take the plugin a while to process your entire current image library. But once that’s done, new images will be processed when uploaded and you’ll enjoy the benefits of the WebP image format. And using svg for vector images such as logos and icons is also an easy choice, because you do want everything on your website to look its best.

Dealing with the end of PHP 7.4 may feel more challenging. Because it won’t actually totally go away or stop working come the end of November. It will still be there, but with no further security patches. 

That’s like opening all doors and windows to your house and just hoping nobody will come and steal that big screen TV, computer or any other goodies you have. Not a question of “if” but “when”. 

Which means now is high time to find out if your website will break when switched to run on PHP 8.x. While there’s still time to fix or rebuild.

Never miss out!

Get an email update every time I publish new content. Be the first to know!