Of particular annoyance is when i purchase a premium plugin that doesn’t do exactly what i want AND it does not have proper hooks to modify its behaviour–or when hooks are present, they’re poorly designed and they do not supply all the needed variables to benefit from them.
In these cases, i have no choice but to modify the plugin core source.
I prefer, when possible, to add hooks in the spots i need them and make my modifications in a separate plugin. Although sometimes this is not possible, particular when there are bugs in the code that need fixing. Working with the plugin developer isn’t a great option because often such changes are not a priority for them.
The trouble with any approach that requires modifying the original source is that if updates are made to the original plugin, you cannot benefit from those updates without overwriting your changes.
I tried to create a patch file using diff and applying it with patch. But unfortunately this is not perfect. i feel it’s a bit clunky.
What i would prefer is to put the original premium plugin into a private github repository and manually update that repository when new updates are released. This is something i already do because i like to build my wordpress project with composer as its dependency manager.
Normally, as i understand it, with github, i can fork an external repository (belonging to someone else), make my patch in a new branch, and then sync that with the original repository so when updates are applied there, they are also applied on my fork.
Is there a way to do something similar in git when BOTH the “original” repository and the patched repository belong to me?
If so, can someone show me step by step what i need to do? I’m not particularly experienced with git or github, so i’m looking for some step by step instructions i can follow.
I’m also open to any other approach that simplifies my workflow.
Read more here:: Modify Premium Plugin & Sync with Updates