PHP code example of duckdev / freemius-plugin-licensing
1. Go to this page and download the library: Download duckdev/freemius-plugin-licensing library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
duckdev / freemius-plugin-licensing example snippets
// Assuming Composer's autoload.php has been instance(
12345, // Your Freemius product ID.
array(
'slug' => 'loggedin', // Your plugin's unique Freemius slug.
'main_file' => LOGGEDIN_FILE, // Absolute path to the plugin's main file.
'public_key' => 'pk_XXXXXXXXXXXXXXXXX', // Plugin public key.
'is_premium' => true, // Whether this build is the premium edition.
'has_addons' => false, // Whether the product has addons to list.
)
);
$result = $freemius->license()->activate( 'XXXX-XXXX-XXXX' );
if ( is_wp_error( $result ) ) {
// $result->get_error_message() — show to the user.
}