Loading Kirki via composer messes with other plugins/classes
Issue description:
When Kirki is loaded via composer (autoload.php) it causes clashes with other plugins, in a very strange way.
Version used:
4.1.0
Using theme_mods or options?
Neither, it happens when you load Kirki itself.
PHP error messages that might be related
Class 'Tutor\Models\CourseModel' not found
Via: https://wordpress.org/plugins/tutor/ on the Dashboard.
Class 'Smartcrawl_Vendor\Vanderlee\Syllable\Syllable' not found
via: https://wordpress.org/plugins/smartcrawl-seo/ when editing any post/page.
It happens with various other plugins as well, and doesn't happen when Kirki is not included.
Code to reproduce the issue (config + field(s))
I created a blank plugin, and installed Kirki via packagist via:
composer require kirki-framework/kirki
Then, the only line of code in the plugin is:
require_once __DIR__ . '/vendor/autoload.php';
When some plugins like Smartcrawl SEO, Tutor LMS, and others are loaded, it throws class not found errors, even though the class/file is definitely there. Commenting out the require_once line makes the error go away.
Another dev/friend said it has to do with how Kirki is using include-path, but I have yet to pinpoint the exact source of the issue.