<!DOCTYPE html>
<html>
<head>
    <title>Protected HTML</title>
    <script>
        async function validateLicense() {
            const license = prompt("Enter your license key:");

            // Make API call to validate the license
            const response = await fetch('https://yourdomain.com/wp-json/license-manager/v1/validate', {
                method: 'POST',
                headers: { 'Content-Type': 'application/json' },
                body: JSON.stringify({ license_key: license })
            });

            const result = await response.json();
            if (result.valid) {
                document.getElementById('content').innerHTML = atob(result.content); // Decrypt content
            } else {
                alert('Invalid license key.');
            }
        }
    </script>
</head>
<body onload="validateLicense()">
    <div id="content" style="display:none;">
        <!-- The encrypted content goes here -->
    </div>
</body>
</html>
