require_once __DIR__ | WordPress.org

I have an issue with require a file in a directory. E.g I want to require a file in the directory /vendor/autoload.php

require_once __DIR__ . '/vendor/autoload.php';
use ipinfo\ipinfo\IPinfo;
$access_token = '3278463abc';
$settings = ['cache_disabled' => true];
$client = new IPinfo($access_token);
$ip_address="000.000.00.00.0";
$details = $client->getDetails($ip_address);

$details->loc;

I get the error:
Failed opening required /home2/malesbarbercom/public_html/wp-content/plugins/insert-headers-and-footers/includes/vendor/autoload.php (include_path=.:/opt/alt/php81/usr/share/pear:/opt/alt/php81/usr/share/php:/usr/share/pear:/usr/share/php)

Why does it add “/wp-content/plugins/insert-headers-and-footers/includes/” in the directory output? And what is the solution?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer