[ad_1]
I built a plugin recently for a client that is now having issues. One of their employees has moved a lot of my original code from the \`functions.php\` to a code snippet plugin. I think this is causing the problems with one of the buttons I created to use my plugin, but I need to be absolutely certain before I go to him and tell him to put it back.
So, are there any real benefits to putting a ton of code into any code snippet plugin versus leaving it in \`functions.php\`?
[ad_2]
In some cases. Primarily to test it out or to add it to systems or themeless page builders (Oxygen). Its often a quicker way to work on it and or share it between sites… But, functions that a theme depends on to work properly should be in the themes function.php file IMHO.
Vulnerabilities with code snippets or any dependency of a third party plugin. Put all your code in the functions file.
Adam Lowe did a nice video on the subject as well: [https://www.youtube.com/watch?v=uKVVStuaDkg&t=460s](https://www.youtube.com/watch?v=uKVVStuaDkg&t=460s)