Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have several WordPress running plugins on my site and as per suggestions of wordpress performance optimizations I am planning to do the optimizations on plugins myself.

However, that will mean that I will have to modify existing plugins codes. Now, as WordPress plugins release frequent updates, the updates will wipe out my manual changes. How can I keep sync between these? That means, how can I get updated plugin and keep my manual changes as well?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Create a local repository in Git (or SVN) for the plugin, and each time an update happens:

  • merge the changes into your adjusted version,
  • test it in your local copy of the production site,
  • then push your updated code to your site.

But much better would it be to send your improvements to the plugin author, so she can use that in the main code. Keeping improvements secret is not the spirit of Open Source.

share|improve this answer
    
Thanks, I much appreciated the idea of using repository, I think am gonna use that. However, sure I will send update to the author also, but that may not come in action very soon. –  Rana Jan 28 '13 at 6:58

It depends on what kind of mods you are going to perform. If plugin uses filters and actions, you can hook them, or deregister them and register your own modified functions instead of them, from your custom plugin or theme's functions.php.

You can read more about hooks and filters in codex.

share|improve this answer

There isn't really a practical way to go about this that will ensure you can update plugins that you have modified and still guarantee your changes will work, unless you inspect the newly released code prior to merging your changes.

So that means every time a plugin update is available, you would need to check that the modifications you have made are still applicable to the newly updated code base because in some instances a plugin author may change their Class/Method/Function structure so as it represents nothing like the changes you have made.

In cases where your modifications do not work in the context of the newly released version of said plugin then you will need to re-adjust accordingly.

You need to keep a local repository/copy/version of your changes and check those against future updates.

This all requires some effort on your part, attention to detail, that would otherwise be better focused toward trying to convince the plugin authors in question to make the same changes that you have made for improved performance.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.