0

Here I'm looking for an answer about releasing a plugin version with 3rd party packages installed by composer.

In my custom plugin I installed Sentry with composer and checked the error logs in my Sentry account. It's working. Everything looks fine. But my biggest concern is that it installed a lot of packages in the vendor folder while I try to install Sentry and Sentry sdk with composer.

What will happen if I want to do a version release of my plugin with all this files and folders? Would that create any problem or how should I do a version release now? I also checked the woocommerce plugin. It seems they are also using composer.

By the way, I'm new with composer and before Sentry integration I didn't use composer for my plugin at all and my plugin already live.

1

What will happen if I want to do a version release of my plugin with all this files and folders?

You need to upload your complete vendors directory to SVN. Nothing more and nothing less.

For the plugin registry, the files composer installed do not have any other meaning than any other files you manually created. It doesn't care* about them and happily hosts them for you.

* as long as these files pass the automatic linting - but with the recent bump to PHP 7.2 it shouldn't be a problem

So what to do if you want to release now?

  1. Delete vendors folder
  2. Run composer install --optimize-autoloader --no-dev
  3. Upload your files to SVN as you used to.

I suggest this, so you do not upload more files than necessary (ie. dev dependencies) and get the benefit of the optimized autoloader.

side note: Welcome to the world of Composer! Please consider setting the type to wordpress-plugin in your composer.json, in order for better WPackagist integration. Other's are already doing this, eg. YOAST.

  • Thank you so much Kero. I'll give it a try. Thanks for the composer command! Your answer looks promising. Hopefully it'll work. If everything works I'll mark your answer as correct. – Developer Oct 9 at 16:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.