DevinVinson / WordPress-Plugin-Boilerplate

[WordPress] A foundation for WordPress Plugin Development that aims to provide a clear and consistent guide for building your plugins.
http://wppb.io
7.66k stars 2.25k forks source link

Add external libraries that use Composer #595

Open jrstarenlard opened 4 months ago

jrstarenlard commented 4 months ago

Hello,

What would be the correct way to add other libraries that use composer? Like for example https://github.com/Bacon/BaconQrCode or any other.

Thanks for the help

jrstarenlard commented 4 months ago

I share my approach and would appreciate your opinion to know if this is the best in terms of performance.

After installing composer I added the loader in the load_dependencies() function. In the class-admin.php and class-public classes, I reference the external libraries and it seems to work fine and they are loaded from the vendor.

Is it the right way? Is there a better way to proceed in this regard?

Thank you!