I am currently developing a Wordpress plugin handling very specific behaviours in our new Wordpress website. I started by reading the introduction articles in the Codex, and I also found the Wordpress plugin boilerplate. It is said that
to avoid function and variable collisions, we should enclose our functions inside a class, which should be named after our plugin.
The boilerplate already seems to handle that, fine!
However, I also expect to use third party libraries for my plugin (Swiftmailer, Mixpanel, etc.), which will be placed in '/wp-content/plugins/myplugin/includes'.
My question is, what if an other plugin also uses one of those libraries in its code? Swiftmailer is a pretty common library, so an other library could load it when initialized. There will be a collision (a class cannot be redefined in PHP). Are there mechanism in Wordpress to handle that ? Or does somebody already have a solution for this kind of issue ?