Many plugins making WordPress run slow by design?

So this is what I've read:

  • Many plugins might get WordPress slow if they are activated
  • Many plugins might get WordPress slow even if they are not activated!?

An example

Let's say I build a large plugin and activate it in WordPress.

Later on I figured it would be better to split the plugin into a few plugins instead, just to change the parts individually. The code is still the same.

Will my plugins slow down my WordPress because there are many instead of one? How can that be?

Topic deactivated-plugin plugin-development plugins Wordpress

Category Web


All the answers you see here are correct enough, but here's what probably (probably!) really matters:

If your multiple plug-ins use code redundantly, they'll be worse, performance-wise, than one plug in with all the functions and doesn't repeat itself.

This is actually WordPress'argument for "why Jetpack isn't a resource hog"; they wrote really clean common code and it loads once instead of (potentially, right now, in Jetpack, 36 times).

And Jetpack IS kind of a resource hog, but their argument is valid in its way.

There's the closest thing you'll get to an "answer"; if you split your big plug-in later and call a library containing common code just once you will have very little performance hit.

You know ... unless something else is wrong ;-)


Having two or twenty plugins does not make difference because of the number of plugins itself. Maybe you can notice difference from one plugin to 1000 thousand, but not from 2 to 20. What the plugins do is what makes difference. Having 50 light plugins can be fast, while having one single plugin doing a heavy job or really poorly coded can be quite slow.

So, there is two key things to take into consideration:

  • What plugin does
  • How good or bad the plugin is coded

That's beign said, if you you split 1 plugin into, let's say, 10 to do the same job, the difference is 10 include statements instead of 1, so there is impact on performance but so minimun that you won't notice it. Splitting one fast plugin into a few ones will continue being fast, splitting one slow plugin into few ones will continue being slow.


I would be wary of things you read - e.g. there's a common myth that "having lots of plugins" is a bad thing, whereas of course what matters is whether they're well written or not. The time to load a large number of very well written plugins is neglible, whereas a line of bad code in one can easily screw things up for everything else.

There might be a case to split a plugin if it makes sense structurally, and you are likely to be able to reuse the individual plugins elsewhere, but concentrate on improving the quality of your own code first:

Make iterative improvements.
Find a good IDE.
Refactor often.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.