I have been wondering how to version Wordpress projects correctly.
Versioning the entire Wordpress directory? I'd be versionning a lot of code that's not mine (Wordpress core, theme(s), plugins...) and that should be dependencies, I don't want to do that.
Versioning only the plugins / themes I develop? Alright, but then creating a local environment is a nightmare of finding the right Wordpress version with the right theme in the right version and the right plugins with the right version.
Aside: "right version" here means "the same version as in production".
Using the composer architecture for Wordpress, so that Composer installs Wordpress core as a dependency but also installs all the themes and plugins as dependencies? Yeah it looks amazing on paper, and I did it for a few projects, but the problem I end up having is that I absolutely want to keep everything up-to-date in production, but can't necessarily open my local environment, run composer update, git add, git commit, git push, deploy and run composer install every time there's an update, considering that Wordpress core, themes and plugins are updated very frequently.
Bottom line, I would need a way to only version the code I produce (not the core of Wordpress, the themes or the plugins I don't make), but also make it very easy to update everything in production while not making it hell to create a new local environment.
Basically, I'd need a composer.json file that would automatically pull the version of everything from the production environment. And that sounds like a Wordpress plugin in itself! But before creating such a thing, I've been wondering if other people have solved this problem before me.