Child plugin? Making tweaks to plugins permanent

Hi guys, I've just updated to the latest version of Membership, it's great that it's moving forward, however this causes a bit of a problem - the tweaks that I have made to the plugin files are wiped out when I update!

I have to manually find the right files to edit and make the changes one by one by hand.

In the same way that you can have a child theme to stop this happening every time you update your theme, is it possible to do this with your plugins?

I've read a few articles online and I am not the only one with this trail of thought. I found a few obscure answers, but they heavily involve quite a bit of coding which I try to stay away from!

Has anyone got any ideas how to solve this? :slight_smile:

  • Patrick
    • Support Monkey

    Hey @bentemple

    That depends on what kind of edits you're talking about :slight_smile:

    If it's translations of text strings, the best way is via a language file using PoEdit.

    If it's mods to existing functions, a more update-proof way would be to try to hook into plugin actions/filters via your functions.php file.

    If you're customizing the display/layout, more often that not, you can create custom templates to add to your theme, and WP will follow template hierarchy (see the readme for whatever plugin is being modded)

    But, as you have found out, child-plugins can be a nightmare. It's a really cool idea though, and I do wish it could be that simple.

    Maybe some better heads than mine would like to chime in here?

  • bentemple
    • Site Builder, Child of Zeus

    I wish so to Patrick!

    Basically I've customised the pop up signup form and payment form to include a line or two of text that makes the process easier to understand for my members - I currently am updating this by hand each time there's a plugin update :slight_frown:

    Any tips on how to permanently affect the functions.php file to make those changes permanent?

  • Griphon Marketing
    • Flash Drive

    Actually I'll post it here. I think I can code most of it myself, but would love to submit it to you for wpmudev help. The concept is a Child Plugin Plugin, it would simply store the original functions.php file content of a plugin in the db, and store function modifications, and add on code. And then rename and insert the modified functions.php file back into the modified plugin. It could also restore the original completely if their edits mess it up. Lastly, when the plugin is updated, it can be run to UPDATE said plugin to reinsert/replace all custom code. If a function can not be reinserted due to it being different than it was previously, it could notify them, allowing for a new edit, and the old edit would be right there as reference. What do you think?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.