0

I often times make a bunch of customizations on plugins I install from the WP repository. Typically the reason I find myself preforming these edits is to fix, rewrite or delete certain functions a plugin might be preforming such as:

  • the plugin is automatically inserting a new menu/sub-menus in an undesirable location which I prefer to have standardized in accordance with my organization.
  • I simply want to remove, edit or replace text or functions for things such as help links/pages, redundant donation buttons or annoying upgrade promotion dialog boxes.

In end effect the edits I end up preforming are totally unique to each individual plugin and/or its files.

The problem I constantly run into is keeping up to-date with the latest version while manually updating the code for each plugin.

I believe the typical way users deal with this problem is by writing a function which takes priority over the plugins function (correct?). I can understand this approach working fine when the plugin/function I want to edit is simple but some of these plugins are very complex in nature and it seems this might not be the best approach.

What I am really hoping for is a clean method to be able to automatically execute a type of regex "find and replace" on the plugins new source code/files prior to the plugin being updated. I understand this method is in no way bulletproof and plugins/code is always changing however some type of function like this would be very helpful... any suggestions?

1

There is no clean solution to this, because task is, well, dirty. :) You should really be making these modifications in a proper ways.

If I absolutely had to do this (and even than probably for specific plugin and not at scale), I would look into maintaining my changes as vendor branch in version control and rebase on top of new releases. Even then it's not really convenient or maintenance-light solution.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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