Error
Class "GuzzleHttp\Client" not found Error thrown with message "Class "GuzzleHttp\Client" not found" Stacktrace: #7 Error in /home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php:290 #6 Lexicon\Currency\Converter:exchangeRateService in /home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php:404 #5 Lexicon\Currency\Converter:fetchHistoricalExchangeRates in /home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php:390 #4 Lexicon\Currency\Converter:getHistoricalExchangeRates in /home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php:165 #3 Lexicon\Currency\Converter:wizardToMuggleAll in /home/hplex/live/wp-content/themes/lexicon/single-event.php:30 #2 include in /home/hplex/live/www/wp-includes/template-loader.php:132 #1 require_once in /home/hplex/live/www/wp-blog-header.php:19 #0 require in /home/hplex/live/www/index.php:17
Stack frames (8)
7
Error
/wp-content/themes/lexicon/lib/Currency/Converter.php:290
6
Lexicon\Currency\Converter exchangeRateService
/wp-content/themes/lexicon/lib/Currency/Converter.php:404
5
Lexicon\Currency\Converter fetchHistoricalExchangeRates
/wp-content/themes/lexicon/lib/Currency/Converter.php:390
4
Lexicon\Currency\Converter getHistoricalExchangeRates
/wp-content/themes/lexicon/lib/Currency/Converter.php:165
3
Lexicon\Currency\Converter wizardToMuggleAll
/wp-content/themes/lexicon/single-event.php:30
2
include
/www/wp-includes/template-loader.php:132
1
require_once
/www/wp-blog-header.php:19
0
require
/www/index.php:17
/home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php
        if ($source == 'USD') {
            $rate = $rates[$dest];
        } else {
            $rate = $rates[$dest] * (1 / $rates[$source]);
        }
 
        return $amount * $rate;
    }
 
    private function filesystem()
    {
        $adapter = new LocalFilesystemAdapter('/home/hplex/api/cache');
        $filesystem = new Filesystem($adapter);
 
        return $filesystem;
    }
 
    private function exchangeRateService()
    {
        $client = new Client();
 
        return new OpenExchangeRatesService(
            '3524ded9f850465799b082abb523ccad',
            [
                'https' => true,
                'base_currency' => 'USD',
            ],
            $client
        );
    }
 
    public function getCurrencies()
    {
        $filesystem = $this->filesystem();
        $currencyFile = 'currencies.json';
 
        if (!$filesystem->fileExists($currencyFile) || time() - $filesystem->lastModified($currencyFile) >= 86400 * 30) {
            return $this->fetchCurrencies();
        }
 
Arguments
  1. "Class "GuzzleHttp\Client" not found"
    
/home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
 
        if (!$filesystem->fileExists($filename)) {
            return $this->fetchHistoricalExchangeRates($date);
        }
 
        $rates = json_decode($filesystem->read($filename), true);
 
        return $this->addWizardingExchangeRates($rates, $date);
    }
 
    private function fetchHistoricalExchangeRates(Carbon $date)
    {
        $earliest = new Carbon('1999-01-01');
        if ($date->lt($earliest)) {
            return [];
        }
        $service = $this->exchangeRateService();
 
        $baseRates = $service->getHistorical($date);
        $rates = $baseRates['rates'];
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
        $rates = $this->addWizardingExchangeRates($rates, $date);
        $this->cacheExchangeRates($filename, $rates, $date);
 
        return $rates;
    }
 
    private function addWizardingExchangeRates($rates, Carbon $date = null)
    {
        $rates['WZG'] = $rates['GBP'] / 5;
        $rates['WZS'] = 17 * $rates['WZG'];
        $rates['WZK'] = 29 * $rates['WZS'];
 
        $rates['WZD'] = 1.5;
        if (!empty($rates['XAU'])) {
/home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php
    {
        $filesystem = $this->filesystem();
 
        if (!$date) {
            $filesystem->write($file, json_encode($rates));
            $date = new Carbon();
        }
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
        $filesystem->write($filename, json_encode($rates));
    }
 
    public function getHistoricalExchangeRates(Carbon $date)
    {
        $filesystem = $this->filesystem();
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
 
        if (!$filesystem->fileExists($filename)) {
            return $this->fetchHistoricalExchangeRates($date);
        }
 
        $rates = json_decode($filesystem->read($filename), true);
 
        return $this->addWizardingExchangeRates($rates, $date);
    }
 
    private function fetchHistoricalExchangeRates(Carbon $date)
    {
        $earliest = new Carbon('1999-01-01');
        if ($date->lt($earliest)) {
            return [];
        }
        $service = $this->exchangeRateService();
 
        $baseRates = $service->getHistorical($date);
        $rates = $baseRates['rates'];
 
        $filename = $date->format("Y/m/d/") . "currencyRates-" . $date->format("Ymd").".json";
 
/home/hplex/live/wp-content/themes/lexicon/lib/Currency/Converter.php
            if ($date) {
                $rates = $this->getHistoricalExchangeRates($date);
            } else {
                $rates = $this->getCurrentExchangeRates();
            }
 
            $conversion = $this->convertCurrency($conversion, $rates, 'GBP', $currency);
        }
 
        $totalGalleons = $galleons + ($sickles / $this->sicklesToGalleons) + ($knuts / $this->knutsToGalleons);
        return number_format((ceil($totalGalleons * $conversion * 100) / 100), 2);
    }
 
    public function wizardToMuggleAll($galleons, $sickels, $knuts, $date = null, $selectedCurrencies = [])
    {
        if ($date) {
            $date = $this->checkDate($date);
        }
        if ($date) {
            $rates = $this->getHistoricalExchangeRates($date);
        } else {
            $rates = $this->getCurrentExchangeRates();
        }
 
        $currencies = $this->getCurrencies();
 
        $currencies['FRF'] = 'French Francs';
        $currencies['DEM'] = 'German Marks';
        $currencies['ITL'] = 'Italian Lira';
        $currencies['ESP'] = 'Spanish Pesetas';
 
        $converted = [];
        $totalGalleons = $galleons + ($sickels / $this->sicklesToGalleons) + ($knuts / $this->knutsToGalleons);
 
        foreach ($rates as $currency => $rate) {
            if ($currency == 'GBP') {
                $conversion = 5;
            } else {
                $conversion = $this->convertCurrency(5, $rates, 'GBP', $currency);
            }
/home/hplex/live/wp-content/themes/lexicon/single-event.php
 * @package  WordPress
 * @subpackage  Timber
 * @since    Timber 0.1
 */
 
$data = Timber::get_context();
 
$data['type'] = $data['type_info'] = $data['post']->type();
$data['iconbanners'] = $data['post']->iconBanners();
$data['icons'] = $data['post']->icons();
 
$visibleCurrencies = commonCurrencies();
 
 
if (isset($data['post']->year) && $data['post']->date_type == 'full') {
    $data['hplex_datetime'] = $date = new Carbon($data['post']->hplex_datetime());
 
    if ($date->gte(new Carbon('1971-01-01')) && $date->lte(new Carbon())) {
        $converter = new Converter();
        $data['currency_rates'] = $converter->wizardToMuggleAll(1, 0, 0, $date, $visibleCurrencies);
    }
}
 
if (isset($_REQUEST['debug']) && $_REQUEST['debug'] == 'breakthisnick') {
    dump($data['hplex_datetime']);
    dump($data['currency_rates']);
    dd($data);
}
 
if (post_password_required($data['post']->ID)) {
    Timber::render('single-password.twig', $data);
} else {
    Timber::render(array( 'single-' . $data['post']->ID . '.twig', 'single-' . $data['post']->post_type . '.twig', 'single.twig' ), $data);
}
 
/home/hplex/live/www/wp-includes/template-loader.php
     */
    $template   = apply_filters( 'template_include', $template );
    $is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
    $template   = $is_stringy ? realpath( (string) $template ) : null;
    if (
        is_string( $template ) &&
        ( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
        is_file( $template ) &&
        is_readable( $template )
    ) {
        /**
         * Fires immediately before including the template.
         *
         * @since 6.9.0
         *
         * @param string $template The path of the template about to be included.
         */
        do_action( 'wp_before_include_template', $template );
 
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
Arguments
  1. "/home/hplex/live/wp-content/themes/lexicon/single-event.php"
    
/home/hplex/live/www/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
Arguments
  1. "/home/hplex/live/www/wp-includes/template-loader.php"
    
/home/hplex/live/www/index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 
Arguments
  1. "/home/hplex/live/www/wp-blog-header.php"
    

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"nginx/1.28.3"
REQUEST_URI
"/event/in-search-of-harry-potter-published/"
USER
"www-data"
HOME
"/var/www"
HTTP_HOST
"www.hp-lexicon.org"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_CF_VISITOR
"{\"scheme\":\"https\"}"
HTTP_CF_IPCOUNTRY
"US"
HTTP_CF_CONNECTING_IP
"216.73.216.48"
HTTP_CDN_LOOP
"cloudflare; loops=1"
HTTP_USER_AGENT
"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])"
HTTP_ACCEPT_ENCODING
"gzip, br"
HTTP_ACCEPT
"*/*"
HTTP_CF_RAY
"a3f5a57449664af4-CMH"
HTTP_X_FORWARDED_FOR
"216.73.216.48"
REDIRECT_STATUS
"200"
SERVER_NAME
"www.hp-lexicon.org"
SERVER_PORT
"443"
SERVER_ADDR
"205.164.24.203"
REMOTE_USER
""
REMOTE_PORT
""
REMOTE_ADDR
"216.73.216.48"
GATEWAY_INTERFACE
"CGI/1.1"
HTTPS
"on"
REQUEST_SCHEME
"https"
SERVER_PROTOCOL
"HTTP/2.0"
DOCUMENT_ROOT
"/home/hplex/live/www"
DOCUMENT_URI
"/index.php"
SCRIPT_NAME
"/index.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
SCRIPT_FILENAME
"/home/hplex/live/www/index.php"
PATH_INFO
""
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1790125582.0098
REQUEST_TIME
1790125582
empty
0. Whoops\Handler\PrettyPageHandler