Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember General Questions › eMember – How to Merge My Custom Code Changes with Future Plugin Version Updates
Tagged: Custom Code Changes
- This topic has 2 replies, 3 voices, and was last updated 8 years, 8 months ago by admin.
-
AuthorPosts
-
March 31, 2016 at 3:21 pm #13387Jerry9Member
QUESTION
Is there a procedure you recommend we use to merge our custom changes with any future eMember plugin updates when they are released?
I read this post about Plugin Upgrades, but it did not appear to answer my question.
BACKGROUND
Many of us are aware of StudioPress Genesis child themes that allow for installing updates without overwriting custom user code. I was wondering what Tips and Tricks recommends.
DIFF COMPARE SOFTWARE
After making custom changes to CSS code, or TEXT in language files, or other direct CODE changes in core plugin files, I have Scooter Software’s Beyond Compare which works great for directories and files.
MY METHOD
For version control, one of the things I do is to make a copy of the original file and rename it with some type of version control indicator. For example, if I were changing the wp-content/plugins/wp-eMember/lang/eng.php, I would first make a copy that I will edit using the original name. I then rename the original (in order to retain the original timestamp). After making the changes, I create a backup of my changes with a file name version control convention that I use. So, after my first change, I’ll have three files, as follows.
FILE NAME …………………….. TIMESTAMP
> eng.php ……………………… 03-31-2016
> eng_2016-03-31_001.php …… 03-31-2016
> eng_ORIG.php ………………. 03-26-2016
BBCode Markup Examples, & BBCode Tags, too bad the forum doesn’t have a “Preview” option.
March 31, 2016 at 4:43 pm #72919wzpModeratorI have addressed this in the past:
https://support.tipsandtricks-hq.com/forums/topic/upgrading-the-plugin-what-exactly-will-be-lost
If you are advanced enough to make changes to the plugin; you should also be advanced enough to know the importance of making backups and having good version controls.
April 1, 2016 at 3:32 am #72920adminKeymasterYou should apply your CSS changes using a plugin like the following which will ensure that the CSS changes won’t get overwritten:
https://www.tipsandtricks-hq.com/wordpress-custom-css-plugin-6413
If you have customized the language file then just keeping a backup of that file is good enough. Language files rarely change. So after an update, you can overwrite with your backedup file. Your current method looks good to me also.
Changing PHP files are tricky because you need to be a developer to be able to do this properly. You should use action hooks or filters to apply PHP file changes (where applicable). That will allow you to put your changes in a custom plugin (call it a child plugin) instead of modifying core plugin files. You are free to customize what you want but we don’t support any customized PHP code. It is almost impossible for us to provide quality support when people make custom PHP code changes and introduce all kinds of problems (without even understanding what the implications are).
-
AuthorPosts
- You must be logged in to reply to this topic.