-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwoocommerce-support-helper.php
89 lines (79 loc) · 2.79 KB
/
woocommerce-support-helper.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
79
80
81
82
83
84
85
86
87
88
89
<?php
/**
* Plugin Name: WooCommerce Support Helper
* Plugin URI: https://github.com/jessepearson/woocommerce-support-helper
* Description: A plugin to export and import many settings in WooCommerce, along with other things.
* Author: Jesse Pearson
* Author URI: https://github.com/jessepearson/
* Text Domain: woocommerce-support-helper
* Version: 1.1.3
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'WooCommerce_Support_Helper' ) ) {
/**
* Main class.
*
* @package WooCommerce_Support_Helper
* @since 1.0.0
*/
class WooCommerce_Support_Helper {
/**
* Constructor.
*
* @since 1.0.0
* @version 1.1.3
*/
public function __construct() {
add_action( 'init', array( $this, 'includes' ) );
add_action( 'init', array( $this, 'plugin_updater' ), 20 );
}
/**
* Includes needed files.
*
* @since 1.0.0
* @version 1.1.3
*/
public function includes() {
// Updater class is needed outside of the admin.
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-updater.php' );
// Files only the admin needs.
if ( is_admin() ) {
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-logger.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-tools.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-file-handler.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-export.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-import.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-shipping-export.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-shipping-import.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-payment-export.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-payment-import.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-settings-tabs-export.php' );
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-settings-tabs-import.php' );
/**
* Subscriptions support.
* We only export if Subs is active, but we import if the data is there regardless.
*/
if ( class_exists( 'WC_Subscriptions_Admin' ) ) {
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-subscriptions-tab-export.php' );
}
require_once( dirname( __FILE__ ) .'/includes/class-wcsh-subscriptions-tab-import.php' );
}
}
/**
* Initializes our plugin updater.
*
* @since 1.0.0
* @version 1.1.1
*/
public function plugin_updater() {
// Get our updater object, set user and repo, and initialize the updater.
$updater = new WCSH_Updater( __FILE__ );
$updater->set_username( 'jessepearson' );
$updater->set_repository( 'woocommerce-support-helper' );
$updater->initialize();
}
}
new WooCommerce_Support_Helper();
}