How to install premium WordPress plugins with composer

Premium versions of plugins such as ACF and Gravity Forms require special treatment, as they’re not in WPackagist.

License keys

First, add license keys to .env:

# API keys
ACF_PRO_KEY='a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2c3d4a1b2'
WP_PLUGIN_GF_KEY='1234abcd1234abcd1234abcd1234abcd'

To avoid exposing these keys on Whoops error pages, add an array called ‘debug_blacklist’ to Sage 10’s config/app.php file, for example under “Application Debug Mode”:

    /*
    |--------------------------------------------------------------------------
    | Application Debug Mode
    |--------------------------------------------------------------------------
    |
    | When your application is in debug mode, detailed error messages with
    | stack traces will be shown on every error that occurs within your
    | application. If disabled, a simple generic error page is shown.
    |
    */

    'debug' => WP_DEBUG,

    'debug_blacklist' => [
        '_ENV' => [
            'ACF_PRO_KEY',
            'WP_PLUGIN_GF_KEY',
        ],
        '_SERVER' => [
            'ACF_PRO_KEY',
            'WP_PLUGIN_GF_KEY',
        ],
    ],

ACF Pro

// Instructions coming soon!

Gravity Forms

// Instructions coming soon!