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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
<?php // phpcs:ignoreFile
namespace AutomateWoo;
/** * @class Options * @since 2.0.2 * * @property string $version * * @property bool $abandoned_cart_enabled * @property int $abandoned_cart_timeout * @property string $guest_email_capture_scope (checkout,all) * @property bool $clean_expired_coupons * @property bool $clear_inactive_carts_after * @property bool $abandoned_cart_includes_pending_orders * * @property bool $email_from_name * @property bool $email_from_address * * @property bool $twilio_integration_enabled * @property string $twilio_from * @property string $twilio_auth_id * @property string $twilio_auth_token * * @property bool $campaign_monitor_enabled * @property bool $campaign_monitor_api_key * @property bool $campaign_monitor_client_id * * @property bool $active_campaign_integration_enabled * @property string $active_campaign_api_url * @property string $active_campaign_api_key * * @property string $bitly_api * @property bool $bitly_shorten_sms_links * * @property int $conversion_window * * @property bool $enable_background_system_check * */
class Options extends Options_API {
/** @var string */ public $prefix = 'automatewoo_';
function __construct() { $this->defaults = [ 'optin_mode' => 'optin', 'enable_checkout_optin' => 'yes', 'enable_account_signup_optin' => 'yes', 'optin_checkbox_text' => __( 'I want to receive updates about products and promotions.', 'automatewoo' ), 'session_tracking_enabled' => 'yes', 'session_tracking_requires_cookie_consent' => 'no', 'enable_communication_account_tab' => 'no', 'communication_page_legal_text' => __( 'You can update these options at any time by clicking the unsubscribe link in the footer of any email you receive from us, or in your account area. By clicking below, you agree that we may process your information in accordance with our [terms] and [privacy_policy].', 'automatewoo' ), 'enable_presubmit_data_capture' => 'no',
'abandoned_cart_enabled' => 'yes', 'abandoned_cart_timeout' => 15, 'clear_inactive_carts_after' => 60, 'guest_email_capture_scope' => 'checkout', 'clean_expired_coupons' => 'yes', 'abandoned_cart_includes_pending_orders' => 'no',
'twilio_integration_enabled' => 'no', 'active_campaign_integration_enabled' => false, 'campaign_monitor_enabled' => false, 'mailchimp_integration_enabled' => false, 'conversion_window' => 14, 'enable_background_system_check' => true, 'bitly_shorten_sms_links' => 'no', ]; }
/** * Returns the version of the database to handle migrations. * * Is autoloaded. * * @since 4.3.0 * * @return string */ static function database_version() { return Clean::string( self::get( 'version' ) ); }
/** * Returns the stored version of the plugin files. Used to log when file updates occur. * * Is autoloaded. * * @since 4.3.0 * * @return string */ static function file_version() { return Clean::string( self::get( 'file_version' ) ); }
/** * @since 4.0 * @return bool */ static function optin_enabled() { return Options::get('optin_mode') === 'optin'; }
/** * @since 4.0 * @return bool */ static function session_tracking_enabled() { return (bool) Options::get('session_tracking_enabled'); }
/** * @since 4.0 * @return bool */ static function session_tracking_requires_cookie_consent() { return (bool) Options::get('session_tracking_requires_cookie_consent'); }
/** * @since 4.0 * @return string */ static function session_tracking_consent_cookie_name() { return Clean::string( Options::get('session_tracking_consent_cookie_name') ); }
/** * @since 4.0 * @return bool */ static function presubmit_capture_enabled() { return Options::get('session_tracking_enabled') && Options::get('enable_presubmit_data_capture'); }
/** * @since 4.0 * @return bool */ static function abandoned_cart_enabled() { return (bool) Options::get('abandoned_cart_enabled'); }
/** * @since 4.0 * @return bool */ static function checkout_optin_enabled() { return (bool) Options::get('enable_checkout_optin'); }
/** * @since 4.0 * @return bool */ static function account_optin_enabled() { return (bool) Options::get('enable_account_signup_optin'); }
/** * @since 4.0 * @return string */ static function optin_checkbox_text() { return trim( wp_kses_post( Options::get('optin_checkbox_text') ) ); }
/** * @since 4.0 * @return int */ static function communication_page_id() { return Clean::id( Options::get('communication_preferences_page_id') ); }
/** * @since 4.0 * @return int */ static function signup_page_id() { return Clean::id( Options::get('communication_signup_page_id') ); }
/** * @since 4.0 * @return string */ static function communication_page_legal_text() { return trim( wp_kses_post( Options::get('communication_page_legal_text') ) ); }
/** * @since 4.0 * @return bool */ static function communication_account_tab_enabled() { return (bool) Options::get('enable_communication_account_tab'); }
/** * Get mailchimp_enabled option. * * @since 4.4 * * @return bool */ static function mailchimp_enabled() { return (bool) Options::get( 'mailchimp_integration_enabled' ); }
/** * Get mailchimp_api_key option. * * @since 4.4 * * @return string */ static function mailchimp_api_key() { return trim( Clean::string( Options::get( 'mailchimp_api_key' ) ) ); }
/** * Get active_campaign_integration_enabled option. * * @since 5.8.5 * * @return bool */ static public function activecampaign_enabled(): bool { return (bool) Options::get( 'active_campaign_integration_enabled' ); }
/** * Get twilio_integration_enabled option. * * @since 5.8.5 * * @return bool */ static public function twilio_enabled(): bool { return (bool) Options::get( 'twilio_integration_enabled' ); }
/** * Get bitly_shorten_sms_links option. * * @since 5.8.5 * * @return bool */ static public function bitly_enabled(): bool { return (bool) Options::get( 'bitly_shorten_sms_links' ); }
/** * Get campaign_monitor_enabled option. * * @since 5.8.5 * * @return bool */ static public function campaign_monitor_enabled(): bool { return (bool) Options::get( 'campaign_monitor_enabled' ); } }
|