Search code examples
phpwordpresspluginswordpress-plugin-creation

How to manual update a private WordPress plugin from free to pro version


I have a wordpress plugin in my wordpress repo. It's a free version. There are some features that are only available in the pro version of the wordpress plugin. I put a download link from where users need to buy the Pro version.

Now I want such a way that when the user uploads the pro version it will update the codes of the free version and add the new features/functionality to the free version. It's a manual upload. How to achieve this with code/plugin development? give an idea.


Solution

  • A simple way that might work.

    • Give your free plugin version numbers like 1.1.2 etc.

    • Give your paid one version numbers like 21.1.2 etc (20 greater than the free version).

    • Give them exactly the same name and other metadata values that go into readme.txt and the toplevel .php file.

    • Put the free one in the w.org repo. Distribute the paid one as a .zip.

    Installing the paid version (via the upload button) will overwrite the free one. And because the paid one has a higher version number than the one in the repo, your customers won't get pestered to upgrade it, and autoupgrade won't overwrite the free one.