xwp / site-performance-tracker

Allows you to detect and track site performance metrics
GNU General Public License v2.0
96 stars 15 forks source link

Make autoload.php optional to support project-wide autoload #6

Closed kasparsd closed 5 years ago

kasparsd commented 5 years ago

We should load the vendor/autoload.php only if it exists, to support projects that have root-level autoload and this plugin is part of the dependency list:

https://github.com/xwp/site-performance-tracker/blob/c2fc61038ac53d92c42f791b00be1463b62ec869/site-performance-tracker.php#L51-L52

would become:

if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
    require_once __DIR__ . '/vendor/autoload.php';
}