<?php

/**
 * Plugin Name: dPlugins DevKit
 * Plugin URI:  https://dplugins.com/
 * Description: Plugin crafted for dPlugins instalations and debuging
 * Author: devusrmk
 * Author URI: https://dplugins.com/
 * Version: 1.1.2
 */

defined( 'ABSPATH' ) or die( 'Move Along, Nothing to See Here' );

// Define plugin constants
define('DPDEVKIT_URL', plugin_dir_url(__FILE__));
define('DPDEVKIT_PATH', plugin_dir_path(__FILE__));
define('DPDEV_ADMIN_SLUG', 'dPlugins-installation-tools');
define('DPDEV_BASE', plugin_basename(__FILE__));

// EDD Plugin const
define( 'DPDEVKIT_UPDATER', __FILE__ );
define( 'DPDEVKIT_STORE_URL', 'https://dplugins.com/' );
define( 'DPDEVKIT_ITEM_ID', 6331 );
define( 'DPDEVKIT_ITEM_NAME',  'dPlugins DevKit' );
define( 'DPDEVKIT_EDD_AUTHOR', 'devusrmk' );
define( 'DPDEVKIT_EDD_PLUGINVERSION',  '1.1.2' );

// includes
if( !class_exists( 'EDD_SL_Plugin_Updater' ) ) {
	// load our custom updater
	include( dirname( __FILE__ ) . '/includes/edd/EDD_SL_Plugin_Updater.php' );
}
require DPDEVKIT_PATH . 'includes/admin__ziparchive.php';
require DPDEVKIT_PATH . 'includes/admin.php';
require DPDEVKIT_PATH . 'includes/admin__plugin-update-classes.php';
require DPDEVKIT_PATH . 'includes/admin__wp-reset.php';

function DPDEVKIT_edd_sl_sample_plugin_updater() {

	// To support auto-updates, this needs to run during the wp_version_check cron job for privileged users.
	$doing_cron = defined( 'DOING_CRON' ) && DOING_CRON;
	if ( ! current_user_can( 'manage_options' ) && ! $doing_cron ) {
		return;
	}

	// setup the updater
	$edd_updater = new EDD_SL_Plugin_Updater( DPDEVKIT_STORE_URL, DPDEVKIT_UPDATER,
		array(
			'version' => DPDEVKIT_EDD_PLUGINVERSION,                    // current version number
			'license' => '',             // license key (used get_option above to retrieve from DB)
			'item_id' => DPDEVKIT_ITEM_ID,       // ID of the product
			'author'  => DPDEVKIT_EDD_AUTHOR, // author of this plugin
			'beta'    => false,
		)
	);

}
add_action( 'init', 'DPDEVKIT_edd_sl_sample_plugin_updater' );