From 1321d35bdf5d63473ecea63f01f2329113f39c11 Mon Sep 17 00:00:00 2001 From: abuyoyo Date: Wed, 4 Oct 2023 02:34:56 +0300 Subject: [PATCH] De-prioritize vendor/autoload.php --- notice-manager.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/notice-manager.php b/notice-manager.php index df6c9b5..db30a5f 100644 --- a/notice-manager.php +++ b/notice-manager.php @@ -10,10 +10,24 @@ */ defined( 'ABSPATH' ) || die( 'No soup for you!' ); -use WPHelper\PluginCore; +/** + * Dependencies + * Allow all other auto-loaders to fail before including our own. + */ +if ( + ! class_exists( 'WPHelper\PluginCore' ) + || + ! class_exists( 'WPHelper\AdminPage' ) + || + ! function_exists( 'wph_add_screen_meta_panel' ) +) +{ + if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ){ + require_once __DIR__ . '/vendor/autoload.php'; + } +} -if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) - require_once __DIR__ . '/vendor/autoload.php'; +use WPHelper\PluginCore; /** * Bootstrap plugin and admin page (Tools > Notice Manager)