1

currently I create 2 different WordPress plugins with the same core classes. Currently, core classes are loaded by the composer from the GitHub repository, and this solution works fine during all of the plugins are using the same version of core classes, because of composer load only one version of core classes and when one of the plugins use a different version of the core classes that could be the reason of errors.

Plugin1 / composer.json

"require": {
   "my/core-classes": "1.0.0"
}

Plugin2 / composer.json

"require": {
    "my/core-classes": "1.1.0"
}

WordPress load plugins in order that have been activated, so when Plugin1 were loaded before Plugin 2 then can throw some errors when use methods that were not included in version 1.0.0.

What solution will be the best in this case? Include core classes in each plugin separately?

0 Answers0