forked from getdokan/migrate-to-dokan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate-to-dokan.php
78 lines (54 loc) · 1.98 KB
/
migrate-to-dokan.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
/**
* Plugin Name: Migrate To Dokan
* Plugin URI: https://wedevs.com/migrate-to-dokan/
* Description: Migrate Existing Data to Dokan. Powered by weDevs.
* Version: 1.0
* Author: weDevs
* Author URI: https://wedevs.com/
* License: GPL2
*/
if( ! defined( 'ABSPATH' ) ) exit;
final class Migrate_To_Dokan {
private $plan = 'migrate-to-dokan';
public $version = '1.0';
private function __construct() {
require_once __DIR__ . '/vendor/autoload.php';
$this->define_constants();
$this->instance();
register_activation_hook( __FILE__, [ $this, 'activate' ] );
// add_action( 'init', [ $this, 'init_plugin' ] );
}
public static function init() {
static $instance = false;
if ( ! $instance ) {
$instance = new Migrate_To_Dokan();
}
return $instance;
}
public function instance() {
new WeDevs\MigrateToDokan\Admin\Menu();
}
public function init_plugin() {
$has_setup_wizard = get_option( 'dokan-migrate-setup-wizard', 'no' );
if ( $has_setup_wizard == 'no' ) {
//wp_safe_redirect('http://wplearn.test/wp-admin/admin.php?page=migrate-to-dokan1');
}
}
public function define_constants() {
define( 'MIGRATE_TO_DOKAN_PLUGIN_VERSION', $this->version );
define( 'MIGRATE_TO_DOKAN_FILE', __FILE__ );
define( 'MIGRATE_DOKAN_DIR', dirname( MIGRATE_TO_DOKAN_FILE ) );
define( 'MIGRATE_DOKAN_TEMPLATE_DIR', MIGRATE_DOKAN_DIR . '/templates' );
define( 'MIGRATE_TO_DOKAN_DIR', dirname( MIGRATE_TO_DOKAN_FILE ) );
define( 'MIGRATE_TO_DOKAN_INC', MIGRATE_TO_DOKAN_DIR . '/includes' );
define( 'MIGRATE_TO_DOKAN_ADMIN_DIR', MIGRATE_TO_DOKAN_INC . '/Admin' );
define( 'MIGRATE_TO_DOKAN_PLUGIN_ASSEST', plugins_url( 'assets', MIGRATE_TO_DOKAN_FILE ) );
}
public function activate() {
}
}
function migrate_to_dokan() {
return Migrate_To_Dokan::init();
}
migrate_to_dokan();