I'm creating a plugin I would like to use from other different plugins. This plugin declares classes and functions. So, I am thinking about the best way to include, from one plugin, a php file present in another plugin.
I think this should work:
require_once WP_PLUGIN_DIR . "/the-other-plugin/required-file.php";
But I am not sure; is it a good solution? I think this would work even if
the-other-plugin is not enabled, and probably that is not a good idea.
This can be done also by using Must Use Plugins. Is this a best practice, or is the other solution better?