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?

3 Answers
3

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:

  • are you using classes (correctly)?
  • are any of your classes or methods becoming unmanageable (e.g. cyclomatic complexity) – use a tool like PHP Mess Detector
  • are you making common mistakes? try PHP Code Sniffer or JS Hint
  • are you using the database correctly/efficiently? e.g. don’t use query_posts ever
  • are you following the coding standards
  • is your code well documented? PHPDoc

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

Leave a Comment