PluginProbe
Lasso Lite – Affiliate Link Manager & Product Displays / 116
Lasso Lite – Affiliate Link Manager & Product Displays v116
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 116 All 56 releases
← All changes | classes/class-init.php +21 -32 155116 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,9 +28,8 @@
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',
@@ -56,16 +34,15 @@
56 34 $this->hooks = array(
57 35 '\LassoLite\Pages\Hook',
58 36 '\LassoLite\Pages\Url_Details\Hook',
59 37 '\LassoLite\Pages\Import_Urls\Hook',
38 + );
39 +
40 + $this->classes = array(
60 41 '\LassoLite\Classes\Cron',
61 42 );
62 43
63 - $this->classes = array();
64 -
65 44 $this->processes = array(
66 - '\LassoLite\Classes\Processes\Amazon',
67 - '\LassoLite\Classes\Processes\Amazon_Shortlink',
68 45 '\LassoLite\Classes\Processes\Import_All',
69 46 '\LassoLite\Classes\Processes\Revert_All',
70 47 );
71 48
@@ -117,8 +94,20 @@
117 94 */
118 95 public function initalize_processes() {
119 96 foreach ( $this->processes as $process ) {
120 97 new $process();
98 + }
99 + }
100 +
101 + /**
102 + * Init Lasso Lite site id
103 + */
104 + public function init_site_id() {
105 + if ( empty( Helper::get_option( Constant::SITE_ID_KEY ) ) ) {
106 + $url_parts = wp_parse_url( home_url() );
107 + $domain = $url_parts['host'];
108 + $hash_site_id = md5( $domain );
109 + Helper::update_option( Constant::SITE_ID_KEY, $hash_site_id );
121 110 }
122 111 }
123 112
124 113 /**