Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best Practice for Managing Free/Freemium and Pro/Premium Code #553

Open
spuddick opened this issue Jan 4, 2021 · 1 comment
Open

Best Practice for Managing Free/Freemium and Pro/Premium Code #553

spuddick opened this issue Jan 4, 2021 · 1 comment

Comments

@spuddick
Copy link

spuddick commented Jan 4, 2021

Hi, I have been using this plugin boilerplate for many years, it is great. I plan on creating some new plugins soon and want to set a good foundational architecture, as well as make my life easy in terms of version control. There will be both a free and pro (paid) version. The pro version will contain a lot of the functionality of the free version. In some cases the pro version will need to override some hooks that were set in the free version. Essentially this is my plan:

  • I plan on inserting the 'free' version within the pro version. The 'free' version code will be loaded first
  • all the relevant action/filter hooks that add 'pro' features will be removed from the free version. The hooks will be added again in the pro version, with callbacks to the 'pro' functions
  • essentially the 'pro' version will be dependent on the 'free' version to work. It will only contain code related to enhancing the 'free' version

I am wondering if others agree with the approach I plan on taking or have any other suggestions, specifically related to how WPPB is structured. I think others may benefit from seeing this conversation too. Thanks!

@UVLabs
Copy link

UVLabs commented Jun 25, 2021

I recommend building the base plugin as a normal free plugin and adding a folder called pro to include pro related classes that extend the free classes.

So when releasing the free version you simply remove that pro folder. I plan on using freemius to automatically take care of this for me and I've started implementing it.

The pro folder is automatically removed as well as some pro-related code in the free version that calls pro methods. Such as my settings page.

More settings are pulled from the pro folder if the class exists. But after running the plugin through freemius this code is completely removed for the free version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants