PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 111
Lasso Lite – Affiliate Link Manager & Product Displays v111
158 157 155 156 154 153 152 151 150 149 148 trunk 0.9.9 104 105 106 107 108 109 110 111 112 113 114 115 All 57 releases
← All changes | classes/class-init.php +21 -33 157111 View file →
@@ -6,44 +6,23 @@
6 6 */
7 7
8 8 namespace LassoLite\Classes;
9 9
10 +use LassoLite\Admin\Constant;
11 +use LassoLite\Classes\Helper;
12 +
10 13 /**
11 14 * Init
12 15 */
13 16 class Init {
14 - /**
15 - * Declare vars of Lasso_Init
16 - *
17 - * @var array $classes List of classes
18 - */
19 - private $classes;
20 17
21 18 /**
22 - * Declare vars of Lasso_Init
23 - *
24 - * @var array $ajaxes List of ajaxes
19 + * Init constructor.
25 20 */
26 - private $ajaxes;
21 + public function __construct() {
27 22
28 - /**
29 - * Declare vars of Lasso_Init
30 - *
31 - * @var array $hooks List of hooks
32 - */
33 - private $hooks;
23 + $this->init_site_id();
34 24
35 - /**
36 - * Declare vars of Lasso_Init
37 - *
38 - * @var array $processes List of processes
39 - */
40 - private $processes;
41 -
42 - /**
43 - * Init constructor.
44 - */
45 - public function __construct() {
46 25 $this->ajaxes = array(
47 26 '\LassoLite\Pages\Ajax',
48 27 '\LassoLite\Pages\Dashboard\Ajax',
49 28 '\LassoLite\Pages\Import_Urls\Ajax',
@@ -49,23 +28,20 @@
49 28 '\LassoLite\Pages\Import_Urls\Ajax',
50 29 '\LassoLite\Pages\Url_Details\Ajax',
51 30 '\LassoLite\Pages\Settings\Ajax',
52 31 '\LassoLite\Pages\Groups\Ajax',
53 - '\LassoLite\Pages\Install\Ajax',
54 32 );
55 33
56 34 $this->hooks = array(
57 35 '\LassoLite\Pages\Hook',
58 36 '\LassoLite\Pages\Url_Details\Hook',
59 - '\LassoLite\Pages\Import_Urls\Hook',
37 + );
38 +
39 + $this->classes = array(
60 40 '\LassoLite\Classes\Cron',
61 41 );
62 42
63 - $this->classes = array();
64 -
65 43 $this->processes = array(
66 - '\LassoLite\Classes\Processes\Amazon',
67 - '\LassoLite\Classes\Processes\Amazon_Shortlink',
68 44 '\LassoLite\Classes\Processes\Import_All',
69 45 '\LassoLite\Classes\Processes\Revert_All',
70 46 );
71 47
@@ -117,8 +93,20 @@
117 93 */
118 94 public function initalize_processes() {
119 95 foreach ( $this->processes as $process ) {
120 96 new $process();
97 + }
98 + }
99 +
100 + /**
101 + * Init Lasso Lite site id
102 + */
103 + public function init_site_id() {
104 + if ( empty( Helper::get_option( Constant::SITE_ID_KEY ) ) ) {
105 + $url_parts = wp_parse_url( home_url() );
106 + $domain = $url_parts['host'];
107 + $hash_site_id = md5( $domain );
108 + Helper::update_option( Constant::SITE_ID_KEY, $hash_site_id );
121 109 }
122 110 }
123 111
124 112 /**