How do you ensure your code is as performant as it can possibly be within the ecosystem?

I’ve built a framework I’m proud of. 14k lines of PHP clean code, this was all transported into a plugin.

My framework offers extensive functionality on the customer support side, boasts great enhancements to the Customizer and a lot of versatility in terms of options.

In short, it uses a lot of get_options, wrangles a lot of internal data and is expandable in very elegant ways through just registering new instances of interfaced classes.

Now, the thing is – this all loads in 100-150ms. Surely, 95% of it is in the back-end, only for the administrator to see but I was thinking…

“Okay, well, assume I’m on a slow host, with about 10-15 plugins enabled”, that 150ms suddenly ain’t so appealing anymore.

What are the caveats to this and what should I look for, or rather, what are the questions that I should be asking myself to make sure my plugin / framework can work fast, having taken into account:

No unecessary loops.
No duplication of data.
No unecessary checks, think !empty($array) instead of if($array)
Transients used wherever possible.

I’m specifically looking for answers related to on-plugin caching and how to better manage my data / requests.

Read more here:: How do you ensure your code is as performant as it can possibly be within the ecosystem?

Leave a Reply

Your email address will not be published. Required fields are marked *