Skip to content

Instantly share code, notes, and snippets.

@vovafeldman
Created July 5, 2017 00:54
Show Gist options
  • Save vovafeldman/0ad555b8cc9766ba386e8afc8f2d6f14 to your computer and use it in GitHub Desktop.
Save vovafeldman/0ad555b8cc9766ba386e8afc8f2d6f14 to your computer and use it in GitHub Desktop.
Freemius Software Licensing Examples
<?php
// This IF block will be auto removed from the Free version.
if ( my_fs()->is__premium_only() ) {
// This IF will be executed only if the user in a trial mode or have a valid license.
if ( my_fs()->can_use_premium_code() ) {
// ... logic related to any paid plan ...
}
if ( my_fs()->is_plan('starter') ) {
// ... logic related to starter plan and higher plans ...
} else if ( my_fs()->is_plan('professional') ) {
// ... logic related to professional plan and higher plans ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment