<?php

use auctionforge\inc\Debug;
use auctionforge\inc\import\AuctionList;

if (!empty($_SERVER['DOCUMENT_ROOT'])) {
    die("Access denied");
}

define('CRON_TASKS_BASE_PATH', __DIR__);
define('WP_USE_THEMES', false);
require(CRON_TASKS_BASE_PATH . '/../../../../wp-load.php');

if (!is_plugin_active(basename(dirname(__DIR__)) . '/' . basename(dirname(__DIR__)) . '.php')) {
    die("Plugin AuctionForge disabled");
}

$auctionList = new AuctionList();
$auctionList->init();
if (!empty($auctionList->getErrors())) {
    $errors = $auctionList->getErrors();
    var_dump($errors);
    Debug::logData($errors, "auction-list");
}