<?php

namespace Devnet\PingVid\Includes;

use Devnet\PingVid\Admin\AdminSide;
use Devnet\PingVid\Public\PublicSide;
if ( !defined( 'ABSPATH' ) ) {
    exit;
}
class Plugin {
    protected $plugin_name;

    protected $version;

    public function __construct() {
        if ( defined( 'DEVNET_PINGVID_VERSION' ) ) {
            $this->version = DEVNET_PINGVID_VERSION;
        } else {
            $this->version = '1.0.0';
        }
        if ( defined( 'DEVNET_PINGVID_NAME' ) ) {
            $this->plugin_name = DEVNET_PINGVID_NAME;
        } else {
            $this->plugin_name = 'pingvid';
        }
        $this->load_dependencies();
    }

    private function load_dependencies() {
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/defaults.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/helper.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/settings-api.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/options.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/settings.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/admin.php';
        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/public.php';
    }

    public function run() {
        new AdminSide($this->get_plugin_name(), $this->get_version());
        new PublicSide($this->get_plugin_name(), $this->get_version());
    }

    public function get_plugin_name() {
        return $this->plugin_name;
    }

    public function get_version() {
        return $this->version;
    }

}
