<?php
/**
 * Plugin Name: Wiaas
 * Plugin URI: http://saburly.com
 * Description: Wiaas contains custom code for wiaas market place
 * Version: 1.0.0
 * Author: Saburly
 * Author URI: http://saburly.com
 * Text Domain: wiaas
 */

if ( !defined( 'ABSPATH' ) ) {
	exit;
}

define( 'WIAAS_FILE', __FILE__ );
define( 'WIAAS_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );


# CLI
if ( defined( 'WP_CLI' ) && WP_CLI ) {
	include_once WIAAS_DIR . '/includes/class-wiaas-cli.php';
}

include_once WIAAS_DIR . '/includes/class-wiaas-authentication.php';

if (is_admin()) {
    include_once WIAAS_DIR . '/includes/class-wiaas-admin.php';
}

include_once WIAAS_DIR . '/includes/class-wiaas-access-management.php';
include_once WIAAS_DIR . '/includes/class-wiaas-db.php';

include_once WIAAS_DIR . '/includes/class-wiaas-delivery-process.php';

include_once WIAAS_DIR . '/includes/class-wiaas-order.php';

include_once WIAAS_DIR . '/includes/class-wiaas-product.php';

include_once WIAAS_DIR . '/includes/class-wiaas-package.php';

include_once WIAAS_DIR . '/includes/class-wiaas-shop.php';

include_once WIAAS_DIR . '/includes/class-wiaas-user.php';

include_once WIAAS_DIR . '/includes/class-wiaas-pricing.php';

include_once WIAAS_DIR . '/includes/class-wiaas-countries.php';

include_once WIAAS_DIR . '/includes/class-wiaas-documents.php';

include_once WIAAS_DIR . '/includes/class-wiaas-cart.php';

include_once WIAAS_DIR . '/includes/class-wiaas-checkout.php';

include_once WIAAS_DIR . '/includes/class-wiaas-api.php';

include_once WIAAS_DIR . '/includes/class-wiass-templates.php';

include_once WIAAS_DIR . '/includes/wiaas-class-measurement-units.php';

function wiaas_redirect_to_login() {
    wp_safe_redirect(get_site_url('', 'wp-login.php'));
}

add_filter('wp_die_handler', 'wiaas_redirect_to_login');
