So I am trying to prepare my plugin for distribution. My plugin uses Composer for its dependency management. I wrote almost all of the business logic as a separate composer package, because I read, that this would be a good practice.
This is my plugin file:
namespace WpCommands; // We need to include the autoload from composer require_once __DIR__ . '/vendor/autoload.php'; use the16thpythonist\Wordpress\WpCommands; use the16thpythonist\Command\Command; use Log\LogPost; use the16thpythonist\Wordpress\Data\DataPost; WpCommands::register(); LogPost::register('log'); DataPost::register('log');
And in my development environment this works perfectly fine.
Then I upload the whole plugin folder (including the vendor folder) to github and when I tried cloning the folder into a different WordPress setup on a different environment, it gave me this error:
I just don't know what I am supposed to do. One solution would obviously be to require anyone who wants to install the plugin to also have composer installed. But I think most hosting services don't offer that much freedom?
How can I make an installation work with just committing the whole vendor folder?