Deploy with Git and CI
Keep your UnleashWP license key out of Git: set it as an environment variable, read it in wp-config.php, and let each deployed site activate itself.
If you deploy WordPress from a Git repository, by hand, with a CI pipeline or with Composer, you do not have to open every site and paste a license key. Put the key on the server as an environment variable, read it in wp-config.php, and each site activates itself.
How it works
The key lives on the server
You set an environment variable such as EASY_SVG_PRO_LICENSE_KEY in your hosting panel, your .env file or your deployment tool. It is never part of the repository.
wp-config.php reads it
One line in wp-config.php turns the variable into the constant the plugin looks for. This line is safe to commit, it contains no key.
The site activates itself
The next time an administrator opens wp-admin, the plugin sends the key once to activate the site. After that the site keeps its own token and the key is not stored in the database.
The line for wp-config.php
define( 'EASY_SVG_PRO_LICENSE_KEY', getenv( 'EASY_SVG_PRO_LICENSE_KEY' ) );
The constant is the product's slug in capital letters, dashes become underscores, followed by _LICENSE_KEY. For Easy SVG Pro (easy-svg-pro) that is EASY_SVG_PRO_LICENSE_KEY. The Composer dialog in your account under Downloads shows the exact line for each product.
Setting the variable
Most managed hosts have a place for environment variables in the site settings. Add EASY_SVG_PRO_LICENSE_KEY with your key as the value and keep the getenv() line in wp-config.php.
Bedrock reads .env, which is already ignored by Git. Add the key there:
EASY_SVG_PRO_LICENSE_KEY='YOUR_LICENSE_KEY'
and define the constant in config/application.php:
Config::define( 'EASY_SVG_PRO_LICENSE_KEY', env( 'EASY_SVG_PRO_LICENSE_KEY' ) );
Store the key as a secret in your CI system and write it into the server's environment or .env file during the deployment step. Never echo it into the build log.
wp-config.php. Anyone who can read the repository could then use your license.Good to know
- Who activates. Only a logged in administrator triggers the activation, on a multisite network a super admin. A visitor never does, so the first page view after a deploy is not slowed down.
- If activation fails, the site tries again later on its own. The reason is shown on the product's license screen, for Easy SVG Pro Icons → License.
- A key for another product is not retried at all. Put the right key into the variable and the site tries again.
- Multisite uses one seat for the whole network. Network-activate the product.
- Staging and copies. Test sites and copies are labelled in your account under Sites, see Licenses.
- Changing the key later. A site that is already activated keeps its token, so a new value in the variable changes nothing on its own. Disconnect the site under Sites in your account or on the license screen, then open wp-admin again.
With Composer
Composer can install the plugin itself from composer.unleash-wp.com with the same license key. The full setup, including COMPOSER_AUTH for CI, is in Install with Composer.