I am bundling Meta Box in a plugin. Forcing the end-user to have to access the wp-config.php to enter the license key would be a terrible user experience. I just want them to activate the plugin and not have to require any further action.
So I defined the constant in my plugin's main file like so:
if ( !defined( 'META_BOX_KEY' ) ) {
define( 'META_BOX_KEY', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ); // Your Meta Box license key.
}
But that doesn't seem secure. I can obfuscate the key like so:
if ( ! defined( 'META_BOX_KEY' ) ) {
$encoded_key = 'QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVoxMjM0NTY='; // Your base64-encoded Meta Box license key.
$decoded_key = base64_decode( $encoded_key );
define( 'META_BOX_KEY', $decoded_key );
}
But that's still not foolproof. Are there any other options?