-
Notifications
You must be signed in to change notification settings - Fork 0
/
Sabadino.php
89 lines (62 loc) · 2.24 KB
/
Sabadino.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
<?php
/**
* Plugin Name: Sabadino
* Plugin URI: http://woocommerce.com/products/woocommerce-extension/
* Description: Your extension's description text.
* Version: 1.0.0
* Author: Hossein pour reza
* Author URI: http://yourdomain.com/
* Developer: Hossein pour reza
* Developer URI: http://yourdomain.com/
* Text Domain: woocommerce-extension
* Domain Path: /languages
*
* Woo: 12345:342928dfsfhsf8429842374wdf4234sfd
* WC requires at least: 2.2
* WC tested up to: 2.3
*
* License: GNU General Public License v3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
use Sabadino\features\analytics\includes\PurchaseProcessor;
use Sabadino\features\analytics\includes\SendSMSProcessor;
use Sabadino\includes\Cron;
use Sabadino\includes\Loader;
use Sabadino\includes\Register;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Sabadino{
protected static $_instance = null;
public static function get_instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
public function __construct()
{
define('ZA_ASSETS_URL' , plugin_dir_url(__FILE__).'/assets/');
define('ZA_ROOT_URL' , plugin_dir_url(__FILE__) );
define('ZA_ROOT_PATH' , plugin_dir_path(__FILE__));
define('ZA_REGISTER_ROOT' , __FILE__ );
define('ZA_FEATURES_PATH' , plugin_dir_path(__FILE__).'features/');
define('ZA_VERSION' , '2.1.8');
define('ZA_DEVELOPER_MODE' , true );
define('ZA_SABADINO_SCRIPTS_VERSION', ZA_DEVELOPER_MODE ? time() : ZA_VERSION );
require_once ZA_ROOT_PATH . 'vendor/autoload.php';
self::withoutHook();
add_action( 'init' ,[ $this ,'load'] , 12 );
}
public static function withoutHook(){
Register ::get_instance();
add_filter( 'cron_schedules' ,[ Cron::get_instance() ,'customInterval'] , 1 );
add_action( 'za_process_user_purchase_list' ,[ PurchaseProcessor::get_instance() ,'run'] , 10 );
add_action( 'za_send_sms_handler' ,[ SendSMSProcessor::get_instance() ,'run'] , 10 );
}
public static function load()
{
Loader::get_instance();
}
}
new Sabadino();