Whoops \ Exception \ ErrorException (E_WARNING)
Invalid argument supplied for foreach() Whoops\Exception\ErrorException thrown with message "Invalid argument supplied for foreach()" Stacktrace: #12 Whoops\Exception\ErrorException in /home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/api-easierad.php:66 #11 Whoops\Run:handleError in /home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/api-easierad.php:66 #10 api_easierad:get_vehicle_data in /home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/template/single-vehicle.php:8 #9 require_once in /home/u509076059/domains/autotradedirect.ie/public_html/wp-includes/template.php:730 #8 load_template in /home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/api-easierad.php:52 #7 api_easierad:custom_rewrite_basic in /home/u509076059/domains/autotradedirect.ie/public_html/wp-includes/class-wp-hook.php:292 #6 WP_Hook:apply_filters in /home/u509076059/domains/autotradedirect.ie/public_html/wp-includes/class-wp-hook.php:316 #5 WP_Hook:do_action in /home/u509076059/domains/autotradedirect.ie/public_html/wp-includes/plugin.php:484 #4 do_action in /home/u509076059/domains/autotradedirect.ie/public_html/wp-settings.php:560 #3 require_once in /home/u509076059/domains/autotradedirect.ie/public_html/wp-config.php:79 #2 require_once in /home/u509076059/domains/autotradedirect.ie/public_html/wp-load.php:37 #1 require_once in /home/u509076059/domains/autotradedirect.ie/public_html/wp-blog-header.php:13 #0 require in /home/u509076059/domains/autotradedirect.ie/public_html/index.php:17
Stack frames (13)
12
Whoops
\
Exception
\
ErrorException
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
66
11
Whoops
\
Run
handleError
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
66
10
api_easierad
get_vehicle_data
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
template
/
single-vehicle.php
8
9
require_once
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
template.php
730
8
load_template
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
52
7
api_easierad
custom_rewrite_basic
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
class-wp-hook.php
292
6
WP_Hook
apply_filters
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
class-wp-hook.php
316
5
WP_Hook
do_action
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
plugin.php
484
4
do_action
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-settings.php
560
3
require_once
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-config.php
79
2
require_once
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-load.php
37
1
require_once
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-blog-header.php
13
0
require
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
index.php
17
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
 
            if (!empty($api_id) && strpos($url, '/vehicle/') !== false)
            {
                $template = plugin_dir_path(__FILE__) . 'template/single-vehicle.php';
 
                load_template($template);
                die();
            }
 
        }
 
        public static function get_vehicle_data($id = false)
        {
            $result = false;
 
            if (!empty($id) && is_int($id) && $id > 0)
            {
                $data = self::$data;
 
                foreach ($data['rows'] as $vh)
                {
                    if ((int)$vh->id == (int)$id)
                    {
                        $result = $vh;
                    }
                }
 
            }
 
            return $result;
 
        }
 
        function current_location()
        {
            if (isset($_SERVER['HTTPS']) &&
                ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
                isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
                $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
            {
Arguments
  1. "Invalid argument supplied for foreach()"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
 
            if (!empty($api_id) && strpos($url, '/vehicle/') !== false)
            {
                $template = plugin_dir_path(__FILE__) . 'template/single-vehicle.php';
 
                load_template($template);
                die();
            }
 
        }
 
        public static function get_vehicle_data($id = false)
        {
            $result = false;
 
            if (!empty($id) && is_int($id) && $id > 0)
            {
                $data = self::$data;
 
                foreach ($data['rows'] as $vh)
                {
                    if ((int)$vh->id == (int)$id)
                    {
                        $result = $vh;
                    }
                }
 
            }
 
            return $result;
 
        }
 
        function current_location()
        {
            if (isset($_SERVER['HTTPS']) &&
                ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
                isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
                $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
            {
Arguments
  1. 2
    
  2. "Invalid argument supplied for foreach()"
    
  3. "/home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/api-easierad.php"
    
  4. 66
    
  5. array:3 [
      "id" => 25255079
      "result" => false
      "data" => array:4 [
        "rows" => null
        "total" => 0
        "curr_page" => 1
        "max_pages" => 1
      ]
    ]
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
template
/
single-vehicle.php
<?php
    get_header();
 
    $sidebar_position = tfuse_sidebar_position();
    tfuse_shortcode_content('top');
 
    $api_id = (int)$_GET['aid'];
    $vdata = api_easierad::get_vehicle_data($api_id);
 
    //vdump_and_die($vdata);
?>
    <div class="header header_thin"></div>
    <div class="middle_row row_white breadcrumbs">
        <div class="container">
            <p class="">
                <a href="https://autotradedirect.ie" hidefocus="true" style="outline: currentcolor none medium;" class="">Home11</a>
                <span class="separator">&gt;</span>
                <span class="">
                    <a href="https://autotradedirect.ie/?s=~&amp;tfseekfid=main_search" hidefocus="true" style="outline: currentcolor none medium;" class="">Vehicles</a>
                </span>
                <span class="separator">&gt;</span>
                <span class=""><?= $vdata->fields->trim; ?></span>
            </p>
            <a href="https://autotradedirect.ie/?s=~&amp;tfseekfid=main_search" class="link_search" hidefocus="true" style="outline: currentcolor none medium;">Start a Car Search</a>
        </div>
    </div>
    <div id="middle" class="full_width">
        <div class="container clearfix">
            <?php tfuse_category_ads();
                tfuse_hook(); ?>
            <div class="header_title title_before_vehicle">
                <h1><?= $vdata->fields->trim; ?></h1>
            </div>
            <div class="offer_details clearfix">
                <div class="content">
                    <?php load_template(plugin_dir_path(__FILE__) . 'offer-views/side-left.php'); ?>
                    <?php load_template(plugin_dir_path(__FILE__) . 'offer-views/side-right.php'); ?>
                </div><!--/ content -->
            </div>
            <?php load_template(plugin_dir_path(__FILE__) . 'offer-views/details-tabs.php'); ?>
Arguments
  1. 25255079
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
template.php
 
    if ( is_array( $wp_query->query_vars ) ) {
        /*
         * This use of extract() cannot be removed. There are many possible ways that
         * templates could depend on variables that it creates existing, and no way to
         * detect and deprecate it.
         *
         * Passing the EXTR_SKIP flag is the safest option, ensuring globals and
         * function variables cannot be overwritten.
         */
        // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
        extract( $wp_query->query_vars, EXTR_SKIP );
    }
 
    if ( isset( $s ) ) {
        $s = esc_attr( $s );
    }
 
    if ( $require_once ) {
        require_once $_template_file;
    } else {
        require $_template_file;
    }
}
 
Arguments
  1. "/home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/template/single-vehicle.php"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-content
/
plugins
/
api-easierad
/
api-easierad.php
            //vdump_and_die($result);
 
 
            self::$data = $result;
 
            add_action('init', array($this, 'custom_rewrite_basic'));
        }
 
        function custom_rewrite_basic()
        {
            global $wp;
 
            $api_id = (int)$_GET['aid'];
            $url = $this->current_location();
 
            if (!empty($api_id) && strpos($url, '/vehicle/') !== false)
            {
                $template = plugin_dir_path(__FILE__) . 'template/single-vehicle.php';
 
                load_template($template);
                die();
            }
 
        }
 
        public static function get_vehicle_data($id = false)
        {
            $result = false;
 
            if (!empty($id) && is_int($id) && $id > 0)
            {
                $data = self::$data;
 
                foreach ($data['rows'] as $vh)
                {
                    if ((int)$vh->id == (int)$id)
                    {
                        $result = $vh;
                    }
                }
Arguments
  1. "/home/u509076059/domains/autotradedirect.ie/public_html/wp-content/plugins/api-easierad/template/single-vehicle.php"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
class-wp-hook.php
 
        $nesting_level = $this->nesting_level++;
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
            $priority                                 = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 == $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
Arguments
  1. ""
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
class-wp-hook.php
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
Arguments
  1. null
    
  2. array:1 [
      0 => ""
    ]
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-includes
/
plugin.php
 
    if ( ! isset( $wp_filter[ $tag ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
    }
 
    if ( empty( $arg ) ) {
        $arg[] = '';
    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
        $arg[0] = $arg[0][0];
    }
 
    $wp_filter[ $tag ]->do_action( $arg );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Retrieve the number of times an action is fired.
 *
 * @since 2.1.0
 *
 * @global int[] $wp_actions Stores the number of times each action was triggered.
 *
 * @param string $tag The name of the action hook.
 * @return int The number of times action hook $tag is fired.
 */
function did_action( $tag ) {
    global $wp_actions;
 
    if ( ! isset( $wp_actions[ $tag ] ) ) {
        return 0;
    }
Arguments
  1. array:1 [
      0 => ""
    ]
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-settings.php
if ( ! class_exists( 'WP_Site_Health' ) ) {
    require_once ABSPATH . 'wp-admin/includes/class-wp-site-health.php';
}
WP_Site_Health::get_instance();
 
// Set up current user.
$GLOBALS['wp']->init();
 
/**
 * Fires after WordPress has finished loading but before any headers are sent.
 *
 * Most of WP is loaded at this stage, and the user is authenticated. WP continues
 * to load on the {@see 'init'} hook that follows (e.g. widgets), and many plugins instantiate
 * themselves on it for all sorts of reasons (e.g. they need a user, a taxonomy, etc.).
 *
 * If you wish to plug an action once WP is loaded, use the {@see 'wp_loaded'} hook below.
 *
 * @since 1.5.0
 */
do_action( 'init' );
 
// Check site status.
if ( is_multisite() ) {
    $file = ms_site_check();
    if ( true !== $file ) {
        require $file;
        die();
    }
    unset( $file );
}
 
/**
 * This hook is fired once WP, all plugins, and the theme are fully loaded and instantiated.
 *
 * Ajax requests should use wp-admin/admin-ajax.php. admin-ajax.php can handle requests for
 * users not logged in.
 *
 * @link https://codex.wordpress.org/AJAX_in_Plugins
 *
 * @since 3.0.0
Arguments
  1. "init"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-config.php
/**
 * WordPress Database Table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';
 
 
 
 
define( 'FS_METHOD', 'direct' );
/* That's all, stop editing! Happy blogging. */
 
/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) )
    define( 'ABSPATH', dirname( __FILE__ ) . '/' );
 
/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';
 
Arguments
  1. "/home/u509076059/domains/autotradedirect.ie/public_html/wp-settings.php"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
wp-load.php
 
/** Define ABSPATH as this file's directory */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', __DIR__ . '/' );
}
 
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR );
 
/*
 * If wp-config.php exists in the WordPress root, or if it exists in the root and wp-settings.php
 * doesn't, load wp-config.php. The secondary check for wp-settings.php has the added benefit
 * of avoiding cases where the current directory is a nested installation, e.g. / is WordPress(a)
 * and /blog/ is WordPress(b).
 *
 * If neither set of conditions is true, initiate loading the setup process.
 */
if ( file_exists( ABSPATH . 'wp-config.php' ) ) {
 
    /** The config file resides in ABSPATH */
    require_once ABSPATH . 'wp-config.php';
 
} elseif ( @file_exists( dirname( ABSPATH ) . '/wp-config.php' ) && ! @file_exists( dirname( ABSPATH ) . '/wp-settings.php' ) ) {
 
    /** The config file resides one level above ABSPATH but is not part of another installation */
    require_once dirname( ABSPATH ) . '/wp-config.php';
 
} else {
 
    // A config file doesn't exist.
 
    define( 'WPINC', 'wp-includes' );
    require_once ABSPATH . WPINC . '/load.php';
 
    // Standardize $_SERVER variables across setups.
    wp_fix_server_vars();
 
    require_once ABSPATH . WPINC . '/functions.php';
 
    $path = wp_guess_url() . '/wp-admin/setup-config.php';
 
Arguments
  1. "/home/u509076059/domains/autotradedirect.ie/public_html/wp-config.php"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
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/u509076059/domains/autotradedirect.ie/public_html/wp-load.php"
    
/
home
/
u509076059
/
domains
/
autotradedirect.ie
/
public_html
/
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/u509076059/domains/autotradedirect.ie/public_html/wp-blog-header.php"
    

Environment & details:

Key Value
aid
"25255079"
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"LiteSpeed"
REQUEST_URI
"/vehicle/?aid=25255079"
LSPHP_ProcessGroup
"on"
PATH
"/usr/local/bin:/bin:/usr/bin"
HTTP_ACCEPT
"*/*"
HTTP_HOST
"autotradedirect.ie"
HTTP_USER_AGENT
"claudebot"
DOCUMENT_ROOT
"/home/u509076059/domains/autotradedirect.ie/public_html"
REMOTE_ADDR
"18.206.12.31"
REMOTE_PORT
"35872"
SERVER_ADDR
"191.96.63.115"
SERVER_NAME
"autotradedirect.ie"
SERVER_ADMIN
""
SERVER_PORT
"443"
REQUEST_SCHEME
"https"
REDIRECT_URL
"/vehicle/"
REDIRECT_QUERY_STRING
"aid=25255079"
REDIRECT_REQUEST_METHOD
"GET"
HTTPS
"on"
CRAWLER_USLEEP
"1000"
CRAWLER_LOAD_LIMIT_ENFORCE
"25"
HTTP_AUTHORIZATION
""
REDIRECT_STATUS
"200"
X_SPDY
"HTTP2"
SSL_PROTOCOL
"TLSv1.3"
SSL_CIPHER
"TLS_AES_256_GCM_SHA384"
SSL_CIPHER_USEKEYSIZE
"256"
SSL_CIPHER_ALGKEYSIZE
"256"
SCRIPT_FILENAME
"/home/u509076059/domains/autotradedirect.ie/public_html/index.php"
QUERY_STRING
"aid=25255079"
SCRIPT_URI
"https://autotradedirect.ie/vehicle/"
SCRIPT_URL
"/vehicle/"
SCRIPT_NAME
"/index.php"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
X-LSCACHE
"on,crawler,esi,combine"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1711619597.122
REQUEST_TIME
1711619597
Key Value
LSPHP_ProcessGroup
"on"
PATH
"/usr/local/bin:/bin:/usr/bin"
0. Whoops\Handler\PrettyPageHandler