I need to add a relatively small bit of functionality to a Wordpress plugin and I have the option to either edit the plugin directly, or scrap the plugin completely and repurpose PHP code from another site to do the same thing. Repurposing non-Wordpress PHP code for such a small change seems silly and I have the few lines of PHP I would use when editing the plugin. My question is, is it a good idea to edit a plugin?
I know that when editing a theme, if the edits are done directly to the old code, when the theme is updated the changes will be lost. Does this happen with plugins too? Is there a way around this?
For those wondering how complicated the changes are, I'll explain briefly. The client I have wants a form submission to go to a dealer and the user. But on certain circumstances depending on the user's email address (if it ends in ".gov" or a few other endings... yes I know this isn't the best idea and I tried to convince the client but they were adamant) the client wants the email to go to someone else. Naturally this could be cured with a few small PHP lines in the plugin but the plugin doesn't have the functionality for "conditional recipients" based on content sent by the user. So I'd like to either add that functionality just for this site (if it can be done quickly) or I'd like to replace the plugin with straight php which seems like it would cause more problems than it would fix initially. Time is of the essence. Thank you so much for your help!