31 Jan

Announcing Composer Support for Installing ACF PRO

By Iain Poulson

Today we are pleased to announce Composer support for installing ACF PRO 🎉

It’s been possible to install the free ACF plugin with Composer since the awesome WordPress Packagist came along, but installing ACF PRO has been more difficult. There are various third-party Composer installers that have made it possible, but these either expose the license key or go through another server, which is less than ideal.

Let’s dive into what we have released.

First-Party Composer Support

We released Composer support for our premium plugins at Delicious Brains back in 2018, one of the first premium plugin companies to do so. When ACF was acquired by Delicious Brains in 2021 there were a lot of excited developers, understandably expecting we would bring this support to ACF. Unfortunately we had to concentrate the majority of our efforts on plugin development so we didn’t quite get to it.

However, since we have moved to the WP Engine family, we have had more resources at our disposal to work on other things alongside plugin development. We’re glad to finally get this shipped.

How to Install With Composer

We’ve add a new section to the licenses panel on the Licenses​​ tab inside My Account. Clicking Install using Composer for your license will reveal a panel where you can generate an auth.json credentials file to be used with Composer.

ACF My Account Licenses screen with Composer installation.

The auth.json file is made up of a username and password field. The username and password are used by Composer to authenticate to our API with HTTP basic authentication.

The username is the ACF PRO license key, and the password is the site URL (including https:// or http://) that the license is active for.


{
  "http-basic": {
    "connect.advancedcustomfields.com": {
      "username": "Dvl2P9fLovYy2oJkdYOPiCrHXcRgGrmk9WR62HdErPasPsV43COx0anwTizc9XFrY8qysqqZ",
      "password": "https://mysite.com"
    }
  }
}

Then you can add our repository to your composer.json file:


"repositories": [
    {
        "type":"composer",
        "url":"https://connect.advancedcustomfields.com"
    }
]

Then from the CLI, require ACF PRO using the following command:


composer require wpengine/advanced-custom-fields-pro

You can read more in our Composer installation guide.

Community Thanks

The ACF community is just brilliant. I’d like to thank anyone who created a Composer repository, installer, or bridge to make installing ACF PRO with Composer possible in the past, and thanks to anyone who blogged or educated others about how to do this.

Shout out to the maintainers of these packages:

Wrapping Up

I’m personally excited to be using the native Composer support for ACF PRO on my next new site build. Will you be using our new method? Let us know in the comments.

About the Author

For plugin support, please contact our support team directly, as comments aren't actively monitored.

  • Admire The Web says:

    Great news, time to update the base theme!

  • André says:

    That’s nice. I had to update my private repo everytime. Now I can use compose directly from the source

  • Tim Briscoe says:

    Thank you! Perfect for use with Roots’ Bedrock!

  • Lindsey says:

    Awesome news. We’ve been using release belt to manage this, but this will make it much easier…if only we could get Gravity Forms on board…

  • Chris says:

    Are there any plans to restore the 2-column layout when editing fields? The v6 approach of having field labels above the field, rather than adjacent to them, is not good. The issues with it are:

    • More vertical space is taken up by fields, so you see less at once.
    • Labels are visually melded in with field data, which makes it harder to view at a glance.
    • The increased visual noise creates a much higher cognitive load.
    • There’s a huge amount of whitespace on the right side of the fields, which looks barren.

    Take these two examples, using the Presentation toggles, which are one of the visually busiest parts of field editing. The 1st is the current layout, the 2nd is a minor edit I made:

    1. https://i.imgur.com/qVjP1ap.png
    2. https://i.imgur.com/JpLW23Q.png

    Image 1 is cluttered, full of visual noise, and does not communicate its intention clearly. There is zero visual hierarchy. This leads to a higher cognitive load and slower performance from developers who use this.

    Meanwhile, image 2 is ordered, shorter, and it’s immediately obvious what’s going on. It also looks like other GUIs; open any modern app and you have labels left, fields right. We’ve reached this standard because it works.

    I’ve mentioned cognitive load a few times so I’ll clarify why this is important: These little losses add up, which causes frustration in developers, especially those who now have to work slightly slower due to this GUI overhaul. It’s not unusual for a WP developer to spend an hour or longer just editing fields in a single day, so scale these little frustrations up across hours, days and weeks — and hence the frustrated tone of this message.

    Can you revert this change please? Or at least provide an option to fix it?

    I will say that there are some good changes, like the field type icons and the nested field border color. It’s unfortunate that they are overshadowed by other obtrusive design patterns.

  • acfguy says:

    Wow man, I remember talking with Elliot maybe eight or ten years ago about adding this. Congratulations on getting it done. We did figure out something that worked at that time though but it broke after a couple years. Just one question, what should I do with my personal acf repo now? 🙂