Self-Updating Code in WordPress

One of the problems I face when having to deploy new code changes — especially those that require database changes, such as updating options, activating or de-activating plugins, etc — is the lag between deploying the code and making the relevant changes to the database. We can’t really risk the site looking broken for even the shortest time, especially true if the broken page gets cached.

Enter the need for self-updating code. The code will “activate” itself the first time it’s run — no temporary glitches in viewing the website because code is live but db changes aren’t or vise-versa.

Continue reading Self-Updating Code in WordPress