Apart from keeping your WordPress core, themes, and plugins up to date, you should also ensure that you are using the latest PHP version available.
This will not only improve your website’s performance, but will also have a greater impact on your website’s security.
PHP versions are usually fully supported for two years. After that period, bugs and security issues are typically not fixed and patched anymore.
So, if your PHP version is 7.1 or lower, you are being unnecessarily exposed to security vulnerabilities.