<?php

if (!defined('ABSPATH')) {
    die( 'You shouldnt be here' );
}

//Including file that manages all template
/*if (defined('AUCTIONFORGE_API_TOKEN')) {
}*/
require_once __DIR__ . '/../vendor/autoload.php';

require_once ABSPATH . 'wp-admin/includes/taxonomy.php';
require_once ABSPATH . 'wp-admin/includes/file.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
require_once ABSPATH . 'wp-admin/includes/media.php';
require_once ABSPATH . 'wp-admin/includes/plugin.php';

require_once __DIR__ . '/Debug.php';
require_once __DIR__ . '/InstanceDB.php';
require_once __DIR__ . '/helpers/SettingsHelper.php';

require_once __DIR__ . '/extensions/AuctionSlugTemplate.php';

require_once __DIR__ . '/helpers/Conditions.php';
require_once __DIR__ . '/helpers/Tools.php';
require_once __DIR__ . '/helpers/View.php';
require_once __DIR__ . '/helpers/LotHelper.php';
require_once __DIR__ . '/helpers/LotLogging.php';

require_once __DIR__ . '/traits/LoggerInfo.php';

require_once __DIR__ . '/interfaces/Webhooks.php';
require_once __DIR__ . '/abs/BidspiritWebhooks.php';
require_once __DIR__ . '/controllers/AuctionRoutes.php';
require_once __DIR__ . '/controllers/BidspiritQuery.php';
require_once __DIR__ . '/controllers/BidspiritLots.php';
require_once __DIR__ . '/controllers/BidspiritViews.php';
require_once __DIR__ . '/controllers/Settings.php';
require_once __DIR__ . '/controllers/MultiLanguageSupport.php';
require_once __DIR__ . '/controllers/PolylangSupport.php';
require_once __DIR__ . '/controllers/HummingbirdSupport.php';
require_once __DIR__ . '/controllers/AdminBarTools.php';
require_once __DIR__ . '/controllers/StyleSettings.php';
require_once __DIR__ . '/controllers/StyleCssOutput.php';
$styleCssOutput = new \auctionforge\inc\controllers\StyleCssOutput();
$styleCssOutput->init();
require_once __DIR__ . '/controllers/ManualAuctions.php';
require_once __DIR__ . '/controllers/ShortcodesPage.php';
$shortcodesPage = new \auctionforge\inc\controllers\ShortcodesPage();
$shortcodesPage->init();
require_once __DIR__ . '/controllers/AuctionsAPI.php';
require_once __DIR__ . '/controllers/PluginAPI.php';
//require_once __DIR__ . '/controllers/TestAppNotification.php';

require_once __DIR__ . '/abs/Importer.php';
require_once __DIR__ . '/abs/Model.php';
require_once __DIR__ . '/abs/ImageModel.php';
require_once __DIR__ . '/abs/InsertLotsAbstract.php';
require_once __DIR__ . '/model/Auction.php';
require_once __DIR__ . '/model/LotModel.php';
require_once __DIR__ . '/model/Lot.php';
require_once __DIR__ . '/model/LotMetaData.php';
require_once __DIR__ . '/model/LotImage.php';
require_once __DIR__ . '/model/FirebaseUser.php';
require_once __DIR__ . '/model/FirebaseLog.php';
require_once __DIR__ . '/model/History.php';
require_once __DIR__ . '/model/SubmissionFormData.php';
require_once __DIR__ . '/model/ViewHistory.php';
require_once __DIR__ . '/model/LotAnalytics.php';
require_once __DIR__ . '/model/SMSSubscriber.php';

require_once __DIR__ . '/services/BrevoSMS.php';

require_once __DIR__ . '/widgets/GalleryWidget.php';
require_once __DIR__ . '/widgets/LotsWidget.php';
require_once __DIR__ . '/shortcodes/CoolDownToSale.php';
require_once __DIR__ . '/shortcodes/UpcomingAuctionWide.php';
require_once __DIR__ . '/shortcodes/PastSales.php';
require_once __DIR__ . '/shortcodes/LoginForm.php';
require_once __DIR__ . '/shortcodes/LoginButtons.php';
require_once __DIR__ . '/shortcodes/RegisterForm.php';
require_once __DIR__ . '/shortcodes/SubmissionForm.php';
require_once __DIR__ . '/shortcodes/ProfileButtons.php';
require_once __DIR__ . '/shortcodes/AuctionList.php';
require_once __DIR__ . '/shortcodes/LotsByCategory.php';
require_once __DIR__ . '/shortcodes/PopularLots.php';
$auctionListShortcode = new \auctionforge\inc\shortcodes\AuctionList();
$auctionListShortcode->init();
$popularLotsShortcode = new \auctionforge\inc\shortcodes\PopularLots();
$popularLotsShortcode->init();

require_once __DIR__ . '/import/AuctionList.php';
require_once __DIR__ . '/import/LotList.php';
require_once __DIR__ . '/import/InsertLots.php';
require_once __DIR__ . '/import/InsertLotsBS.php';
require_once __DIR__ . '/import/DevZone.php';
require_once __DIR__ . '/import/AuctionErrors.php';
require_once __DIR__ . '/import/FeatureLot.php';
require_once __DIR__ . '/import/SilentMigrator.php';
require_once __DIR__ . '/import/MetaMigrate.php';

require_once __DIR__ . '/helpers/BS_API.php';

require_once __DIR__ . '/CurlRequest.php';
require_once __DIR__ . '/BidSpiritRequest.php';
require_once __DIR__ . '/ImageUploader.php';

require_once __DIR__ . '/sync/SyncQueue.php';
require_once __DIR__ . '/sync/SyncLogger.php';
require_once __DIR__ . '/sync/CatalogSyncWorker.php';
require_once __DIR__ . '/sync/ItemUpdateWorker.php';
require_once __DIR__ . '/sync/BulkSyncWorker.php';
require_once __DIR__ . '/sync/SafetySync.php';

require_once __DIR__ . '/../ajax/abs/AjaxHandler.php';
require_once __DIR__ . '/../ajax/BidSpiritGate.php';
require_once __DIR__ . '/../ajax/ProfileLink.php';
require_once __DIR__ . '/../ajax/LotListAjax.php';
require_once __DIR__ . '/../ajax/LoadMore.php';
require_once __DIR__ . '/../ajax/ShowcaseAction.php';
require_once __DIR__ . '/../ajax/ViewHistory.php';
require_once __DIR__ . '/../ajax/LotAnalytics.php';
require_once __DIR__ . "/../ajax/UpdateBids.php";

require_once __DIR__ . '/api/InvoicePdfGenerator.php';
require_once __DIR__ . '/api/PublicAuctions.php';
$publicAuctions = new \auctionforge\inc\api\PublicAuctions();
$publicAuctions->init();

if (is_admin()) {
    $styleSettings = new \auctionforge\inc\controllers\StyleSettings();
    $styleSettings->init();

    require_once __DIR__ . '/../ajax/SyncNow.php';
    require_once __DIR__ . '/model/ImportHistory.php';
    require_once __DIR__ . '/controllers/HistoryTable.php';
    require_once __DIR__ . '/controllers/History.php';
    require_once __DIR__ . '/controllers/Submissions.php';
    require_once __DIR__ . '/controllers/SubmissionsTable.php';
    require_once __DIR__ . '/controllers/MetaBoxImages.php';
    require_once __DIR__ . '/controllers/MetaBoxViewHomepage.php';
}