How to activate License using PHP

To activate license with PHP, you can utilize the utility functions that our plugin provides as follows:

<?php

$result = dlm_activate_license( 'AAAA-AAAA-AAAA-AAAA', [
	'label' => 'yoursite.com',
	'meta'  => [  // optional
		'your meta data 1' => 'your meta value 1'
	]
] );

if ( is_wp_error( $result ) ) {
	echo 'Not activated: ' . $result->get_error_message();
} else {
	// Store the license token somewhere safe,
	// The token can be used to disable (deactivate) the activation
	echo 'Activated: '. $result->getToken();
	// Example:
	store_token($result->getToken());
}