Automate License Checks
One of the biggest concerns for developers is code piracy. With CodeStar, you can protect your scripts by checking license keys directly via our REST API. Here is a simple PHP implementation you can copy:
$licenseKey = "YOUR_BUYER_KEY";
$domain = $_SERVER['HTTP_HOST'];
$response = file_get_contents("http://codestar.pk/api/verify-license?code=" . urlencode($licenseKey) . "&domain=" . urlencode($domain));
$result = json_decode($response, true);
if ($result['status'] !== 'active') {
die("Invalid License Key or Domain Unauthorized.");
}
This simple snippet ensures that the script only functions on registered domains authorized in the buyer's downloads panel.