Code is poetry

Hi, I'mYuriy Hirivskiy

Web Developer

Download Resume

WORDPRESS PLUGINS VS SNIPPETS

Working with large sites on WordPress, you can face the fact that you have to install a huge number of plug-ins that gradually overload the site, and it looks like a huge dump of braking debris. I found a solution for this problem, which will help reduce the number of plug-ins and generally improve the site’s performance …

Are there many plug-ins that are bad? It’s no secret that half of the plugins have vulnerabilities, not to mention that if you look at the code of a plug-in, you can see 10-30 lines of code that could be inserted into the topic, but for some reason they are in the plugin. And I decided to gradually give up a huge number of plug-ins, or rather from their installation, unnecessarily disadvantages more than pluses.

To begin with, I just analyzed and collected all the most popular plug-ins that I use in each project and that contain 1-2 files with a total code capacity of not more than 50 lines. An interesting coincidence, but all these plugins were downloaded from the official WordPresss repository and have not been updated for more than a year or more. Consequently, all these plug-ins were developed according to the principle “Whenever it is installed, they will work in any case and under any circumstances.” Next, I created a separate directory in my template, where I put all these former plug-ins, after having worked them and divided them into separate files.

Total, I got 5 files containing the codes of the former plug-ins, but quietly and painlessly for the eyes connecting at the end of the functions.php of my theme. Beauty, now entering the list of plug-ins for 5 plug-ins has become smaller. Now it remains to solve the problem with new plug-ins. After all, I will not always install new plug-ins every time I develop a project, and then analyze each and decide whether to leave or introduce into the topic a snippet, the method described above. In any case, doing this can lose a lot of time, but I do not need it. Therefore, I found this site, which contains a ready-made list of snippets of popular small plug-ins (and not only). The only downside is that this resource is still “raw” and does not contain as much as it would be desirable, but in any case at least some snippets can be found there if there are difficulties with transferring the plug-in code to the topic.

Leave a comment