Planning for a free/premium plugin

Question

I’m an old Delphi programmer who’s writing php plugins for WordPress. In Delphi I could write code for both a free and premium version in the same code using IFDEF.

{$DEFINE PROVERSION}
{$IFDEF PROVERSION}
    Do this if the version is pro.
{$ELSE}
    Do this if the free version.
{$ENDIF}

I understand because Delphi creates a compiled executable that something like this isn’t possible in PHP. But, this is what I’m trying to accomplish instead of having to go back and rip the pro version apart and create an entirely separate project.

How is this best handled to reduce the amount of code needed to be maintained?

I’m using NetBeans.

Thanks

0
uPrompt 2 months 0 Answers 12 views 0

Leave an answer