@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
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.
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.