Perfmatters Review: Love it or Leave it

I have been playing a little with the code snippets and the elements section from GeneratePress.

One day I was thinking if it was possible for me to use code snippets to take care of some or most of the stuff that PerfMatters does and that motivated me to write this very honest take on Perfmatters.

Don’t get me wrong, Perfmatters is a great plugin, probably the plugin every WordPress site must have.

If you don’t want to complicate yourself testing if code snippets for this and that still work or if the code snippets don’t conflict with existing plugins, themes, or the WordPress core, you should go and get yourself the Perfmatters plugin, I am sure your site will thank you for that.

If you think Perfmatters is a plugin you should have, click on my affiliate link and support more honest reviews.

These are my notes trying to figure out whether I can live with Perfmatters or not.



Current Status

This series is called “Love It or Leave It” for a reason.

I stopped using Perfmatters because I had everything under control with the help of code snippets and a minimalistic approach to web design and functionalities.

A year passed and I subscribed to Pefmatters again since I started playing with plugins and features that require a speed optimization plugin to make things easier and avoid headaches.

I am using Perfmatters at this very moment but I will continue sharing my thoughts about how to optimize your site without it in case you can’t afford it or simply don’t want to use it.


Perfmatters Support

If you need support, you will probably find a lot of help on the plugin’s documentation.

If the documentation doesn’t cover it, you might reach the Perfmatters support team and they will guide you.

I don’t contact support very often but when I do, they are always willing to answer my questions and help me if I can’t really do that myself.

It is a great plugin, with great support, and great developers behind it.


My WordPress Stack

My WordPress stack is kind of simple, I use only 12 plugins and most of them are pretty lightweight.

#1Ad Inserter Pro
#2Cloudflare
#3Code Snippets
#4GenerateBlocks
#5GenerateBlocks Pro
#6GP Premium
#7MB Custom Post Types
#8H5P
#9Perfmatters
#10Smart Crawl
#11Table of Contents Plus
#12WP – Optimize

These are my thoughts about each one of the plugins that I use:

  • Ad Inserter Pro add some scripts and styles but they are all necessary if I want to monetize my WordPress site the right way.
  • Cloudflare is installed because I don’t want to go to the CF panel to clear the cache every time I modify a post or page. I also use it on some sites because I am paying for Cloudflare APO.
  • Code Snippets gives me the chance to add scripts, styles, and custom PHP so I don’t have to modify the theme files.
  • GenerateBlocks has only 6 blocks but all the CSS is inlined so I don’t have to worry about it in terms of speed
  • GenerateBlocks Pro doesn’t have every block you ever dream of but you gotta respect the work it does if you love simplicity.
  • GP Premium is something I have to keep using because of the “Elements” section.
  • H5P is a good reason to get yourself the Perfmatters Plugin. H5P adds several styles and scripts.
  • Perfmatters is a plugin that should be installed on every site if you care about speed and peace of mind
  • SmartCrawl has everything you need to do SEO.

Most WordPress users recommend using a plugin to handle caching and your site security

I don’t use security plugins because I have built a Firewall using Cloudflare and that firewall is far more powerful than the security plugins out there.

I am not using a caching plugin because my sites are pretty lean and more than 95% of the requests are handled by Cloudflare servers. If I ever use a caching plugin, I would probably use something simple.


PerfMatters Sections

Perfmatters is divided into 7 major sections

#1General
#2Assets
#3Preloading
#4Lazy Loading
#5Fonts
#6CDN
#7Analytics

Perfmatters: General (1)

This is the part that requires a bunch of code snippets to do what PerfMatters does

I found lots of code snippets to disable and remove some of the unnecessary stuff that WordPress adds to sites.

OptimizationSnippet
Disable EmojisCode
Disable DashiconsCode
Disable EmbedsCode
Disable XML-RPCCode
Remove jQuery MigrateCode
Hide WP VersionCode
Remove wlwmanifest LinkCode
Remove RSD LinkCode
Remove ShortlinkCode
Disable RSS FeedsCode
Remove RSS Feed LinksCode
Disable Self PingbacksCode
Disable REST APICode
Remove REST API LinksCode
Disable Password Strength MeterCode
Disable CommentsCode
Remove Comment URLsCode
Remove Global StylesCode
Disable HeartbeatCode
Limit Post RevisionsCode

This section also has the option to change the login page URL

I don’t use this option since CloudFlare Firewall Rules are probably the best way to reduce brute force attacks made to the login page.

Note: If you have to manage several sites, the process of keeping these Code Snippets updated could be a pain in the *ss but it is 100% possible.


Perfmatters: Asset Manager (2A)

The script manager is really useful when you want to remove styles and scripts from your site.

If you don’t have PerfMatters, you can dequeue styles and scripts using code and a code snippets plugin.

This is how I remove some GeneratePress styles I don’t really need because I am not using the blog page and categories pages since the Query Loop block does it better.

// Dequeue Scripts and Styles
add_action( 'wp_enqueue_scripts', 'tu_remove_menu_scripts', 50 );
function tu_remove_menu_scripts() {
	wp_dequeue_style( 'generate-widget-areas' );
	wp_dequeue_style( 'generate-blog-columns' );
}

Perfmatters: Scripts (2B)

In this section you can delay the execution of scripts, I delayed the execution of all scripts and I exclude the ones that I really can’t delay or don’t want to delay.

For instance, I don’t delay ads since that is my main source of income from websites.

If you can afford PerfMatters you can delay scripts with the Flying Scripts Plugin.

The Flying Scripts doesn’t really get much love since it is free and that feature is part of Flying Press, a great caching plugin.


Perfmatters: Styles (2C)

CSS is not super hard, you can dequeue a stylesheet and add the necessary styles some other way.

I do this with the Block Library since I don’t use most WordPress blocks.

If you don’t want to test what styles your sites need and which ones don’t, you can rely on Perfmatters to do the job and exclude any styles you don’t want to optimize.

Note: Purifying CSS can be a complex task for many WordPress users, and big sites with several styles might make you questions if you really want to do that manually


Perfmatters: Preloading (3)

Instapage will load links before visitors click on them.

I don’t use InstaPage since it is used only to improve perceived performance and that feature adds an additional request to your site.

I am not preloading, pre-connecting, or prefetching anything.

Note: I haven’t tried preloading, pre-connecting, or prefetching anything with the help of code snippets yet. I am sure there is a way.


Perfmatters: Lazy Loading (4)

There have been periods of time in which I haven’t lazy-loaded Images, Iframes, and Videos because I usually add these files way below the fold and WordPress took care of them.

For some reason, the native lazy loading feature didn’t seem to work so I kept most features in the lazy loading section activated.

Then I figured out that the problem of browsers not lazy loading my images, iframes, and videos was because the class that tells the browser to do that was missing.

I wrote some code with the help of an AI tool, and added the code to my site with the help of a code snippet plugin:

function add_lazy_loading_to_images_iframes_and_videos($content) {
  // Check if the content contains any img, iframe, or video elements
  if (preg_match_all('/<(img|iframe|video)\b[^>]*>/i', $content, $matches)) {
    foreach ($matches[0] as $match) {
      // Check if the element already has the loading="lazy" attribute
      if (!preg_match('/\sloading="lazy"/i', $match)) {
        // Add the loading="lazy" attribute to the element
        $lazy_loading_element = preg_replace('/<(img|iframe|video)\b/i', '<$1 loading="lazy"', $match);
        $content = str_replace($match, $lazy_loading_element, $content);
      }
    }
  }

  return $content;
}
add_filter('the_content', 'add_lazy_loading_to_images_iframes_and_videos');

Now my videos, images, and Iframes are being lazy-loaded without the need for a JS library.

Keep in mind that the Lazy loading feature on Perfmatter does more than the simply native lazy loading functionality implemented by most major browsers.

If you don’t have PerfMatters, you can use the LazyLoad Plugin – Lazy Load Images, Videos, and Iframes to handle the lazy loading.

Note: I did some searches and it seems that lazy-loading images, videos, and Iframes requires some intermediate coding skills and the use of libraries if you want a simple script to handle things the way lazy-loading plugins do.


Perfmatters: Fonts (5)

I was the kind of person who will tell you to stay away from Google Fonts but I changed my mind recently.

Why use Google Fonts?

I can use Google Fonts without feeling sorry for my site speed

Note: It is recommended to use Local Google Fonts and I don’t think there is a way to do that simply with code snippets.


Perfmatters: CDN (6)

The CDN rewrite option allows you to easily use third-party CDN providers on your WordPress site.

Rewrite means that it will automatically change all of your assets’ URLs on the fly to use the CDN URL

I am using Cloudflare for all things CDN and security so I don’t use anything from this section.

Some users might need it but I don’t.

Note: I have never used an additional CDN for resources such as images. I am not sure if that improves load times when you are using full-page caching or Cloudflare APO.


Perfmatters: Analytics (7)

There are several options that you can play within this section to reduce the impact of Google Analytics.

When I use this speed optimization, I usually go for the minimal inline script type.

If you don’t have PerfMatters, you can use this script to reduce the impact of Google Analytics on your site.

You can add the script to the footer using Elements from GeneratePress or any insert header and footer plugin.

Take into account that the Google Analytics script created by Perfmatters is minified in a better way than the alternative provided by Minimal Analytics.

Note: I have used the minimal analytic script and it works as expected. I just need to check for my pageviews and that’s pretty much it I do with the Google Analytics data.


Conclusion

It takes a lot of work to maintain code snippets when you have several sites, especially when you are dealing with client sites.

Perfmatters is a great WordPress plugin and there are far more complex sites than mine that might benefit from using it.

This is not a guide to help users avoid Perfmatters, I didn’t deal with everything the plugin can do and what it could potentially do for your site in complex scenarios

Do you know how many hours it takes for a non-coder to figure all this out?

The plugin is reasonably priced so show your appreciation for the developer of the plugin and buy PerfMatters today.


More about WordPress Speed

I hope that you have found this guide useful

These are other posts that you might want to check out:

  1. How to Optimize GeneratePress for Core Web Vitals [100% Solved]
  2. How to Lazy Load Ads
  3. How to Preload Links in WordPress
  4. How to Optimize Table of Contents Plus for Speed
  5. How to Use Flying Scripts to Speed up Your WordPress Site
  6. How to Use Cloudflare Full Page Caching With WordPress
  7. Optimizing WordPress Sites with Autoptimize
Manuel Campos, English Professor

Manuel Campos

I am José Manuel. I am writing about things I know and things that I am learning about WordPress. I hope you find the content of this blog useful.

WP SURFER

home

about

privacy

contact

© 2024 WP SURFER • Made with Love in Costa Rica