Support Forum
Support › Meta Box AIO › Meta Box License Warning On Plugin Activation with MB Bundled
I've created a plugin bundling Meta Box into it. Upon plugin activation, I'm getting a License Key warning from Meta Box.
What's the best way to remove this warning? I've not yet found an obvious method.
I do have the Agency Ultimate Plan and added the license key to my composer.json file before running 'composer install' to install Meta Box into the /vendors folder of my plugin.
Other than the warning, everything seems to be working fine.
Best Regards,
Ryan
Hello,
You can define the license key in a constant in the wp-config.php file to remove the warning. For example:
define( 'META_BOX_KEY', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ); // Your Meta Box license key.
Please read more here https://docs.metabox.io/updates/#can-i-define-the-license-key-via-a-constant-in-wp-configphp
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?
Actually, the base64 encoding is no better because Chat GPT is able to decode it immediately. Just tested it and it returned my license key from the encoded license key.
Any other options?
Just to note: The encoded license key above is not my actual license key.
Hello,
Defining the license key in a file under the plugin folder will not work. I will inform the development team to support this case in future updates.
Yes, there needs to be a solution because otherwise, it's a bad user experience to require users that use the plugin I develop to have to purchase a Meta Box license and enter the license key in order to use the plugin.
I've seen plugins that bundle ACF that do not have this issue, so there should be a solution that can be added.
Guys, I came to this topic for the same reason, I need a way to activate the metabox io with a key, it is integrated into my plugin and using define( 'META_BOX_KEY' doesn't seem like a good thing to do
Guys, any news about this?
I tried to use defini within my plugin so that when metaboxAIO loads it recognizes the license, but AIO sometimes says that no license was found.
if ( !defined( 'META_BOX_KEY' ) ) {
define( 'META_BOX_KEY', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ); // Your Meta Box license key.
}
I was thinking that Metabox AIO could retrieve the key directly from a wp_options entry, this way my plugin would enter the license directly into the database.