I will jump to the list first and after that I will explain what & why. Here it is:
That's the list.
I hope it will help you solve most of your performance issues. Now I will explain why.
First of all you are most likely using a custom theme. Based on the most popular places that you probably got it, it's most likely using a MVC theme structure. The best way to work out your plugins is to integrate the plugin functionality into this MVC structure (if you don't know how and you're looking for someone to do this for you throw me a mail ). There are several reasons why this is the correct approach.
- It's the performance approach
- It's custom solution that a web dev guy would prefer to support
- Super easy to customize
Integrating plugins in a theme is not always the correct approach - not when it's up to adding shortcodes and stuff, but most of the times it is the next step the higher performance and scalability.
Usually when a new client comes to me and ask for a CMS-based scalable solution for web project and what should be based on, the last thing I'd say would be WordPress. But usually that's not the case. As by far being the most popular web container WordPress is well known and everyone that at some point had presented their business online are familiar with. Which as fact is more important to most clients than having it the right way. The right way as it should be, would cost more and not compatible to small businesses, that aren't ready with budget above the border line of 30 grand.
Supporting plugin-integrated themes
When it comes to that it's by far the easiest to support a custom made theme. For the past 2 years with our team we've been creating a high performance premium theme framework for WordPress that includes plugin integration and tracking.
It allows us to integrate all the plugins you'd need and keep them up-to-date within days of initial new version release.
Building high-performance web sites was a dream of mine for the past 5 years. And every day since the first month I've been making that dream come to true, by just getting it better.
When it comes to custom themes where you need to take the time to study it's structure and integrate a plugin, it might be a bit rough, but it's definitely worth it.
The cheesy integration
What you might see in most themes is a large number of spaghetti included as a 'library' into it. As a both author & buyer on the largest wp themes market Themeforest I've seen stuff, that the author in me regrets for buying and wants to punch the client in me in the face.
Mostly the market there is filled with great designers and shitty developers which is the cause why I hate their double standards. For the front-end development quality check they really do their jobs and check every pixel, but as for the back-end it's terrible.
What's so bad in having a lot/any of plugins
As I got roasted really hard for my 'beliefs' on slack I forgot to turn my other cheek (i'm sorry guys). So I did my homework.
There is a nice graphic showing how elements are loaded within the WP core:
This is the list of actions run by the WP core on a page request
What this graph shows is the exact location where your plugins are being executed (or that's what I am showing here). It's just before the theme. Now why am I going against my thoughts few paragraphs back there. Well, I am not. As I previously said, loading 0 plugins is the thing that you need for your theme. Since you can't run your web site without a theme, but you can run without plugins this is the point where you sit back and listen.
Every theme executes a fair number of hooks to the core. Every plugin does the same, so what's the point in mashing important theme functions during plugin calls. That's the point of plugin-to-theme integration. You can set your prioritized hooks, you can manage carefully what and where to execute and even combine hooks inside the MVC structure.
Here is an article against everything (or mostly everything) I've said so far. Just to make sure I made my point I will share few of the stuff that are pointed out there as "pluses" to using plugins.
- Separating your code into "chunks" is one of the best things you can do for large projects, as it makes the entire project much easier to maintain, and debug in the case of a problem. By placing your separate pieces of functionality into their own dedicated plugins, you effectively create these "chunks". Each plugin is maintained separately, which (as you will find) can make it infinitely easier to track down problems.
- If something breaks, you simply deactivate the plugin. Let's say that the contact form on your site is integrated into your theme and it breaks, bringing the site down with it. What do you do? If you don't have the skills or know how to replace the contact form with a functioning one, you are in big trouble. On the other hand, if the functionality is provided by a plugin, you simply deactivate the plugin, and bring it back online once the problem is fixed, or you go find a new one.
- If you ever want to change themes, as most sites will do at least once or twice, you will lose every bit of custom functionality you have (including short codes) because the new theme will either not have the same functions, or it will execute / build them differently. If you, however, had all of your short codes inside of a plugin, as well as things like contact forms, all you have to do is upload the new theme and activate it: everything will still work just as before. Isn't that right there a good enough reason to say that plugins are better for separate pieces of functionality than themes? I believe it is.
- Plugins can each be separately updated and enhanced. If you add improvements to a theme, then the entire theme has to be updated. How many times have you seen a user of a theme add customization to the style.css or functions.php? If they have done so, it is impossible for them to update the theme and get the new improvements without manually moving all of their changes over. This is assuming they have not created a child theme, which they should have but many users don’t. When the improvements are placed into a plugin, the user has to do nothing more than update the plugin from their Dashboard.
So let's go. I know it's old article, but the principles won't change in 2 years. That's why I think it's important to discourage beliefs set by plugin developers (because they are more than theme developers and I'm neither .. )
- Those 'chunks' are part of your theme's MVC structure. And as for a 'whole-sale' kinda developer not interested in half-ish made stuff I am pretty sure I'd rather maintain a code that is logically connected and doesn't make call I've never authorized. Creating a simple option field within the admin panel calls a function, if I created already 15 of those within the theme in 1 function, why'd I need a 2nd function for just 1 that's caused by the separated 'chunk' (the plugin).
- Nothing would break if the plugin is integrated to the theme. No comment on this one. Plugin would break if it's incompatible to a theme (or with the WP version, but that's rare and for unsupported plugins)
- Same one as above. It won't happen. Look here.
- That's true. Plugin can be updated and enhanced, but plugin can be successfully integrated into a theme post-update for no more than few hours. With a proper plugin integration the plugin would be able to match the theme structure and stay at one piece like it was before.
So basically the biggest concerns aimed by plugin developers are related to plugin-theme incompatibility. Something that with once-at-a-time integration won't happen.
The other side. When all this is wrong.
There are certain parts of the WordPress core that are better maintained by a plugin. As I previously said a huge part of this is the editor, it's short codes and posting functionality. All this is better maintained by a plugin than theme functions.
Of course everyone has their own beliefs. My main concern is keeping the simplicity. For example: rather than having 15 shortcodes that are turning your blog post into a page you can use a custom post format with a page builder and do the job.
WordPress is a blogging platform, it was, it will be a blogging platform. It doesn't matter what are people using the core for - newspapers, magazines, portfolios, eCommerce solutions or else. Any external functionality should be added as it is, as external not interacting with the core functionality.
Those were my 2 cents.