Title: Structuring and performance considerations
Last modified: August 17, 2021

---

# Structuring and performance considerations

 *  [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/structuring-and-performance-considerations/)
 * Hey
 * I love this plugin. The ability to easily add custom code and snippets in an 
   easy to use interface is superb.
 * I need to write quite a bit of code, adding lots of filters and actions to extend
   the functionality of another plugin: Restrict Content Pro. The specifics of that
   plugin aren’t really important, except to say that there is a generous mix of
   HTML and PHP required to add additional form fields and import/export functionality
   to it.
 * I could put this in a site specific custom plugin, but I like this plugin so 
   much that I don’t want some code here and others in a plugin. The site specific
   plugin isn’t exactly reusable.
 * Is there any general recommendations in terms of size of code/how best to split
   up the code in to different snippets? It was always once said that eval is slow,
   but I don’t know how true that is.
 * Thanks!
    Jamie

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/structuring-and-performance-considerations/#post-14777992)
 * [@bungeshea](https://wordpress.org/support/users/bungeshea/)
    I just wanted to
   add after reading through nearly every page of this forum – you are an absolute
   star. Most of the issues I’ve read relate to broken code or botched PHP upgrades
   that have nothing to do with your plugin, but of course it and you are directly
   in the firing line. That you still help and even go so far as to fix code outside
   the scope of your plugin is testement to you.
 * I’ve spotted a couple of threads from what can only be best described as rude
   and entitled people and both cannot fathom how you have kept your cool and how
   they have the attitude and expectation for free support for a free product, which
   is maintained for free. As a developer of sorts myself, I feel frustrated for
   you.
 * Jamie
    -  This reply was modified 4 years, 9 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
    -  This reply was modified 4 years, 9 months ago by [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/).
 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/structuring-and-performance-considerations/#post-14838149)
 * Hi Jamie!
 * Apologies for the delay in getting you a response. I definitely don’t envy you
   going through all of these forum posts – there are a lot of them there!
 * I’ve been thinking about your question, and I think this mostly comes down to
   personal preference. There aren’t a lot of technical factors to take into account.
   Each snippet is evaluated separately, so I suppose technically there’s a performance
   difference there, but they are all fetched from the database in the same query.
 * I would probably separate the code out in such a way so that the code within 
   one snippet is not wholly reliant on the code in another. This would allow toggling
   of activation status for any of the snippets for debug purposes without affecting
   the site too much.
 * Apart from that, it’s difficult to speak generally. Apologies that this probably
   hasn’t provided a lot of clarity, but please to post any follow-up questions 
   you might have.
 *  Thread Starter [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * (@jamieburchell)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/structuring-and-performance-considerations/#post-14841851)
 * Thanks Shea
 * I also came to the conclusion that it’s better to have small non-dependent snippets
   that can be easily toggled to affect discreet functionality. It’s great that 
   all of the snippets are fetched with one query too.
 * For my use case above where I needed to write quite a bit of code to extend a
   plugin I decided to write that as a custom plugin, but for everything else I 
   have used Code Snippets and think it’s a great idea.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Structuring and performance considerations’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Jamie Burchell](https://wordpress.org/support/users/jamieburchell/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/structuring-and-performance-considerations/#post-14841851)
 * Status: not a support question