Install ACF Extended Pro with Composer
Is your feature request related to a problem? Please describe. To my knowledge, there is currently no way to install ACF Extended Pro with Composer.
Describe the solution you'd like I'd like to be able to install ACF Extended Pro with Composer. Unfortunately, I think this might involve circumventing Easy Digital Downloads.
Describe alternatives you've considered
WordPress Packagist only works for plugins published to the official WordPress plugin directory. private-composer-installer is used to get around this. Just plug in the URL and add a key to .env and you're good to go. Unfortunately, this only works when the download URL is static.
Additional context The ACF Extended Pro download URL has two query parameters that change every time the download page is refreshed. By contrast, the ACF Pro download URL only uses the license token to verify the download. If we were to switch to license-based authorization (as opposed to the current token-based authorization), then this should solve the problem.
ACF Pro uses the following format:
https://connect.advancedcustomfields.com/v2/plugins/download?p=pro&k={{ ACF_LICENSE_KEY }}
By contrast, ACF Extended Pro uses this format:
https://www.acf-extended.com/index.php?eddfile={{ EDD_FILE }}&ttl={{ DYNAMIC_TTL }}&file={{
FILE_ID }}&token={{ DYNAMIC_TOKEN }}
From there, Composer installation using private-composer-installer should be straightforward:
{
"type": "package",
"package": {
"name": "acf-extended/acf-extended-pro",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
"url": "https://www.acf-extended.com/index.php&k={%ACF_EXTENDED_LICENSE_KEY}"
},
"require": {
"composer/installers": "^1.4",
"ffraenz/private-composer-installer": "^5.0"
}
}
}
Based on my past experience with EDD packages, I suggest using edd_action=get_version until a better solution arises either with ffraenz/private-composer-installer or with ACF Extended:
curl 'https://www.acf-extended.com/?edd_action=get_version&license={%ACF_EXTENDED_LICENSE_KEY}&item_name=ACF+Extended+Pro&url={%ACF_EXTENDED_LICENSE_URL}' | json_pp
This action returns a JSON response that contains a download_link with the URL to download the pro plugin.
~~I've created a pull request to add the pro version to junaidbhura/composer-wp-pro-plugins.~~
Support for ACF Extended Pro was introduced in junaidbhura/composer-wp-pro-plugins v1.6.0