When installing the Perfmatters plugin, it’s rare, but you might run into an error like this which prevents you from activating the plugin:
Plugin could not be activated because it triggered a fatal error. Parse error: syntax error, unexpected '?' in /www/wp-content/plugins/perfmatters/inc/functions.php on line xxxx
The reason for this is usually because you’re using a very old version of PHP. We currently require PHP 7.0 (released in 2015) or higher for Perfmatters to work properly.
How to check your PHP version
Follow the steps below to check what version of PHP you’re running.
Under “Tools” in your WordPress dashboard click on “Site Health.”
Click on the “Info” tab.
Scroll down and expand the “Server” section. You should see the PHP version you’re running.
While we only require PHP 7.0 or higher, WordPress officially recommends PHP 7.4 or higher. Any version below PHP 7.4 is actually a big security risk and bad for performance since it’s no longer updated, developed, or supported.
If you need to update your PHP version, the easiest thing to do is check with your hosting provider or their documentation. Some hosting providers, like Kinsta, even have a toggle where you can easily switch between PHP versions.