autoLoad(); add_action('init', function () { load_plugin_textdomain('easy-code-manager', false, 'fluent-snippets/language'); }); } private function autoLoad() { spl_autoload_register(function ($class) { $match = 'FluentSnippets'; if (!preg_match("/\b{$match}\b/", $class)) { return; } $path = plugin_dir_path(__FILE__); $file = str_replace( ['FluentSnippets', '\\', '/App/'], ['', DIRECTORY_SEPARATOR, 'app/'], $class ); require(trailingslashit($path) . trim($file, '/') . '.php'); }); add_action('plugins_loaded', function () { add_action('rest_api_init', function () { require_once FLUENT_SNIPPETS_PLUGIN_PATH . 'app/Http/routes.php'; }); }); require_once FLUENT_SNIPPETS_PLUGIN_PATH . 'app/Hooks/hooks.php'; register_deactivation_hook(__FILE__, [\FluentSnippets\App\Helpers\Helper::class, 'handleDeactivate']); } } (new FluentCodeSnippetsBoot())->boot();