-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propose an updated composer.json for PRO version #2
Comments
Thanks for the topic. I'm happy to admit that I don't know much about composer, and understand that a lot of developers use it in their WP workflow. Can you better explain the issue about 'set the version of each ACF version'?
Can you also tell me more about the https://github.com/PhilippBaschke/acf-pro-installer repo?
|
Hey @elliotcondon, Thanks for opening a discussion about this request. Composer helps a lot development of wordpress plugin by managing dependencies and autoloading, but it is also used a lot to deploy whole wordpress project. In this case, we install everything (wordpress core, plugins and themes) through the help of a single composer.json file. In this case, automatic updates are generally disabled in wordpress and only managed through composer. Normally a single call to The problem with
In fact acf-pro-installer is mainly used to hide the acf pro key and prevent it to be displayed / comitted in composer.json / composer.lock files. I think we could find a simple way to get auto-updates by simply providing a github repository with a single composer.json file properly committed in branches / tags. That would be a great addition for pro users as the auto-upgrade of the free version is already provided by the wpackagist repository. JohnBlock did a similar approach to manage auto-updates of wordpress core in https://github.com/johnpbloch/wordpress. Well know composer projects templates like BedRock moved to a similar approach years ago to resolve that kind of issue. Hope it helps, Let me know if you need more informations. |
I tried an experiment here, but sadly it doesn't work. I wasn't aware of https://getcomposer.org/doc/faqs/why-can't-composer-load-repositories-recursively.md. So, the only way to achieve that is wether to implement a custom satis repository coupled with your licensing system or use the private packagist service: https://packagist.com/pricing which gives you the opportunity to distribute your private package and authenticate allowed users. |
Thanks for the info. I'm sure we can find a simple solution for this. I'm not sure if this is any help, but I have a public API that can provide update information: Can you also explain how a "github repository with a single composer.json file properly committed in branches / tags" would work? |
Hey @elliotcondon, Indeed, "the only issue" is that composer can't reach informations about new versions of ACF PRO. However, it should be done in a composer way, and so far I have no idea how to handle this. When I opened the issue I had a solution in mind, "that github repository with a single composer.json file properly committed in branches / tags". I did an experiment in the following github repository https://github.com/mickaelperrin/acf-pro but sadly that can't work because of https://getcomposer.org/doc/faqs/why-can't-composer-load-repositories-recursively.md. So far, I have no other idea, how to resolve this in composer except the two propositions I exposed in my previous answer: a custom satis repository or the use of packagist. |
Thanks for the info. I'll do some research too and hope to find a good solution for composer. |
Using bedrock-WordPress I experience the same issue. |
Complaining here again :) In the short term, could you please add this in a {
"name" : "elliotcondon/advanced-custom-fields-pro",
"description" : "Customise WordPress with powerful, professional and intuitive fields.",
"keywords" : ["wordpress"],
"homepage" : "https://www.advancedcustomfields.com",
"license" : "GPL-2.0+",
"type" : "wordpress-plugin",
"authors" : [
{
"name" : "Elliot Condon",
"homepage" : "https://www.advancedcustomfields.com"
}
],
"require" : {
"composer/installers" : "^1.0",
"php" : ">=5.3.0"
}
} In the long run, providing a composer/packagist-friendly way to fetch ACF-pro would be neat. |
Hi all, Just checking in on this. I'm interested in using ACF plugin with Roots Bedrock - it looks like currently the best way to use composer is via one of these below. (If anyone else knows differently please let me know, thanks!) For standard ACF, use:
(Before running the above, you'll need to add the wpackagist repo as follows to your local composer.json)
For ACF Pro, see: |
Even though we have paid license number we've relied on https://github.com/wp-premium/advanced-custom-fields-pro/ for years because even though releases tend to lag, it's so much simple to simply Still, recently I gave another shot to
It's very cumbersome.
In the end: Yes, it's doable and somehow works. But it's not simple (nor ideal). |
+1 here. We just switched from https://github.com/PhilippBaschke/acf-pro-installer to https://github.com/ffraenz/private-composer-installer/ and updated to Composer 2 at the same time. It's all working but definitely not as simple as a dedicated composer package would be. |
Why not use https://github.com/cedaro/satispress? It was created for exactly the purpose discussed in this issue. Also see https://stackoverflow.com/a/59610919/1410103 for details. Off-topic: Regarding Bedrock, I cannot recommend it, because it’s a boilerplate, resulting in the “mess” described by @drzraf. I highly recommend https://github.com/wecodemore/wpstarter/tree/version-3 instead. It’s a Composer plugin, meaning you require it as every other package and configure it in |
I can't personally use that because we're bundling ACF Pro inside our premium theme/plugin. AFAIK Satispress is meant for projects you manage where you want separate plugins to be managed via Composer. |
@JiveDig Hey Mike! SatisPress should work fine that use case. It exposes plugins as packages in a Composer repository, so it's completely up to you how you consume them. It just depends on whether managing a separate WordPress instance is worth the benefits SatisPress provides. I'm not totally familiar with the workarounds for ACF Pro, but if a |
@bradyvercher Hey dude! Long time no talk! Hope things are well. This is great news! I've never used SatisPress before, but I'll take a look and see if I can get it to work. I'm not a pro with tooling and dependency management, so I'm always nervous when I have to change things :) |
It is great you provided support for installing acf-pro via composer! One concern I have is having my license key in a json file that can be accessed via browser. Is it possible to deny direct access (via .htaccess?) but allow your package to call it? |
Have you tested to see if a .json file is accessible on your server already? Can you upload a dummy one to test if your server already disallows .json files being accessed? I suggest using https://roots.io/bedrock/ which stores your credentials one level up which avoids this being a concern at all. You can block access yourself via your Apache .htaccess, or nginx config file. |
Yes, I uploaded a testfile, called it The documentation says nothing about how to relocate the auth.json that's why I wondered if someone had thought that out before (I'm sure that's the case :) ) - so I guess I have to look out for some helpful .htaccess rules. |
Yeah definitely don't go trying to move it out of your working directory unless you know what you're doing. Adding a .htaccess deny from all for .json should be the easiest way. There's a million resources out there for that :) |
Hi,
I am currently using the project https://github.com/PhilippBaschke/acf-pro-installer to get ACF PRO installed through composer.
While it works great, I need to manually set the version of each ACF version to get the update installed.
That would be great if you could maintain a repository with a simple
composer.json
file that could be used to enable updates through composer.Something like https://github.com/johnpbloch/wordpress but with the
package
format used in https://github.com/PhilippBaschke/acf-pro-installer.Even if I am a PRO user, a
composer.json
in this repository should help installation / upgrade through composer also for free version.What to do you think about that?
Thanks,
The text was updated successfully, but these errors were encountered: