Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress - Version 1.5.16

Version Description

Download this release

Release Info

Developer sandesh055
Plugin Icon Funnel Builder by CartFlows – Create High Converting Sales Funnels For WordPress
Version 1.5.16
Comparing to
See all releases

Code changes from version 1.5.15 to 1.5.16

admin/bsf-analytics/class-bsf-analytics-loader.php CHANGED
@@ -1,118 +1,118 @@
1
- <?php
2
- /**
3
- * BSF analytics loader file.
4
- *
5
- * @version 1.0.0
6
- *
7
- * @package bsf-analytics
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit();
12
- }
13
-
14
- /**
15
- * Class BSF_Analytics_Loader.
16
- */
17
- class BSF_Analytics_Loader {
18
-
19
- /**
20
- * Analytics Entities.
21
- *
22
- * @access private
23
- * @var array Entities array.
24
- */
25
- private $entities = array();
26
-
27
- /**
28
- * Analytics Version.
29
- *
30
- * @access private
31
- * @var float analytics version.
32
- */
33
- private $analytics_version = '';
34
-
35
- /**
36
- * Analytics path.
37
- *
38
- * @access private
39
- * @var string path array.
40
- */
41
- private $analytics_path = '';
42
-
43
- /**
44
- * Instance
45
- *
46
- * @access private
47
- * @var object Class object.
48
- */
49
- private static $instance = null;
50
-
51
- /**
52
- * Get instace of class.
53
- *
54
- * @return object
55
- */
56
- public static function get_instance() {
57
- if ( null === self::$instance ) {
58
- self::$instance = new self();
59
- }
60
-
61
- return self::$instance;
62
- }
63
-
64
- /**
65
- * Constructor
66
- */
67
- public function __construct() {
68
- add_action( 'init', array( $this, 'load_analytics' ) );
69
- }
70
-
71
- /**
72
- * Set entity for analytics.
73
- *
74
- * @param string $data Entity attributes data.
75
- * @return void
76
- */
77
- public function set_entity( $data ) {
78
- array_push( $this->entities, $data );
79
- }
80
-
81
- /**
82
- * Load Analytics library.
83
- *
84
- * @return void
85
- */
86
- public function load_analytics() {
87
- $unique_entities = array();
88
-
89
- if ( ! empty( $this->entities ) ) {
90
- foreach ( $this->entities as $entity ) {
91
- foreach ( $entity as $key => $data ) {
92
-
93
- if ( isset( $data['path'] ) ) {
94
- if ( file_exists( $data['path'] . '/version.json' ) ) {
95
- $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
- $analytics_version = json_decode( $file_contents, 1 );
97
- $analytics_version = $analytics_version['bsf-analytics-ver'];
98
-
99
- if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100
- $this->analytics_version = $analytics_version;
101
- $this->analytics_path = $data['path'];
102
- }
103
- }
104
- }
105
-
106
- if ( ! isset( $unique_entities[ $key ] ) ) {
107
- $unique_entities[ $key ] = $data;
108
- }
109
- }
110
- }
111
-
112
- if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113
- require_once $this->analytics_path . '/class-bsf-analytics.php';
114
- new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115
- }
116
- }
117
- }
118
- }
1
+ <?php
2
+ /**
3
+ * BSF analytics loader file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit();
12
+ }
13
+
14
+ /**
15
+ * Class BSF_Analytics_Loader.
16
+ */
17
+ class BSF_Analytics_Loader {
18
+
19
+ /**
20
+ * Analytics Entities.
21
+ *
22
+ * @access private
23
+ * @var array Entities array.
24
+ */
25
+ private $entities = array();
26
+
27
+ /**
28
+ * Analytics Version.
29
+ *
30
+ * @access private
31
+ * @var float analytics version.
32
+ */
33
+ private $analytics_version = '';
34
+
35
+ /**
36
+ * Analytics path.
37
+ *
38
+ * @access private
39
+ * @var string path array.
40
+ */
41
+ private $analytics_path = '';
42
+
43
+ /**
44
+ * Instance
45
+ *
46
+ * @access private
47
+ * @var object Class object.
48
+ */
49
+ private static $instance = null;
50
+
51
+ /**
52
+ * Get instace of class.
53
+ *
54
+ * @return object
55
+ */
56
+ public static function get_instance() {
57
+ if ( null === self::$instance ) {
58
+ self::$instance = new self();
59
+ }
60
+
61
+ return self::$instance;
62
+ }
63
+
64
+ /**
65
+ * Constructor
66
+ */
67
+ public function __construct() {
68
+ add_action( 'init', array( $this, 'load_analytics' ) );
69
+ }
70
+
71
+ /**
72
+ * Set entity for analytics.
73
+ *
74
+ * @param string $data Entity attributes data.
75
+ * @return void
76
+ */
77
+ public function set_entity( $data ) {
78
+ array_push( $this->entities, $data );
79
+ }
80
+
81
+ /**
82
+ * Load Analytics library.
83
+ *
84
+ * @return void
85
+ */
86
+ public function load_analytics() {
87
+ $unique_entities = array();
88
+
89
+ if ( ! empty( $this->entities ) ) {
90
+ foreach ( $this->entities as $entity ) {
91
+ foreach ( $entity as $key => $data ) {
92
+
93
+ if ( isset( $data['path'] ) ) {
94
+ if ( file_exists( $data['path'] . '/version.json' ) ) {
95
+ $file_contents = file_get_contents( $data['path'] . '/version.json' ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
96
+ $analytics_version = json_decode( $file_contents, 1 );
97
+ $analytics_version = $analytics_version['bsf-analytics-ver'];
98
+
99
+ if ( version_compare( $analytics_version, $this->analytics_version, '>' ) ) {
100
+ $this->analytics_version = $analytics_version;
101
+ $this->analytics_path = $data['path'];
102
+ }
103
+ }
104
+ }
105
+
106
+ if ( ! isset( $unique_entities[ $key ] ) ) {
107
+ $unique_entities[ $key ] = $data;
108
+ }
109
+ }
110
+ }
111
+
112
+ if ( file_exists( $this->analytics_path ) && ! class_exists( 'BSF_Analytics' ) ) {
113
+ require_once $this->analytics_path . '/class-bsf-analytics.php';
114
+ new BSF_Analytics( $unique_entities, $this->analytics_path, $this->analytics_version );
115
+ }
116
+ }
117
+ }
118
+ }
admin/bsf-analytics/class-bsf-analytics.php CHANGED
@@ -1,503 +1,503 @@
1
- <?php
2
- /**
3
- * BSF analytics class file.
4
- *
5
- * @version 1.0.0
6
- *
7
- * @package bsf-analytics
8
- */
9
-
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- exit; // Exit if accessed directly.
12
- }
13
-
14
- if ( ! class_exists( 'BSF_Analytics' ) ) {
15
-
16
- /**
17
- * BSF analytics
18
- */
19
- class BSF_Analytics {
20
-
21
- /**
22
- * Member Variable
23
- *
24
- * @var array Entities data.
25
- */
26
- private $entities;
27
-
28
- /**
29
- * Member Variable
30
- *
31
- * @var string Usage tracking document URL
32
- */
33
- public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
34
-
35
- /**
36
- * Setup actions, load files.
37
- *
38
- * @param array $args entity data for analytics.
39
- * @param string $analytics_path directory path to analytics library.
40
- * @param float $analytics_version analytics library version.
41
- * @since 1.0.0
42
- */
43
- public function __construct( $args, $analytics_path, $analytics_version ) {
44
-
45
- // Bail when no analytics entities are registered.
46
- if ( empty( $args ) ) {
47
- return;
48
- }
49
-
50
- $this->entities = $args;
51
-
52
- define( 'BSF_ANALYTICS_VERSION', $analytics_version );
53
- define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) );
54
-
55
- add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
56
- add_action( 'admin_notices', array( $this, 'option_notice' ) );
57
- add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 );
58
-
59
- $this->set_actions();
60
-
61
- add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
62
-
63
- $this->includes();
64
- }
65
-
66
- /**
67
- * Setup actions for admin notice style and analytics cron event.
68
- *
69
- * @since 1.0.4
70
- */
71
- public function set_actions() {
72
-
73
- foreach ( $this->entities as $key => $data ) {
74
- add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
75
- add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
76
- add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
77
- }
78
- }
79
-
80
- /**
81
- * BSF Analytics URL
82
- *
83
- * @param string $analytics_path directory path to analytics library.
84
- * @return String URL of bsf-analytics directory.
85
- * @since 1.0.0
86
- */
87
- public function get_analytics_url( $analytics_path ) {
88
- return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );
89
- }
90
-
91
- /**
92
- * Get API URL for sending analytics.
93
- *
94
- * @return string API URL.
95
- * @since 1.0.0
96
- */
97
- private function get_api_url() {
98
- return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
99
- }
100
-
101
- /**
102
- * Enqueue Scripts.
103
- *
104
- * @since 1.0.0
105
- * @return void
106
- */
107
- public function enqueue_assets() {
108
-
109
- /**
110
- * Load unminified if SCRIPT_DEBUG is true.
111
- *
112
- * Directory and Extensions.
113
- */
114
- $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
115
- $file_rtl = ( is_rtl() ) ? '-rtl' : '';
116
- $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
117
-
118
- $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
119
-
120
- wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
121
- }
122
-
123
- /**
124
- * Send analytics API call.
125
- *
126
- * @since 1.0.0
127
- */
128
- public function send() {
129
- wp_remote_post(
130
- $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
131
- array(
132
- 'body' => BSF_Analytics_Stats::instance()->get_stats(),
133
- 'timeout' => 5,
134
- 'blocking' => false,
135
- )
136
- );
137
- }
138
-
139
- /**
140
- * Check if usage tracking is enabled.
141
- *
142
- * @return bool
143
- * @since 1.0.0
144
- */
145
- public function is_tracking_enabled() {
146
-
147
- foreach ( $this->entities as $key => $data ) {
148
-
149
- $is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
150
- $is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
151
-
152
- if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
153
- return true;
154
- }
155
- }
156
-
157
- return false;
158
- }
159
-
160
- /**
161
- * Check if WHITE label is enabled for BSF products.
162
- *
163
- * @param string $source source of analytics.
164
- * @return bool
165
- * @since 1.0.0
166
- */
167
- public function is_white_label_enabled( $source ) {
168
-
169
- $options = apply_filters( $source . '_white_label_options', array() );
170
- $is_enabled = false;
171
-
172
- if ( is_array( $options ) ) {
173
- foreach ( $options as $option ) {
174
- if ( true === $option ) {
175
- $is_enabled = true;
176
- break;
177
- }
178
- }
179
- }
180
-
181
- return $is_enabled;
182
- }
183
-
184
- /**
185
- * Display admin notice for usage tracking.
186
- *
187
- * @since 1.0.0
188
- */
189
- public function option_notice() {
190
-
191
- if ( ! current_user_can( 'manage_options' ) ) {
192
- return;
193
- }
194
-
195
- foreach ( $this->entities as $key => $data ) {
196
-
197
- $time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
198
- $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
199
-
200
- // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
201
- if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
202
- continue;
203
- }
204
-
205
- // Show tracker consent notice after 24 hours from installed time.
206
- if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
207
- continue;
208
- }
209
-
210
- /* translators: %s product name */
211
- $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
212
-
213
- if ( is_multisite() ) {
214
- $notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
215
- }
216
-
217
- $language_dir = is_rtl() ? 'rtl' : 'ltr';
218
-
219
- Astra_Notices::add_notice(
220
- array(
221
- 'id' => $key . '-optin-notice',
222
- 'type' => '',
223
- 'message' => sprintf(
224
- '<div class="notice-content">
225
- <div class="notice-heading">
226
- %1$s
227
- </div>
228
- <div class="astra-notices-container">
229
- <a href="%2$s" class="astra-notices button-primary">
230
- %3$s
231
- </a>
232
- <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
233
- %6$s
234
- </a>
235
- </div>
236
- </div>',
237
- /* translators: %s usage doc link */
238
- sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
239
- add_query_arg(
240
- array(
241
- $key . '_analytics_optin' => 'yes',
242
- $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
243
- 'bsf_analytics_source' => $key,
244
- )
245
- ),
246
- __( 'Yes! Allow it', 'cartflows' ),
247
- add_query_arg(
248
- array(
249
- $key . '_analytics_optin' => 'no',
250
- $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
251
- 'bsf_analytics_source' => $key,
252
- )
253
- ),
254
- MONTH_IN_SECONDS,
255
- __( 'No Thanks', 'cartflows' )
256
- ),
257
- 'show_if' => true,
258
- 'repeat-notice-after' => false,
259
- 'priority' => 18,
260
- 'display-with-other-notices' => true,
261
- )
262
- );
263
- }
264
- }
265
-
266
- /**
267
- * Process usage tracking opt out.
268
- *
269
- * @since 1.0.0
270
- */
271
- public function handle_optin_optout() {
272
-
273
- if ( ! current_user_can( 'manage_options' ) ) {
274
- return;
275
- }
276
-
277
- $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
278
-
279
- if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
280
- return;
281
- }
282
-
283
- if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
284
- return;
285
- }
286
-
287
- $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
288
-
289
- if ( 'yes' === $optin_status ) {
290
- $this->optin( $source );
291
- } elseif ( 'no' === $optin_status ) {
292
- $this->optout( $source );
293
- }
294
-
295
- wp_safe_redirect(
296
- remove_query_arg(
297
- array(
298
- $source . '_analytics_optin',
299
- $source . '_analytics_nonce',
300
- 'bsf_analytics_source',
301
- )
302
- )
303
- );
304
- }
305
-
306
- /**
307
- * Opt in to usage tracking.
308
- *
309
- * @param string $source source of analytics.
310
- * @since 1.0.0
311
- */
312
- private function optin( $source ) {
313
- update_site_option( $source . '_analytics_optin', 'yes' );
314
- }
315
-
316
- /**
317
- * Opt out to usage tracking.
318
- *
319
- * @param string $source source of analytics.
320
- * @since 1.0.0
321
- */
322
- private function optout( $source ) {
323
- update_site_option( $source . '_analytics_optin', 'no' );
324
- }
325
-
326
- /**
327
- * Load analytics stat class.
328
- *
329
- * @since 1.0.0
330
- */
331
- private function includes() {
332
- require_once __DIR__ . '/class-bsf-analytics-stats.php';
333
- }
334
-
335
- /**
336
- * Register usage tracking option in General settings page.
337
- *
338
- * @since 1.0.0
339
- */
340
- public function register_usage_tracking_setting() {
341
-
342
- foreach ( $this->entities as $key => $data ) {
343
-
344
- if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
345
- return;
346
- }
347
-
348
- $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
349
- $author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
350
-
351
- register_setting(
352
- 'general', // Options group.
353
- $key . '_analytics_optin', // Option name/database.
354
- array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
355
- );
356
-
357
- add_settings_field(
358
- $key . '-analytics-optin', // Field ID.
359
- __( 'Usage Tracking', 'cartflows' ), // Field title.
360
- array( $this, 'render_settings_field_html' ), // Field callback function.
361
- 'general',
362
- 'default', // Settings page slug.
363
- array(
364
- 'type' => 'checkbox',
365
- 'title' => $author,
366
- 'name' => $key . '_analytics_optin',
367
- 'label_for' => $key . '-analytics-optin',
368
- 'id' => $key . '-analytics-optin',
369
- 'usage_doc_link' => $usage_doc_link,
370
- )
371
- );
372
- }
373
- }
374
-
375
- /**
376
- * Sanitize Callback Function
377
- *
378
- * @param bool $input Option value.
379
- * @since 1.0.0
380
- */
381
- public function sanitize_option( $input ) {
382
-
383
- if ( ! $input || 'no' === $input ) {
384
- return 'no';
385
- }
386
-
387
- return 'yes';
388
- }
389
-
390
- /**
391
- * Print settings field HTML.
392
- *
393
- * @param array $args arguments to field.
394
- * @since 1.0.0
395
- */
396
- public function render_settings_field_html( $args ) {
397
- ?>
398
- <fieldset>
399
- <label for="<?php echo esc_attr( $args['label_for'] ); ?>">
400
- <input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
401
- <?php
402
- /* translators: %s Product title */
403
- echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'cartflows' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
404
-
405
- if ( is_multisite() ) {
406
- esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
407
- }
408
- ?>
409
- </label>
410
- <?php
411
- echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
412
- ?>
413
- </fieldset>
414
- <?php
415
- }
416
-
417
- /**
418
- * Set analytics installed time in option.
419
- *
420
- * @param string $source source of analytics.
421
- * @return string $time analytics installed time.
422
- * @since 1.0.0
423
- */
424
- private function get_analytics_install_time( $source ) {
425
-
426
- $time = get_site_option( $source . '_analytics_installed_time' );
427
-
428
- if ( ! $time ) {
429
- $time = time();
430
- update_site_option( $source . '_analytics_installed_time', time() );
431
- }
432
-
433
- return $time;
434
- }
435
-
436
- /**
437
- * Schedule/unschedule cron event on updation of option.
438
- *
439
- * @param string $old_value old value of option.
440
- * @param string $value value of option.
441
- * @param string $option Option name.
442
- * @since 1.0.0
443
- */
444
- public function update_analytics_option_callback( $old_value, $value, $option ) {
445
- if ( is_multisite() ) {
446
- $this->add_option_to_network( $option, $value );
447
- }
448
- }
449
-
450
- /**
451
- * Analytics option add callback.
452
- *
453
- * @param string $option Option name.
454
- * @param string $value value of option.
455
- * @since 1.0.0
456
- */
457
- public function add_analytics_option_callback( $option, $value ) {
458
- if ( is_multisite() ) {
459
- $this->add_option_to_network( $option, $value );
460
- }
461
- }
462
-
463
- /**
464
- * Send analaytics track event if tracking is enabled.
465
- *
466
- * @since 1.0.0
467
- */
468
- public function maybe_track_analytics() {
469
-
470
- if ( ! $this->is_tracking_enabled() ) {
471
- return;
472
- }
473
-
474
- $analytics_track = get_site_transient( 'bsf_analytics_track' );
475
-
476
- // If the last data sent is 2 days old i.e. transient is expired.
477
- if ( ! $analytics_track ) {
478
- $this->send();
479
- set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS );
480
- }
481
- }
482
-
483
- /**
484
- * Save analytics option to network.
485
- *
486
- * @param string $option name of option.
487
- * @param string $value value of option.
488
- * @since 1.0.0
489
- */
490
- public function add_option_to_network( $option, $value ) {
491
-
492
- // If action coming from general settings page.
493
- if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
494
-
495
- if ( get_site_option( $option ) ) {
496
- update_site_option( $option, $value );
497
- } else {
498
- add_site_option( $option, $value );
499
- }
500
- }
501
- }
502
- }
503
- }
1
+ <?php
2
+ /**
3
+ * BSF analytics class file.
4
+ *
5
+ * @version 1.0.0
6
+ *
7
+ * @package bsf-analytics
8
+ */
9
+
10
+ if ( ! defined( 'ABSPATH' ) ) {
11
+ exit; // Exit if accessed directly.
12
+ }
13
+
14
+ if ( ! class_exists( 'BSF_Analytics' ) ) {
15
+
16
+ /**
17
+ * BSF analytics
18
+ */
19
+ class BSF_Analytics {
20
+
21
+ /**
22
+ * Member Variable
23
+ *
24
+ * @var array Entities data.
25
+ */
26
+ private $entities;
27
+
28
+ /**
29
+ * Member Variable
30
+ *
31
+ * @var string Usage tracking document URL
32
+ */
33
+ public $usage_doc_link = 'https://store.brainstormforce.com/usage-tracking/?utm_source=wp_dashboard&utm_medium=general_settings&utm_campaign=usage_tracking';
34
+
35
+ /**
36
+ * Setup actions, load files.
37
+ *
38
+ * @param array $args entity data for analytics.
39
+ * @param string $analytics_path directory path to analytics library.
40
+ * @param float $analytics_version analytics library version.
41
+ * @since 1.0.0
42
+ */
43
+ public function __construct( $args, $analytics_path, $analytics_version ) {
44
+
45
+ // Bail when no analytics entities are registered.
46
+ if ( empty( $args ) ) {
47
+ return;
48
+ }
49
+
50
+ $this->entities = $args;
51
+
52
+ define( 'BSF_ANALYTICS_VERSION', $analytics_version );
53
+ define( 'BSF_ANALYTICS_URI', $this->get_analytics_url( $analytics_path ) );
54
+
55
+ add_action( 'admin_init', array( $this, 'handle_optin_optout' ) );
56
+ add_action( 'admin_notices', array( $this, 'option_notice' ) );
57
+ add_action( 'init', array( $this, 'maybe_track_analytics' ), 99 );
58
+
59
+ $this->set_actions();
60
+
61
+ add_action( 'admin_init', array( $this, 'register_usage_tracking_setting' ) );
62
+
63
+ $this->includes();
64
+ }
65
+
66
+ /**
67
+ * Setup actions for admin notice style and analytics cron event.
68
+ *
69
+ * @since 1.0.4
70
+ */
71
+ public function set_actions() {
72
+
73
+ foreach ( $this->entities as $key => $data ) {
74
+ add_action( 'astra_notice_before_markup_' . $key . '-optin-notice', array( $this, 'enqueue_assets' ) );
75
+ add_action( 'update_option_' . $key . '_analytics_optin', array( $this, 'update_analytics_option_callback' ), 10, 3 );
76
+ add_action( 'add_option_' . $key . '_analytics_optin', array( $this, 'add_analytics_option_callback' ), 10, 2 );
77
+ }
78
+ }
79
+
80
+ /**
81
+ * BSF Analytics URL
82
+ *
83
+ * @param string $analytics_path directory path to analytics library.
84
+ * @return String URL of bsf-analytics directory.
85
+ * @since 1.0.0
86
+ */
87
+ public function get_analytics_url( $analytics_path ) {
88
+ return str_replace( WP_CONTENT_DIR, content_url(), $analytics_path );
89
+ }
90
+
91
+ /**
92
+ * Get API URL for sending analytics.
93
+ *
94
+ * @return string API URL.
95
+ * @since 1.0.0
96
+ */
97
+ private function get_api_url() {
98
+ return defined( 'BSF_API_URL' ) ? BSF_API_URL : 'https://support.brainstormforce.com/';
99
+ }
100
+
101
+ /**
102
+ * Enqueue Scripts.
103
+ *
104
+ * @since 1.0.0
105
+ * @return void
106
+ */
107
+ public function enqueue_assets() {
108
+
109
+ /**
110
+ * Load unminified if SCRIPT_DEBUG is true.
111
+ *
112
+ * Directory and Extensions.
113
+ */
114
+ $dir_name = ( SCRIPT_DEBUG ) ? 'unminified' : 'minified';
115
+ $file_rtl = ( is_rtl() ) ? '-rtl' : '';
116
+ $css_ext = ( SCRIPT_DEBUG ) ? '.css' : '.min.css';
117
+
118
+ $css_uri = BSF_ANALYTICS_URI . '/assets/css/' . $dir_name . '/style' . $file_rtl . $css_ext;
119
+
120
+ wp_enqueue_style( 'bsf-analytics-admin-style', $css_uri, false, BSF_ANALYTICS_VERSION, 'all' );
121
+ }
122
+
123
+ /**
124
+ * Send analytics API call.
125
+ *
126
+ * @since 1.0.0
127
+ */
128
+ public function send() {
129
+ wp_remote_post(
130
+ $this->get_api_url() . 'wp-json/bsf-core/v1/analytics/',
131
+ array(
132
+ 'body' => BSF_Analytics_Stats::instance()->get_stats(),
133
+ 'timeout' => 5,
134
+ 'blocking' => false,
135
+ )
136
+ );
137
+ }
138
+
139
+ /**
140
+ * Check if usage tracking is enabled.
141
+ *
142
+ * @return bool
143
+ * @since 1.0.0
144
+ */
145
+ public function is_tracking_enabled() {
146
+
147
+ foreach ( $this->entities as $key => $data ) {
148
+
149
+ $is_enabled = get_site_option( $key . '_analytics_optin' ) === 'yes' ? true : false;
150
+ $is_enabled = $this->is_white_label_enabled( $key ) ? false : $is_enabled;
151
+
152
+ if ( apply_filters( $key . '_tracking_enabled', $is_enabled ) ) {
153
+ return true;
154
+ }
155
+ }
156
+
157
+ return false;
158
+ }
159
+
160
+ /**
161
+ * Check if WHITE label is enabled for BSF products.
162
+ *
163
+ * @param string $source source of analytics.
164
+ * @return bool
165
+ * @since 1.0.0
166
+ */
167
+ public function is_white_label_enabled( $source ) {
168
+
169
+ $options = apply_filters( $source . '_white_label_options', array() );
170
+ $is_enabled = false;
171
+
172
+ if ( is_array( $options ) ) {
173
+ foreach ( $options as $option ) {
174
+ if ( true === $option ) {
175
+ $is_enabled = true;
176
+ break;
177
+ }
178
+ }
179
+ }
180
+
181
+ return $is_enabled;
182
+ }
183
+
184
+ /**
185
+ * Display admin notice for usage tracking.
186
+ *
187
+ * @since 1.0.0
188
+ */
189
+ public function option_notice() {
190
+
191
+ if ( ! current_user_can( 'manage_options' ) ) {
192
+ return;
193
+ }
194
+
195
+ foreach ( $this->entities as $key => $data ) {
196
+
197
+ $time_to_display = isset( $data['time_to_display'] ) ? $data['time_to_display'] : '+24 hours';
198
+ $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
199
+
200
+ // Don't display the notice if tracking is disabled or White Label is enabled for any of our plugins.
201
+ if ( false !== get_site_option( $key . '_analytics_optin', false ) || $this->is_white_label_enabled( $key ) ) {
202
+ continue;
203
+ }
204
+
205
+ // Show tracker consent notice after 24 hours from installed time.
206
+ if ( strtotime( $time_to_display, $this->get_analytics_install_time( $key ) ) > time() ) {
207
+ continue;
208
+ }
209
+
210
+ /* translators: %s product name */
211
+ $notice_string = __( 'Want to help make <strong>%1s</strong> even more awesome? Allow us to collect non-sensitive diagnostic data and usage information. ', 'cartflows' );
212
+
213
+ if ( is_multisite() ) {
214
+ $notice_string .= __( 'This will be applicable for all sites from the network.', 'cartflows' );
215
+ }
216
+
217
+ $language_dir = is_rtl() ? 'rtl' : 'ltr';
218
+
219
+ Astra_Notices::add_notice(
220
+ array(
221
+ 'id' => $key . '-optin-notice',
222
+ 'type' => '',
223
+ 'message' => sprintf(
224
+ '<div class="notice-content">
225
+ <div class="notice-heading">
226
+ %1$s
227
+ </div>
228
+ <div class="astra-notices-container">
229
+ <a href="%2$s" class="astra-notices button-primary">
230
+ %3$s
231
+ </a>
232
+ <a href="%4$s" data-repeat-notice-after="%5$s" class="astra-notices button-secondary">
233
+ %6$s
234
+ </a>
235
+ </div>
236
+ </div>',
237
+ /* translators: %s usage doc link */
238
+ sprintf( $notice_string . '<span dir="%2s"><a href="%3s" target="_blank" rel="noreferrer noopener">%4s</a><span>', esc_html( $data['product_name'] ), $language_dir, esc_url( $usage_doc_link ), __( ' Know More.', 'cartflows' ) ),
239
+ add_query_arg(
240
+ array(
241
+ $key . '_analytics_optin' => 'yes',
242
+ $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
243
+ 'bsf_analytics_source' => $key,
244
+ )
245
+ ),
246
+ __( 'Yes! Allow it', 'cartflows' ),
247
+ add_query_arg(
248
+ array(
249
+ $key . '_analytics_optin' => 'no',
250
+ $key . '_analytics_nonce' => wp_create_nonce( $key . '_analytics_optin' ),
251
+ 'bsf_analytics_source' => $key,
252
+ )
253
+ ),
254
+ MONTH_IN_SECONDS,
255
+ __( 'No Thanks', 'cartflows' )
256
+ ),
257
+ 'show_if' => true,
258
+ 'repeat-notice-after' => false,
259
+ 'priority' => 18,
260
+ 'display-with-other-notices' => true,
261
+ )
262
+ );
263
+ }
264
+ }
265
+
266
+ /**
267
+ * Process usage tracking opt out.
268
+ *
269
+ * @since 1.0.0
270
+ */
271
+ public function handle_optin_optout() {
272
+
273
+ if ( ! current_user_can( 'manage_options' ) ) {
274
+ return;
275
+ }
276
+
277
+ $source = isset( $_GET['bsf_analytics_source'] ) ? sanitize_text_field( wp_unslash( $_GET['bsf_analytics_source'] ) ) : '';
278
+
279
+ if ( ! isset( $_GET[ $source . '_analytics_nonce' ] ) ) {
280
+ return;
281
+ }
282
+
283
+ if ( ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_nonce' ] ) ), $source . '_analytics_optin' ) ) {
284
+ return;
285
+ }
286
+
287
+ $optin_status = isset( $_GET[ $source . '_analytics_optin' ] ) ? sanitize_text_field( wp_unslash( $_GET[ $source . '_analytics_optin' ] ) ) : '';
288
+
289
+ if ( 'yes' === $optin_status ) {
290
+ $this->optin( $source );
291
+ } elseif ( 'no' === $optin_status ) {
292
+ $this->optout( $source );
293
+ }
294
+
295
+ wp_safe_redirect(
296
+ remove_query_arg(
297
+ array(
298
+ $source . '_analytics_optin',
299
+ $source . '_analytics_nonce',
300
+ 'bsf_analytics_source',
301
+ )
302
+ )
303
+ );
304
+ }
305
+
306
+ /**
307
+ * Opt in to usage tracking.
308
+ *
309
+ * @param string $source source of analytics.
310
+ * @since 1.0.0
311
+ */
312
+ private function optin( $source ) {
313
+ update_site_option( $source . '_analytics_optin', 'yes' );
314
+ }
315
+
316
+ /**
317
+ * Opt out to usage tracking.
318
+ *
319
+ * @param string $source source of analytics.
320
+ * @since 1.0.0
321
+ */
322
+ private function optout( $source ) {
323
+ update_site_option( $source . '_analytics_optin', 'no' );
324
+ }
325
+
326
+ /**
327
+ * Load analytics stat class.
328
+ *
329
+ * @since 1.0.0
330
+ */
331
+ private function includes() {
332
+ require_once __DIR__ . '/class-bsf-analytics-stats.php';
333
+ }
334
+
335
+ /**
336
+ * Register usage tracking option in General settings page.
337
+ *
338
+ * @since 1.0.0
339
+ */
340
+ public function register_usage_tracking_setting() {
341
+
342
+ foreach ( $this->entities as $key => $data ) {
343
+
344
+ if ( ! apply_filters( $key . '_tracking_enabled', true ) || $this->is_white_label_enabled( $key ) ) {
345
+ return;
346
+ }
347
+
348
+ $usage_doc_link = isset( $data['usage_doc_link'] ) ? $data['usage_doc_link'] : $this->usage_doc_link;
349
+ $author = isset( $data['author'] ) ? $data['author'] : 'Brainstorm Force';
350
+
351
+ register_setting(
352
+ 'general', // Options group.
353
+ $key . '_analytics_optin', // Option name/database.
354
+ array( 'sanitize_callback' => array( $this, 'sanitize_option' ) ) // sanitize callback function.
355
+ );
356
+
357
+ add_settings_field(
358
+ $key . '-analytics-optin', // Field ID.
359
+ __( 'Usage Tracking', 'cartflows' ), // Field title.
360
+ array( $this, 'render_settings_field_html' ), // Field callback function.
361
+ 'general',
362
+ 'default', // Settings page slug.
363
+ array(
364
+ 'type' => 'checkbox',
365
+ 'title' => $author,
366
+ 'name' => $key . '_analytics_optin',
367
+ 'label_for' => $key . '-analytics-optin',
368
+ 'id' => $key . '-analytics-optin',
369
+ 'usage_doc_link' => $usage_doc_link,
370
+ )
371
+ );
372
+ }
373
+ }
374
+
375
+ /**
376
+ * Sanitize Callback Function
377
+ *
378
+ * @param bool $input Option value.
379
+ * @since 1.0.0
380
+ */
381
+ public function sanitize_option( $input ) {
382
+
383
+ if ( ! $input || 'no' === $input ) {
384
+ return 'no';
385
+ }
386
+
387
+ return 'yes';
388
+ }
389
+
390
+ /**
391
+ * Print settings field HTML.
392
+ *
393
+ * @param array $args arguments to field.
394
+ * @since 1.0.0
395
+ */
396
+ public function render_settings_field_html( $args ) {
397
+ ?>
398
+ <fieldset>
399
+ <label for="<?php echo esc_attr( $args['label_for'] ); ?>">
400
+ <input id="<?php echo esc_attr( $args['id'] ); ?>" type="checkbox" value="1" name="<?php echo esc_attr( $args['name'] ); ?>" <?php checked( get_site_option( $args['name'], 'no' ), 'yes' ); ?>>
401
+ <?php
402
+ /* translators: %s Product title */
403
+ echo esc_html( sprintf( __( 'Allow %s products to track non-sensitive usage tracking data.', 'cartflows' ), $args['title'] ) );// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText
404
+
405
+ if ( is_multisite() ) {
406
+ esc_html_e( ' This will be applicable for all sites from the network.', 'cartflows' );
407
+ }
408
+ ?>
409
+ </label>
410
+ <?php
411
+ echo wp_kses_post( sprintf( '<a href="%1s" target="_blank" rel="noreferrer noopener">%2s</a>', esc_url( $args['usage_doc_link'] ), __( 'Learn More.', 'cartflows' ) ) );
412
+ ?>
413
+ </fieldset>
414
+ <?php
415
+ }
416
+
417
+ /**
418
+ * Set analytics installed time in option.
419
+ *
420
+ * @param string $source source of analytics.
421
+ * @return string $time analytics installed time.
422
+ * @since 1.0.0
423
+ */
424
+ private function get_analytics_install_time( $source ) {
425
+
426
+ $time = get_site_option( $source . '_analytics_installed_time' );
427
+
428
+ if ( ! $time ) {
429
+ $time = time();
430
+ update_site_option( $source . '_analytics_installed_time', time() );
431
+ }
432
+
433
+ return $time;
434
+ }
435
+
436
+ /**
437
+ * Schedule/unschedule cron event on updation of option.
438
+ *
439
+ * @param string $old_value old value of option.
440
+ * @param string $value value of option.
441
+ * @param string $option Option name.
442
+ * @since 1.0.0
443
+ */
444
+ public function update_analytics_option_callback( $old_value, $value, $option ) {
445
+ if ( is_multisite() ) {
446
+ $this->add_option_to_network( $option, $value );
447
+ }
448
+ }
449
+
450
+ /**
451
+ * Analytics option add callback.
452
+ *
453
+ * @param string $option Option name.
454
+ * @param string $value value of option.
455
+ * @since 1.0.0
456
+ */
457
+ public function add_analytics_option_callback( $option, $value ) {
458
+ if ( is_multisite() ) {
459
+ $this->add_option_to_network( $option, $value );
460
+ }
461
+ }
462
+
463
+ /**
464
+ * Send analaytics track event if tracking is enabled.
465
+ *
466
+ * @since 1.0.0
467
+ */
468
+ public function maybe_track_analytics() {
469
+
470
+ if ( ! $this->is_tracking_enabled() ) {
471
+ return;
472
+ }
473
+
474
+ $analytics_track = get_site_transient( 'bsf_analytics_track' );
475
+
476
+ // If the last data sent is 2 days old i.e. transient is expired.
477
+ if ( ! $analytics_track ) {
478
+ $this->send();
479
+ set_site_transient( 'bsf_analytics_track', true, 2 * DAY_IN_SECONDS );
480
+ }
481
+ }
482
+
483
+ /**
484
+ * Save analytics option to network.
485
+ *
486
+ * @param string $option name of option.
487
+ * @param string $value value of option.
488
+ * @since 1.0.0
489
+ */
490
+ public function add_option_to_network( $option, $value ) {
491
+
492
+ // If action coming from general settings page.
493
+ if ( isset( $_POST['option_page'] ) && 'general' === $_POST['option_page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
494
+
495
+ if ( get_site_option( $option ) ) {
496
+ update_site_option( $option, $value );
497
+ } else {
498
+ add_site_option( $option, $value );
499
+ }
500
+ }
501
+ }
502
+ }
503
+ }
assets/js/frontend.js CHANGED
@@ -50,7 +50,7 @@
50
  fbq('init', facebook_pixel);
51
  fbq('track', 'PageView', {'plugin': 'CartFlows'});
52
  if ('enable' === initial_checkout_event) {
53
- if ('1' === is_checkout_page) {
54
  fbq('track', 'AddToCart', cartflows.params);
55
  fbq('track', 'InitiateCheckout', cartflows.params);
56
  }
@@ -92,7 +92,7 @@
92
  //Common page view event for cartflows pages.
93
  gtag('event', 'page_view', { send_to: google_a_id, non_interaction : true } );
94
  }
95
- if( "1" === is_checkout_page ){
96
  var param = cartflows.ga_param;
97
 
98
  var event_data = {
50
  fbq('init', facebook_pixel);
51
  fbq('track', 'PageView', {'plugin': 'CartFlows'});
52
  if ('enable' === initial_checkout_event) {
53
+ if ( true === is_checkout_page) {
54
  fbq('track', 'AddToCart', cartflows.params);
55
  fbq('track', 'InitiateCheckout', cartflows.params);
56
  }
92
  //Common page view event for cartflows pages.
93
  gtag('event', 'page_view', { send_to: google_a_id, non_interaction : true } );
94
  }
95
+ if( true === is_checkout_page ){
96
  var param = cartflows.ga_param;
97
 
98
  var event_data = {
assets/js/import.js CHANGED
@@ -1313,7 +1313,7 @@ var CartFlowsAjaxQueue = (function() {
1313
  btn.removeClass('importing updating-message')
1314
  .text('Import Failed!');
1315
 
1316
- $('#wcf-start-from-scratch .inner').append( '<div class="wcf-notice-wrap"><div class="notice notice-warning"><p>Upgrade to Pro for adding more than one '+step_type.charAt(0).toUpperCase()+step_type.slice(1)+' step.</p></div></div>' );
1317
 
1318
  return;
1319
  }
1313
  btn.removeClass('importing updating-message')
1314
  .text('Import Failed!');
1315
 
1316
+ $('#wcf-start-from-scratch .inner').append( '<div class="wcf-notice-wrap"><div class="notice notice-warning wcf-notice"><p>Upgrade to Pro for adding more than one '+step_type.charAt(0).toUpperCase()+step_type.slice(1)+' step.</p></div></div>' );
1317
 
1318
  return;
1319
  }
assets/min-js/frontend.min.js CHANGED
@@ -1 +1 @@
1
- !function(w){w(document).on("click",'a[href*="wcf-next-step"]',function(e){if(e.preventDefault(),void 0===cartflows.is_pb_preview||"1"!=cartflows.is_pb_preview)return window.location.href=cartflows.next_step,!1;e.stopPropagation()}),w(document).on("click",".wcf-next-step-link",function(e){if(void 0!==cartflows.is_pb_preview&&"1"==cartflows.is_pb_preview)return e.preventDefault(),e.stopPropagation(),!1});w(document).ready(function(e){var a=e('a[href*="wcf-next-step"]');0<a.length&&void 0!==cartflows.next_step&&(a.addClass("wcf-next-step-link"),a.attr("href",cartflows.next_step)),function(){if("OceanWP"===cartflows.current_theme&&"default"!==cartflows.page_template){var e=document.getElementById("oceanwp-style-css");null!=e&&e.remove()}}(),"1"!==cartflows.is_pb_preview&&(function(){if("enable"===cartflows.fb_active.facebook_pixel_tracking&&""!=cartflows.fb_active.facebook_pixel_id){var e=cartflows.fb_active.facebook_pixel_id,a=cartflows.fb_active.facebook_pixel_initiate_checkout,t=cartflows.fb_active.facebook_pixel_purchase_complete,c=cartflows.fb_active.facebook_pixel_add_payment_info,o=(cartflows.fb_active.facebook_pixel_tracking_for_site,cartflows.is_checkout_page);if(fbq("init",e),fbq("track","PageView",{plugin:"CartFlows"}),"enable"===a&&"1"===o&&(fbq("track","AddToCart",cartflows.params),fbq("track","InitiateCheckout",cartflows.params)),"enable"===t){var n=w.cookie("wcf_order_details");void 0!==n&&(fbq("track","Purchase",jQuery.parseJSON(n)),w.removeCookie("wcf_order_details",{path:"/"}))}"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){var e=cartflows.params;fbq("track","AddPaymentInfo",e)})}}(),function(){if("enable"===cartflows.wcf_ga_active.enable_google_analytics){var e=cartflows.wcf_ga_active.google_analytics_id,a=cartflows.wcf_ga_active.enable_google_analytics_for_site,t=cartflows.wcf_ga_active.enable_begin_checkout,c=cartflows.wcf_ga_active.enable_add_payment_info,o=cartflows.wcf_ga_active.enable_purchase_event,n=cartflows.wcf_ga_active.enable_add_to_cart,i=w.cookie("wcf_ga_trans_data"),r=cartflows.is_checkout_page;if("disable"===a&&gtag("event","page_view",{send_to:e,non_interaction:!0}),"1"===r){var _=cartflows.ga_param,f={send_to:e,event_category:"ecommerce",items:_,non_interaction:!0};"enable"===t&&gtag("event","begin_checkout",f),"enable"===n&&gtag("event","add_to_cart",f),"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){gtag("event","add_payment_info",{send_to:e,non_interaction:!0})})}if(void 0!==i&&null!=i){var s=jQuery.parseJSON(i),l={send_to:e,event_category:"ecommerce",transaction_id:s.transaction_id,value:s.value,currency:s.currency,shipping:s.shipping,tax:s.tax,items:s.items,non_interaction:!0};"enable"===o&&(gtag("event","purchase",l),w.removeCookie("wcf_ga_trans_data",{path:"/"}))}}}())})}(jQuery);
1
+ !function(w){w(document).on("click",'a[href*="wcf-next-step"]',function(e){if(e.preventDefault(),void 0===cartflows.is_pb_preview||"1"!=cartflows.is_pb_preview)return window.location.href=cartflows.next_step,!1;e.stopPropagation()}),w(document).on("click",".wcf-next-step-link",function(e){if(void 0!==cartflows.is_pb_preview&&"1"==cartflows.is_pb_preview)return e.preventDefault(),e.stopPropagation(),!1});w(document).ready(function(e){var a=e('a[href*="wcf-next-step"]');0<a.length&&void 0!==cartflows.next_step&&(a.addClass("wcf-next-step-link"),a.attr("href",cartflows.next_step)),function(){if("OceanWP"===cartflows.current_theme&&"default"!==cartflows.page_template){var e=document.getElementById("oceanwp-style-css");null!=e&&e.remove()}}(),"1"!==cartflows.is_pb_preview&&(function(){if("enable"===cartflows.fb_active.facebook_pixel_tracking&&""!=cartflows.fb_active.facebook_pixel_id){var e=cartflows.fb_active.facebook_pixel_id,a=cartflows.fb_active.facebook_pixel_initiate_checkout,t=cartflows.fb_active.facebook_pixel_purchase_complete,c=cartflows.fb_active.facebook_pixel_add_payment_info,o=(cartflows.fb_active.facebook_pixel_tracking_for_site,cartflows.is_checkout_page);if(fbq("init",e),fbq("track","PageView",{plugin:"CartFlows"}),"enable"===a&&!0===o&&(fbq("track","AddToCart",cartflows.params),fbq("track","InitiateCheckout",cartflows.params)),"enable"===t){var n=w.cookie("wcf_order_details");void 0!==n&&(fbq("track","Purchase",jQuery.parseJSON(n)),w.removeCookie("wcf_order_details",{path:"/"}))}"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){var e=cartflows.params;fbq("track","AddPaymentInfo",e)})}}(),function(){if("enable"===cartflows.wcf_ga_active.enable_google_analytics){var e=cartflows.wcf_ga_active.google_analytics_id,a=cartflows.wcf_ga_active.enable_google_analytics_for_site,t=cartflows.wcf_ga_active.enable_begin_checkout,c=cartflows.wcf_ga_active.enable_add_payment_info,o=cartflows.wcf_ga_active.enable_purchase_event,n=cartflows.wcf_ga_active.enable_add_to_cart,i=w.cookie("wcf_ga_trans_data"),r=cartflows.is_checkout_page;if("disable"===a&&gtag("event","page_view",{send_to:e,non_interaction:!0}),!0===r){var _=cartflows.ga_param,f={send_to:e,event_category:"ecommerce",items:_,non_interaction:!0};"enable"===t&&gtag("event","begin_checkout",f),"enable"===n&&gtag("event","add_to_cart",f),"enable"===c&&jQuery("form.woocommerce-checkout").on("submit",function(){gtag("event","add_payment_info",{send_to:e,non_interaction:!0})})}if(void 0!==i&&null!=i){var s=jQuery.parseJSON(i),l={send_to:e,event_category:"ecommerce",transaction_id:s.transaction_id,value:s.value,currency:s.currency,shipping:s.shipping,tax:s.tax,items:s.items,non_interaction:!0};"enable"===o&&(gtag("event","purchase",l),w.removeCookie("wcf_ga_trans_data",{path:"/"}))}}}())})}(jQuery);
assets/min-js/import.min.js CHANGED
@@ -1 +1 @@
1
- var CartFlowsAjaxQueue=function(){var a=[];return{add:function(t){a.push(t)},remove:function(t){-1<jQuery.inArray(t,a)&&a.splice($.inArray(t,a),1)},run:function(){var t,e=this;a.length?(t=a[0].complete,a[0].complete=function(){"function"==typeof t&&t(),a.shift(),e.run.apply(e,[])},jQuery.ajax(a[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){a=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou","optin"],step_order:["landing","checkout","upsell","downsell","thankyou","optin"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)",optin:"Optin (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var a=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(a,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,a){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&a.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,a,s){"error"==s&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var a=c(this).attr("href");c(a).removeClass("hide"),c(a).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),a=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(a),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(a)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";if(e&&(c(".step-type-filter-links").val(e),c(".step-type-filter-links").find("a").removeClass("current"),c(".step-type-filter-links").find('a[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:selected").addClass("current"),$step_type=c(".step-type-filter-links").find("option:selected").data("slug"),!("no"!==CartFlowsImportVars.is_wc_installed&&"no"!==CartFlowsImportVars.is_wc_activated||"upsell"!==$step_type&&"downsell"!==$step_type&&"checkout"!==$step_type&&"thankyou"!==$step_type))return c(".cartflows-step-import-blank").after("<p class='wcf-notice-wrap' style='text-align: center'>You need WooCommerce plugin installed and actived to use this product flow. <br/><br/> <a href='#' class='wcf-activate-wc button-secondary'> Click here to install and activate WooCommerce </a> </p>"),void c(".cartflows-step-import-blank").addClass("disabled").css("pointer-events","none");"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&(c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps())},_showSteps:function(){var t={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",s=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",s=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(a){a.current_step_type=s,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(t,e){a.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(a.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(a.items_count)?c("#wcf-remote-step-list").html(t(a)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=100},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),a=CartFlowsImport;t.val()||(t.val("CartFlows #"+a.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var a={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},s={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(a)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()},mapOrder:function(t,r,o){return t.sort(function(t,e){var a=t[o],s=e[o];return-1===r.indexOf(a)?0:r.indexOf(a)>r.indexOf(s)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var s=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var a=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(s)),c("#wcf-scratch-steps-categories").html(a(s)),c("#wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li a[data-slug=landing]").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var s=[];return c.each(t,function(t,e){var a=e.step_type.slug;void 0===s[a]&&(s[a]=[]),s[a].push(e)}),s},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,s,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,a){s&&"function"==typeof s&&s({request:t,status:e,XHR:a}),o.doc.trigger(r+"-done",[t,e,a])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var a in t)t.hasOwnProperty(a)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString(),per_page:100},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var a={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(s){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(a,t){s.items[a].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(s.items[a].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(s.items_count)?c("#wcf-remote-flow-list").html(t(s)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),a.addClass("updating-message").text("Creating Flow.."),a.parents(".template").addClass("importing");var s={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(s,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){a.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,a={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(a,function(t){})},_process_import_flow:function(t){t.preventDefault();var s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;s.text("Creating Flow.."),s.addClass("updating-message"),s.parents(".template").addClass("importing");var a=s.data("flow-steps")||"",r=""!==a?JSON.parse("["+a+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var a=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,s.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:a,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+a+"&action=edit"},3e3)):s.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=s.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message button-primary").addClass("disabled")},3e3)):s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):s.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var a=c(this),e=CartFlowsImport,s=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(a.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){a.parents(".template.importing");return a.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:s,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(a.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var a=c(this),e=a.data("slug")||"",s=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=a.data("title")||"",step_custom_title=step_title+" "+(parseInt(s)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=a.parents(".template");return a.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!a.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;a.addClass("updating-message"),a.parents(".template").addClass("importing");var l=a.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),a.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,a){t.preventDefault();CartFlowsImport;var s=c(".wcf-flow-steps-data-wrap-importer .template.importing");s.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),s.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
1
+ var CartFlowsAjaxQueue=function(){var a=[];return{add:function(t){a.push(t)},remove:function(t){-1<jQuery.inArray(t,a)&&a.splice($.inArray(t,a),1)},run:function(){var t,e=this;a.length?(t=a[0].complete,a[0].complete=function(){"function"==typeof t&&t(),a.shift(),e.run.apply(e,[])},jQuery.ajax(a[0])):e.tid=setTimeout(function(){e.run.apply(e,[])},1e3)},stop:function(){a=[],clearTimeout(this.tid)}}}();!function(c){CartFlowsImport={doc:c(document),wrap:c(".wcf-flow-steps-data-wrap"),inner:c(".wcf-flow-steps-data-wrap-importer"),post_id:c("#post_ID").val(),_ref:null,_api_step_type:{},_api_params:{},all_steps:0,remaining_steps:0,remaining_install_plugins:0,remaining_active_plugins:0,woo_required_steps:["checkout","upsell","downsell","thankyou","optin"],step_order:["landing","checkout","upsell","downsell","thankyou","optin"],new_step_names:{landing:"Landing",checkout:"Checkout (Woo)",upsell:"Upsell (Woo)",downsell:"Downsell (Woo)",thankyou:"Thank You (Woo)",optin:"Optin (Woo)"},init:function(){if(this._bind(),"other"!==CartFlowsImportVars.default_page_builder&&(c(".post-type-cartflows_flow").hasClass("edit-php")&&this._process_cache_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&this._process_cache_remote_steps()),c(".post-type-cartflows_flow").hasClass("edit-php")&&null!==this._getParamFromURL("add-new-flow")&&this._render_remote_flows(),c(".post-type-cartflows_flow").hasClass("post-php")&&null!==this._getParamFromURL("add-new-step")&&this._render_remote_steps(),this._getParamFromURL("highlight-step-id")){var t=c('.wcf-step-wrap[data-id="'+this._getParamFromURL("highlight-step-id")+'"]');t.length&&c("html, body").animate({scrollTop:t.offset().top},1500)}if(c(".post-type-cartflows_flow").hasClass("edit-php")){var e=c(".edit-php.post-type-cartflows_flow").find(".page-title-action:first");e.after('<a href="'+CartFlowsImportVars.export_url+'" class="page-title-action">Export</a>'),e.after('<a href="'+CartFlowsImportVars.import_url+'" class="page-title-action">Import</a>')}},_getParamFromURL:function(t,e){e=e||window.location.href,t=t.replace(/[\[\]]/g,"\\$&");var a=new RegExp("[?&]"+t+"(=([^&#]*)|&|#|$)").exec(e);return a?a[2]?decodeURIComponent(a[2].replace(/\+/g," ")):"":null},_bind:function(){var t=CartFlowsImport;t.doc.on("click",".wcf-install-plugin",t._install_plugin),t.doc.on("cartflows-api-request-fail",t._api_request_failed),t.doc.on("click","#wcf-get-started-steps a, .wcf-create-from-scratch-link",t._toggle_ready_templates),t.doc.on("click",".cartflows-flow-import-blank",t._create_default_flow),t.doc.on("click","#wcf-remote-flow-importer .wcf-page-builder-links a",t._filterFlowPageBuilderClick),t.doc.on("click","#wcf-remote-step-importer #wcf-categories .step-type-filter-links a",t._filterBlankStepCategoryClick),t.doc.on("change","#wcf-remote-step-importer #wcf-scratch-steps-categories .step-type-filter-links",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-get-started-steps",t._filterBlankStepCategoryChange),t.doc.on("click","#wcf-remote-step-importer .wcf-page-builder-links a",t._filterStepPageBuilderClick),t.doc.on("click",".cartflows-step-import-blank:not(.get-pro)",t._create_blank_step),t.doc.on("click","#wcf-remote-step-importer .cartflows-step-import",t._process_import_step),t.doc.on("click","#wcf-remote-flow-importer .cartflows-step-import",t._process_import_flow),t.doc.on("click",".cartflows-preview-flow-step",t._preview_individual),t.doc.on("add_template_to_page-fail",t._add_template_to_page_fail),c("body").on("thickbox:iframe:loaded",t._previewLoaded),c(document).on("keyup input","#wcf-remote-step-importer .wcf-flow-search-input",t._remote_step_search),c(document).on("click",".actions a",t._previewResponsive),c(document).on("click",".page-title-action:first",t._render_remote_flows),c(document).on("click",".wcf-trigger-popup",t._render_remote_steps),c(document).on("click",".wcf-templates-popup-overlay",t._close_template_popup),c(document).on("click",".wcf-popup-close-wrap .close-icon",t._close_template_popup),c(document).on("wp-plugin-install-success",t._installSuccess),c(document).on("click",".wcf-activate-wc",t._installWc)},_install_plugin:function(t){t.preventDefault();var e=c(this);if(!e.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),c("#wcf-remote-step-importer").addClass("request-process"),e.addClass("updating-message button");var a=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(a,function(t,e){"install"===e.status&&CartFlowsImport.remaining_install_plugins++,"activate"===e.status&&CartFlowsImport.remaining_active_plugins++}),CartFlowsImport.remaining_install_plugins?CartFlowsImport._install_all_plugins():CartFlowsImport.remaining_active_plugins?CartFlowsImport._activate_all_plugins():c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()}},_install_all_plugins:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(t,function(t,e){"install"===e.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:e.slug}})}),wp.updates.queueChecker()},_activate_all_plugins:function(){if(CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),c.each(t,function(t,e){"activate"===e.status&&CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce},success:function(t){CartFlowsImport.remaining_active_plugins--,CartFlowsImport.remaining_active_plugins||CartFlowsImport.remaining_install_plugins||(c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps())}})})}else c("#wcf-remote-flow-importer").length?CartFlowsImport._cache_remote_flows():c("#wcf-remote-step-importer").length&&CartFlowsImport._cache_remote_steps()},_installSuccess:function(t,a){t.preventDefault(),"no"===CartFlowsImportVars.is_wc_activated&&CartFlowsImport._activateWc();var e=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins;c.each(e,function(t,e){"install"===e.status&&a.slug===e.slug&&c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:e.init,security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){CartFlowsImport.remaining_install_plugins--,CartFlowsImport.remaining_install_plugins||CartFlowsImport._activate_all_plugins()})})},_api_request_failed:function(t,e,a,s){"error"==s&&(c("#wcf-remote-content-failed").length||c("#wcf-ready-templates").html(wp.template("cartflows-website-unreachable")))},_toggle_ready_templates:function(t){t.preventDefault();var e=c(this).data("slug")||"";c("#wcf-get-started-steps").find("a").removeClass("current"),c("#wcf-get-started-steps").find('a[data-slug="'+e+'"]').addClass("current"),"canvas"==e?(c("#wcf-ready-templates").hide(),c("#wcf-start-from-scratch").show()):(c("#wcf-ready-templates").show(),c("#wcf-start-from-scratch").hide()),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&CartFlowsImport._showSteps()},_switch_step_tab:function(t){t.preventDefault();var e=c(".wcf-tab > li.active > a").attr("href");c(".wcf-tab > li.active").removeClass("active"),c(this).parents("li").addClass("active"),c(e).removeClass("active"),c(e).addClass("hide");var a=c(this).attr("href");c(a).removeClass("hide"),c(a).addClass("active")},_remote_step_search:function(t){t.preventDefault(),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:first-child").addClass("current"),window.clearTimeout(CartFlowsImport._ref),CartFlowsImport._ref=window.setTimeout(function(){CartFlowsImport._ref=null,CartFlowsImport._showSteps()},500)},_previewResponsive:function(t){t.preventDefault();var e=c(this).find(".dashicons"),a=e.attr("data-view")||"";c("#TB_window").removeClass("desktop tablet mobile"),c("#TB_window").addClass(a),c(".actions .dashicons").removeClass("active"),e.addClass("active"),c("#TB_iframeContent").removeClass(),c("#TB_iframeContent").addClass(a)},_filterStepPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current");var e=c(".step-type-filter-links .current").data("slug")||"";"upsell"===e||"downsell"===e?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryClick:function(t){t.preventDefault(),c(".wcf-page-builder-notice").html("");var e=c(this).data("group")||"";e&&(c("#wcf-scratch-steps-categories .step-type-filter-links").val(e),c("#wcf-scratch-steps-categories .step-type-filter-links option").removeClass("current"),c('#wcf-scratch-steps-categories .step-type-filter-links option[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("a").removeClass("current"),c(this).addClass("current"),$step_type=c(this).data("slug"),"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps()},_filterBlankStepCategoryChange:function(t){t.preventDefault(),c(".wcf-notice-wrap").remove(),c(".cartflows-step-import-blank").css("pointer-events","auto").removeClass("disabled");var e=c(".step-type-filter-links").find("option:selected").val()||"";if(e&&(c(".step-type-filter-links").val(e),c(".step-type-filter-links").find("a").removeClass("current"),c(".step-type-filter-links").find('a[data-group="'+e+'"]').addClass("current")),c(".step-type-filter-links").find("option").removeClass("current"),c(".step-type-filter-links").find("option:selected").addClass("current"),$step_type=c(".step-type-filter-links").find("option:selected").data("slug"),!("no"!==CartFlowsImportVars.is_wc_installed&&"no"!==CartFlowsImportVars.is_wc_activated||"upsell"!==$step_type&&"downsell"!==$step_type&&"checkout"!==$step_type&&"thankyou"!==$step_type))return c(".cartflows-step-import-blank").after("<p class='wcf-notice-wrap' style='text-align: center'>You need WooCommerce plugin installed and actived to use this product flow. <br/><br/> <a href='#' class='wcf-activate-wc button-secondary'> Click here to install and activate WooCommerce </a> </p>"),void c(".cartflows-step-import-blank").addClass("disabled").css("pointer-events","none");"upsell"===$step_type||"downsell"===$step_type?c(".wcf-template-notice").show():c(".wcf-template-notice").hide(),""!=CartFlowsImportVars._is_pro_active||"upsell"!=$step_type&&"downsell"!=$step_type?(c(".cartflows-step-import-blank").text("Create Step"),c(".cartflows-step-import-blank").removeClass("get-pro"),c(".cartflows-step-import-blank").removeAttr("target")):(c(".cartflows-step-import-blank").text("Get Pro"),c(".cartflows-step-import-blank").attr("href",CartFlowsImportVars.domain_url),c(".cartflows-step-import-blank").attr("target","_blank"),c(".cartflows-step-import-blank").addClass("get-pro")),!c(".wcf-page-builder-notice").length&&c("#wcf-remote-step-importer").length&&(c("#wcf-remote-step-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showSteps())},_showSteps:function(){var t={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()},e=c("#wcf-categories .step-type-filter-links").find(".current").data("group")||"",s=c("#wcf-categories .step-type-filter-links").find(".current").data("slug");""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_type]=e);e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"",s=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug")||"";var r=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title")||"Page Builder";""!==e&&"all"!==e&&(t[CartFlowsImportVars.step_page_builder]=e);var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(a){a.current_step_type=s,"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(a.items,function(t,e){a.items[t].woo_required=!1,0<=c.inArray(e.step_type.slug,CartFlowsImport.woo_required_steps)&&(a.items[t].woo_required=!0)});var t=wp.template("cartflows-steps-list");parseInt(a.items_count)?c("#wcf-remote-step-list").html(t(a)):(c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),c(".cartflows-no-steps").find(".description").html("We are working on ready templates designed with "+r+'.<br/>Meanwhile you can <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own designs</a> easily.')),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-step-importer").removeClass("request-process")})},_apiAddParam_per_page:function(){CartFlowsImport._api_params.per_page=100},_apiAddParam_licence_args:function(){CartFlowsImport._api_params.licence_args=CartFlowsImportVars.licence_args},_apiAddParam_search:function(){var t=c(".wcf-flow-search-input").val()||"";""!==t&&(CartFlowsImport._api_params.search=t)},_close_popup:function(){c("#cartflows-steps").fadeOut(),c("body").removeClass("cartflows-popup-is-open")},_post_auto_save:function(){var t=c("#title"),e=c("#title-prompt-text"),a=CartFlowsImport;t.val()||(t.val("CartFlows #"+a.post_id),e.length&&e.remove()),wp.autosave&&wp.autosave.server.triggerSave()},_process_cache_remote_flows:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-flow-list").find(".spinner").remove()):CartFlowsImport._cache_remote_flows()},_cache_remote_flows:function(){CartFlowsImport;var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.flow_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.flow_page_builder,slug:CartFlowsImportVars.flow_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current");var a={licence_args:CartFlowsImportVars.licence_args,hide_empty:!0,_fields:CartFlowsImportVars.flow_type_fields.toString()},s={remote_slug:CartFlowsImportVars.flow_type,slug:CartFlowsImportVars.flow_type+"?"+decodeURIComponent(c.param(a)),wrapper_class:"flow-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(s,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(t)),c("#wcf-categories").find("li:first a").addClass("current"),CartFlowsImport._showFlows()})})},_render_remote_flows:function(t){t&&t.preventDefault(),c("#wcf-remote-flow-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_process_cache_remote_steps:function(){var t=CartFlowsImportVars.required_plugins[CartFlowsImportVars.default_page_builder].plugins,a=!0;c.each(t,function(t,e){a&&("install"!==e.status&&"activate"!==e.status||(a=!1))}),!1===a?(c(".wcf-page-builder-notice").html(wp.template("cartflows-page-builder-notice")),c("#wcf-remote-step-list").find(".spinner").remove()):CartFlowsImport._cache_remote_steps()},mapOrder:function(t,r,o){return t.sort(function(t,e){var a=t[o],s=e[o];return-1===r.indexOf(a)?0:r.indexOf(a)>r.indexOf(s)?1:-1}),t},_cache_remote_steps:function(){CartFlowsImport;c("html").addClass("wcf-steps-loading");var t={search:CartFlowsImportVars.default_page_builder,licence_args:CartFlowsImportVars.licence_args,hide_empty:!1,_fields:CartFlowsImportVars.step_page_builder_fields.toString()},e={remote_slug:CartFlowsImportVars.step_page_builder,slug:CartFlowsImportVars.step_page_builder+"?"+decodeURIComponent(c.param(t)),wrapper_class:"wcf-page-builder-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){var e=wp.template("cartflows-term-filters");c("#wcf-page-builders").html(e(t)),c("#wcf-page-builders").find("li:first a").addClass("current")});t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.step_type_fields.toString()},e={remote_slug:CartFlowsImportVars.step_type,slug:CartFlowsImportVars.step_type+"?"+decodeURIComponent(c.param(t)),wrapper_class:"step-type-filter-links filter-links",show_all:!1};CartFlowsAPI._api_request(e,function(t){t.items=CartFlowsImport.mapOrder(t.items,CartFlowsImport.step_order,"slug");var s=t,r=t.items_count;if(t.items)for(key in t.items){t.items[key].name=CartFlowsImport.new_step_names[t.items[key].slug];var e={licence_args:CartFlowsImportVars.licence_args,per_page:100,_fields:CartFlowsImportVars.step_fields.toString()};e[CartFlowsImportVars.step_type]=t.items[key].id;var a={remote_slug:CartFlowsImportVars.step,slug:CartFlowsImportVars.step+"?"+decodeURIComponent(c.param(e))};CartFlowsAPI._api_request(a,function(t){var e=wp.template("cartflows-steps-list");if(parseInt(t.items_count)?c("#wcf-remote-step-list").html(e(t)):c("#wcf-remote-step-list").html(wp.template("cartflows-no-steps")),0==--r){var a=wp.template("cartflows-term-filters-dropdown");e=wp.template("cartflows-term-filters");c("#wcf-categories").html(e(s)),c("#wcf-scratch-steps-categories").html(a(s)),c("#wcf-scratch-steps-categories").find("option:first").addClass("current"),c("#wcf-categories").find("li a[data-slug=landing]").addClass("current"),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-content").find(".spinner").remove(),CartFlowsImport._showSteps(),c("html").removeClass("wcf-steps-loading")}})}})},_render_remote_steps:function(t){t&&t.preventDefault(),c("#wcf-remote-step-importer").addClass("open"),c("html").addClass("wcf-popup-open")},_categorize_data:function(t){var s=[];return c.each(t,function(t,e){var a=e.step_type.slug;void 0===s[a]&&(s[a]=[]),s[a].push(e)}),s},_close_template_popup:function(t){(c(t.target).hasClass("wcf-templates-popup-overlay")||c(t.target).hasClass("close-icon"))&&(c(".wcf-templates-popup-overlay").hasClass("request-process")||(c("html").removeClass("wcf-popup-open"),c(".wcf-templates-popup-overlay").removeClass("open")))},_ajax:function(t,s,r){var o=CartFlowsImport;c.ajax({url:ajaxurl,type:"POST",data:t}).done(function(t,e,a){s&&"function"==typeof s&&s({request:t,status:e,XHR:a}),o.doc.trigger(r+"-done",[t,e,a])}).fail(function(t,e){o.doc.trigger(r+"-fail",[t,e])}).always(function(){o.doc.trigger(r+"-always")})},_empty:function(t){if("number"==typeof t||"boolean"==typeof t)return!1;if(null==t)return!0;if(void 0!==t.length)return 0==t.length;var e=0;for(var a in t)t.hasOwnProperty(a)&&e++;return 0==e},_preview_individual:function(){var t=c(this).data("id")||"",e=c(this).data("href")||"";c(".cartflows-preview-flow-step").removeClass("active"),c('.cartflows-preview-flow-step[data-id="'+t+'"]').addClass("active"),c("#TB_window").addClass("cartflows-thickbox-loading"),c("#TB_iframeContent").removeAttr("onload"),c("#TB_iframeContent").removeAttr("src"),c("#TB_iframeContent").attr("src",e),c("#TB_iframeContent").attr("onload","CartFlowsImport.showIframe()")},showIframe:function(){c("#TB_load").remove(),c("#TB_window").css({visibility:"visible"}),c("#TB_window").removeClass("cartflows-thickbox-loading")},_previewLoaded:function(t){t.preventDefault(),c("#TB_window").removeClass("cartflows-thickbox-loading")},_filterFlowPageBuilderClick:function(t){t.preventDefault(),c(this).parents("ul").find("a").removeClass("current"),c(this).addClass("current"),c(".wcf-page-builder-notice").html(""),c("#wcf-remote-flow-list").html('<span class="spinner is-active"></span>'),CartFlowsImport._showFlows()},_showFlows:function(){var t={licence_args:CartFlowsImportVars.licence_args,_fields:CartFlowsImportVars.flow_fields.toString(),per_page:100},e=c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("group")||"";c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("slug"),c("#wcf-page-builders .wcf-page-builder-links").find(".current").data("title");""!==e&&"all"!==e&&(t[CartFlowsImportVars.flow_page_builder]=e);var a={remote_slug:CartFlowsImportVars.flow,slug:CartFlowsImportVars.flow+"?"+decodeURIComponent(c.param(t))};CartFlowsAPI._api_request(a,function(s){"yes"!==CartFlowsImportVars.is_wc_activated&&c.each(s.items,function(a,t){s.items[a].woo_required=!1,c.each(t.flow_steps,function(t,e){0<=c.inArray(e.type,CartFlowsImport.woo_required_steps)&&(s.items[a].woo_required=!0)})});var t=wp.template("cartflows-flows-list");parseInt(s.items_count)?c("#wcf-remote-flow-list").html(t(s)):c("#wcf-remote-flow-list").html(wp.template("cartflows-no-flows")),c(".wcf-page-builder-notice").remove(),c("#wcf-remote-flow-importer").removeClass("request-process")})},_create_default_flow:function(t){t.preventDefault();var e=CartFlowsImport,a=c(this);if(!a.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process"),a.addClass("updating-message").text("Creating Flow.."),a.parents(".template").addClass("importing");var s={action:"cartflows_default_flow",security:cartflows_admin.cf_default_flow_nonce};e._ajax(s,function(t){if(t.request.success){var e=t.request.data;setTimeout(function(){a.removeClass("updating-message").text("Flow Created! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+e+"&action=edit"},3e3)}})}},_activate_plugin:function(t){var e=CartFlowsImport,a={action:"cartflows_activate_plugin",plugin_init:t,security:CartFlowsImportVars.cartflows_activate_plugin_nonce};e._ajax(a,function(t){})},_process_import_flow:function(t){t.preventDefault();var s=c(this);if(!s.hasClass("updating-message")){c("#wcf-remote-flow-importer").addClass("request-process");var e=CartFlowsImport;s.text("Creating Flow.."),s.addClass("updating-message"),s.parents(".template").addClass("importing");var a=s.data("flow-steps")||"",r=""!==a?JSON.parse("["+a+"]"):[],o={action:"cartflows_create_flow",security:cartflows_admin.cf_create_flow_nonce};e._ajax(o,function(t){if(t.request.success){var a=t.request.data;r&&(CartFlowsAjaxQueue.stop(),CartFlowsAjaxQueue.run(),CartFlowsImport.all_steps=r.length,s.addClass("updating-message").text("Importing Step 1 of "+CartFlowsImport.all_steps),c.each(r,function(t,e){CartFlowsAjaxQueue.add({url:CartFlowsImportVars.ajaxurl,type:"POST",data:{action:"cartflows_import_flow_step",flow_id:a,template_id:e,security:cartflows_admin.cf_import_flow_step_nonce},success:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Imported! Redirecting.."),window.location=CartFlowsImportVars.admin_url+"post.php?post="+a+"&action=edit"},3e3)):s.addClass("updating-message").text("Importing Step "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},error:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,template=s.parents(".template.importing"),template.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.statusText),CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message button-primary").addClass("disabled")},3e3)):s.addClass("updating-message").text("Failed "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)},fail:function(t){CartFlowsImport.remaining_steps=CartFlowsImport.remaining_steps+1,CartFlowsImport.remaining_steps===CartFlowsImport.all_steps?(s.addClass("updating-message").text("Imported "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps),setTimeout(function(){s.removeClass("updating-message").text("All Step Imported! Reloading.."),location.reload()},3e3)):s.addClass("updating-message").text("Importing "+CartFlowsImport.remaining_steps+" of "+CartFlowsImport.all_steps)}})}))}})}},_handle_error:function(t){c(".cartflows-step-import.updating-message").addClass("updating-message").text(t.errorMessage)},_create_blank_step:function(t){t.preventDefault();var a=c(this),e=CartFlowsImport,s=c("#post_ID").val(),r=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("slug")||"",o=c("#wcf-scratch-steps-categories .step-type-filter-links .current").data("title")||"",l=r,i=c('.wcf-step-wrap[data-term-slug="'+r+'"]').length||1,p=o+" "+(parseInt(i)+1);if(all_step_type=["landing","checkout","thankyou"],c("#wcf-start-from-scratch .wcf-notice-wrap ").remove(),""!==l){if(CartFlowsImportVars._is_pro_active||"upsell"!==l&&"downsell"!==l){if(a.parents(".template").addClass("importing"),!CartFlowsImportVars._is_pro_active)if("-1"!=jQuery.inArray(l,all_step_type))if(0<c('.wcf-step-wrap[data-term-slug="'+l+'"]').length){a.parents(".template.importing");return a.removeClass("importing updating-message").text("Import Failed!"),void c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-warning wcf-notice"><p>Upgrade to Pro for adding more than one '+l.charAt(0).toUpperCase()+l.slice(1)+" step.</p></div></div>")}if(c("#wcf-remote-step-importer").addClass("request-process"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Creating.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_create_blank",flow_id:s,step_type:l,step_title:p,security:cartflows_admin.cf_step_create_blank_nonce};e._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Created. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(a.removeClass("importing updating-message").text("Creating Failed!"),c("#wcf-remote-step-importer").removeClass("request-process"),e.find(".cartflows-step-preview").append("<div class='preview'></div>"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))})}}}else c("#wcf-start-from-scratch .inner").append('<div class="wcf-notice-wrap"><div class="notice notice-info"><p>Please select the step type.</p></div></div>')},_process_import_step:function(t){t.preventDefault();var a=c(this),e=a.data("slug")||"",s=c('.wcf-step-wrap[data-term-slug="'+e+'"]').length||1;if((step_title=a.data("title")||"",step_custom_title=step_title+" "+(parseInt(s)+1),o=CartFlowsImport,all_step_slug=["landing","checkout","thankyou"],!CartFlowsImportVars._is_pro_active)&&("-1"!=jQuery.inArray(e,all_step_slug)&&0<c('.wcf-step-wrap[data-term-slug="'+e+'"]').length)){var r=a.parents(".template");return a.removeClass("importing updating-message").text("Import Failed!"),r.find(".preview").hide(),r.find("#wcf_create_notice").show().find("a").addClass("notice notice-warning ").text("Upgrade to Pro for adding more than one "+e.charAt(0).toUpperCase()+e.slice(1)+" step"),void c("#wcf-remote-step-importer").removeClass("request-process")}if(!a.hasClass("updating-message")){c("#wcf-remote-step-importer").addClass("request-process");var o=CartFlowsImport;a.addClass("updating-message"),a.parents(".template").addClass("importing");var l=a.data("template-id")||"",i=c("#post_ID").val(),p=e;o=CartFlowsImport;if(c(".cartflows-step-import-blank").addClass("disabled"),c(".cartflows-step-import").addClass("disabled"),a.addClass("importing updating-message").text("Importing.."),c("body").hasClass("post-type-cartflows_flow")){var n={action:"cartflows_step_import",flow_id:i,template_id:l,step_title:step_custom_title,step_type:p,security:cartflows_admin.cf_step_import_nonce};o._ajax(n,function(t){CartFlowsImport;var e=a.parents(".template.importing");t.request.success?(a.text("Imported. Reloading.."),setTimeout(function(){window.location.href=window.location.href+"&highlight-step-id="+t.request.data},3e3)):(c(".wcf-templates-popup-overlay").removeClass("request-process"),a.removeClass("importing updating-message").text("Import Failed!"),e.find(".preview").addClass("notice notice-warning").removeClass("preview").text(t.request.data))},"add_template_to_page")}}},_add_template_to_page_fail:function(t,e,a){t.preventDefault();CartFlowsImport;var s=c(".wcf-flow-steps-data-wrap-importer .template.importing");s.find(".cartflows-step-import").removeClass("importing updating-message").text("Import Failed!"),s.find(".preview").addClass("notice notice-warning").removeClass("preview").text(e.responseText)},_activateWc:function(t){c.ajax({url:ajaxurl,type:"POST",data:{action:"cartflows_activate_plugin",plugin_init:"woocommerce/woocommerce.php",security:CartFlowsImportVars.cartflows_activate_plugin_nonce}}).done(function(t,e,a){c(".wcf-notice-wrap").addClass("wcf-hidden"),c(".cartflows-template-selector").removeAttr("disabled"),CartFlowsImport.wc_installed=!0,CartFlowsImportVars.is_wc_installed="yes",CartFlowsImportVars.is_wc_activated="yes",location.reload(!0),window.location.search+="&add-new-flow"})},_installWc:function(t){c(this).addClass("updating-message button"),c(this).text(cartflows_admin.wc_activating_message),0==cartflows_admin.wc_status.installed?(wp.updates.shouldRequestFilesystemCredentials&&!wp.updates.ajaxLocked&&(wp.updates.requestFilesystemCredentials(t),$document.on("credential-modal-cancel",function(){c(".install-now.updating-message").removeClass("updating-message").text(wp.updates.l10n.installNow),wp.a11y.speak(wp.updates.l10n.updateCancel,"polite")})),wp.updates.installPlugin({slug:"woocommerce"})):CartFlowsImport._activateWc()}},c(function(){CartFlowsImport.init()})}(jQuery);
cartflows.php CHANGED
@@ -1,24 +1,24 @@
1
- <?php
2
- /**
3
- * Plugin Name: CartFlows
4
- * Plugin URI: https://cartflows.com/
5
- * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
- * Version: 1.5.15
7
- * Author: CartFlows Inc
8
- * Author URI: https://cartflows.com/
9
- * Text Domain: cartflows
10
- * WC requires at least: 3.0
11
- * WC tested up to: 4.3
12
- *
13
- * @package CartFlows
14
- */
15
-
16
- /**
17
- * Set constants.
18
- */
19
- define( 'CARTFLOWS_FILE', __FILE__ );
20
-
21
- /**
22
- * Loader
23
- */
24
- require_once 'classes/class-cartflows-loader.php';
1
+ <?php
2
+ /**
3
+ * Plugin Name: CartFlows
4
+ * Plugin URI: https://cartflows.com/
5
+ * Description: Create beautiful checkout pages & sales flows for WooCommerce.
6
+ * Version: 1.5.16
7
+ * Author: CartFlows Inc
8
+ * Author URI: https://cartflows.com/
9
+ * Text Domain: cartflows
10
+ * WC requires at least: 3.0
11
+ * WC tested up to: 4.4.1
12
+ *
13
+ * @package CartFlows
14
+ */
15
+
16
+ /**
17
+ * Set constants.
18
+ */
19
+ define( 'CARTFLOWS_FILE', __FILE__ );
20
+
21
+ /**
22
+ * Loader
23
+ */
24
+ require_once 'classes/class-cartflows-loader.php';
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  Version 1.5.15 - Wednesday, 12th August 2020
2
  - Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
3
  - Improvement: Added WordPress 5.5 Compatibility.
1
+ Version 1.5.16 - Tuesday, 25th August 2020
2
+ - Improvement: Hardened the security of the plugin.
3
+ - Fix: User's account was not getting created from the Optin step.
4
+ - Fix: Import notice was not displaying if the import step limit is over.
5
+ - Fix: Facebook Pixel and Google Analytics tracking events were not getting triggered in some cases.
6
+
7
  Version 1.5.15 - Wednesday, 12th August 2020
8
  - Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
9
  - Improvement: Added WordPress 5.5 Compatibility.
classes/class-cartflows-importer.php CHANGED
@@ -1,1742 +1,1742 @@
1
- <?php
2
- /**
3
- * CartFlows Admin
4
- *
5
- * @package CartFlows
6
- * @since 1.0.0
7
- */
8
-
9
- if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
-
11
- /**
12
- * CartFlows Import
13
- *
14
- * @since 1.0.0
15
- */
16
- class CartFlows_Importer {
17
-
18
- /**
19
- * Instance
20
- *
21
- * @since 1.0.0
22
- * @access private
23
- * @var object Class object.
24
- */
25
- private static $instance;
26
-
27
- /**
28
- * Initiator
29
- *
30
- * @since 1.0.0
31
- * @return object initialized object of class.
32
- */
33
- public static function get_instance() {
34
- if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self();
36
- }
37
-
38
- return self::$instance;
39
- }
40
-
41
- /**
42
- * Constructor
43
- *
44
- * @since 1.0.0
45
- */
46
- public function __construct() {
47
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
-
49
- add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
- add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
- add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
52
- add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
53
- add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
54
-
55
- add_action( 'admin_footer', array( $this, 'js_templates' ) );
56
- add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
57
-
58
- add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
59
-
60
- add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
61
-
62
- add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
63
- add_action( 'admin_init', array( $this, 'export_json' ) );
64
- add_action( 'admin_init', array( $this, 'import_json' ) );
65
- add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
66
- add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
67
- }
68
-
69
- /**
70
- * Add the export link to action list for flows row actions
71
- *
72
- * @since 1.1.4
73
- *
74
- * @param array $actions Actions array.
75
- * @param object $post Post object.
76
- *
77
- * @return array
78
- */
79
- public function export_link( $actions, $post ) {
80
- if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
81
- $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
82
- }
83
- return $actions;
84
- }
85
-
86
- /**
87
- * Add menus
88
- *
89
- * @since 1.1.4
90
- */
91
- public function add_to_menus() {
92
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
93
- add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
94
- }
95
-
96
- /**
97
- * Export flow with steps and its meta
98
- *
99
- * @since 1.1.4
100
- */
101
- public function export_flow() {
102
-
103
- if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
104
- wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
105
- }
106
-
107
- if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
108
- return;
109
- }
110
-
111
- // Get the original post id.
112
- $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
113
-
114
- $flows = array();
115
- $flows[] = $this->get_flow_export_data( $flow_id );
116
- $flows = apply_filters( 'cartflows_export_data', $flows );
117
-
118
- nocache_headers();
119
- header( 'Content-Type: application/json; charset=utf-8' );
120
- header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
121
- header( 'Expires: 0' );
122
-
123
- echo wp_json_encode( $flows );
124
- exit;
125
- }
126
-
127
- /**
128
- * Export flow markup
129
- *
130
- * @since 1.1.4
131
- */
132
- public function exporter_markup() {
133
- include_once CARTFLOWS_DIR . 'includes/exporter.php';
134
- }
135
-
136
- /**
137
- * Import flow markup
138
- *
139
- * @since 1.1.4
140
- */
141
- public function importer_markup() {
142
- include_once CARTFLOWS_DIR . 'includes/importer.php';
143
- }
144
-
145
- /**
146
- * Export flow
147
- *
148
- * @since 1.1.4
149
- */
150
- public function export_json() {
151
- if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
152
- return;
153
- }
154
-
155
- if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
156
- return;
157
- }
158
-
159
- if ( ! current_user_can( 'manage_options' ) ) {
160
- return;
161
- }
162
-
163
- $flows = $this->get_all_flow_export_data();
164
- $flows = apply_filters( 'cartflows_export_data', $flows );
165
-
166
- nocache_headers();
167
- header( 'Content-Type: application/json; charset=utf-8' );
168
- header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
169
- header( 'Expires: 0' );
170
-
171
- echo wp_json_encode( $flows );
172
- exit;
173
- }
174
-
175
- /**
176
- * Get flow export data
177
- *
178
- * @since 1.1.4
179
- *
180
- * @param integer $flow_id Flow ID.
181
- * @return array
182
- */
183
- public function get_flow_export_data( $flow_id ) {
184
-
185
- $export_all = apply_filters( 'cartflows_export_all', true );
186
-
187
- $valid_step_meta_keys = array(
188
- '_wp_page_template',
189
- '_thumbnail_id',
190
- 'classic-editor-remember',
191
- );
192
-
193
- $new_steps = array();
194
- $steps = get_post_meta( $flow_id, 'wcf-steps', true );
195
- if ( $steps ) {
196
- foreach ( $steps as $key => $step ) {
197
-
198
- // Add step post meta.
199
- $new_all_meta = array();
200
- $all_meta = get_post_meta( $step['id'] );
201
-
202
- // Add single step.
203
- $step_data_arr = array(
204
- 'title' => get_the_title( $step['id'] ),
205
- 'type' => $step['type'],
206
- 'meta' => $all_meta,
207
- 'post_content' => '',
208
- );
209
-
210
- if ( $export_all ) {
211
-
212
- $step_post_obj = get_post( $step['id'] );
213
-
214
- $step_data_arr['post_content'] = $step_post_obj->post_content;
215
- }
216
-
217
- $new_steps[] = $step_data_arr;
218
- }
219
- }
220
-
221
- // Add single flow.
222
- return array(
223
- 'title' => get_the_title( $flow_id ),
224
- 'steps' => $new_steps,
225
- );
226
- }
227
-
228
- /**
229
- * Get all flow export data
230
- *
231
- * @since 1.1.4
232
- */
233
- public function get_all_flow_export_data() {
234
-
235
- $query_args = array(
236
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
237
-
238
- // Query performance optimization.
239
- 'fields' => 'ids',
240
- 'no_found_rows' => true,
241
- 'posts_per_page' => -1,
242
- );
243
-
244
- $query = new WP_Query( $query_args );
245
- $flows = array();
246
- if ( $query->posts ) {
247
- foreach ( $query->posts as $key => $post_id ) {
248
- $flows[] = $this->get_flow_export_data( $post_id );
249
- }
250
- }
251
-
252
- return $flows;
253
- }
254
-
255
- /**
256
- * Import our exported file
257
- *
258
- * @since 1.1.4
259
- */
260
- public function import_json() {
261
- if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
262
- return;
263
- }
264
-
265
- if ( isset( $_POST['cartflows-action-nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
266
- return;
267
- }
268
-
269
- if ( ! current_user_can( 'manage_options' ) ) {
270
- return;
271
- }
272
-
273
- $filename = $_FILES['file']['name']; //phpcs:ignore
274
- $file_info = explode( '.', $filename );
275
- $extension = end( $file_info );
276
-
277
- if ( 'json' != $extension ) {
278
- wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
279
- }
280
-
281
- $file = $_FILES['file']['tmp_name']; //phpcs:ignore
282
-
283
- if ( empty( $file ) ) {
284
- wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
285
- }
286
-
287
- // Retrieve the settings from the file and convert the JSON object to an array.
288
- $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
289
-
290
- $this->import_from_json_data( $flows );
291
-
292
- add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
293
- }
294
-
295
- /**
296
- * Import flow from the JSON data
297
- *
298
- * @since x.x.x
299
- * @param array $flows JSON array.
300
- * @return void
301
- */
302
- public function import_from_json_data( $flows ) {
303
- if ( $flows ) {
304
-
305
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
306
-
307
- foreach ( $flows as $key => $flow ) {
308
-
309
- $flow_title = $flow['title'];
310
- if ( post_exists( $flow['title'] ) ) {
311
- $flow_title = $flow['title'] . ' Copy';
312
- }
313
-
314
- // Create post object.
315
- $new_flow_args = apply_filters(
316
- 'cartflows_flow_importer_args',
317
- array(
318
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
319
- 'post_title' => $flow_title,
320
- 'post_status' => 'publish',
321
- )
322
- );
323
-
324
- // Insert the post into the database.
325
- $flow_id = wp_insert_post( $new_flow_args );
326
-
327
- /**
328
- * Fire after flow import
329
- *
330
- * @since x.x.x
331
- * @param int $flow_id Flow ID.
332
- * @param array $new_flow_args Flow post args.
333
- * @param array $flows Flow JSON data.
334
- */
335
- do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
336
-
337
- if ( $flow['steps'] ) {
338
- foreach ( $flow['steps'] as $key => $step ) {
339
-
340
- $new_all_meta = array();
341
- if ( is_array( $step['meta'] ) ) {
342
- foreach ( $step['meta'] as $meta_key => $mvalue ) {
343
- $new_all_meta[ $meta_key ] = maybe_unserialize( $mvalue[0] );
344
- }
345
- }
346
- $new_step_args = apply_filters(
347
- 'cartflows_step_importer_args',
348
- array(
349
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
350
- 'post_title' => $step['title'],
351
- 'post_status' => 'publish',
352
- 'meta_input' => $new_all_meta,
353
- 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
354
- )
355
- );
356
-
357
- $new_step_id = wp_insert_post( $new_step_args );
358
-
359
- /**
360
- * Fire after step import
361
- *
362
- * @since x.x.x
363
- * @param int $new_step_id step ID.
364
- * @param int $flow_id flow ID.
365
- * @param array $new_step_args Step post args.
366
- * @param array $flow_steps Flow steps.
367
- * @param array $flows All flows JSON data.
368
- */
369
- do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
370
-
371
- // Insert post meta.
372
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
373
-
374
- $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
375
- $current_term = term_exists( $step['type'], $step_taxonomy );
376
-
377
- // // Set type object.
378
- $data = get_term( $current_term['term_id'], $step_taxonomy );
379
- $step_slug = $data->slug;
380
- wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
381
-
382
- // Set type.
383
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
384
-
385
- // Set flow.
386
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
387
-
388
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
389
-
390
- if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
391
-
392
- // Download and replace images.
393
- $content = $this->get_content( $step['post_content'] );
394
-
395
- // Update post content.
396
- wp_update_post(
397
- array(
398
- 'ID' => $new_step_id,
399
- 'post_content' => $content,
400
- )
401
- );
402
- }
403
-
404
- // Elementor Data.
405
- if ( ( 'elementor' === $default_page_builder ) && class_exists( '\Elementor\Plugin' ) ) {
406
- // Add "elementor" in import [queue].
407
- // @todo Remove required `allow_url_fopen` support.
408
- if ( ini_get( 'allow_url_fopen' ) && isset( $step['meta']['_elementor_data'] ) ) {
409
- $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
410
- $obj->import_single_template( $new_step_id );
411
- }
412
- }
413
-
414
- // Beaver Builder.
415
- if ( ( 'beaver-builder' === $default_page_builder ) && class_exists( 'FLBuilder' ) ) {
416
- if ( isset( $step['meta']['_fl_builder_data'] ) ) {
417
- CartFlows_Importer_Beaver_Builder::get_instance()->import_single_post( $new_step_id );
418
- }
419
- }
420
- }
421
- }
422
- }
423
- }
424
- }
425
-
426
- /**
427
- * Download and Replace hotlink images
428
- *
429
- * @since x.x.x
430
- *
431
- * @param string $content Mixed post content.
432
- * @return array Hotlink image array.
433
- */
434
- public function get_content( $content = '' ) {
435
-
436
- $content = stripslashes( $content );
437
-
438
- // Extract all links.
439
- $all_links = wp_extract_urls( $content );
440
-
441
- // Not have any link.
442
- if ( empty( $all_links ) ) {
443
- return $content;
444
- }
445
-
446
- $link_mapping = array();
447
- $image_links = array();
448
- $other_links = array();
449
-
450
- // Extract normal and image links.
451
- foreach ( $all_links as $key => $link ) {
452
- if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) {
453
-
454
- // Get all image links.
455
- // Avoid *-150x, *-300x and *-1024x images.
456
- if (
457
- false === strpos( $link, '-150x' ) &&
458
- false === strpos( $link, '-300x' ) &&
459
- false === strpos( $link, '-1024x' )
460
- ) {
461
- $image_links[] = $link;
462
- }
463
- } else {
464
-
465
- // Collect other links.
466
- $other_links[] = $link;
467
- }
468
- }
469
-
470
- // Step 1: Download images.
471
- if ( ! empty( $image_links ) ) {
472
- foreach ( $image_links as $key => $image_url ) {
473
- // Download remote image.
474
- $image = array(
475
- 'url' => $image_url,
476
- 'id' => 0,
477
- );
478
- $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
479
-
480
- // Old and New image mapping links.
481
- $link_mapping[ $image_url ] = $downloaded_image['url'];
482
- }
483
- }
484
-
485
- // Step 3: Replace mapping links.
486
- foreach ( $link_mapping as $old_url => $new_url ) {
487
- $content = str_replace( $old_url, $new_url, $content );
488
-
489
- // Replace the slashed URLs if any exist.
490
- $old_url = str_replace( '/', '/\\', $old_url );
491
- $new_url = str_replace( '/', '/\\', $new_url );
492
- $content = str_replace( $old_url, $new_url, $content );
493
- }
494
-
495
- return $content;
496
- }
497
-
498
- /**
499
- * Imported notice
500
- *
501
- * @since 1.1.4
502
- */
503
- public function imported_successfully() {
504
- ?>
505
- <div class="notice notice-success">
506
- <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
507
- </div>
508
- <?php
509
- }
510
-
511
- /**
512
- * Clear Cache.
513
- *
514
- * @since 1.0.0
515
- */
516
- public function clear_cache() {
517
- // Clear 'Elementor' file cache.
518
- if ( class_exists( '\Elementor\Plugin' ) ) {
519
- \Elementor\Plugin::$instance->files_manager->clear_cache();
520
- }
521
- }
522
-
523
- /**
524
- * JS Templates
525
- *
526
- * @since 1.0.0
527
- *
528
- * @return void
529
- */
530
- public function js_templates() {
531
-
532
- // Loading Templates.
533
- ?>
534
- <script type="text/template" id="tmpl-cartflows-step-loading">
535
- <div class="template-message-block cartflows-step-loading">
536
- <h2>
537
- <span class="spinner"></span>
538
- <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
539
- </h2>
540
- <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
541
- </div>
542
- </script>
543
-
544
- <?php
545
- // Search Templates.
546
- ?>
547
- <script type="text/template" id="tmpl-cartflows-searching-templates">
548
- <div class="template-message-block cartflows-searching-templates">
549
- <h2>
550
- <span class="spinner"></span>
551
- <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
552
- </h2>
553
- <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
554
- </div>
555
- </script>
556
-
557
- <?php
558
- // CartFlows Importing Template.
559
- ?>
560
- <script type="text/template" id="tmpl-cartflows-step-importing">
561
- <div class="template-message-block cartflows-step-importing">
562
- <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
563
- </div>
564
- </script>
565
-
566
- <?php
567
- // CartFlows Imported.
568
- ?>
569
- <script type="text/template" id="tmpl-cartflows-step-imported">
570
- <div class="template-message-block cartflows-step-imported">
571
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
572
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
573
- </script>
574
-
575
- <?php
576
- // No templates.
577
- ?>
578
- <script type="text/template" id="tmpl-cartflows-no-steps">
579
- <div class="cartflows-no-steps">
580
- <div class="template-message-block">
581
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
582
- <p class="description"></p>
583
- </div>
584
- </div>
585
- </script>
586
-
587
- <?php
588
- // No templates.
589
- ?>
590
- <script type="text/template" id="tmpl-cartflows-no-flows">
591
- <div class="cartflows-no-flows">
592
- <div class="template-message-block">
593
- <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
594
- <p class="description"></p>
595
- </div>
596
- </div>
597
- </script>
598
-
599
- <?php
600
- // Error handling.
601
- ?>
602
- <script type="text/template" id="tmpl-templator-error">
603
- <div class="notice notice-error"><p>{{ data }}</p></div>
604
- </script>
605
-
606
- <?php
607
- // Redirect to Elementor.
608
- ?>
609
- <script type="text/template" id="tmpl-templator-redirect-to-elementor">
610
- <div class="template-message-block templator-redirect-to-elementor">
611
- <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
612
- <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
613
- </script>
614
-
615
- <?php
616
- /**
617
- * Responsive Buttons
618
- */
619
- ?>
620
- <script type="text/template" id="tmpl-cartflows-responsive-view">
621
- <span class="responsive-view">
622
- <span class="actions">
623
- <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
624
- <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
625
- <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
626
- </span>
627
- </span>
628
- </script>
629
-
630
- <?php
631
- // Templates data.
632
- ?>
633
- <script type="text/template" id="tmpl-cartflows-flows-list">
634
-
635
- <# console.log( data.items.length ) #>
636
- <# console.log( data.items ) #>
637
- <# if ( data.items.length ) { #>
638
- <# for ( key in data.items ) { #>
639
- <#
640
- var flow_steps = [];
641
- if( data.items[ key ].flow_steps ) {
642
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
643
- return value['id'];
644
- });
645
- }
646
- #>
647
- <div class="inner">
648
- <div class="template">
649
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
650
- <div class="template-screenshot">
651
- <# if( data.items[ key ].featured_image_url ) { #>
652
- <img src="{{ data.items[ key ].featured_image_url }}" />
653
- <# } else { #>
654
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
655
- <# } #>
656
- </div>
657
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
658
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
659
- <# } #>
660
- <# if( data.items[ key ].woo_required ) { #>
661
- <div class="notice notice-info" style="width: auto;">
662
- <p class="wcf-learn-how">
663
- Install/Activate WooCommerce to use this template.
664
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
665
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
666
- <i class="dashicons dashicons-external"></i>
667
- </a>
668
- </p>
669
- </div>
670
- <# } else { #>
671
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
672
- <# } #>
673
-
674
- </span>
675
- <div class="template-id-container">
676
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
677
- <div class="template-actions">
678
-
679
- <#
680
- if( data.items[ key ].page_builder.slug ) {
681
- required_plugin_group = data.items[ key ].page_builder.slug;
682
- } else {
683
- required_plugin_group = '';
684
- }
685
-
686
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
687
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
688
- } else {
689
- import_btn_title = 'Import';
690
- } #>
691
-
692
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
693
- <# if( ! data.items[ key ].woo_required ) { #>
694
- <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
695
- <# } else { #>
696
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
697
- <# } #>
698
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
699
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
700
- <# } else { #>
701
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
702
- <# } #>
703
- </div>
704
- </div>
705
- </div>
706
- </div>
707
- <# } #>
708
- <# } #>
709
- </script>
710
-
711
- <?php
712
- // Empty Step.
713
- ?>
714
- <script type="text/template" id="tmpl-cartflows-create-blank-step">
715
- <div class="inner">
716
- <div class="template">
717
- <span class="thumbnail site-preview cartflows-flow-preview">
718
- <div class="template-screenshot">
719
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
720
- </div>
721
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
722
- </span>
723
- <div class="template-id-container">
724
- <h3 class="template-name"> Blank </h3>
725
- <div class="template-actions">
726
- <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
727
- </div>
728
- </div>
729
- </div>
730
- </div>
731
- </script>
732
-
733
- <?php
734
- // Templates data.
735
- ?>
736
- <script type="text/template" id="tmpl-cartflows-steps-list">
737
- <# if ( data.items.length ) { #>
738
- <# for ( key in data.items ) { #>
739
- <#
740
- var flow_steps = [];
741
- if( data.items[ key ].flow_steps ) {
742
- flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
743
- return value['id'];
744
- });
745
- }
746
- #>
747
- <div class="inner">
748
- <div class="template">
749
- <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
750
- <div class="template-screenshot">
751
- <# if( data.items[ key ].featured_image_url ) { #>
752
- <img src="{{ data.items[ key ].featured_image_url }}" />
753
- <# } else { #>
754
- <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
755
- <# } #>
756
- </div>
757
- <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
758
-
759
- <# if( data.items[ key ].woo_required ) { #>
760
- <div class="notice notice-info" style="width: auto;">
761
- <p class="wcf-learn-how">
762
- Install/Activate WooCommerce to use this template.
763
- <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
764
- <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
765
- <i class="dashicons dashicons-external"></i>
766
- </a>
767
- </p>
768
- </div>
769
- <# } else { #>
770
- <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
771
- <# } #>
772
-
773
- <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
774
- <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
775
- <# } #>
776
- </span>
777
- <div class="template-id-container">
778
- <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
779
- <div class="template-actions">
780
-
781
- <#
782
-
783
- var step_slug = data.items[ key ].step_type.slug || '';
784
- var step_title = data.items[ key ].step_type.name || '';
785
- var import_btn_title = 'Import';
786
-
787
- var required_plugin_group = '';
788
- if( data.items[ key ].page_builder ) {
789
- required_plugin_group = data.items[ key ].page_builder.slug;
790
-
791
- if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
792
- import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
793
- }
794
- }
795
- #>
796
-
797
- <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
798
-
799
- <# if( ! data.items[ key ].woo_required ) { #>
800
- <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
801
- <# } else { #>
802
- <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
803
- <# } #>
804
-
805
- <# } else if( CartFlowsImportVars._is_pro_active ) { #>
806
- <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
807
- <# } else { #>
808
- <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
809
- <# } #>
810
- </div>
811
- </div>
812
- </div>
813
- </div>
814
- <# } #>
815
- <# } #>
816
- </script>
817
-
818
- <?php
819
- /**
820
- * TMPL - Website Unreachable
821
- */
822
- ?>
823
- <script type="text/template" id="tmpl-cartflows-website-unreachable">
824
- <div class="postbox cartflows-website-unreachable">
825
- <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
826
- <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
827
- <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
828
- </div>
829
- </script>
830
-
831
- <?php
832
- /**
833
- * TMPL - Filters
834
- */
835
- ?>
836
- <script type="text/template" id="tmpl-cartflows-page-builder-notice">
837
- <?php
838
- $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
839
- $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
840
- $title = $page_builder['title'];
841
-
842
- $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
843
- $theme_status = '';
844
- if ( 'divi' === $default_page_builder ) {
845
-
846
- $theme_status = $page_builder['theme-status'];
847
- $plugin_status = $page_builder['plugin-status'];
848
-
849
- if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
850
- $plugin_string = 'Please activate ' . esc_html( $title );
851
- } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
852
- $plugin_string = 'Please install and activate ' . esc_html( $title );
853
- }
854
- }
855
- ?>
856
- <div class="wcf-page-builder-message">
857
- <p><?php /* translators: %s: Plugin string */ printf( __( '%1$s to see CartFlows templates. If you prefer another page builder tool, you can <a href="%2$s" target="blank">select it here</a>.', 'cartflows' ), $plugin_string, admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings#form-field-wcf_default_page_builder' ) ); ?></p>
858
- <p>If your preferred page builder is not available, feel free to <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own</a> pages using page builder of your choice as CartFlows works with all major page builders.</p>
859
- <p>We plan to add design templates made with more page builder shortly!</p>
860
- </div>
861
- </script>
862
-
863
- <?php
864
- /**
865
- * TMPL - Filters
866
- */
867
- ?>
868
- <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
869
- <# if ( data ) { #>
870
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
871
- <# if ( data.args.show_all ) { #>
872
- <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
873
- <# } #>
874
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
875
- <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
876
- <# } #>
877
- <# var step_slug_data = []; #>
878
- <# for ( key in data.items ) { #>
879
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
880
-
881
- <# step_slug_data.push( data.items[ key ].slug ); #>
882
-
883
- <# } #>
884
- <# if( step_slug_data.indexOf("optin") === -1){ #>
885
- <option value='0' data-group='0' class="Optin (Woo)" data-slug="optin" data-title="Optin (Woo)">Optin (Woo)</option>
886
- <# } #>
887
- </select>
888
- <# } #>
889
- </script>
890
-
891
- <script type="text/template" id="tmpl-cartflows-term-filters">
892
-
893
- <# if ( data ) { #>
894
-
895
- <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
896
- <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
897
-
898
- <# if ( data.args.show_all ) { #>
899
- <li>
900
- <a href="#" data-group="all"> All </a>
901
- </li>
902
- <# } #>
903
-
904
- <# for ( key in data.items ) { #>
905
- <li>
906
- <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
907
- </li>
908
- <# } #>
909
-
910
- </ul>
911
-
912
- <?php
913
-
914
- /**
915
- <# } else { #>
916
- <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
917
-
918
- <# if ( data.args.show_all ) { #>
919
- <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
920
- <# } #>
921
-
922
- <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
923
- <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
924
- <# } #>
925
-
926
- <# for ( key in data.items ) { #>
927
- <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
928
- <# } #>
929
-
930
- </select>
931
- */
932
- ?>
933
-
934
- <?php /* <# } #> */ ?>
935
-
936
- <# } #>
937
- </script>
938
-
939
- <?php
940
- // Step Type.
941
- ?>
942
- <script type="text/template" id="tmpl-cartflows-step-types">
943
- <ul class="wcf-tab nav-tabs">
944
- <# if( data.items_count ) { #>
945
- <# for( key in data.items ) { #>
946
- <# console.log( data.items[ key ].id ) #>
947
- <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
948
- <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
949
- </li>
950
- <# } #>
951
- <# } #>
952
- </ul>
953
- </script>
954
-
955
- <?php
956
- // Add to library button.
957
- ?>
958
- <script type="text/template" id="tmpl-templator-add-to-library">
959
- <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
960
- </script>
961
- <?php
962
- }
963
-
964
- /**
965
- * Enqueue scripts
966
- *
967
- * @since 1.0.0
968
- *
969
- * @hook admin_enqueue_scripts
970
- * @param string $hook Current page hook.
971
- */
972
- public function scripts( $hook = '' ) {
973
-
974
- if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
975
- return;
976
- }
977
-
978
- wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
979
- wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
980
- wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
981
- wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
982
-
983
- $installed_plugins = get_plugins();
984
- $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
985
- $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
986
-
987
- $localize_vars = array(
988
- '_is_pro_active' => _is_cartflows_pro(),
989
- 'is_wc_installed' => $is_wc_installed,
990
- 'is_wc_activated' => $is_wc_activated,
991
-
992
- // Set API headers for the CartFlows API Calls only.
993
- 'headers' => array(),
994
-
995
- // Flow and its rest fields.
996
- 'flow' => CARTFLOWS_FLOW_POST_TYPE,
997
- 'flow_fields' => array(
998
- 'id',
999
- 'title',
1000
- 'flow_type',
1001
- 'page_builder',
1002
- 'flow_steps',
1003
- 'licence_status',
1004
- 'featured_image_url',
1005
- 'featured_media', // @required for field `featured_image_url`.
1006
- ),
1007
-
1008
- // Flow type and rest fields.
1009
- 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
1010
- 'flow_type_fields' => array(
1011
- 'id',
1012
- 'name',
1013
- 'slug',
1014
- ),
1015
-
1016
- // Flow page builder and rest fields.
1017
- 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
1018
- 'flow_page_builder_fields' => array(
1019
- 'id',
1020
- 'name',
1021
- 'slug',
1022
- ),
1023
-
1024
- // Step page builder and rest fields.
1025
- 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
1026
- 'step_page_builder_fields' => array(
1027
- 'id',
1028
- 'name',
1029
- 'slug',
1030
- ),
1031
-
1032
- // Step and its rest fields.
1033
- 'step' => CARTFLOWS_STEP_POST_TYPE,
1034
- 'step_fields' => array(
1035
- 'title',
1036
- 'featured_image_url',
1037
- 'featured_media', // @required for field `featured_image_url`.
1038
- 'id',
1039
- 'flow_type',
1040
- 'step_type',
1041
- 'page_builder',
1042
- 'licence_status',
1043
- ),
1044
-
1045
- // Step type and its rest fields.
1046
- 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1047
- 'step_type_fields' => array(
1048
- 'id',
1049
- 'name',
1050
- 'slug',
1051
- ),
1052
-
1053
- 'domain_url' => CARTFLOWS_DOMAIN_URL,
1054
- 'server_url' => CARTFLOWS_TEMPLATES_URL,
1055
- 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1056
- 'site_url' => site_url(),
1057
- 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1058
- 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1059
- 'admin_url' => admin_url(),
1060
- 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1061
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1062
- 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1063
-
1064
- 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1065
-
1066
- 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1067
- );
1068
-
1069
- $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1070
-
1071
- // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1072
- // wp_die( );
1073
- // Add thickbox.
1074
- add_thickbox();
1075
-
1076
- wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1077
- wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1078
- }
1079
-
1080
- /**
1081
- * Import.
1082
- *
1083
- * @since 1.0.0
1084
- *
1085
- * @hook wp_ajax_cartflows_import_flow_step
1086
- * @return void
1087
- */
1088
- public function import_flow() {
1089
-
1090
- if ( ! current_user_can( 'manage_options' ) ) {
1091
- return;
1092
- }
1093
-
1094
- check_ajax_referer( 'cf-import-flow-step', 'security' );
1095
-
1096
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1097
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1098
-
1099
- wcf()->logger->import_log( '------------------------------------' );
1100
- wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1101
- wcf()->logger->import_log( '------------------------------------' );
1102
- wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1103
-
1104
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1105
-
1106
- $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1107
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1108
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1109
- $post_content = $response['data']['divi_content'];
1110
- }
1111
- }
1112
-
1113
- if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1114
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1115
- $post_content = $response['data']['divi_content'];
1116
- }
1117
- }
1118
-
1119
- if ( false === $response['success'] ) {
1120
- wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1121
- wp_send_json_error( $response );
1122
- }
1123
-
1124
- wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1125
-
1126
- $new_step_id = wp_insert_post(
1127
- array(
1128
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1129
- 'post_title' => $response['title'],
1130
- 'post_content' => $post_content,
1131
- 'post_status' => 'publish',
1132
- )
1133
- );
1134
-
1135
- if ( is_wp_error( $new_step_id ) ) {
1136
- wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1137
- wp_send_json_error( $new_step_id );
1138
- }
1139
-
1140
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1141
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1142
- update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1143
- }
1144
- }
1145
-
1146
- /* Imported Step */
1147
- update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1148
-
1149
- wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1150
- // insert post meta.
1151
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1152
- wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1153
-
1154
- /**
1155
- * Import & Set type.
1156
- */
1157
- $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1158
-
1159
- $term_slug = '';
1160
- if ( $term ) {
1161
-
1162
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1163
- $term_exist = term_exists( $term->slug, $taxonomy );
1164
-
1165
- if ( empty( $term_exist ) ) {
1166
- $terms = array(
1167
- array(
1168
- 'name' => $term->name,
1169
- 'slug' => $term->slug,
1170
- ),
1171
- );
1172
-
1173
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1174
- wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1175
- }
1176
-
1177
- $current_term = term_exists( $term->slug, $taxonomy );
1178
-
1179
- // Set type object.
1180
- $data = get_term( $current_term['term_id'], $taxonomy );
1181
- $term_slug = $data->slug;
1182
- $term_name = $data->name;
1183
- wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1184
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1185
-
1186
- // Set type.
1187
- update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1188
- wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1189
- }
1190
-
1191
- // Set flow.
1192
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1193
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1194
-
1195
- /**
1196
- * Update steps for the current flow.
1197
- */
1198
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1199
-
1200
- if ( ! is_array( $flow_steps ) ) {
1201
- $flow_steps = array();
1202
- }
1203
-
1204
- $flow_steps[] = array(
1205
- 'id' => $new_step_id,
1206
- 'title' => $response['title'],
1207
- 'type' => $term_slug,
1208
- );
1209
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1210
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1211
-
1212
- // Import Post Meta.
1213
- self::import_post_meta( $new_step_id, $response );
1214
-
1215
- wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1216
- wcf()->logger->import_log( '------------------------------------' );
1217
- wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1218
- wcf()->logger->import_log( '------------------------------------' );
1219
-
1220
- do_action( 'cartflows_import_complete' );
1221
- wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1222
-
1223
- // Batch Process.
1224
- do_action( 'cartflows_after_template_import', $new_step_id, $response );
1225
-
1226
- /**
1227
- * End
1228
- */
1229
- wp_send_json_success( $new_step_id );
1230
- }
1231
-
1232
- /**
1233
- * Import Step.
1234
- *
1235
- * @since 1.0.0
1236
- * @hook wp_ajax_cartflows_step_import
1237
- *
1238
- * @return void
1239
- */
1240
- public function create_default_flow() {
1241
-
1242
- if ( ! current_user_can( 'manage_options' ) ) {
1243
- return;
1244
- }
1245
-
1246
- check_ajax_referer( 'cf-default-flow', 'security' );
1247
-
1248
- // Create post object.
1249
- $new_flow_post = array(
1250
- 'post_content' => '',
1251
- 'post_status' => 'publish',
1252
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1253
- );
1254
-
1255
- // Insert the post into the database.
1256
- $flow_id = wp_insert_post( $new_flow_post );
1257
-
1258
- if ( is_wp_error( $flow_id ) ) {
1259
- wp_send_json_error( $flow_id->get_error_message() );
1260
- }
1261
-
1262
- $flow_steps = array();
1263
-
1264
- if ( wcf()->is_woo_active ) {
1265
- $steps_data = array(
1266
- 'sales' => array(
1267
- 'title' => __( 'Sales Landing', 'cartflows' ),
1268
- 'type' => 'landing',
1269
- ),
1270
- 'order-form' => array(
1271
- 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1272
- 'type' => 'checkout',
1273
- ),
1274
- 'order-confirmation' => array(
1275
- 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1276
- 'type' => 'thankyou',
1277
- ),
1278
- );
1279
-
1280
- } else {
1281
- $steps_data = array(
1282
- 'landing' => array(
1283
- 'title' => __( 'Landing', 'cartflows' ),
1284
- 'type' => 'landing',
1285
- ),
1286
- 'thankyou' => array(
1287
- 'title' => __( 'Thank You', 'cartflows' ),
1288
- 'type' => 'landing',
1289
- ),
1290
- );
1291
- }
1292
-
1293
- foreach ( $steps_data as $slug => $data ) {
1294
-
1295
- $post_content = '';
1296
- $step_type = trim( $data['type'] );
1297
-
1298
- $step_id = wp_insert_post(
1299
- array(
1300
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1301
- 'post_title' => $data['title'],
1302
- 'post_content' => $post_content,
1303
- 'post_status' => 'publish',
1304
- )
1305
- );
1306
-
1307
- if ( is_wp_error( $step_id ) ) {
1308
- wp_send_json_error( $step_id->get_error_message() );
1309
- }
1310
-
1311
- if ( $step_id ) {
1312
-
1313
- $flow_steps[] = array(
1314
- 'id' => $step_id,
1315
- 'title' => $data['title'],
1316
- 'type' => $step_type,
1317
- );
1318
-
1319
- // insert post meta.
1320
- update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1321
- update_post_meta( $step_id, 'wcf-step-type', $step_type );
1322
-
1323
- wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1324
- wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1325
-
1326
- update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1327
- }
1328
- }
1329
-
1330
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1331
-
1332
- wp_send_json_success( $flow_id );
1333
- }
1334
-
1335
- /**
1336
- * Create Flow
1337
- *
1338
- * @return void
1339
- */
1340
- public function create_flow() {
1341
-
1342
- if ( ! current_user_can( 'manage_options' ) ) {
1343
- return;
1344
- }
1345
-
1346
- check_ajax_referer( 'cf-create-flow', 'security' );
1347
-
1348
- // Create post object.
1349
- $new_flow_post = array(
1350
- 'post_content' => '',
1351
- 'post_status' => 'publish',
1352
- 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1353
- );
1354
-
1355
- // Insert the post into the database.
1356
- $flow_id = wp_insert_post( $new_flow_post );
1357
-
1358
- if ( is_wp_error( $flow_id ) ) {
1359
- wp_send_json_error( $flow_id->get_error_message() );
1360
- }
1361
-
1362
- /* Imported Flow */
1363
- update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1364
-
1365
- wp_send_json_success( $flow_id );
1366
- }
1367
-
1368
- /**
1369
- * Create Step
1370
- *
1371
- * @return void
1372
- */
1373
- public function import_step() {
1374
-
1375
- if ( ! current_user_can( 'manage_options' ) ) {
1376
- return;
1377
- }
1378
-
1379
- check_ajax_referer( 'cf-step-import', 'security' );
1380
-
1381
- $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1382
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1383
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1384
- $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1385
- $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1386
-
1387
- $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1388
-
1389
- $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1390
-
1391
- wcf()->logger->import_log( '------------------------------------' );
1392
- wcf()->logger->import_log( 'STARTED! Importing STEP' );
1393
- wcf()->logger->import_log( '------------------------------------' );
1394
-
1395
- if ( empty( $template_id ) || empty( $post_id ) ) {
1396
- /* translators: %s: template ID */
1397
- $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1398
- wcf()->logger->import_log( $data );
1399
- wp_send_json_error( $data );
1400
- }
1401
-
1402
- wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1403
-
1404
- $response = CartFlows_API::get_instance()->get_template( $template_id );
1405
-
1406
- if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1407
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1408
-
1409
- update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1410
-
1411
- wp_update_post(
1412
- array(
1413
- 'ID' => $post_id,
1414
- 'post_content' => $response['data']['divi_content'],
1415
- )
1416
- );
1417
- }
1418
- }
1419
-
1420
- if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1421
- if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1422
-
1423
- wp_update_post(
1424
- array(
1425
- 'ID' => $post_id,
1426
- 'post_content' => $response['data']['divi_content'],
1427
- )
1428
- );
1429
- }
1430
- }
1431
-
1432
- /* Imported Step */
1433
- update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1434
-
1435
- // Import Post Meta.
1436
- self::import_post_meta( $post_id, $response );
1437
-
1438
- do_action( 'cartflows_import_complete' );
1439
-
1440
- // Batch Process.
1441
- do_action( 'cartflows_after_template_import', $post_id, $response );
1442
-
1443
- wcf()->logger->import_log( '------------------------------------' );
1444
- wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1445
- wcf()->logger->import_log( '------------------------------------' );
1446
-
1447
- wp_send_json_success( $post_id );
1448
- }
1449
-
1450
- /**
1451
- * Import Step.
1452
- *
1453
- * @since 1.0.0
1454
- * @hook wp_ajax_cartflows_step_create_blank
1455
- *
1456
- * @return void
1457
- */
1458
- public function step_create_blank() {
1459
-
1460
- if ( ! current_user_can( 'manage_options' ) ) {
1461
- return;
1462
- }
1463
-
1464
- check_ajax_referer( 'cf-step-create-blank', 'security' );
1465
-
1466
- $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1467
- $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1468
- $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1469
-
1470
- if ( empty( $flow_id ) || empty( $step_type ) ) {
1471
- /* translators: %s: flow ID */
1472
- $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1473
- wcf()->logger->import_log( $data );
1474
- wp_send_json_error( $data );
1475
- }
1476
-
1477
- wcf()->logger->import_log( '------------------------------------' );
1478
- wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1479
-
1480
- $step_type_title = str_replace( '-', ' ', $step_type );
1481
- $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1482
-
1483
- $new_step_id = wp_insert_post(
1484
- array(
1485
- 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1486
- 'post_title' => $step_title,
1487
- 'post_content' => '',
1488
- 'post_status' => 'publish',
1489
- )
1490
- );
1491
-
1492
- // insert post meta.
1493
- update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1494
-
1495
- $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1496
- $term_exist = term_exists( $step_type_slug, $taxonomy );
1497
-
1498
- if ( empty( $term_exist ) ) {
1499
- $terms = array(
1500
- array(
1501
- 'name' => $step_type_title,
1502
- 'slug' => $step_type_slug,
1503
- ),
1504
- );
1505
-
1506
- Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1507
- wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1508
- }
1509
-
1510
- $current_term = term_exists( $step_type_slug, $taxonomy );
1511
-
1512
- // Set type object.
1513
- $data = get_term( $current_term['term_id'], $taxonomy );
1514
- $step_slug = $data->slug;
1515
- wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1516
- wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1517
-
1518
- // Set Default page Layout.
1519
- update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1520
-
1521
- // Set type.
1522
- update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1523
- wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1524
-
1525
- // Set flow.
1526
- wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1527
- wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1528
-
1529
- self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1530
-
1531
- wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1532
- wcf()->logger->import_log( '------------------------------------' );
1533
-
1534
- wp_send_json_success( $new_step_id );
1535
- }
1536
-
1537
- /**
1538
- * Import Post Meta
1539
- *
1540
- * @since 1.0.0
1541
- *
1542
- * @param integer $post_id Post ID.
1543
- * @param array $response Post meta.
1544
- * @return void
1545
- */
1546
- public static function import_post_meta( $post_id, $response ) {
1547
-
1548
- $metadata = (array) $response['post_meta'];
1549
-
1550
- foreach ( $metadata as $meta_key => $meta_value ) {
1551
- $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1552
-
1553
- if ( $meta_value ) {
1554
-
1555
- if ( is_serialized( $meta_value, true ) ) {
1556
- $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1557
- } elseif ( is_array( $meta_value ) ) {
1558
- $raw_data = json_decode( stripslashes( $meta_value ), true );
1559
- } else {
1560
- $raw_data = $meta_value;
1561
- }
1562
-
1563
- if ( '_elementor_data' === $meta_key ) {
1564
- if ( is_array( $raw_data ) ) {
1565
- $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1566
- } else {
1567
- $raw_data = wp_slash( $raw_data );
1568
- }
1569
- }
1570
- if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1571
- if ( is_array( $raw_data ) ) {
1572
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1573
- } else {
1574
- if ( ! is_object( $raw_data ) ) {
1575
- wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1576
- }
1577
- }
1578
- }
1579
-
1580
- update_post_meta( $post_id, $meta_key, $raw_data );
1581
- }
1582
- }
1583
- }
1584
-
1585
- /**
1586
- * Import Template for Elementor
1587
- *
1588
- * @since 1.0.0
1589
- *
1590
- * @param integer $post_id Post ID.
1591
- * @param array $response Post meta.
1592
- * @param array $page_build_data Page build data.
1593
- * @return void
1594
- */
1595
- public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1596
- if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1597
- $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1598
- wcf()->logger->import_log( $data );
1599
- wp_send_json_error( $data );
1600
- }
1601
-
1602
- require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1603
-
1604
- wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1605
-
1606
- $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1607
- $obj->import_single_template( $post_id );
1608
-
1609
- wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1610
- }
1611
-
1612
- /**
1613
- * Supported post types
1614
- *
1615
- * @since 1.0.0
1616
- *
1617
- * @return array Supported post types.
1618
- */
1619
- public static function supported_post_types() {
1620
- return apply_filters(
1621
- 'cartflows_supported_post_types',
1622
- array(
1623
- CARTFLOWS_FLOW_POST_TYPE,
1624
- )
1625
- );
1626
- }
1627
-
1628
- /**
1629
- * Check supported post type
1630
- *
1631
- * @since 1.0.0
1632
- *
1633
- * @param string $post_type Post type.
1634
- * @return boolean Supported post type status.
1635
- */
1636
- public static function is_supported_post( $post_type = '' ) {
1637
-
1638
- if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1639
- return true;
1640
- }
1641
-
1642
- return false;
1643
- }
1644
-
1645
- /**
1646
- * Set steps to the flow
1647
- *
1648
- * @param integer $flow_id Flow ID.
1649
- * @param integer $new_step_id New step ID.
1650
- * @param string $step_title Flow Type.
1651
- * @param string $step_slug Flow Type.
1652
- */
1653
- public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1654
- // Update steps for the current flow.
1655
- $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1656
-
1657
- if ( ! is_array( $flow_steps ) ) {
1658
- $flow_steps = array();
1659
- }
1660
-
1661
- $flow_steps[] = array(
1662
- 'id' => $new_step_id,
1663
- 'title' => $step_title,
1664
- 'type' => $step_slug,
1665
- );
1666
- update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1667
- wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1668
- }
1669
-
1670
- /**
1671
- * Localize variables in admin
1672
- *
1673
- * @param array $vars variables.
1674
- */
1675
- public function localize_vars( $vars ) {
1676
-
1677
- $ajax_actions = array(
1678
- 'cf_step_import',
1679
- 'cf_load_steps',
1680
- 'cf_create_flow',
1681
- 'cf_default_flow',
1682
- 'cf_step_create_blank',
1683
- 'cf_import_flow_step',
1684
- );
1685
-
1686
- foreach ( $ajax_actions as $action ) {
1687
-
1688
- $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1689
- }
1690
-
1691
- return $vars;
1692
- }
1693
-
1694
- /**
1695
- * Ajax action to activate plugin
1696
- */
1697
- public function activate_plugin() {
1698
-
1699
- if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1700
- wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1701
- }
1702
-
1703
- if ( ! current_user_can( 'activate_plugins' ) ) {
1704
- wp_send_json_error(
1705
- array(
1706
- 'success' => false,
1707
- 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1708
- )
1709
- );
1710
- }
1711
-
1712
- $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1713
-
1714
- $activate = activate_plugin( $plugin_init, '', false, true );
1715
-
1716
- if ( is_wp_error( $activate ) ) {
1717
- wp_send_json_error(
1718
- array(
1719
- 'success' => false,
1720
- 'message' => $activate->get_error_message(),
1721
- 'init' => $plugin_init,
1722
- )
1723
- );
1724
- }
1725
-
1726
- wp_send_json_success(
1727
- array(
1728
- 'success' => true,
1729
- 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1730
- 'init' => $plugin_init,
1731
- )
1732
- );
1733
- }
1734
-
1735
- }
1736
-
1737
- /**
1738
- * Initialize class object with 'get_instance()' method
1739
- */
1740
- CartFlows_Importer::get_instance();
1741
-
1742
- endif;
1
+ <?php
2
+ /**
3
+ * CartFlows Admin
4
+ *
5
+ * @package CartFlows
6
+ * @since 1.0.0
7
+ */
8
+
9
+ if ( ! class_exists( 'CartFlows_Importer' ) ) :
10
+
11
+ /**
12
+ * CartFlows Import
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class CartFlows_Importer {
17
+
18
+ /**
19
+ * Instance
20
+ *
21
+ * @since 1.0.0
22
+ * @access private
23
+ * @var object Class object.
24
+ */
25
+ private static $instance;
26
+
27
+ /**
28
+ * Initiator
29
+ *
30
+ * @since 1.0.0
31
+ * @return object initialized object of class.
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
+ }
37
+
38
+ return self::$instance;
39
+ }
40
+
41
+ /**
42
+ * Constructor
43
+ *
44
+ * @since 1.0.0
45
+ */
46
+ public function __construct() {
47
+ add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
48
+
49
+ add_action( 'wp_ajax_cartflows_step_import', array( $this, 'import_step' ) );
50
+ add_action( 'wp_ajax_cartflows_create_flow', array( $this, 'create_flow' ) );
51
+ add_action( 'wp_ajax_cartflows_import_flow_step', array( $this, 'import_flow' ) );
52
+ add_action( 'wp_ajax_cartflows_default_flow', array( $this, 'create_default_flow' ) );
53
+ add_action( 'wp_ajax_cartflows_step_create_blank', array( $this, 'step_create_blank' ) );
54
+
55
+ add_action( 'admin_footer', array( $this, 'js_templates' ) );
56
+ add_action( 'cartflows_import_complete', array( $this, 'clear_cache' ) );
57
+
58
+ add_filter( 'cartflows_admin_js_localize', array( $this, 'localize_vars' ) );
59
+
60
+ add_action( 'wp_ajax_cartflows_activate_plugin', array( $this, 'activate_plugin' ) );
61
+
62
+ add_action( 'admin_menu', array( $this, 'add_to_menus' ) );
63
+ add_action( 'admin_init', array( $this, 'export_json' ) );
64
+ add_action( 'admin_init', array( $this, 'import_json' ) );
65
+ add_filter( 'post_row_actions', array( $this, 'export_link' ), 10, 2 );
66
+ add_action( 'admin_action_cartflows_export_flow', array( $this, 'export_flow' ) );
67
+ }
68
+
69
+ /**
70
+ * Add the export link to action list for flows row actions
71
+ *
72
+ * @since 1.1.4
73
+ *
74
+ * @param array $actions Actions array.
75
+ * @param object $post Post object.
76
+ *
77
+ * @return array
78
+ */
79
+ public function export_link( $actions, $post ) {
80
+ if ( current_user_can( 'edit_posts' ) && isset( $post ) && CARTFLOWS_FLOW_POST_TYPE === $post->post_type ) {
81
+ $actions['export'] = '<a href="' . wp_nonce_url( 'admin.php?action=cartflows_export_flow&post=' . $post->ID, basename( __FILE__ ), 'flow_export_nonce' ) . '" title="' . __( 'Export this flow', 'cartflows' ) . '" rel="permalink">' . __( 'Export', 'cartflows' ) . '</a>';
82
+ }
83
+ return $actions;
84
+ }
85
+
86
+ /**
87
+ * Add menus
88
+ *
89
+ * @since 1.1.4
90
+ */
91
+ public function add_to_menus() {
92
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Export', 'cartflows' ), __( 'Flow Export', 'cartflows' ), 'export', 'flow_exporter', array( $this, 'exporter_markup' ) );
93
+ add_submenu_page( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE, __( 'Flow Import', 'cartflows' ), __( 'Flow Import', 'cartflows' ), 'import', 'flow_importer', array( $this, 'importer_markup' ) );
94
+ }
95
+
96
+ /**
97
+ * Export flow with steps and its meta
98
+ *
99
+ * @since 1.1.4
100
+ */
101
+ public function export_flow() {
102
+
103
+ if ( ! ( isset( $_GET['post'] ) || isset( $_POST['post'] ) || ( isset( $_REQUEST['action'] ) && 'cartflows_export_flow' == $_REQUEST['action'] ) ) ) {
104
+ wp_die( esc_html__( 'No post to export has been supplied!', 'cartflows' ) );
105
+ }
106
+
107
+ if ( ! isset( $_GET['flow_export_nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['flow_export_nonce'] ) ), basename( __FILE__ ) ) ) {
108
+ return;
109
+ }
110
+
111
+ // Get the original post id.
112
+ $flow_id = ( isset( $_GET['post'] ) ? absint( $_GET['post'] ) : absint( $_POST['post'] ) );
113
+
114
+ $flows = array();
115
+ $flows[] = $this->get_flow_export_data( $flow_id );
116
+ $flows = apply_filters( 'cartflows_export_data', $flows );
117
+
118
+ nocache_headers();
119
+ header( 'Content-Type: application/json; charset=utf-8' );
120
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-' . $flow_id . '-' . gmdate( 'm-d-Y' ) . '.json' );
121
+ header( 'Expires: 0' );
122
+
123
+ echo wp_json_encode( $flows );
124
+ exit;
125
+ }
126
+
127
+ /**
128
+ * Export flow markup
129
+ *
130
+ * @since 1.1.4
131
+ */
132
+ public function exporter_markup() {
133
+ include_once CARTFLOWS_DIR . 'includes/exporter.php';
134
+ }
135
+
136
+ /**
137
+ * Import flow markup
138
+ *
139
+ * @since 1.1.4
140
+ */
141
+ public function importer_markup() {
142
+ include_once CARTFLOWS_DIR . 'includes/importer.php';
143
+ }
144
+
145
+ /**
146
+ * Export flow
147
+ *
148
+ * @since 1.1.4
149
+ */
150
+ public function export_json() {
151
+ if ( empty( $_POST['cartflows-action'] ) || 'export' != $_POST['cartflows-action'] ) {
152
+ return;
153
+ }
154
+
155
+ if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
156
+ return;
157
+ }
158
+
159
+ if ( ! current_user_can( 'manage_options' ) ) {
160
+ return;
161
+ }
162
+
163
+ $flows = $this->get_all_flow_export_data();
164
+ $flows = apply_filters( 'cartflows_export_data', $flows );
165
+
166
+ nocache_headers();
167
+ header( 'Content-Type: application/json; charset=utf-8' );
168
+ header( 'Content-Disposition: attachment; filename=cartflows-flow-export-' . gmdate( 'm-d-Y' ) . '.json' );
169
+ header( 'Expires: 0' );
170
+
171
+ echo wp_json_encode( $flows );
172
+ exit;
173
+ }
174
+
175
+ /**
176
+ * Get flow export data
177
+ *
178
+ * @since 1.1.4
179
+ *
180
+ * @param integer $flow_id Flow ID.
181
+ * @return array
182
+ */
183
+ public function get_flow_export_data( $flow_id ) {
184
+
185
+ $export_all = apply_filters( 'cartflows_export_all', true );
186
+
187
+ $valid_step_meta_keys = array(
188
+ '_wp_page_template',
189
+ '_thumbnail_id',
190
+ 'classic-editor-remember',
191
+ );
192
+
193
+ $new_steps = array();
194
+ $steps = get_post_meta( $flow_id, 'wcf-steps', true );
195
+ if ( $steps ) {
196
+ foreach ( $steps as $key => $step ) {
197
+
198
+ // Add step post meta.
199
+ $new_all_meta = array();
200
+ $all_meta = get_post_meta( $step['id'] );
201
+
202
+ // Add single step.
203
+ $step_data_arr = array(
204
+ 'title' => get_the_title( $step['id'] ),
205
+ 'type' => $step['type'],
206
+ 'meta' => $all_meta,
207
+ 'post_content' => '',
208
+ );
209
+
210
+ if ( $export_all ) {
211
+
212
+ $step_post_obj = get_post( $step['id'] );
213
+
214
+ $step_data_arr['post_content'] = $step_post_obj->post_content;
215
+ }
216
+
217
+ $new_steps[] = $step_data_arr;
218
+ }
219
+ }
220
+
221
+ // Add single flow.
222
+ return array(
223
+ 'title' => get_the_title( $flow_id ),
224
+ 'steps' => $new_steps,
225
+ );
226
+ }
227
+
228
+ /**
229
+ * Get all flow export data
230
+ *
231
+ * @since 1.1.4
232
+ */
233
+ public function get_all_flow_export_data() {
234
+
235
+ $query_args = array(
236
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
237
+
238
+ // Query performance optimization.
239
+ 'fields' => 'ids',
240
+ 'no_found_rows' => true,
241
+ 'posts_per_page' => -1,
242
+ );
243
+
244
+ $query = new WP_Query( $query_args );
245
+ $flows = array();
246
+ if ( $query->posts ) {
247
+ foreach ( $query->posts as $key => $post_id ) {
248
+ $flows[] = $this->get_flow_export_data( $post_id );
249
+ }
250
+ }
251
+
252
+ return $flows;
253
+ }
254
+
255
+ /**
256
+ * Import our exported file
257
+ *
258
+ * @since 1.1.4
259
+ */
260
+ public function import_json() {
261
+ if ( empty( $_POST['cartflows-action'] ) || 'import' != $_POST['cartflows-action'] ) {
262
+ return;
263
+ }
264
+
265
+ if ( ! isset( $_POST['cartflows-action-nonce'] ) || empty( $_POST['cartflows-action-nonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['cartflows-action-nonce'] ) ), 'cartflows-action-nonce' ) ) {
266
+ return;
267
+ }
268
+
269
+ if ( ! current_user_can( 'manage_options' ) ) {
270
+ return;
271
+ }
272
+
273
+ $filename = $_FILES['file']['name']; //phpcs:ignore
274
+ $file_info = explode( '.', $filename );
275
+ $extension = end( $file_info );
276
+
277
+ if ( 'json' != $extension ) {
278
+ wp_die( esc_html__( 'Please upload a valid .json file', 'cartflows' ) );
279
+ }
280
+
281
+ $file = $_FILES['file']['tmp_name']; //phpcs:ignore
282
+
283
+ if ( empty( $file ) ) {
284
+ wp_die( esc_html__( 'Please upload a file to import', 'cartflows' ) );
285
+ }
286
+
287
+ // Retrieve the settings from the file and convert the JSON object to an array.
288
+ $flows = json_decode( file_get_contents( $file ), true );//phpcs:ignore
289
+
290
+ $this->import_from_json_data( $flows );
291
+
292
+ add_action( 'admin_notices', array( $this, 'imported_successfully' ) );
293
+ }
294
+
295
+ /**
296
+ * Import flow from the JSON data
297
+ *
298
+ * @since x.x.x
299
+ * @param array $flows JSON array.
300
+ * @return void
301
+ */
302
+ public function import_from_json_data( $flows ) {
303
+ if ( $flows ) {
304
+
305
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
306
+
307
+ foreach ( $flows as $key => $flow ) {
308
+
309
+ $flow_title = $flow['title'];
310
+ if ( post_exists( $flow['title'] ) ) {
311
+ $flow_title = $flow['title'] . ' Copy';
312
+ }
313
+
314
+ // Create post object.
315
+ $new_flow_args = apply_filters(
316
+ 'cartflows_flow_importer_args',
317
+ array(
318
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
319
+ 'post_title' => $flow_title,
320
+ 'post_status' => 'publish',
321
+ )
322
+ );
323
+
324
+ // Insert the post into the database.
325
+ $flow_id = wp_insert_post( $new_flow_args );
326
+
327
+ /**
328
+ * Fire after flow import
329
+ *
330
+ * @since x.x.x
331
+ * @param int $flow_id Flow ID.
332
+ * @param array $new_flow_args Flow post args.
333
+ * @param array $flows Flow JSON data.
334
+ */
335
+ do_action( 'cartflows_flow_imported', $flow_id, $new_flow_args, $flows );
336
+
337
+ if ( $flow['steps'] ) {
338
+ foreach ( $flow['steps'] as $key => $step ) {
339
+
340
+ $new_all_meta = array();
341
+ if ( is_array( $step['meta'] ) ) {
342
+ foreach ( $step['meta'] as $meta_key => $mvalue ) {
343
+ $new_all_meta[ $meta_key ] = maybe_unserialize( $mvalue[0] );
344
+ }
345
+ }
346
+ $new_step_args = apply_filters(
347
+ 'cartflows_step_importer_args',
348
+ array(
349
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
350
+ 'post_title' => $step['title'],
351
+ 'post_status' => 'publish',
352
+ 'meta_input' => $new_all_meta,
353
+ 'post_content' => isset( $step['post_content'] ) ? $step['post_content'] : '',
354
+ )
355
+ );
356
+
357
+ $new_step_id = wp_insert_post( $new_step_args );
358
+
359
+ /**
360
+ * Fire after step import
361
+ *
362
+ * @since x.x.x
363
+ * @param int $new_step_id step ID.
364
+ * @param int $flow_id flow ID.
365
+ * @param array $new_step_args Step post args.
366
+ * @param array $flow_steps Flow steps.
367
+ * @param array $flows All flows JSON data.
368
+ */
369
+ do_action( 'cartflows_step_imported', $new_step_id, $flow_id, $new_step_args, $flow['steps'], $flows );
370
+
371
+ // Insert post meta.
372
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
373
+
374
+ $step_taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
375
+ $current_term = term_exists( $step['type'], $step_taxonomy );
376
+
377
+ // // Set type object.
378
+ $data = get_term( $current_term['term_id'], $step_taxonomy );
379
+ $step_slug = $data->slug;
380
+ wp_set_object_terms( $new_step_id, $data->slug, $step_taxonomy );
381
+
382
+ // Set type.
383
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
384
+
385
+ // Set flow.
386
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
387
+
388
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step['title'], $step_slug );
389
+
390
+ if ( isset( $step['post_content'] ) && ! empty( $step['post_content'] ) ) {
391
+
392
+ // Download and replace images.
393
+ $content = $this->get_content( $step['post_content'] );
394
+
395
+ // Update post content.
396
+ wp_update_post(
397
+ array(
398
+ 'ID' => $new_step_id,
399
+ 'post_content' => $content,
400
+ )
401
+ );
402
+ }
403
+
404
+ // Elementor Data.
405
+ if ( ( 'elementor' === $default_page_builder ) && class_exists( '\Elementor\Plugin' ) ) {
406
+ // Add "elementor" in import [queue].
407
+ // @todo Remove required `allow_url_fopen` support.
408
+ if ( ini_get( 'allow_url_fopen' ) && isset( $step['meta']['_elementor_data'] ) ) {
409
+ $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
410
+ $obj->import_single_template( $new_step_id );
411
+ }
412
+ }
413
+
414
+ // Beaver Builder.
415
+ if ( ( 'beaver-builder' === $default_page_builder ) && class_exists( 'FLBuilder' ) ) {
416
+ if ( isset( $step['meta']['_fl_builder_data'] ) ) {
417
+ CartFlows_Importer_Beaver_Builder::get_instance()->import_single_post( $new_step_id );
418
+ }
419
+ }
420
+ }
421
+ }
422
+ }
423
+ }
424
+ }
425
+
426
+ /**
427
+ * Download and Replace hotlink images
428
+ *
429
+ * @since x.x.x
430
+ *
431
+ * @param string $content Mixed post content.
432
+ * @return array Hotlink image array.
433
+ */
434
+ public function get_content( $content = '' ) {
435
+
436
+ $content = stripslashes( $content );
437
+
438
+ // Extract all links.
439
+ $all_links = wp_extract_urls( $content );
440
+
441
+ // Not have any link.
442
+ if ( empty( $all_links ) ) {
443
+ return $content;
444
+ }
445
+
446
+ $link_mapping = array();
447
+ $image_links = array();
448
+ $other_links = array();
449
+
450
+ // Extract normal and image links.
451
+ foreach ( $all_links as $key => $link ) {
452
+ if ( preg_match( '/^((https?:\/\/)|(www\.))([a-z0-9-].?)+(:[0-9]+)?\/[\w\-]+\.(jpg|png|gif|jpeg)\/?$/i', $link ) ) {
453
+
454
+ // Get all image links.
455
+ // Avoid *-150x, *-300x and *-1024x images.
456
+ if (
457
+ false === strpos( $link, '-150x' ) &&
458
+ false === strpos( $link, '-300x' ) &&
459
+ false === strpos( $link, '-1024x' )
460
+ ) {
461
+ $image_links[] = $link;
462
+ }
463
+ } else {
464
+
465
+ // Collect other links.
466
+ $other_links[] = $link;
467
+ }
468
+ }
469
+
470
+ // Step 1: Download images.
471
+ if ( ! empty( $image_links ) ) {
472
+ foreach ( $image_links as $key => $image_url ) {
473
+ // Download remote image.
474
+ $image = array(
475
+ 'url' => $image_url,
476
+ 'id' => 0,
477
+ );
478
+ $downloaded_image = CartFlows_Import_Image::get_instance()->import( $image );
479
+
480
+ // Old and New image mapping links.
481
+ $link_mapping[ $image_url ] = $downloaded_image['url'];
482
+ }
483
+ }
484
+
485
+ // Step 3: Replace mapping links.
486
+ foreach ( $link_mapping as $old_url => $new_url ) {
487
+ $content = str_replace( $old_url, $new_url, $content );
488
+
489
+ // Replace the slashed URLs if any exist.
490
+ $old_url = str_replace( '/', '/\\', $old_url );
491
+ $new_url = str_replace( '/', '/\\', $new_url );
492
+ $content = str_replace( $old_url, $new_url, $content );
493
+ }
494
+
495
+ return $content;
496
+ }
497
+
498
+ /**
499
+ * Imported notice
500
+ *
501
+ * @since 1.1.4
502
+ */
503
+ public function imported_successfully() {
504
+ ?>
505
+ <div class="notice notice-success">
506
+ <p><?php esc_html_e( 'Successfully imported flows.', 'cartflows' ); ?></p>
507
+ </div>
508
+ <?php
509
+ }
510
+
511
+ /**
512
+ * Clear Cache.
513
+ *
514
+ * @since 1.0.0
515
+ */
516
+ public function clear_cache() {
517
+ // Clear 'Elementor' file cache.
518
+ if ( class_exists( '\Elementor\Plugin' ) ) {
519
+ \Elementor\Plugin::$instance->files_manager->clear_cache();
520
+ }
521
+ }
522
+
523
+ /**
524
+ * JS Templates
525
+ *
526
+ * @since 1.0.0
527
+ *
528
+ * @return void
529
+ */
530
+ public function js_templates() {
531
+
532
+ // Loading Templates.
533
+ ?>
534
+ <script type="text/template" id="tmpl-cartflows-step-loading">
535
+ <div class="template-message-block cartflows-step-loading">
536
+ <h2>
537
+ <span class="spinner"></span>
538
+ <?php esc_html_e( 'Loading Steps', 'cartflows' ); ?>
539
+ </h2>
540
+ <p class="description"><?php esc_html_e( 'Getting steps from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
541
+ </div>
542
+ </script>
543
+
544
+ <?php
545
+ // Search Templates.
546
+ ?>
547
+ <script type="text/template" id="tmpl-cartflows-searching-templates">
548
+ <div class="template-message-block cartflows-searching-templates">
549
+ <h2>
550
+ <span class="spinner"></span>
551
+ <?php esc_html_e( 'Searching Template..', 'cartflows' ); ?>
552
+ </h2>
553
+ <p class="description"><?php esc_html_e( 'Getting templates from the cloud. Please wait for the moment.', 'cartflows' ); ?></p>
554
+ </div>
555
+ </script>
556
+
557
+ <?php
558
+ // CartFlows Importing Template.
559
+ ?>
560
+ <script type="text/template" id="tmpl-cartflows-step-importing">
561
+ <div class="template-message-block cartflows-step-importing">
562
+ <h2><span class="spinner"></span> <?php esc_html_e( 'Importing..', 'cartflows' ); ?></h2>
563
+ </div>
564
+ </script>
565
+
566
+ <?php
567
+ // CartFlows Imported.
568
+ ?>
569
+ <script type="text/template" id="tmpl-cartflows-step-imported">
570
+ <div class="template-message-block cartflows-step-imported">
571
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
572
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span></p></div>
573
+ </script>
574
+
575
+ <?php
576
+ // No templates.
577
+ ?>
578
+ <script type="text/template" id="tmpl-cartflows-no-steps">
579
+ <div class="cartflows-no-steps">
580
+ <div class="template-message-block">
581
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
582
+ <p class="description"></p>
583
+ </div>
584
+ </div>
585
+ </script>
586
+
587
+ <?php
588
+ // No templates.
589
+ ?>
590
+ <script type="text/template" id="tmpl-cartflows-no-flows">
591
+ <div class="cartflows-no-flows">
592
+ <div class="template-message-block">
593
+ <h2><?php esc_html_e( 'Coming Soon!', 'cartflows' ); ?></h2>
594
+ <p class="description"></p>
595
+ </div>
596
+ </div>
597
+ </script>
598
+
599
+ <?php
600
+ // Error handling.
601
+ ?>
602
+ <script type="text/template" id="tmpl-templator-error">
603
+ <div class="notice notice-error"><p>{{ data }}</p></div>
604
+ </script>
605
+
606
+ <?php
607
+ // Redirect to Elementor.
608
+ ?>
609
+ <script type="text/template" id="tmpl-templator-redirect-to-elementor">
610
+ <div class="template-message-block templator-redirect-to-elementor">
611
+ <h2><span class="dashicons dashicons-yes"></span> <?php esc_html_e( 'Imported', 'cartflows' ); ?></h2>
612
+ <p class="description"><?php esc_html_e( 'Thanks for patience', 'cartflows' ); ?> <span class="dashicons dashicons-smiley"></span><br/><br/><?php esc_html_e( 'Redirecting to the Elementor edit window.', 'cartflows' ); ?> </p></div>
613
+ </script>
614
+
615
+ <?php
616
+ /**
617
+ * Responsive Buttons
618
+ */
619
+ ?>
620
+ <script type="text/template" id="tmpl-cartflows-responsive-view">
621
+ <span class="responsive-view">
622
+ <span class="actions">
623
+ <a class="desktop" href="#"><span data-view="desktop " class="active dashicons dashicons-desktop"></span></a>
624
+ <a class="tablet" href="#"><span data-view="tablet" class="dashicons dashicons-tablet"></span></a>
625
+ <a class="mobile" href="#"><span data-view="mobile" class="dashicons dashicons-smartphone"></span></a>
626
+ </span>
627
+ </span>
628
+ </script>
629
+
630
+ <?php
631
+ // Templates data.
632
+ ?>
633
+ <script type="text/template" id="tmpl-cartflows-flows-list">
634
+
635
+ <# console.log( data.items.length ) #>
636
+ <# console.log( data.items ) #>
637
+ <# if ( data.items.length ) { #>
638
+ <# for ( key in data.items ) { #>
639
+ <#
640
+ var flow_steps = [];
641
+ if( data.items[ key ].flow_steps ) {
642
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
643
+ return value['id'];
644
+ });
645
+ }
646
+ #>
647
+ <div class="inner">
648
+ <div class="template">
649
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
650
+ <div class="template-screenshot">
651
+ <# if( data.items[ key ].featured_image_url ) { #>
652
+ <img src="{{ data.items[ key ].featured_image_url }}" />
653
+ <# } else { #>
654
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
655
+ <# } #>
656
+ </div>
657
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
658
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
659
+ <# } #>
660
+ <# if( data.items[ key ].woo_required ) { #>
661
+ <div class="notice notice-info" style="width: auto;">
662
+ <p class="wcf-learn-how">
663
+ Install/Activate WooCommerce to use this template.
664
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
665
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
666
+ <i class="dashicons dashicons-external"></i>
667
+ </a>
668
+ </p>
669
+ </div>
670
+ <# } else { #>
671
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>flow={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
672
+ <# } #>
673
+
674
+ </span>
675
+ <div class="template-id-container">
676
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
677
+ <div class="template-actions">
678
+
679
+ <#
680
+ if( data.items[ key ].page_builder.slug ) {
681
+ required_plugin_group = data.items[ key ].page_builder.slug;
682
+ } else {
683
+ required_plugin_group = '';
684
+ }
685
+
686
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
687
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
688
+ } else {
689
+ import_btn_title = 'Import';
690
+ } #>
691
+
692
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
693
+ <# if( ! data.items[ key ].woo_required ) { #>
694
+ <a data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
695
+ <# } else { #>
696
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
697
+ <# } #>
698
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
699
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
700
+ <# } else { #>
701
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
702
+ <# } #>
703
+ </div>
704
+ </div>
705
+ </div>
706
+ </div>
707
+ <# } #>
708
+ <# } #>
709
+ </script>
710
+
711
+ <?php
712
+ // Empty Step.
713
+ ?>
714
+ <script type="text/template" id="tmpl-cartflows-create-blank-step">
715
+ <div class="inner">
716
+ <div class="template">
717
+ <span class="thumbnail site-preview cartflows-flow-preview">
718
+ <div class="template-screenshot">
719
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/start-scratch.jpg" />
720
+ </div>
721
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
722
+ </span>
723
+ <div class="template-id-container">
724
+ <h3 class="template-name"> Blank </h3>
725
+ <div class="template-actions">
726
+ <a href="#" class="button button-primary cartflows-step-import-blank"><?php esc_html_e( 'Create', 'cartflows' ); ?></a>
727
+ </div>
728
+ </div>
729
+ </div>
730
+ </div>
731
+ </script>
732
+
733
+ <?php
734
+ // Templates data.
735
+ ?>
736
+ <script type="text/template" id="tmpl-cartflows-steps-list">
737
+ <# if ( data.items.length ) { #>
738
+ <# for ( key in data.items ) { #>
739
+ <#
740
+ var flow_steps = [];
741
+ if( data.items[ key ].flow_steps ) {
742
+ flow_steps = data.items[ key ].flow_steps.map(function(value,index) {
743
+ return value['id'];
744
+ });
745
+ }
746
+ #>
747
+ <div class="inner">
748
+ <div class="template">
749
+ <span class="thumbnail site-preview cartflows-preview-flow-steps" data-flow-steps="{{ JSON.stringify( data.items[ key ].flow_steps ) }}" data-title="{{ data.items[ key ].title.rendered }}">
750
+ <div class="template-screenshot">
751
+ <# if( data.items[ key ].featured_image_url ) { #>
752
+ <img src="{{ data.items[ key ].featured_image_url }}" />
753
+ <# } else { #>
754
+ <img src="<?php echo esc_attr( CARTFLOWS_URL ); ?>assets/images/400x400.jpg" />
755
+ <# } #>
756
+ </div>
757
+ <div id="wcf_create_notice" class=""><a href="https://cartflows.com/" target="_blank"></a></div>
758
+
759
+ <# if( data.items[ key ].woo_required ) { #>
760
+ <div class="notice notice-info" style="width: auto;">
761
+ <p class="wcf-learn-how">
762
+ Install/Activate WooCommerce to use this template.
763
+ <a href="https://cartflows.com/docs/cartflows-step-types/" target="_blank">
764
+ <strong><?php esc_html_e( 'Learn How', 'cartflows' ); ?></strong>
765
+ <i class="dashicons dashicons-external"></i>
766
+ </a>
767
+ </p>
768
+ </div>
769
+ <# } else { #>
770
+ <a href="<?php echo CARTFLOWS_TEMPLATES_URL . 'preview/?'; ?>step={{ data.items[ key ].id }}&title={{{ data.items[ key ].title.rendered }}}" class="preview" target="_blank">Preview <i class="dashicons dashicons-external"></i></a>
771
+ <# } #>
772
+
773
+ <# if( data.items[ key ].flow_type && 'pro' === data.items[ key ].flow_type.slug ) { #>
774
+ <span class="wcf-flow-type pro"><?php esc_html_e( 'Pro', 'cartflows' ); ?></span>
775
+ <# } #>
776
+ </span>
777
+ <div class="template-id-container">
778
+ <h3 class="template-name"> {{{ data.items[ key ].title.rendered }}} </h3>
779
+ <div class="template-actions">
780
+
781
+ <#
782
+
783
+ var step_slug = data.items[ key ].step_type.slug || '';
784
+ var step_title = data.items[ key ].step_type.name || '';
785
+ var import_btn_title = 'Import';
786
+
787
+ var required_plugin_group = '';
788
+ if( data.items[ key ].page_builder ) {
789
+ required_plugin_group = data.items[ key ].page_builder.slug;
790
+
791
+ if( data.items[ key ].page_builder.slug && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug] && CartFlowsImportVars.required_plugins[data.items[ key ].page_builder.slug].button_title ) {
792
+ import_btn_title = CartFlowsImportVars.required_plugins[ data.items[ key ].page_builder.slug ].button_title;
793
+ }
794
+ }
795
+ #>
796
+
797
+ <# if( data.items[ key ].licence_status && 'valid' === data.items[ key ].licence_status ) { #>
798
+
799
+ <# if( ! data.items[ key ].woo_required ) { #>
800
+ <a data-slug="{{step_slug}}" data-title="{{step_title}}" data-flow-steps="{{ flow_steps }}" data-required-plugin-group="{{required_plugin_group}}" href="#" class="button button-primary cartflows-step-import" data-template-id="{{ data.items[ key ].id }}">{{ import_btn_title }}</a>
801
+ <# } else { #>
802
+ <a href='#' class='wcf-activate-wc button-primary'>Install & activate Woo</a>
803
+ <# } #>
804
+
805
+ <# } else if( CartFlowsImportVars._is_pro_active ) { #>
806
+ <a target="_blank" href="<?php echo esc_url( admin_url( 'plugins.php?cartflows-license-popup' ) ); ?>" class="button button-primary"><?php esc_html_e( 'Activate License', 'cartflows' ); ?></a>
807
+ <# } else { #>
808
+ <a target="_blank" href="<?php echo esc_url( CARTFLOWS_DOMAIN_URL ); ?>" class="button button-primary"><?php esc_html_e( 'Get Pro', 'cartflows' ); ?></a>
809
+ <# } #>
810
+ </div>
811
+ </div>
812
+ </div>
813
+ </div>
814
+ <# } #>
815
+ <# } #>
816
+ </script>
817
+
818
+ <?php
819
+ /**
820
+ * TMPL - Website Unreachable
821
+ */
822
+ ?>
823
+ <script type="text/template" id="tmpl-cartflows-website-unreachable">
824
+ <div class="postbox cartflows-website-unreachable">
825
+ <h2><?php esc_html_e( 'Under Maintenance..', 'cartflows' ); ?></h2>
826
+ <p><?php esc_html_e( 'If you are seeing this message, most likely our servers are under routine maintenance and we will be back shortly.', 'cartflows' ); ?></p>
827
+ <p><?php esc_html_e( 'In rare case, it is possible your website is having trouble connecting with ours. If you need help, please feel free to get in touch with us from our website..', 'cartflows' ); ?></p>
828
+ </div>
829
+ </script>
830
+
831
+ <?php
832
+ /**
833
+ * TMPL - Filters
834
+ */
835
+ ?>
836
+ <script type="text/template" id="tmpl-cartflows-page-builder-notice">
837
+ <?php
838
+ $default_page_builder = Cartflows_Helper::get_common_setting( 'default_page_builder' );
839
+ $page_builder = Cartflows_Helper::get_required_plugins_for_page_builder( Cartflows_Helper::get_common_setting( 'default_page_builder' ) );
840
+ $title = $page_builder['title'];
841
+
842
+ $plugin_string = '<a href="#" data-slug="' . esc_html( $default_page_builder ) . '" class="wcf-install-plugin">Please click here and activate ' . esc_html( $title ) . '</a>';
843
+ $theme_status = '';
844
+ if ( 'divi' === $default_page_builder ) {
845
+
846
+ $theme_status = $page_builder['theme-status'];
847
+ $plugin_status = $page_builder['plugin-status'];
848
+
849
+ if ( 'deactivate' === $theme_status || 'install' === $plugin_status ) {
850
+ $plugin_string = 'Please activate ' . esc_html( $title );
851
+ } elseif ( ( 'deactivate' === $theme_status || 'not-installed' === $theme_status ) && 'install' === $plugin_status ) {
852
+ $plugin_string = 'Please install and activate ' . esc_html( $title );
853
+ }
854
+ }
855
+ ?>
856
+ <div class="wcf-page-builder-message">
857
+ <p><?php /* translators: %s: Plugin string */ printf( __( '%1$s to see CartFlows templates. If you prefer another page builder tool, you can <a href="%2$s" target="blank">select it here</a>.', 'cartflows' ), $plugin_string, admin_url( 'admin.php?page=' . CARTFLOWS_SETTINGS . '&action=common-settings#form-field-wcf_default_page_builder' ) ); ?></p>
858
+ <p>If your preferred page builder is not available, feel free to <a href="#" data-slug="canvas" class="wcf-create-from-scratch-link">create your own</a> pages using page builder of your choice as CartFlows works with all major page builders.</p>
859
+ <p>We plan to add design templates made with more page builder shortly!</p>
860
+ </div>
861
+ </script>
862
+
863
+ <?php
864
+ /**
865
+ * TMPL - Filters
866
+ */
867
+ ?>
868
+ <script type="text/template" id="tmpl-cartflows-term-filters-dropdown">
869
+ <# if ( data ) { #>
870
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
871
+ <# if ( data.args.show_all ) { #>
872
+ <option value="all"> <?php esc_html_e( 'All', 'cartflows' ); ?> </option>
873
+ <# } #>
874
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
875
+ <option value=""> <?php esc_html_e( 'Select Step Type', 'cartflows' ); ?> </option>
876
+ <# } #>
877
+ <# var step_slug_data = []; #>
878
+ <# for ( key in data.items ) { #>
879
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
880
+
881
+ <# step_slug_data.push( data.items[ key ].slug ); #>
882
+
883
+ <# } #>
884
+ <# if( step_slug_data.indexOf("optin") === -1){ #>
885
+ <option value='0' data-group='0' class="Optin (Woo)" data-slug="optin" data-title="Optin (Woo)">Optin (Woo)</option>
886
+ <# } #>
887
+ </select>
888
+ <# } #>
889
+ </script>
890
+
891
+ <script type="text/template" id="tmpl-cartflows-term-filters">
892
+
893
+ <# if ( data ) { #>
894
+
895
+ <?php /* <# if ( CartFlowsImportVars.flow_page_builder === data.args.remote_slug || CartFlowsImportVars.step_page_builder === data.args.remote_slug ) { #> */ ?>
896
+ <ul class="{{ data.args.wrapper_class }} {{ data.args.class }}">
897
+
898
+ <# if ( data.args.show_all ) { #>
899
+ <li>
900
+ <a href="#" data-group="all"> All </a>
901
+ </li>
902
+ <# } #>
903
+
904
+ <# for ( key in data.items ) { #>
905
+ <li>
906
+ <a href="#" data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</a>
907
+ </li>
908
+ <# } #>
909
+
910
+ </ul>
911
+
912
+ <?php
913
+
914
+ /**
915
+ <# } else { #>
916
+ <select class="{{ data.args.wrapper_class }} {{ data.args.class }}">
917
+
918
+ <# if ( data.args.show_all ) { #>
919
+ <option value="all"> <?php _e( 'All', 'cartflows' ); ?> </option>
920
+ <# } #>
921
+
922
+ <# if ( CartFlowsImportVars.step_type === data.args.remote_slug ) { #>
923
+ <option value=""> <?php _e( 'Select Step Type', 'cartflows' ); ?> </option>
924
+ <# } #>
925
+
926
+ <# for ( key in data.items ) { #>
927
+ <option value='{{ data.items[ key ].id }}' data-group='{{ data.items[ key ].id }}' class="{{ data.items[ key ].name }}" data-slug="{{ data.items[ key ].slug }}" data-title="{{ data.items[ key ].name }}">{{ data.items[ key ].name }}</option>
928
+ <# } #>
929
+
930
+ </select>
931
+ */
932
+ ?>
933
+
934
+ <?php /* <# } #> */ ?>
935
+
936
+ <# } #>
937
+ </script>
938
+
939
+ <?php
940
+ // Step Type.
941
+ ?>
942
+ <script type="text/template" id="tmpl-cartflows-step-types">
943
+ <ul class="wcf-tab nav-tabs">
944
+ <# if( data.items_count ) { #>
945
+ <# for( key in data.items ) { #>
946
+ <# console.log( data.items[ key ].id ) #>
947
+ <li data-slug="{{data.items[ key ].slug}}" data-title="{{ data.items[ key ].name }}">
948
+ <a href="#{{{ data.items[ key ].slug }}}">{{{ data.items[ key ].name }}}</a>
949
+ </li>
950
+ <# } #>
951
+ <# } #>
952
+ </ul>
953
+ </script>
954
+
955
+ <?php
956
+ // Add to library button.
957
+ ?>
958
+ <script type="text/template" id="tmpl-templator-add-to-library">
959
+ <a class="templator-add-to-library page-title-action cartflows-load-steps-library"><i class="dashicons dashicons-cloud"></i><?php esc_attr_e( 'Import from Cloud', 'cartflows' ); ?></a>
960
+ </script>
961
+ <?php
962
+ }
963
+
964
+ /**
965
+ * Enqueue scripts
966
+ *
967
+ * @since 1.0.0
968
+ *
969
+ * @hook admin_enqueue_scripts
970
+ * @param string $hook Current page hook.
971
+ */
972
+ public function scripts( $hook = '' ) {
973
+
974
+ if ( ! self::is_supported_post( get_current_screen()->post_type ) ) {
975
+ return;
976
+ }
977
+
978
+ wp_enqueue_script( 'cartflows-rest-api', CARTFLOWS_URL . 'assets/js/rest-api.js', array( 'jquery' ), CARTFLOWS_VER, true );
979
+ wp_enqueue_style( 'cartflows-import', CARTFLOWS_URL . 'assets/css/import.css', null, CARTFLOWS_VER, 'all' );
980
+ wp_style_add_data( 'cartflows-import', 'rtl', 'replace' );
981
+ wp_enqueue_script( 'cartflows-import', CARTFLOWS_URL . 'assets/js/import.js', array( 'jquery', 'wp-util', 'cartflows-rest-api', 'updates' ), CARTFLOWS_VER, true );
982
+
983
+ $installed_plugins = get_plugins();
984
+ $is_wc_installed = isset( $installed_plugins['woocommerce/woocommerce.php'] ) ? 'yes' : 'no';
985
+ $is_wc_activated = wcf()->is_woo_active ? 'yes' : 'no';
986
+
987
+ $localize_vars = array(
988
+ '_is_pro_active' => _is_cartflows_pro(),
989
+ 'is_wc_installed' => $is_wc_installed,
990
+ 'is_wc_activated' => $is_wc_activated,
991
+
992
+ // Set API headers for the CartFlows API Calls only.
993
+ 'headers' => array(),
994
+
995
+ // Flow and its rest fields.
996
+ 'flow' => CARTFLOWS_FLOW_POST_TYPE,
997
+ 'flow_fields' => array(
998
+ 'id',
999
+ 'title',
1000
+ 'flow_type',
1001
+ 'page_builder',
1002
+ 'flow_steps',
1003
+ 'licence_status',
1004
+ 'featured_image_url',
1005
+ 'featured_media', // @required for field `featured_image_url`.
1006
+ ),
1007
+
1008
+ // Flow type and rest fields.
1009
+ 'flow_type' => CARTFLOWS_TAXONOMY_FLOW_CATEGORY,
1010
+ 'flow_type_fields' => array(
1011
+ 'id',
1012
+ 'name',
1013
+ 'slug',
1014
+ ),
1015
+
1016
+ // Flow page builder and rest fields.
1017
+ 'flow_page_builder' => CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER,
1018
+ 'flow_page_builder_fields' => array(
1019
+ 'id',
1020
+ 'name',
1021
+ 'slug',
1022
+ ),
1023
+
1024
+ // Step page builder and rest fields.
1025
+ 'step_page_builder' => CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER,
1026
+ 'step_page_builder_fields' => array(
1027
+ 'id',
1028
+ 'name',
1029
+ 'slug',
1030
+ ),
1031
+
1032
+ // Step and its rest fields.
1033
+ 'step' => CARTFLOWS_STEP_POST_TYPE,
1034
+ 'step_fields' => array(
1035
+ 'title',
1036
+ 'featured_image_url',
1037
+ 'featured_media', // @required for field `featured_image_url`.
1038
+ 'id',
1039
+ 'flow_type',
1040
+ 'step_type',
1041
+ 'page_builder',
1042
+ 'licence_status',
1043
+ ),
1044
+
1045
+ // Step type and its rest fields.
1046
+ 'step_type' => CARTFLOWS_TAXONOMY_STEP_TYPE,
1047
+ 'step_type_fields' => array(
1048
+ 'id',
1049
+ 'name',
1050
+ 'slug',
1051
+ ),
1052
+
1053
+ 'domain_url' => CARTFLOWS_DOMAIN_URL,
1054
+ 'server_url' => CARTFLOWS_TEMPLATES_URL,
1055
+ 'server_rest_url' => CARTFLOWS_TEMPLATES_URL . 'wp-json/wp/v2/',
1056
+ 'site_url' => site_url(),
1057
+ 'import_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_importer' ),
1058
+ 'export_url' => admin_url( 'edit.php?post_type=' . CARTFLOWS_FLOW_POST_TYPE . '&page=flow_exporter' ),
1059
+ 'admin_url' => admin_url(),
1060
+ 'licence_args' => CartFlows_API::get_instance()->get_licence_args(),
1061
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
1062
+ 'debug' => ( ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || isset( $_GET['debug'] ) ) ? true : false, //phpcs:ignore
1063
+
1064
+ 'required_plugins' => Cartflows_Helper::get_plugins_groupby_page_builders(),
1065
+
1066
+ 'default_page_builder' => Cartflows_Helper::get_common_setting( 'default_page_builder' ),
1067
+ );
1068
+
1069
+ $localize_vars['cartflows_activate_plugin_nonce'] = wp_create_nonce( 'cartflows_activate_plugin' );
1070
+
1071
+ // var_dump(Cartflows_Helper::get_common_setting( 'default_page_builder' ));
1072
+ // wp_die( );
1073
+ // Add thickbox.
1074
+ add_thickbox();
1075
+
1076
+ wp_localize_script( 'cartflows-import', 'CartFlowsImportVars', $localize_vars );
1077
+ wp_localize_script( 'cartflows-rest-api', 'CartFlowsImportVars', $localize_vars );
1078
+ }
1079
+
1080
+ /**
1081
+ * Import.
1082
+ *
1083
+ * @since 1.0.0
1084
+ *
1085
+ * @hook wp_ajax_cartflows_import_flow_step
1086
+ * @return void
1087
+ */
1088
+ public function import_flow() {
1089
+
1090
+ if ( ! current_user_can( 'manage_options' ) ) {
1091
+ return;
1092
+ }
1093
+
1094
+ check_ajax_referer( 'cf-import-flow-step', 'security' );
1095
+
1096
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1097
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1098
+
1099
+ wcf()->logger->import_log( '------------------------------------' );
1100
+ wcf()->logger->import_log( 'STARTED! Importing FLOW' );
1101
+ wcf()->logger->import_log( '------------------------------------' );
1102
+ wcf()->logger->import_log( '(✓) Creating new step from remote step [' . $template_id . '] for FLOW ' . get_the_title( $flow_id ) . ' [' . $flow_id . ']' );
1103
+
1104
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1105
+
1106
+ $post_content = isset( $response['data']['content']->rendered ) ? $response['data']['content']->rendered : '';
1107
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1108
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1109
+ $post_content = $response['data']['divi_content'];
1110
+ }
1111
+ }
1112
+
1113
+ if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1114
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1115
+ $post_content = $response['data']['divi_content'];
1116
+ }
1117
+ }
1118
+
1119
+ if ( false === $response['success'] ) {
1120
+ wcf()->logger->import_log( '(✕) Failed to fetch remote data.' );
1121
+ wp_send_json_error( $response );
1122
+ }
1123
+
1124
+ wcf()->logger->import_log( '(✓) Successfully getting remote step response ' . wp_json_encode( $response ) );
1125
+
1126
+ $new_step_id = wp_insert_post(
1127
+ array(
1128
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1129
+ 'post_title' => $response['title'],
1130
+ 'post_content' => $post_content,
1131
+ 'post_status' => 'publish',
1132
+ )
1133
+ );
1134
+
1135
+ if ( is_wp_error( $new_step_id ) ) {
1136
+ wcf()->logger->import_log( '(✕) Failed to create new step for flow ' . $flow_id );
1137
+ wp_send_json_error( $new_step_id );
1138
+ }
1139
+
1140
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1141
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1142
+ update_post_meta( $new_step_id, 'divi_content', $response['data']['divi_content'] );
1143
+ }
1144
+ }
1145
+
1146
+ /* Imported Step */
1147
+ update_post_meta( $new_step_id, 'cartflows_imported_step', 'yes' );
1148
+
1149
+ wcf()->logger->import_log( '(✓) Created new step ' . '"' . $response['title'] . '" id ' . $new_step_id );//phpcs:ignore
1150
+ // insert post meta.
1151
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1152
+ wcf()->logger->import_log( '(✓) Added flow ID ' . $flow_id . ' in post meta key wcf-flow-id.' );
1153
+
1154
+ /**
1155
+ * Import & Set type.
1156
+ */
1157
+ $term = isset( $response['data']['step_type'] ) ? $response['data']['step_type'] : '';
1158
+
1159
+ $term_slug = '';
1160
+ if ( $term ) {
1161
+
1162
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1163
+ $term_exist = term_exists( $term->slug, $taxonomy );
1164
+
1165
+ if ( empty( $term_exist ) ) {
1166
+ $terms = array(
1167
+ array(
1168
+ 'name' => $term->name,
1169
+ 'slug' => $term->slug,
1170
+ ),
1171
+ );
1172
+
1173
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1174
+ wcf()->logger->import_log( '(✓) Created new term name ' . $term->name . ' | term slug ' . $term->slug );
1175
+ }
1176
+
1177
+ $current_term = term_exists( $term->slug, $taxonomy );
1178
+
1179
+ // Set type object.
1180
+ $data = get_term( $current_term['term_id'], $taxonomy );
1181
+ $term_slug = $data->slug;
1182
+ $term_name = $data->name;
1183
+ wp_set_object_terms( $new_step_id, $term_slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1184
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $term_name . ' to the template ' . $new_step_id );
1185
+
1186
+ // Set type.
1187
+ update_post_meta( $new_step_id, 'wcf-step-type', $term_slug );
1188
+ wcf()->logger->import_log( '(✓) Updated term ' . $term_name . ' to the post meta wcf-step-type.' );
1189
+ }
1190
+
1191
+ // Set flow.
1192
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1193
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1194
+
1195
+ /**
1196
+ * Update steps for the current flow.
1197
+ */
1198
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1199
+
1200
+ if ( ! is_array( $flow_steps ) ) {
1201
+ $flow_steps = array();
1202
+ }
1203
+
1204
+ $flow_steps[] = array(
1205
+ 'id' => $new_step_id,
1206
+ 'title' => $response['title'],
1207
+ 'type' => $term_slug,
1208
+ );
1209
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1210
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1211
+
1212
+ // Import Post Meta.
1213
+ self::import_post_meta( $new_step_id, $response );
1214
+
1215
+ wcf()->logger->import_log( '(✓) Importing step "' . get_the_title( $new_step_id ) . '" [' . $new_step_id . '] for FLOW "' . get_the_title( $flow_id ) . '" [' . $flow_id . ']' );
1216
+ wcf()->logger->import_log( '------------------------------------' );
1217
+ wcf()->logger->import_log( 'COMPLETE! Importing FLOW' );
1218
+ wcf()->logger->import_log( '------------------------------------' );
1219
+
1220
+ do_action( 'cartflows_import_complete' );
1221
+ wcf()->logger->import_log( '(✓) BATCH STARTED for step ' . $new_step_id . ' for Blog name \'' . get_bloginfo( 'name' ) . '\' (' . get_current_blog_id() . ')' );
1222
+
1223
+ // Batch Process.
1224
+ do_action( 'cartflows_after_template_import', $new_step_id, $response );
1225
+
1226
+ /**
1227
+ * End
1228
+ */
1229
+ wp_send_json_success( $new_step_id );
1230
+ }
1231
+
1232
+ /**
1233
+ * Import Step.
1234
+ *
1235
+ * @since 1.0.0
1236
+ * @hook wp_ajax_cartflows_step_import
1237
+ *
1238
+ * @return void
1239
+ */
1240
+ public function create_default_flow() {
1241
+
1242
+ if ( ! current_user_can( 'manage_options' ) ) {
1243
+ return;
1244
+ }
1245
+
1246
+ check_ajax_referer( 'cf-default-flow', 'security' );
1247
+
1248
+ // Create post object.
1249
+ $new_flow_post = array(
1250
+ 'post_content' => '',
1251
+ 'post_status' => 'publish',
1252
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1253
+ );
1254
+
1255
+ // Insert the post into the database.
1256
+ $flow_id = wp_insert_post( $new_flow_post );
1257
+
1258
+ if ( is_wp_error( $flow_id ) ) {
1259
+ wp_send_json_error( $flow_id->get_error_message() );
1260
+ }
1261
+
1262
+ $flow_steps = array();
1263
+
1264
+ if ( wcf()->is_woo_active ) {
1265
+ $steps_data = array(
1266
+ 'sales' => array(
1267
+ 'title' => __( 'Sales Landing', 'cartflows' ),
1268
+ 'type' => 'landing',
1269
+ ),
1270
+ 'order-form' => array(
1271
+ 'title' => __( 'Checkout (Woo)', 'cartflows' ),
1272
+ 'type' => 'checkout',
1273
+ ),
1274
+ 'order-confirmation' => array(
1275
+ 'title' => __( 'Thank You (Woo)', 'cartflows' ),
1276
+ 'type' => 'thankyou',
1277
+ ),
1278
+ );
1279
+
1280
+ } else {
1281
+ $steps_data = array(
1282
+ 'landing' => array(
1283
+ 'title' => __( 'Landing', 'cartflows' ),
1284
+ 'type' => 'landing',
1285
+ ),
1286
+ 'thankyou' => array(
1287
+ 'title' => __( 'Thank You', 'cartflows' ),
1288
+ 'type' => 'landing',
1289
+ ),
1290
+ );
1291
+ }
1292
+
1293
+ foreach ( $steps_data as $slug => $data ) {
1294
+
1295
+ $post_content = '';
1296
+ $step_type = trim( $data['type'] );
1297
+
1298
+ $step_id = wp_insert_post(
1299
+ array(
1300
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1301
+ 'post_title' => $data['title'],
1302
+ 'post_content' => $post_content,
1303
+ 'post_status' => 'publish',
1304
+ )
1305
+ );
1306
+
1307
+ if ( is_wp_error( $step_id ) ) {
1308
+ wp_send_json_error( $step_id->get_error_message() );
1309
+ }
1310
+
1311
+ if ( $step_id ) {
1312
+
1313
+ $flow_steps[] = array(
1314
+ 'id' => $step_id,
1315
+ 'title' => $data['title'],
1316
+ 'type' => $step_type,
1317
+ );
1318
+
1319
+ // insert post meta.
1320
+ update_post_meta( $step_id, 'wcf-flow-id', $flow_id );
1321
+ update_post_meta( $step_id, 'wcf-step-type', $step_type );
1322
+
1323
+ wp_set_object_terms( $step_id, $step_type, CARTFLOWS_TAXONOMY_STEP_TYPE );
1324
+ wp_set_object_terms( $step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1325
+
1326
+ update_post_meta( $step_id, '_wp_page_template', 'cartflows-default' );
1327
+ }
1328
+ }
1329
+
1330
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1331
+
1332
+ wp_send_json_success( $flow_id );
1333
+ }
1334
+
1335
+ /**
1336
+ * Create Flow
1337
+ *
1338
+ * @return void
1339
+ */
1340
+ public function create_flow() {
1341
+
1342
+ if ( ! current_user_can( 'manage_options' ) ) {
1343
+ return;
1344
+ }
1345
+
1346
+ check_ajax_referer( 'cf-create-flow', 'security' );
1347
+
1348
+ // Create post object.
1349
+ $new_flow_post = array(
1350
+ 'post_content' => '',
1351
+ 'post_status' => 'publish',
1352
+ 'post_type' => CARTFLOWS_FLOW_POST_TYPE,
1353
+ );
1354
+
1355
+ // Insert the post into the database.
1356
+ $flow_id = wp_insert_post( $new_flow_post );
1357
+
1358
+ if ( is_wp_error( $flow_id ) ) {
1359
+ wp_send_json_error( $flow_id->get_error_message() );
1360
+ }
1361
+
1362
+ /* Imported Flow */
1363
+ update_post_meta( $flow_id, 'cartflows_imported_flow', 'yes' );
1364
+
1365
+ wp_send_json_success( $flow_id );
1366
+ }
1367
+
1368
+ /**
1369
+ * Create Step
1370
+ *
1371
+ * @return void
1372
+ */
1373
+ public function import_step() {
1374
+
1375
+ if ( ! current_user_can( 'manage_options' ) ) {
1376
+ return;
1377
+ }
1378
+
1379
+ check_ajax_referer( 'cf-step-import', 'security' );
1380
+
1381
+ $template_id = isset( $_POST['template_id'] ) ? intval( $_POST['template_id'] ) : '';
1382
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1383
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1384
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_title( wp_unslash( $_POST['step_type'] ) ) : '';
1385
+ $step_custom_title = isset( $_POST['step_custom_title'] ) ? sanitize_title( wp_unslash( $_POST['step_custom_title'] ) ) : $step_title;
1386
+
1387
+ $cartflow_meta = Cartflows_Flow_Meta::get_instance();
1388
+
1389
+ $post_id = $cartflow_meta->create_step( $flow_id, $step_type, $step_custom_title );
1390
+
1391
+ wcf()->logger->import_log( '------------------------------------' );
1392
+ wcf()->logger->import_log( 'STARTED! Importing STEP' );
1393
+ wcf()->logger->import_log( '------------------------------------' );
1394
+
1395
+ if ( empty( $template_id ) || empty( $post_id ) ) {
1396
+ /* translators: %s: template ID */
1397
+ $data = sprintf( __( 'Invalid template id %1$s or post id %2$s.', 'cartflows' ), $template_id, $post_id );
1398
+ wcf()->logger->import_log( $data );
1399
+ wp_send_json_error( $data );
1400
+ }
1401
+
1402
+ wcf()->logger->import_log( 'Remote Step ' . $template_id . ' for local flow "' . get_the_title( $post_id ) . '" [' . $post_id . ']' );
1403
+
1404
+ $response = CartFlows_API::get_instance()->get_template( $template_id );
1405
+
1406
+ if ( 'divi' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1407
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1408
+
1409
+ update_post_meta( $post_id, 'divi_content', $response['data']['divi_content'] );
1410
+
1411
+ wp_update_post(
1412
+ array(
1413
+ 'ID' => $post_id,
1414
+ 'post_content' => $response['data']['divi_content'],
1415
+ )
1416
+ );
1417
+ }
1418
+ }
1419
+
1420
+ if ( 'gutenberg' === Cartflows_Helper::get_common_setting( 'default_page_builder' ) ) {
1421
+ if ( isset( $response['data']['divi_content'] ) && ! empty( $response['data']['divi_content'] ) ) {
1422
+
1423
+ wp_update_post(
1424
+ array(
1425
+ 'ID' => $post_id,
1426
+ 'post_content' => $response['data']['divi_content'],
1427
+ )
1428
+ );
1429
+ }
1430
+ }
1431
+
1432
+ /* Imported Step */
1433
+ update_post_meta( $post_id, 'cartflows_imported_step', 'yes' );
1434
+
1435
+ // Import Post Meta.
1436
+ self::import_post_meta( $post_id, $response );
1437
+
1438
+ do_action( 'cartflows_import_complete' );
1439
+
1440
+ // Batch Process.
1441
+ do_action( 'cartflows_after_template_import', $post_id, $response );
1442
+
1443
+ wcf()->logger->import_log( '------------------------------------' );
1444
+ wcf()->logger->import_log( 'COMPLETE! Importing Step' );
1445
+ wcf()->logger->import_log( '------------------------------------' );
1446
+
1447
+ wp_send_json_success( $post_id );
1448
+ }
1449
+
1450
+ /**
1451
+ * Import Step.
1452
+ *
1453
+ * @since 1.0.0
1454
+ * @hook wp_ajax_cartflows_step_create_blank
1455
+ *
1456
+ * @return void
1457
+ */
1458
+ public function step_create_blank() {
1459
+
1460
+ if ( ! current_user_can( 'manage_options' ) ) {
1461
+ return;
1462
+ }
1463
+
1464
+ check_ajax_referer( 'cf-step-create-blank', 'security' );
1465
+
1466
+ $flow_id = isset( $_POST['flow_id'] ) ? intval( $_POST['flow_id'] ) : '';
1467
+ $step_type = isset( $_POST['step_type'] ) ? sanitize_text_field( wp_unslash( $_POST['step_type'] ) ) : '';
1468
+ $step_title = isset( $_POST['step_title'] ) ? sanitize_text_field( wp_unslash( $_POST['step_title'] ) ) : '';
1469
+
1470
+ if ( empty( $flow_id ) || empty( $step_type ) ) {
1471
+ /* translators: %s: flow ID */
1472
+ $data = sprintf( __( 'Invalid flow id %1$s OR step type %2$s.', 'cartflows' ), $flow_id, $step_type );
1473
+ wcf()->logger->import_log( $data );
1474
+ wp_send_json_error( $data );
1475
+ }
1476
+
1477
+ wcf()->logger->import_log( '------------------------------------' );
1478
+ wcf()->logger->import_log( 'STARTED! Creating Blank STEP for Flow ' . $flow_id );
1479
+
1480
+ $step_type_title = str_replace( '-', ' ', $step_type );
1481
+ $step_type_slug = strtolower( str_replace( '-', ' ', $step_type ) );
1482
+
1483
+ $new_step_id = wp_insert_post(
1484
+ array(
1485
+ 'post_type' => CARTFLOWS_STEP_POST_TYPE,
1486
+ 'post_title' => $step_title,
1487
+ 'post_content' => '',
1488
+ 'post_status' => 'publish',
1489
+ )
1490
+ );
1491
+
1492
+ // insert post meta.
1493
+ update_post_meta( $new_step_id, 'wcf-flow-id', $flow_id );
1494
+
1495
+ $taxonomy = CARTFLOWS_TAXONOMY_STEP_TYPE;
1496
+ $term_exist = term_exists( $step_type_slug, $taxonomy );
1497
+
1498
+ if ( empty( $term_exist ) ) {
1499
+ $terms = array(
1500
+ array(
1501
+ 'name' => $step_type_title,
1502
+ 'slug' => $step_type_slug,
1503
+ ),
1504
+ );
1505
+
1506
+ Cartflows_Step_Post_Type::get_instance()->add_terms( $taxonomy, $terms );
1507
+ wcf()->logger->import_log( '(✓) Created new term name ' . $step_type_title . ' | term slug ' . $step_type_slug );
1508
+ }
1509
+
1510
+ $current_term = term_exists( $step_type_slug, $taxonomy );
1511
+
1512
+ // Set type object.
1513
+ $data = get_term( $current_term['term_id'], $taxonomy );
1514
+ $step_slug = $data->slug;
1515
+ wp_set_object_terms( $new_step_id, $data->slug, CARTFLOWS_TAXONOMY_STEP_TYPE );
1516
+ wcf()->logger->import_log( '(✓) Assigned existing term ' . $step_type_title . ' to the template ' . $new_step_id );
1517
+
1518
+ // Set Default page Layout.
1519
+ update_post_meta( $new_step_id, '_wp_page_template', 'cartflows-default' );
1520
+
1521
+ // Set type.
1522
+ update_post_meta( $new_step_id, 'wcf-step-type', $data->slug );
1523
+ wcf()->logger->import_log( '(✓) Updated term ' . $data->name . ' to the post meta wcf-step-type.' );
1524
+
1525
+ // Set flow.
1526
+ wp_set_object_terms( $new_step_id, 'flow-' . $flow_id, CARTFLOWS_TAXONOMY_STEP_FLOW );
1527
+ wcf()->logger->import_log( '(✓) Assigned flow step flow-' . $flow_id );
1528
+
1529
+ self::get_instance()->set_step_to_flow( $flow_id, $new_step_id, $step_type_title, $step_slug );
1530
+
1531
+ wcf()->logger->import_log( 'COMPLETE! Creating Blank STEP for Flow ' . $flow_id );
1532
+ wcf()->logger->import_log( '------------------------------------' );
1533
+
1534
+ wp_send_json_success( $new_step_id );
1535
+ }
1536
+
1537
+ /**
1538
+ * Import Post Meta
1539
+ *
1540
+ * @since 1.0.0
1541
+ *
1542
+ * @param integer $post_id Post ID.
1543
+ * @param array $response Post meta.
1544
+ * @return void
1545
+ */
1546
+ public static function import_post_meta( $post_id, $response ) {
1547
+
1548
+ $metadata = (array) $response['post_meta'];
1549
+
1550
+ foreach ( $metadata as $meta_key => $meta_value ) {
1551
+ $meta_value = isset( $meta_value[0] ) ? $meta_value[0] : '';
1552
+
1553
+ if ( $meta_value ) {
1554
+
1555
+ if ( is_serialized( $meta_value, true ) ) {
1556
+ $raw_data = maybe_unserialize( stripslashes( $meta_value ) );
1557
+ } elseif ( is_array( $meta_value ) ) {
1558
+ $raw_data = json_decode( stripslashes( $meta_value ), true );
1559
+ } else {
1560
+ $raw_data = $meta_value;
1561
+ }
1562
+
1563
+ if ( '_elementor_data' === $meta_key ) {
1564
+ if ( is_array( $raw_data ) ) {
1565
+ $raw_data = wp_slash( wp_json_encode( $raw_data ) );
1566
+ } else {
1567
+ $raw_data = wp_slash( $raw_data );
1568
+ }
1569
+ }
1570
+ if ( '_elementor_data' !== $meta_key && '_elementor_draft' !== $meta_key && '_fl_builder_data' !== $meta_key && '_fl_builder_draft' !== $meta_key ) {
1571
+ if ( is_array( $raw_data ) ) {
1572
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . wp_json_encode( $raw_data ) );
1573
+ } else {
1574
+ if ( ! is_object( $raw_data ) ) {
1575
+ wcf()->logger->import_log( '(✓) Added post meta ' . $meta_key . ' | ' . $raw_data );
1576
+ }
1577
+ }
1578
+ }
1579
+
1580
+ update_post_meta( $post_id, $meta_key, $raw_data );
1581
+ }
1582
+ }
1583
+ }
1584
+
1585
+ /**
1586
+ * Import Template for Elementor
1587
+ *
1588
+ * @since 1.0.0
1589
+ *
1590
+ * @param integer $post_id Post ID.
1591
+ * @param array $response Post meta.
1592
+ * @param array $page_build_data Page build data.
1593
+ * @return void
1594
+ */
1595
+ public static function import_template_elementor( $post_id, $response, $page_build_data ) {
1596
+ if ( ! is_plugin_active( 'elementor/elementor.php' ) ) {
1597
+ $data = __( 'Elementor is not activated. Please activate plugin Elementor Page Builder to import the step.', 'cartflows' );
1598
+ wcf()->logger->import_log( $data );
1599
+ wp_send_json_error( $data );
1600
+ }
1601
+
1602
+ require_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-importer-elementor.php';
1603
+
1604
+ wcf()->logger->import_log( '# Started "importing page builder data" for step ' . $post_id );
1605
+
1606
+ $obj = new \Elementor\TemplateLibrary\CartFlows_Importer_Elementor();
1607
+ $obj->import_single_template( $post_id );
1608
+
1609
+ wcf()->logger->import_log( '# Complete "importing page builder data" for step ' . $post_id );
1610
+ }
1611
+
1612
+ /**
1613
+ * Supported post types
1614
+ *
1615
+ * @since 1.0.0
1616
+ *
1617
+ * @return array Supported post types.
1618
+ */
1619
+ public static function supported_post_types() {
1620
+ return apply_filters(
1621
+ 'cartflows_supported_post_types',
1622
+ array(
1623
+ CARTFLOWS_FLOW_POST_TYPE,
1624
+ )
1625
+ );
1626
+ }
1627
+
1628
+ /**
1629
+ * Check supported post type
1630
+ *
1631
+ * @since 1.0.0
1632
+ *
1633
+ * @param string $post_type Post type.
1634
+ * @return boolean Supported post type status.
1635
+ */
1636
+ public static function is_supported_post( $post_type = '' ) {
1637
+
1638
+ if ( in_array( $post_type, self::supported_post_types(), true ) ) {
1639
+ return true;
1640
+ }
1641
+
1642
+ return false;
1643
+ }
1644
+
1645
+ /**
1646
+ * Set steps to the flow
1647
+ *
1648
+ * @param integer $flow_id Flow ID.
1649
+ * @param integer $new_step_id New step ID.
1650
+ * @param string $step_title Flow Type.
1651
+ * @param string $step_slug Flow Type.
1652
+ */
1653
+ public function set_step_to_flow( $flow_id, $new_step_id, $step_title, $step_slug ) {
1654
+ // Update steps for the current flow.
1655
+ $flow_steps = get_post_meta( $flow_id, 'wcf-steps', true );
1656
+
1657
+ if ( ! is_array( $flow_steps ) ) {
1658
+ $flow_steps = array();
1659
+ }
1660
+
1661
+ $flow_steps[] = array(
1662
+ 'id' => $new_step_id,
1663
+ 'title' => $step_title,
1664
+ 'type' => $step_slug,
1665
+ );
1666
+ update_post_meta( $flow_id, 'wcf-steps', $flow_steps );
1667
+ wcf()->logger->import_log( '(✓) Updated flow steps post meta key \'wcf-steps\' ' . wp_json_encode( $flow_steps ) );
1668
+ }
1669
+
1670
+ /**
1671
+ * Localize variables in admin
1672
+ *
1673
+ * @param array $vars variables.
1674
+ */
1675
+ public function localize_vars( $vars ) {
1676
+
1677
+ $ajax_actions = array(
1678
+ 'cf_step_import',
1679
+ 'cf_load_steps',
1680
+ 'cf_create_flow',
1681
+ 'cf_default_flow',
1682
+ 'cf_step_create_blank',
1683
+ 'cf_import_flow_step',
1684
+ );
1685
+
1686
+ foreach ( $ajax_actions as $action ) {
1687
+
1688
+ $vars[ $action . '_nonce' ] = wp_create_nonce( str_replace( '_', '-', $action ) );
1689
+ }
1690
+
1691
+ return $vars;
1692
+ }
1693
+
1694
+ /**
1695
+ * Ajax action to activate plugin
1696
+ */
1697
+ public function activate_plugin() {
1698
+
1699
+ if ( ! check_ajax_referer( 'cartflows_activate_plugin', 'security', false ) ) {
1700
+ wp_send_json_error( esc_html__( 'Action failed. Invalid Security Nonce.', 'cartflows' ) );
1701
+ }
1702
+
1703
+ if ( ! current_user_can( 'activate_plugins' ) ) {
1704
+ wp_send_json_error(
1705
+ array(
1706
+ 'success' => false,
1707
+ 'message' => __( 'User have not plugin install permissions.', 'cartflows' ),
1708
+ )
1709
+ );
1710
+ }
1711
+
1712
+ $plugin_init = isset( $_POST['plugin_init'] ) ? sanitize_text_field( wp_unslash( $_POST['plugin_init'] ) ) : '';
1713
+
1714
+ $activate = activate_plugin( $plugin_init, '', false, true );
1715
+
1716
+ if ( is_wp_error( $activate ) ) {
1717
+ wp_send_json_error(
1718
+ array(
1719
+ 'success' => false,
1720
+ 'message' => $activate->get_error_message(),
1721
+ 'init' => $plugin_init,
1722
+ )
1723
+ );
1724
+ }
1725
+
1726
+ wp_send_json_success(
1727
+ array(
1728
+ 'success' => true,
1729
+ 'message' => __( 'Plugin Successfully Activated', 'cartflows' ),
1730
+ 'init' => $plugin_init,
1731
+ )
1732
+ );
1733
+ }
1734
+
1735
+ }
1736
+
1737
+ /**
1738
+ * Initialize class object with 'get_instance()' method
1739
+ */
1740
+ CartFlows_Importer::get_instance();
1741
+
1742
+ endif;
classes/class-cartflows-loader.php CHANGED
@@ -1,599 +1,599 @@
1
- <?php
2
- /**
3
- * CartFlows Loader.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
-
10
- /**
11
- * Class Cartflows_Loader.
12
- */
13
- final class Cartflows_Loader {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var instance
19
- */
20
- private static $instance = null;
21
-
22
- /**
23
- * Member Variable
24
- *
25
- * @var utils
26
- */
27
- public $utils = null;
28
-
29
- /**
30
- * Member Variable
31
- *
32
- * @var logger
33
- */
34
- public $logger = null;
35
-
36
- /**
37
- * Member Variable
38
- *
39
- * @var options
40
- */
41
- public $options = null;
42
-
43
- /**
44
- * Member Variable
45
- *
46
- * @var meta
47
- */
48
- public $meta = null;
49
-
50
- /**
51
- * Member Variable
52
- *
53
- * @var Tracking_Data
54
- */
55
- public $alldata;
56
-
57
- /**
58
- * Member Variable
59
- *
60
- * @var flow
61
- */
62
- public $flow = null;
63
-
64
- /**
65
- * Member Variable
66
- *
67
- * @var wcf_step_objs
68
- */
69
-
70
- public $wcf_step_objs = array();
71
-
72
- /**
73
- * Member Variable
74
- *
75
- * @var assets_vars
76
- */
77
- public $assets_vars = null;
78
-
79
- /**
80
- * Member Variable
81
- *
82
- * @var assets_vars
83
- */
84
-
85
- public $is_woo_active = true;
86
-
87
- /**
88
- * Initiator
89
- */
90
- public static function get_instance() {
91
-
92
- if ( is_null( self::$instance ) ) {
93
-
94
- self::$instance = new self();
95
-
96
- /**
97
- * CartFlows loaded.
98
- *
99
- * Fires when Cartflows was fully loaded and instantiated.
100
- *
101
- * @since 1.0.0
102
- */
103
- do_action( 'cartflows_loaded' );
104
- }
105
-
106
- return self::$instance;
107
- }
108
-
109
- /**
110
- * Constructor
111
- */
112
- public function __construct() {
113
-
114
- $this->define_constants();
115
-
116
- // Activation hook.
117
- register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
118
-
119
- // deActivation hook.
120
- register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
121
-
122
- add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
123
- add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
124
- }
125
-
126
- /**
127
- * Defines all constants
128
- *
129
- * @since 1.0.0
130
- */
131
- public function define_constants() {
132
-
133
- define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
134
- define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
135
- define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
136
- define( 'CARTFLOWS_VER', '1.5.15' );
137
- define( 'CARTFLOWS_SLUG', 'cartflows' );
138
- define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
139
-
140
- define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
141
- define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
142
-
143
- if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
144
- define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
145
- }
146
- define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
147
- define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
148
- define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
149
- define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
150
-
151
- if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
152
- define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
153
- }
154
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
155
- define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
156
- }
157
- if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
158
- define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
159
- }
160
-
161
- if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
162
-
163
- $upload_dir = wp_upload_dir( null, false );
164
-
165
- define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
166
- }
167
-
168
- $GLOBALS['wcf_step'] = null;
169
- }
170
-
171
- /**
172
- * Loads plugin files.
173
- *
174
- * @since 1.0.0
175
- *
176
- * @return void
177
- */
178
- public function load_plugin() {
179
-
180
- $this->load_helper_files_components();
181
- $this->load_core_files();
182
- $this->load_core_components();
183
-
184
- add_action( 'wp_loaded', array( $this, 'initialize' ) );
185
- add_action( 'cartflows_pro_init', array( $this, 'after_cartflows_pro_init' ) );
186
-
187
- if ( ! $this->is_woo_active ) {
188
- add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
189
- }
190
-
191
- /**
192
- * CartFlows Init.
193
- *
194
- * Fires when Cartflows is instantiated.
195
- *
196
- * @since 1.0.0
197
- */
198
- do_action( 'cartflows_init' );
199
- }
200
-
201
- /**
202
- * After CartFlows Pro init.
203
- *
204
- * @since 1.1.19
205
- *
206
- * @return void
207
- */
208
- public function after_cartflows_pro_init() {
209
-
210
- if ( ! is_admin() ) {
211
- return;
212
- }
213
-
214
- if ( version_compare( CARTFLOWS_PRO_VER, '1.5.8', '<' ) ) {
215
- add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
216
- }
217
- }
218
-
219
- /**
220
- * Required CartFlows Pro Notice.
221
- *
222
- * @since 1.1.19
223
- *
224
- * @return void
225
- */
226
- public function required_cartflows_pro_notice() {
227
-
228
- $required_pro_version = '1.5.8';
229
-
230
- $class = 'notice notice-warning';
231
- /* translators: %s: html tags */
232
- $message = sprintf( __( 'You are using an older version of %1$sCartFlows Pro%2$s. Please update %1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher.', 'cartflows' ), '<strong>', '</strong>', $required_pro_version );
233
-
234
- printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
235
- }
236
-
237
- /**
238
- * Load Helper Files and Components.
239
- *
240
- * @since 1.0.0
241
- *
242
- * @return void
243
- */
244
- public function load_helper_files_components() {
245
-
246
- $this->is_woo_active = function_exists( 'WC' );
247
-
248
- /* Public Utils */
249
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
250
-
251
- /* Public Global Namespace Function */
252
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
253
-
254
- /* Admin Helper */
255
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
256
-
257
- /* Factory objects */
258
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-step-factory.php';
259
-
260
- /* Meta Default Values */
261
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
262
-
263
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-tracking.php';
264
-
265
- if ( is_admin() ) {
266
- require_once CARTFLOWS_DIR . 'classes/lib/notices/class-astra-notices.php';
267
- }
268
-
269
- if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
270
- require_once CARTFLOWS_DIR . '/admin/bsf-analytics/class-bsf-analytics-loader.php';
271
- }
272
-
273
- $bsf_analytics = BSF_Analytics_Loader::get_instance();
274
-
275
- $bsf_analytics->set_entity(
276
- array(
277
- 'cf' => array(
278
- 'product_name' => 'CartFlows',
279
- 'usage_doc_link' => 'https://my.cartflows.com/usage-tracking/',
280
- 'path' => CARTFLOWS_DIR . 'admin/bsf-analytics',
281
- 'author' => 'CartFlows Inc',
282
- ),
283
- )
284
- );
285
-
286
- $this->utils = Cartflows_Utils::get_instance();
287
- $this->options = Cartflows_Default_Meta::get_instance();
288
- $this->alldata = Cartflows_Tracking::get_instance();
289
- }
290
-
291
- /**
292
- * Init hooked function.
293
- *
294
- * @since 1.0.0
295
- *
296
- * @return void
297
- */
298
- public function initialize() {
299
- $this->assets_vars = $this->utils->get_assets_path();
300
- }
301
-
302
- /**
303
- * Load Core Files.
304
- *
305
- * @since 1.0.0
306
- *
307
- * @return void
308
- */
309
- public function load_core_files() {
310
-
311
- /* Update compatibility. */
312
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
313
-
314
- /* Page builder compatibilty class */
315
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
316
-
317
- /* Theme support */
318
- if ( $this->is_woo_active ) {
319
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-theme-support.php';
320
- }
321
-
322
- /* Admin Meta Fields*/
323
- include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
324
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
325
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
326
-
327
- if ( is_admin() ) {
328
- /* Cloning */
329
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
330
-
331
- /* Admin Settings */
332
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
333
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-stats.php';
334
- }
335
-
336
- /* Logger */
337
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-interface.php';
338
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler.php';
339
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-file.php';
340
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-levels.php';
341
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-logger-interface.php';
342
- include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-wc-logger.php';
343
-
344
- /* Core Modules */
345
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
346
-
347
- /* Frontend Global */
348
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
349
- require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
350
-
351
- /* Modules */
352
- include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
353
- include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
354
-
355
- if ( $this->is_woo_active ) {
356
- include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
357
- include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
358
- include_once CARTFLOWS_DIR . 'modules/optin/class-cartflows-optin.php';
359
- }
360
-
361
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
362
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
363
-
364
- include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
365
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
366
-
367
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-wizard.php';
368
-
369
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
370
-
371
- include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
372
-
373
- }
374
-
375
- /**
376
- * Load Core Components.
377
- *
378
- * @since 1.0.0
379
- *
380
- * @return void
381
- */
382
- public function load_core_components() {
383
-
384
- $this->meta = Cartflows_Meta_Fields::get_instance();
385
- $this->logger = Cartflows_Logger::get_instance();
386
- $this->flow = Cartflows_Flow_Frontend::get_instance();
387
- }
388
-
389
- /**
390
- * Create files/directories.
391
- */
392
- public function create_files() {
393
-
394
- // Install files and folders for uploading files and prevent hotlinking.
395
- $upload_dir = wp_upload_dir();
396
-
397
- $files = array(
398
- array(
399
- 'base' => CARTFLOWS_LOG_DIR,
400
- 'file' => '.htaccess',
401
- 'content' => 'deny from all',
402
- ),
403
- array(
404
- 'base' => CARTFLOWS_LOG_DIR,
405
- 'file' => 'index.html',
406
- 'content' => '',
407
- ),
408
- );
409
-
410
- foreach ( $files as $file ) {
411
- if ( wp_mkdir_p( $file['base'] ) && ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
412
- $file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'w' ); // phpcs:ignore
413
- if ( $file_handle ) {
414
- fwrite( $file_handle, $file['content'] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
415
- fclose( $file_handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
416
- }
417
- }
418
- }
419
- }
420
- /**
421
- * Load CartFlows Pro Text Domain.
422
- * This will load the translation textdomain depending on the file priorities.
423
- * 1. Global Languages /wp-content/languages/cartflows/ folder
424
- * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
425
- *
426
- * @since 1.0.3
427
- * @return void
428
- */
429
- public function load_cf_textdomain() {
430
-
431
- // Default languages directory for CartFlows Pro.
432
- $lang_dir = CARTFLOWS_DIR . 'languages/';
433
-
434
- /**
435
- * Filters the languages directory path to use for CartFlows Pro.
436
- *
437
- * @param string $lang_dir The languages directory path.
438
- */
439
- $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
440
-
441
- // Traditional WordPress plugin locale filter.
442
- global $wp_version;
443
-
444
- $get_locale = get_locale();
445
-
446
- if ( $wp_version >= 4.7 ) {
447
- $get_locale = get_user_locale();
448
- }
449
-
450
- /**
451
- * Language Locale for CartFlows Pro
452
- *
453
- * @var $get_locale The locale to use.
454
- * Uses get_user_locale()` in WordPress 4.7 or greater,
455
- * otherwise uses `get_locale()`.
456
- */
457
- $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
458
- $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
459
-
460
- // Setup paths to current locale file.
461
- $mofile_local = $lang_dir . $mofile;
462
- $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
463
-
464
- if ( file_exists( $mofile_global ) ) {
465
- // Look in global /wp-content/languages/cartflows/ folder.
466
- load_textdomain( 'cartflows', $mofile_global );
467
- } elseif ( file_exists( $mofile_local ) ) {
468
- // Look in local /wp-content/plugins/cartflows/languages/ folder.
469
- load_textdomain( 'cartflows', $mofile_local );
470
- } else {
471
- // Load the default language files.
472
- load_plugin_textdomain( 'cartflows', false, $lang_dir );
473
- }
474
- }
475
-
476
- /**
477
- * Fires admin notice when Elementor is not installed and activated.
478
- *
479
- * @since 1.0.0
480
- *
481
- * @return void
482
- */
483
- public function fails_to_load() {
484
-
485
- $screen = get_current_screen();
486
-
487
- if ( ! wcf()->utils->is_step_post_type() ) {
488
- return;
489
- }
490
-
491
- if ( ! wcf()->utils->check_is_woo_required_page() ) {
492
- return;
493
- }
494
-
495
- $skip_notice = false;
496
-
497
- wp_localize_script( 'wcf-global-admin', 'cartflows_woo', array( 'show_update_post' => $skip_notice ) );
498
-
499
- $class = 'notice notice-warning';
500
- /* translators: %s: html tags */
501
- $message = sprintf( __( 'This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
502
-
503
- $plugin = 'woocommerce/woocommerce.php';
504
-
505
- if ( _is_woo_installed() ) {
506
- if ( ! current_user_can( 'activate_plugins' ) ) {
507
- return;
508
- }
509
-
510
- $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
511
- $button_label = __( 'Activate WooCommerce', 'cartflows' );
512
-
513
- } else {
514
- if ( ! current_user_can( 'install_plugins' ) ) {
515
- return;
516
- }
517
-
518
- $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
519
- $button_label = __( 'Install WooCommerce', 'cartflows' );
520
- }
521
-
522
- $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
523
-
524
- printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
525
- }
526
-
527
- /**
528
- * Activation Reset
529
- */
530
- public function activation_reset() {
531
-
532
- if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
533
-
534
- $upload_dir = wp_upload_dir( null, false );
535
-
536
- define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
537
- }
538
-
539
- $this->create_files();
540
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
541
- include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
542
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
543
- include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
544
-
545
- Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
546
- Cartflows_Step_Post_Type::get_instance()->step_post_type();
547
- flush_rewrite_rules();
548
- }
549
-
550
- /**
551
- * Deactivation Reset
552
- */
553
- public function deactivation_reset() {
554
- }
555
-
556
- /**
557
- * Logger Class Instance
558
- */
559
- public function logger() {
560
- return Cartflows_Logger::get_instance();
561
- }
562
-
563
-
564
- }
565
-
566
- /**
567
- * Prepare if class 'Cartflows_Loader' exist.
568
- * Kicking this off by calling 'get_instance()' method
569
- */
570
- Cartflows_Loader::get_instance();
571
- }
572
-
573
- /**
574
- * Get global class.
575
- *
576
- * @return object
577
- */
578
- function wcf() {
579
- return Cartflows_Loader::get_instance();
580
- }
581
-
582
-
583
- if ( ! function_exists( '_is_woo_installed' ) ) {
584
-
585
- /**
586
- * Is woocommerce plugin installed.
587
- *
588
- * @since 1.0.0
589
- *
590
- * @access public
591
- */
592
- function _is_woo_installed() {
593
-
594
- $path = 'woocommerce/woocommerce.php';
595
- $plugins = get_plugins();
596
-
597
- return isset( $plugins[ $path ] );
598
- }
599
- }
1
+ <?php
2
+ /**
3
+ * CartFlows Loader.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ if ( ! class_exists( 'Cartflows_Loader' ) ) {
9
+
10
+ /**
11
+ * Class Cartflows_Loader.
12
+ */
13
+ final class Cartflows_Loader {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var instance
19
+ */
20
+ private static $instance = null;
21
+
22
+ /**
23
+ * Member Variable
24
+ *
25
+ * @var utils
26
+ */
27
+ public $utils = null;
28
+
29
+ /**
30
+ * Member Variable
31
+ *
32
+ * @var logger
33
+ */
34
+ public $logger = null;
35
+
36
+ /**
37
+ * Member Variable
38
+ *
39
+ * @var options
40
+ */
41
+ public $options = null;
42
+
43
+ /**
44
+ * Member Variable
45
+ *
46
+ * @var meta
47
+ */
48
+ public $meta = null;
49
+
50
+ /**
51
+ * Member Variable
52
+ *
53
+ * @var Tracking_Data
54
+ */
55
+ public $alldata;
56
+
57
+ /**
58
+ * Member Variable
59
+ *
60
+ * @var flow
61
+ */
62
+ public $flow = null;
63
+
64
+ /**
65
+ * Member Variable
66
+ *
67
+ * @var wcf_step_objs
68
+ */
69
+
70
+ public $wcf_step_objs = array();
71
+
72
+ /**
73
+ * Member Variable
74
+ *
75
+ * @var assets_vars
76
+ */
77
+ public $assets_vars = null;
78
+
79
+ /**
80
+ * Member Variable
81
+ *
82
+ * @var assets_vars
83
+ */
84
+
85
+ public $is_woo_active = true;
86
+
87
+ /**
88
+ * Initiator
89
+ */
90
+ public static function get_instance() {
91
+
92
+ if ( is_null( self::$instance ) ) {
93
+
94
+ self::$instance = new self();
95
+
96
+ /**
97
+ * CartFlows loaded.
98
+ *
99
+ * Fires when Cartflows was fully loaded and instantiated.
100
+ *
101
+ * @since 1.0.0
102
+ */
103
+ do_action( 'cartflows_loaded' );
104
+ }
105
+
106
+ return self::$instance;
107
+ }
108
+
109
+ /**
110
+ * Constructor
111
+ */
112
+ public function __construct() {
113
+
114
+ $this->define_constants();
115
+
116
+ // Activation hook.
117
+ register_activation_hook( CARTFLOWS_FILE, array( $this, 'activation_reset' ) );
118
+
119
+ // deActivation hook.
120
+ register_deactivation_hook( CARTFLOWS_FILE, array( $this, 'deactivation_reset' ) );
121
+
122
+ add_action( 'plugins_loaded', array( $this, 'load_plugin' ), 99 );
123
+ add_action( 'plugins_loaded', array( $this, 'load_cf_textdomain' ) );
124
+ }
125
+
126
+ /**
127
+ * Defines all constants
128
+ *
129
+ * @since 1.0.0
130
+ */
131
+ public function define_constants() {
132
+
133
+ define( 'CARTFLOWS_BASE', plugin_basename( CARTFLOWS_FILE ) );
134
+ define( 'CARTFLOWS_DIR', plugin_dir_path( CARTFLOWS_FILE ) );
135
+ define( 'CARTFLOWS_URL', plugins_url( '/', CARTFLOWS_FILE ) );
136
+ define( 'CARTFLOWS_VER', '1.5.16' );
137
+ define( 'CARTFLOWS_SLUG', 'cartflows' );
138
+ define( 'CARTFLOWS_SETTINGS', 'cartflows_settings' );
139
+
140
+ define( 'CARTFLOWS_FLOW_POST_TYPE', 'cartflows_flow' );
141
+ define( 'CARTFLOWS_STEP_POST_TYPE', 'cartflows_step' );
142
+
143
+ if ( ! defined( 'CARTFLOWS_SERVER_URL' ) ) {
144
+ define( 'CARTFLOWS_SERVER_URL', 'https://my.cartflows.com/' );
145
+ }
146
+ define( 'CARTFLOWS_DOMAIN_URL', 'https://cartflows.com/' );
147
+ define( 'CARTFLOWS_TEMPLATES_URL', 'https://templates.cartflows.com/' );
148
+ define( 'CARTFLOWS_TAXONOMY_STEP_TYPE', 'cartflows_step_type' );
149
+ define( 'CARTFLOWS_TAXONOMY_STEP_FLOW', 'cartflows_step_flow' );
150
+
151
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER' ) ) {
152
+ define( 'CARTFLOWS_TAXONOMY_STEP_PAGE_BUILDER', 'cartflows_step_page_builder' );
153
+ }
154
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER' ) ) {
155
+ define( 'CARTFLOWS_TAXONOMY_FLOW_PAGE_BUILDER', 'cartflows_flow_page_builder' );
156
+ }
157
+ if ( ! defined( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY' ) ) {
158
+ define( 'CARTFLOWS_TAXONOMY_FLOW_CATEGORY', 'cartflows_flow_category' );
159
+ }
160
+
161
+ if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
162
+
163
+ $upload_dir = wp_upload_dir( null, false );
164
+
165
+ define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
166
+ }
167
+
168
+ $GLOBALS['wcf_step'] = null;
169
+ }
170
+
171
+ /**
172
+ * Loads plugin files.
173
+ *
174
+ * @since 1.0.0
175
+ *
176
+ * @return void
177
+ */
178
+ public function load_plugin() {
179
+
180
+ $this->load_helper_files_components();
181
+ $this->load_core_files();
182
+ $this->load_core_components();
183
+
184
+ add_action( 'wp_loaded', array( $this, 'initialize' ) );
185
+ add_action( 'cartflows_pro_init', array( $this, 'after_cartflows_pro_init' ) );
186
+
187
+ if ( ! $this->is_woo_active ) {
188
+ add_action( 'admin_notices', array( $this, 'fails_to_load' ) );
189
+ }
190
+
191
+ /**
192
+ * CartFlows Init.
193
+ *
194
+ * Fires when Cartflows is instantiated.
195
+ *
196
+ * @since 1.0.0
197
+ */
198
+ do_action( 'cartflows_init' );
199
+ }
200
+
201
+ /**
202
+ * After CartFlows Pro init.
203
+ *
204
+ * @since 1.1.19
205
+ *
206
+ * @return void
207
+ */
208
+ public function after_cartflows_pro_init() {
209
+
210
+ if ( ! is_admin() ) {
211
+ return;
212
+ }
213
+
214
+ if ( version_compare( CARTFLOWS_PRO_VER, '1.5.8', '<' ) ) {
215
+ add_action( 'admin_notices', array( $this, 'required_cartflows_pro_notice' ) );
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Required CartFlows Pro Notice.
221
+ *
222
+ * @since 1.1.19
223
+ *
224
+ * @return void
225
+ */
226
+ public function required_cartflows_pro_notice() {
227
+
228
+ $required_pro_version = '1.5.8';
229
+
230
+ $class = 'notice notice-warning';
231
+ /* translators: %s: html tags */
232
+ $message = sprintf( __( 'You are using an older version of %1$sCartFlows Pro%2$s. Please update %1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher.', 'cartflows' ), '<strong>', '</strong>', $required_pro_version );
233
+
234
+ printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
235
+ }
236
+
237
+ /**
238
+ * Load Helper Files and Components.
239
+ *
240
+ * @since 1.0.0
241
+ *
242
+ * @return void
243
+ */
244
+ public function load_helper_files_components() {
245
+
246
+ $this->is_woo_active = function_exists( 'WC' );
247
+
248
+ /* Public Utils */
249
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-utils.php';
250
+
251
+ /* Public Global Namespace Function */
252
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
253
+
254
+ /* Admin Helper */
255
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
256
+
257
+ /* Factory objects */
258
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-step-factory.php';
259
+
260
+ /* Meta Default Values */
261
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-default-meta.php';
262
+
263
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-tracking.php';
264
+
265
+ if ( is_admin() ) {
266
+ require_once CARTFLOWS_DIR . 'classes/lib/notices/class-astra-notices.php';
267
+ }
268
+
269
+ if ( ! class_exists( 'BSF_Analytics_Loader' ) ) {
270
+ require_once CARTFLOWS_DIR . '/admin/bsf-analytics/class-bsf-analytics-loader.php';
271
+ }
272
+
273
+ $bsf_analytics = BSF_Analytics_Loader::get_instance();
274
+
275
+ $bsf_analytics->set_entity(
276
+ array(
277
+ 'cf' => array(
278
+ 'product_name' => 'CartFlows',
279
+ 'usage_doc_link' => 'https://my.cartflows.com/usage-tracking/',
280
+ 'path' => CARTFLOWS_DIR . 'admin/bsf-analytics',
281
+ 'author' => 'CartFlows Inc',
282
+ ),
283
+ )
284
+ );
285
+
286
+ $this->utils = Cartflows_Utils::get_instance();
287
+ $this->options = Cartflows_Default_Meta::get_instance();
288
+ $this->alldata = Cartflows_Tracking::get_instance();
289
+ }
290
+
291
+ /**
292
+ * Init hooked function.
293
+ *
294
+ * @since 1.0.0
295
+ *
296
+ * @return void
297
+ */
298
+ public function initialize() {
299
+ $this->assets_vars = $this->utils->get_assets_path();
300
+ }
301
+
302
+ /**
303
+ * Load Core Files.
304
+ *
305
+ * @since 1.0.0
306
+ *
307
+ * @return void
308
+ */
309
+ public function load_core_files() {
310
+
311
+ /* Update compatibility. */
312
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-update.php';
313
+
314
+ /* Page builder compatibilty class */
315
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-compatibility.php';
316
+
317
+ /* Theme support */
318
+ if ( $this->is_woo_active ) {
319
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-theme-support.php';
320
+ }
321
+
322
+ /* Admin Meta Fields*/
323
+ include_once CARTFLOWS_DIR . 'classes/fields/typography/class-cartflows-font-families.php';
324
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta-fields.php';
325
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-meta.php';
326
+
327
+ if ( is_admin() ) {
328
+ /* Cloning */
329
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-cloning.php';
330
+
331
+ /* Admin Settings */
332
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-admin.php';
333
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-stats.php';
334
+ }
335
+
336
+ /* Logger */
337
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-interface.php';
338
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler.php';
339
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-handler-file.php';
340
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-log-levels.php';
341
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-logger-interface.php';
342
+ include_once CARTFLOWS_DIR . 'classes/logger/class-cartflows-wc-logger.php';
343
+
344
+ /* Core Modules */
345
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-logger.php';
346
+
347
+ /* Frontend Global */
348
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-frontend.php';
349
+ require_once CARTFLOWS_DIR . 'classes/class-cartflows-flow-frontend.php';
350
+
351
+ /* Modules */
352
+ include_once CARTFLOWS_DIR . 'modules/flow/class-cartflows-flow.php';
353
+ include_once CARTFLOWS_DIR . 'modules/landing/class-cartflows-landing.php';
354
+
355
+ if ( $this->is_woo_active ) {
356
+ include_once CARTFLOWS_DIR . 'modules/checkout/class-cartflows-checkout.php';
357
+ include_once CARTFLOWS_DIR . 'modules/thankyou/class-cartflows-thankyou.php';
358
+ include_once CARTFLOWS_DIR . 'modules/optin/class-cartflows-optin.php';
359
+ }
360
+
361
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-api.php';
362
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer-core.php';
363
+
364
+ include_once CARTFLOWS_DIR . 'classes/batch-process/class-cartflows-batch-process.php';
365
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-importer.php';
366
+
367
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-wizard.php';
368
+
369
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-metabox.php';
370
+
371
+ include_once CARTFLOWS_DIR . 'classes/deprecated/deprecated-hooks.php';
372
+
373
+ }
374
+
375
+ /**
376
+ * Load Core Components.
377
+ *
378
+ * @since 1.0.0
379
+ *
380
+ * @return void
381
+ */
382
+ public function load_core_components() {
383
+
384
+ $this->meta = Cartflows_Meta_Fields::get_instance();
385
+ $this->logger = Cartflows_Logger::get_instance();
386
+ $this->flow = Cartflows_Flow_Frontend::get_instance();
387
+ }
388
+
389
+ /**
390
+ * Create files/directories.
391
+ */
392
+ public function create_files() {
393
+
394
+ // Install files and folders for uploading files and prevent hotlinking.
395
+ $upload_dir = wp_upload_dir();
396
+
397
+ $files = array(
398
+ array(
399
+ 'base' => CARTFLOWS_LOG_DIR,
400
+ 'file' => '.htaccess',
401
+ 'content' => 'deny from all',
402
+ ),
403
+ array(
404
+ 'base' => CARTFLOWS_LOG_DIR,
405
+ 'file' => 'index.html',
406
+ 'content' => '',
407
+ ),
408
+ );
409
+
410
+ foreach ( $files as $file ) {
411
+ if ( wp_mkdir_p( $file['base'] ) && ! file_exists( trailingslashit( $file['base'] ) . $file['file'] ) ) {
412
+ $file_handle = @fopen( trailingslashit( $file['base'] ) . $file['file'], 'w' ); // phpcs:ignore
413
+ if ( $file_handle ) {
414
+ fwrite( $file_handle, $file['content'] ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fwrite
415
+ fclose( $file_handle ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_read_fclose
416
+ }
417
+ }
418
+ }
419
+ }
420
+ /**
421
+ * Load CartFlows Pro Text Domain.
422
+ * This will load the translation textdomain depending on the file priorities.
423
+ * 1. Global Languages /wp-content/languages/cartflows/ folder
424
+ * 2. Local dorectory /wp-content/plugins/cartflows/languages/ folder
425
+ *
426
+ * @since 1.0.3
427
+ * @return void
428
+ */
429
+ public function load_cf_textdomain() {
430
+
431
+ // Default languages directory for CartFlows Pro.
432
+ $lang_dir = CARTFLOWS_DIR . 'languages/';
433
+
434
+ /**
435
+ * Filters the languages directory path to use for CartFlows Pro.
436
+ *
437
+ * @param string $lang_dir The languages directory path.
438
+ */
439
+ $lang_dir = apply_filters( 'cartflows_languages_directory', $lang_dir );
440
+
441
+ // Traditional WordPress plugin locale filter.
442
+ global $wp_version;
443
+
444
+ $get_locale = get_locale();
445
+
446
+ if ( $wp_version >= 4.7 ) {
447
+ $get_locale = get_user_locale();
448
+ }
449
+
450
+ /**
451
+ * Language Locale for CartFlows Pro
452
+ *
453
+ * @var $get_locale The locale to use.
454
+ * Uses get_user_locale()` in WordPress 4.7 or greater,
455
+ * otherwise uses `get_locale()`.
456
+ */
457
+ $locale = apply_filters( 'plugin_locale', $get_locale, 'cartflows' );
458
+ $mofile = sprintf( '%1$s-%2$s.mo', 'cartflows', $locale );
459
+
460
+ // Setup paths to current locale file.
461
+ $mofile_local = $lang_dir . $mofile;
462
+ $mofile_global = WP_LANG_DIR . '/plugins/' . $mofile;
463
+
464
+ if ( file_exists( $mofile_global ) ) {
465
+ // Look in global /wp-content/languages/cartflows/ folder.
466
+ load_textdomain( 'cartflows', $mofile_global );
467
+ } elseif ( file_exists( $mofile_local ) ) {
468
+ // Look in local /wp-content/plugins/cartflows/languages/ folder.
469
+ load_textdomain( 'cartflows', $mofile_local );
470
+ } else {
471
+ // Load the default language files.
472
+ load_plugin_textdomain( 'cartflows', false, $lang_dir );
473
+ }
474
+ }
475
+
476
+ /**
477
+ * Fires admin notice when Elementor is not installed and activated.
478
+ *
479
+ * @since 1.0.0
480
+ *
481
+ * @return void
482
+ */
483
+ public function fails_to_load() {
484
+
485
+ $screen = get_current_screen();
486
+
487
+ if ( ! wcf()->utils->is_step_post_type() ) {
488
+ return;
489
+ }
490
+
491
+ if ( ! wcf()->utils->check_is_woo_required_page() ) {
492
+ return;
493
+ }
494
+
495
+ $skip_notice = false;
496
+
497
+ wp_localize_script( 'wcf-global-admin', 'cartflows_woo', array( 'show_update_post' => $skip_notice ) );
498
+
499
+ $class = 'notice notice-warning';
500
+ /* translators: %s: html tags */
501
+ $message = sprintf( __( 'This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & activated.', 'cartflows' ), '<strong>', '</strong>' );
502
+
503
+ $plugin = 'woocommerce/woocommerce.php';
504
+
505
+ if ( _is_woo_installed() ) {
506
+ if ( ! current_user_can( 'activate_plugins' ) ) {
507
+ return;
508
+ }
509
+
510
+ $action_url = wp_nonce_url( 'plugins.php?action=activate&amp;plugin=' . $plugin . '&amp;plugin_status=all&amp;paged=1&amp;s', 'activate-plugin_' . $plugin );
511
+ $button_label = __( 'Activate WooCommerce', 'cartflows' );
512
+
513
+ } else {
514
+ if ( ! current_user_can( 'install_plugins' ) ) {
515
+ return;
516
+ }
517
+
518
+ $action_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=woocommerce' ), 'install-plugin_woocommerce' );
519
+ $button_label = __( 'Install WooCommerce', 'cartflows' );
520
+ }
521
+
522
+ $button = '<p><a href="' . $action_url . '" class="button-primary">' . $button_label . '</a></p><p></p>';
523
+
524
+ printf( '<div class="%1$s"><p>%2$s</p>%3$s</div>', esc_attr( $class ), $message, $button );
525
+ }
526
+
527
+ /**
528
+ * Activation Reset
529
+ */
530
+ public function activation_reset() {
531
+
532
+ if ( ! defined( 'CARTFLOWS_LOG_DIR' ) ) {
533
+
534
+ $upload_dir = wp_upload_dir( null, false );
535
+
536
+ define( 'CARTFLOWS_LOG_DIR', $upload_dir['basedir'] . '/cartflows-logs/' );
537
+ }
538
+
539
+ $this->create_files();
540
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-helper.php';
541
+ include_once CARTFLOWS_DIR . 'classes/class-cartflows-functions.php';
542
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-flow-post-type.php';
543
+ include_once CARTFLOWS_DIR . 'modules/flow/classes/class-cartflows-step-post-type.php';
544
+
545
+ Cartflows_Flow_Post_Type::get_instance()->flow_post_type();
546
+ Cartflows_Step_Post_Type::get_instance()->step_post_type();
547
+ flush_rewrite_rules();
548
+ }
549
+
550
+ /**
551
+ * Deactivation Reset
552
+ */
553
+ public function deactivation_reset() {
554
+ }
555
+
556
+ /**
557
+ * Logger Class Instance
558
+ */
559
+ public function logger() {
560
+ return Cartflows_Logger::get_instance();
561
+ }
562
+
563
+
564
+ }
565
+
566
+ /**
567
+ * Prepare if class 'Cartflows_Loader' exist.
568
+ * Kicking this off by calling 'get_instance()' method
569
+ */
570
+ Cartflows_Loader::get_instance();
571
+ }
572
+
573
+ /**
574
+ * Get global class.
575
+ *
576
+ * @return object
577
+ */
578
+ function wcf() {
579
+ return Cartflows_Loader::get_instance();
580
+ }
581
+
582
+
583
+ if ( ! function_exists( '_is_woo_installed' ) ) {
584
+
585
+ /**
586
+ * Is woocommerce plugin installed.
587
+ *
588
+ * @since 1.0.0
589
+ *
590
+ * @access public
591
+ */
592
+ function _is_woo_installed() {
593
+
594
+ $path = 'woocommerce/woocommerce.php';
595
+ $plugins = get_plugins();
596
+
597
+ return isset( $plugins[ $path ] );
598
+ }
599
+ }
classes/class-cartflows-logger.php CHANGED
@@ -1,183 +1,183 @@
1
- <?php
2
- /**
3
- * Logger.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Initialization
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Logger {
14
-
15
-
16
- /**
17
- * Member Variable
18
- *
19
- * @var instance
20
- */
21
- private static $instance;
22
-
23
- /**
24
- * Member Variable
25
- *
26
- * @var logger
27
- */
28
- public $logger;
29
-
30
- /**
31
- * Initiator
32
- */
33
- public static function get_instance() {
34
- if ( ! isset( self::$instance ) ) {
35
- self::$instance = new self();
36
- }
37
- return self::$instance;
38
- }
39
-
40
- /**
41
- * Constructor
42
- */
43
- public function __construct() {
44
-
45
- /* Load WC Logger */
46
- add_action( 'init', array( $this, 'init_wc_logger' ), 99 );
47
-
48
- $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
49
-
50
- if ( CARTFLOWS_SETTINGS === $page ) {
51
- add_filter( 'admin_footer_text', array( $this, 'add_footer_link' ), 99 );
52
- }
53
-
54
- }
55
-
56
- /**
57
- * Add footer link.
58
- */
59
- public function add_footer_link() {
60
- $settings_url = add_query_arg(
61
- array(
62
- 'page' => CARTFLOWS_SETTINGS,
63
- 'cartflows-error-log' => 1,
64
- ),
65
- admin_url( '/admin.php' )
66
- );
67
-
68
- echo '<span id="footer-thankyou"> Thank you for using <a href="https://cartflows.com/">CartFlows</a></span> | <a href="' . $settings_url . '"> View Logs </a>';
69
- }
70
-
71
- /**
72
- * Inint Logger.
73
- *
74
- * @since 1.0.0
75
- */
76
- public function init_wc_logger() {
77
- if ( class_exists( 'CartFlows_WC_Logger' ) ) {
78
- $this->logger = new CartFlows_WC_Logger();
79
- }
80
- }
81
-
82
- /**
83
- * Write log
84
- *
85
- * @param string $message log message.
86
- * @param string $level type of log.
87
- * @since 1.0.0
88
- */
89
- public function log( $message, $level = 'info' ) {
90
-
91
- $enable_log = apply_filters( 'cartflows_enable_log', 'enable' );
92
-
93
- if ( 'enable' === $enable_log &&
94
- is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
95
- did_action( 'plugins_loaded' )
96
- ) {
97
-
98
- $this->logger->log( $level, $message, array( 'source' => 'cartflows' ) );
99
- }
100
- }
101
-
102
- /**
103
- * Write log
104
- *
105
- * @param string $message log message.
106
- * @param string $level type of log.
107
- * @since 1.0.0
108
- */
109
- public function import_log( $message, $level = 'info' ) {
110
-
111
- if ( defined( 'WP_DEBUG' ) &&
112
- WP_DEBUG &&
113
- is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
114
- did_action( 'plugins_loaded' )
115
- ) {
116
-
117
- $this->logger->log( $level, $message, array( 'source' => 'cartflows-import' ) );
118
- }
119
- }
120
-
121
- /**
122
- * Get all log files in the log directory.
123
- *
124
- * @return array
125
- */
126
- public static function get_log_files() {
127
- $files = scandir( CARTFLOWS_LOG_DIR );
128
- $result = array();
129
-
130
- if ( ! empty( $files ) ) {
131
- foreach ( $files as $key => $value ) {
132
- if ( ! in_array( $value, array( '.', '..' ), true ) ) {
133
- if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
134
- $result[ sanitize_title( $value ) ] = $value;
135
- }
136
- }
137
- }
138
- }
139
-
140
- return $result;
141
- }
142
-
143
- /**
144
- * Return the log file handle.
145
- *
146
- * @param string $filename Filename to get the handle for.
147
- * @return string
148
- */
149
- public static function get_log_file_handle( $filename ) {
150
- return substr( $filename, 0, strlen( $filename ) > 48 ? strlen( $filename ) - 48 : strlen( $filename ) - 4 );
151
- }
152
-
153
- /**
154
- * Show the log page contents for file log handler.
155
- */
156
- public static function status_logs_file() {
157
-
158
- if ( ! empty( $_REQUEST['handle'] ) ) {
159
-
160
- if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'remove_log' ) ) {
161
- wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'cartflows' ) );
162
- }
163
- wp_delete_file( CARTFLOWS_LOG_DIR . rtrim( $_REQUEST['handle'], '-log' ) . '.log' ); //phpcs:ignore
164
- echo "<div style='padding: 15px;' class='updated inline'> Log deleted successfully! </div>";
165
- }
166
-
167
- $logs = self::get_log_files();
168
- if ( ! empty( $_REQUEST['log_file'] ) && isset( $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ] ) ) {
169
- $viewed_log = $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ];
170
- } elseif ( ! empty( $logs ) ) {
171
- $viewed_log = current( $logs );
172
- }
173
- $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
174
-
175
- include_once CARTFLOWS_DIR . 'includes/admin/cartflows-error-log.php';
176
- }
177
-
178
- }
179
-
180
- /**
181
- * Kicking this off by calling 'get_instance()' method
182
- */
183
- Cartflows_Logger::get_instance();
1
+ <?php
2
+ /**
3
+ * Logger.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Initialization
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Logger {
14
+
15
+
16
+ /**
17
+ * Member Variable
18
+ *
19
+ * @var instance
20
+ */
21
+ private static $instance;
22
+
23
+ /**
24
+ * Member Variable
25
+ *
26
+ * @var logger
27
+ */
28
+ public $logger;
29
+
30
+ /**
31
+ * Initiator
32
+ */
33
+ public static function get_instance() {
34
+ if ( ! isset( self::$instance ) ) {
35
+ self::$instance = new self();
36
+ }
37
+ return self::$instance;
38
+ }
39
+
40
+ /**
41
+ * Constructor
42
+ */
43
+ public function __construct() {
44
+
45
+ /* Load WC Logger */
46
+ add_action( 'init', array( $this, 'init_wc_logger' ), 99 );
47
+
48
+ $page = filter_input( INPUT_GET, 'page', FILTER_SANITIZE_STRING );
49
+
50
+ if ( CARTFLOWS_SETTINGS === $page ) {
51
+ add_filter( 'admin_footer_text', array( $this, 'add_footer_link' ), 99 );
52
+ }
53
+
54
+ }
55
+
56
+ /**
57
+ * Add footer link.
58
+ */
59
+ public function add_footer_link() {
60
+ $settings_url = add_query_arg(
61
+ array(
62
+ 'page' => CARTFLOWS_SETTINGS,
63
+ 'cartflows-error-log' => 1,
64
+ ),
65
+ admin_url( '/admin.php' )
66
+ );
67
+
68
+ echo '<span id="footer-thankyou"> Thank you for using <a href="https://cartflows.com/">CartFlows</a></span> | <a href="' . $settings_url . '"> View Logs </a>';
69
+ }
70
+
71
+ /**
72
+ * Inint Logger.
73
+ *
74
+ * @since 1.0.0
75
+ */
76
+ public function init_wc_logger() {
77
+ if ( class_exists( 'CartFlows_WC_Logger' ) ) {
78
+ $this->logger = new CartFlows_WC_Logger();
79
+ }
80
+ }
81
+
82
+ /**
83
+ * Write log
84
+ *
85
+ * @param string $message log message.
86
+ * @param string $level type of log.
87
+ * @since 1.0.0
88
+ */
89
+ public function log( $message, $level = 'info' ) {
90
+
91
+ $enable_log = apply_filters( 'cartflows_enable_log', 'enable' );
92
+
93
+ if ( 'enable' === $enable_log &&
94
+ is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
95
+ did_action( 'plugins_loaded' )
96
+ ) {
97
+
98
+ $this->logger->log( $level, $message, array( 'source' => 'cartflows' ) );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Write log
104
+ *
105
+ * @param string $message log message.
106
+ * @param string $level type of log.
107
+ * @since 1.0.0
108
+ */
109
+ public function import_log( $message, $level = 'info' ) {
110
+
111
+ if ( defined( 'WP_DEBUG' ) &&
112
+ WP_DEBUG &&
113
+ is_a( $this->logger, 'CartFlows_WC_Logger' ) &&
114
+ did_action( 'plugins_loaded' )
115
+ ) {
116
+
117
+ $this->logger->log( $level, $message, array( 'source' => 'cartflows-import' ) );
118
+ }
119
+ }
120
+
121
+ /**
122
+ * Get all log files in the log directory.
123
+ *
124
+ * @return array
125
+ */
126
+ public static function get_log_files() {
127
+ $files = scandir( CARTFLOWS_LOG_DIR );
128
+ $result = array();
129
+
130
+ if ( ! empty( $files ) ) {
131
+ foreach ( $files as $key => $value ) {
132
+ if ( ! in_array( $value, array( '.', '..' ), true ) ) {
133
+ if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
134
+ $result[ sanitize_title( $value ) ] = $value;
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ return $result;
141
+ }
142
+
143
+ /**
144
+ * Return the log file handle.
145
+ *
146
+ * @param string $filename Filename to get the handle for.
147
+ * @return string
148
+ */
149
+ public static function get_log_file_handle( $filename ) {
150
+ return substr( $filename, 0, strlen( $filename ) > 48 ? strlen( $filename ) - 48 : strlen( $filename ) - 4 );
151
+ }
152
+
153
+ /**
154
+ * Show the log page contents for file log handler.
155
+ */
156
+ public static function status_logs_file() {
157
+
158
+ if ( ! empty( $_REQUEST['handle'] ) ) {
159
+
160
+ if ( ! isset( $_REQUEST['_wpnonce'] ) || empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ), 'remove_log' ) ) {
161
+ wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'cartflows' ) );
162
+ }
163
+ wp_delete_file( CARTFLOWS_LOG_DIR . rtrim( $_REQUEST['handle'], '-log' ) . '.log' ); //phpcs:ignore
164
+ echo "<div style='padding: 15px;' class='updated inline'> Log deleted successfully! </div>";
165
+ }
166
+
167
+ $logs = self::get_log_files();
168
+ if ( ! empty( $_REQUEST['log_file'] ) && isset( $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ] ) ) {
169
+ $viewed_log = $logs[ sanitize_title( wp_unslash( $_REQUEST['log_file'] ) ) ];
170
+ } elseif ( ! empty( $logs ) ) {
171
+ $viewed_log = current( $logs );
172
+ }
173
+ $handle = ! empty( $viewed_log ) ? self::get_log_file_handle( $viewed_log ) : '';
174
+
175
+ include_once CARTFLOWS_DIR . 'includes/admin/cartflows-error-log.php';
176
+ }
177
+
178
+ }
179
+
180
+ /**
181
+ * Kicking this off by calling 'get_instance()' method
182
+ */
183
+ Cartflows_Logger::get_instance();
languages/cartflows.pot CHANGED
@@ -1,2159 +1,2159 @@
1
- # Copyright (C) 2020 CartFlows Inc
2
- # This file is distributed under the same license as the CartFlows package.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: CartFlows 1.5.15\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
- "POT-Creation-Date: 2020-08-12 08:20:50+00:00\n"
8
- "MIME-Version: 1.0\n"
9
- "Content-Type: text/plain; charset=utf-8\n"
10
- "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "Language: en\n"
15
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- "X-Poedit-Country: United States\n"
17
- "X-Poedit-SourceCharset: UTF-8\n"
18
- "X-Poedit-KeywordsList: "
19
- "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
- "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
- "X-Poedit-Basepath: ../\n"
22
- "X-Poedit-SearchPath-0: .\n"
23
- "X-Poedit-Bookmarks: \n"
24
- "X-Textdomain-Support: yes\n"
25
- "X-Generator: grunt-wp-i18n 1.0.3\n"
26
-
27
- #: admin/bsf-analytics/class-bsf-analytics.php:211
28
- #. translators: %s product name
29
- msgid ""
30
- "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
- "collect non-sensitive diagnostic data and usage information. "
32
- msgstr ""
33
-
34
- #: admin/bsf-analytics/class-bsf-analytics.php:214
35
- msgid "This will be applicable for all sites from the network."
36
- msgstr ""
37
-
38
- #: admin/bsf-analytics/class-bsf-analytics.php:238
39
- #. translators: %s usage doc link
40
- msgid " Know More."
41
- msgstr ""
42
-
43
- #: admin/bsf-analytics/class-bsf-analytics.php:246
44
- msgid "Yes! Allow it"
45
- msgstr ""
46
-
47
- #: admin/bsf-analytics/class-bsf-analytics.php:255
48
- msgid "No Thanks"
49
- msgstr ""
50
-
51
- #: admin/bsf-analytics/class-bsf-analytics.php:359
52
- msgid "Usage Tracking"
53
- msgstr ""
54
-
55
- #: admin/bsf-analytics/class-bsf-analytics.php:403
56
- #. translators: %s Product title
57
- msgid "Allow %s products to track non-sensitive usage tracking data."
58
- msgstr ""
59
-
60
- #: admin/bsf-analytics/class-bsf-analytics.php:406
61
- msgid " This will be applicable for all sites from the network."
62
- msgstr ""
63
-
64
- #: admin/bsf-analytics/class-bsf-analytics.php:411
65
- msgid "Learn More."
66
- msgstr ""
67
-
68
- #: classes/batch-process/class-cartflows-importer-elementor.php:44
69
- msgid "Invalid content."
70
- msgstr ""
71
-
72
- #: classes/batch-process/class-cartflows-importer-elementor.php:56
73
- msgid "Invalid content. Expected an array."
74
- msgstr ""
75
-
76
- #: classes/batch-process/helpers/class-wp-background-process.php:435
77
- msgid "Every %d Minutes"
78
- msgstr ""
79
-
80
- #: classes/class-cartflows-admin-fields.php:235
81
- msgid "Select"
82
- msgstr ""
83
-
84
- #: classes/class-cartflows-admin-fields.php:238
85
- msgid "No Checkout Steps"
86
- msgstr ""
87
-
88
- #: classes/class-cartflows-admin-fields.php:264
89
- #. translators: %s: link
90
- msgid ""
91
- "Be sure not to add any product in above selected Global Checkout step. "
92
- "Please read information about how to set up Global Checkout %1$shere%2$s."
93
- msgstr ""
94
-
95
- #: classes/class-cartflows-admin.php:159 includes/admin/cartflows-home.php:11
96
- msgid "Home"
97
- msgstr ""
98
-
99
- #: classes/class-cartflows-admin.php:164 classes/class-cartflows-admin.php:165
100
- #: modules/optin/classes/class-cartflows-optin-meta.php:150
101
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
102
- msgid "Settings"
103
- msgstr ""
104
-
105
- #: classes/class-cartflows-admin.php:453
106
- msgid "Installing and activating.."
107
- msgstr ""
108
-
109
- #: classes/class-cartflows-admin.php:454
110
- msgid "There was an error with the installation of plugin."
111
- msgstr ""
112
-
113
- #: classes/class-cartflows-admin.php:516
114
- msgid "Flows Library"
115
- msgstr ""
116
-
117
- #: classes/class-cartflows-admin.php:523
118
- #: modules/flow/view/view-remote-importer.php:26
119
- msgid "Ready Templates"
120
- msgstr ""
121
-
122
- #: classes/class-cartflows-admin.php:526
123
- #: modules/flow/view/view-remote-importer.php:29
124
- msgid "Create Your Own"
125
- msgstr ""
126
-
127
- #: classes/class-cartflows-admin.php:537
128
- #: modules/flow/view/view-remote-importer.php:41
129
- msgid "Search Sites"
130
- msgstr ""
131
-
132
- #: classes/class-cartflows-admin.php:538
133
- #: modules/flow/view/view-remote-importer.php:42
134
- msgid "Search Flow..."
135
- msgstr ""
136
-
137
- #: classes/class-cartflows-admin.php:555
138
- msgid "Design Your Flow"
139
- msgstr ""
140
-
141
- #: classes/class-cartflows-admin.php:556
142
- #: classes/class-cartflows-importer.php:665
143
- #: classes/class-cartflows-importer.php:764
144
- #: modules/flow/view/view-remote-importer.php:72
145
- msgid "Learn How"
146
- msgstr ""
147
-
148
- #: classes/class-cartflows-api.php:369
149
- msgid "Request successfully processed!"
150
- msgstr ""
151
-
152
- #: classes/class-cartflows-cloning.php:284
153
- #. translators: %s flow id
154
- msgid "Can't clone this step - %1$s. Flow - %2$s"
155
- msgstr ""
156
-
157
- #: classes/class-cartflows-cloning.php:401
158
- #. translators: %s flow id
159
- msgid "Step - %1$s cloned. Flow - %2$s"
160
- msgstr ""
161
-
162
- #: classes/class-cartflows-cloning.php:427
163
- msgid "Clone this flow"
164
- msgstr ""
165
-
166
- #: classes/class-cartflows-cloning.php:427
167
- #: modules/flow/classes/class-cartflows-flow-meta.php:824
168
- msgid "Clone"
169
- msgstr ""
170
-
171
- #: classes/class-cartflows-default-meta.php:745
172
- #: modules/optin/classes/class-cartflows-optin-meta.php:490
173
- msgid "Submit"
174
- msgstr ""
175
-
176
- #: classes/class-cartflows-flow-frontend.php:53
177
- msgid ""
178
- "Test mode is active — which displays random products for previewing. It can "
179
- "be deactivated from the flow settings in the admin dashboard."
180
- msgstr ""
181
-
182
- #: classes/class-cartflows-flow-frontend.php:58
183
- msgid "Click here to disable it"
184
- msgstr ""
185
-
186
- #: classes/class-cartflows-importer.php:81
187
- msgid "Export this flow"
188
- msgstr ""
189
-
190
- #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
191
- msgid "Export"
192
- msgstr ""
193
-
194
- #: classes/class-cartflows-importer.php:92
195
- msgid "Flow Export"
196
- msgstr ""
197
-
198
- #: classes/class-cartflows-importer.php:93
199
- msgid "Flow Import"
200
- msgstr ""
201
-
202
- #: classes/class-cartflows-importer.php:104
203
- msgid "No post to export has been supplied!"
204
- msgstr ""
205
-
206
- #: classes/class-cartflows-importer.php:278
207
- msgid "Please upload a valid .json file"
208
- msgstr ""
209
-
210
- #: classes/class-cartflows-importer.php:284
211
- msgid "Please upload a file to import"
212
- msgstr ""
213
-
214
- #: classes/class-cartflows-importer.php:506
215
- msgid "Successfully imported flows."
216
- msgstr ""
217
-
218
- #: classes/class-cartflows-importer.php:538
219
- msgid "Loading Steps"
220
- msgstr ""
221
-
222
- #: classes/class-cartflows-importer.php:540
223
- msgid "Getting steps from the cloud. Please wait for the moment."
224
- msgstr ""
225
-
226
- #: classes/class-cartflows-importer.php:551
227
- msgid "Searching Template.."
228
- msgstr ""
229
-
230
- #: classes/class-cartflows-importer.php:553
231
- msgid "Getting templates from the cloud. Please wait for the moment."
232
- msgstr ""
233
-
234
- #: classes/class-cartflows-importer.php:562
235
- msgid "Importing.."
236
- msgstr ""
237
-
238
- #: classes/class-cartflows-importer.php:571
239
- #: classes/class-cartflows-importer.php:611
240
- msgid "Imported"
241
- msgstr ""
242
-
243
- #: classes/class-cartflows-importer.php:572
244
- #: classes/class-cartflows-importer.php:612
245
- msgid "Thanks for patience"
246
- msgstr ""
247
-
248
- #: classes/class-cartflows-importer.php:581
249
- #: classes/class-cartflows-importer.php:593
250
- msgid "Coming Soon!"
251
- msgstr ""
252
-
253
- #: classes/class-cartflows-importer.php:612
254
- msgid "Redirecting to the Elementor edit window."
255
- msgstr ""
256
-
257
- #: classes/class-cartflows-importer.php:658
258
- #: classes/class-cartflows-importer.php:774
259
- msgid "Pro"
260
- msgstr ""
261
-
262
- #: classes/class-cartflows-importer.php:699
263
- #: classes/class-cartflows-importer.php:806
264
- msgid "Activate License"
265
- msgstr ""
266
-
267
- #: classes/class-cartflows-importer.php:701
268
- #: classes/class-cartflows-importer.php:808
269
- #: modules/flow/classes/class-cartflows-flow-meta.php:503
270
- msgid "Get Pro"
271
- msgstr ""
272
-
273
- #: classes/class-cartflows-importer.php:726
274
- msgid "Create"
275
- msgstr ""
276
-
277
- #: classes/class-cartflows-importer.php:825
278
- msgid "Under Maintenance.."
279
- msgstr ""
280
-
281
- #: classes/class-cartflows-importer.php:826
282
- msgid ""
283
- "If you are seeing this message, most likely our servers are under routine "
284
- "maintenance and we will be back shortly."
285
- msgstr ""
286
-
287
- #: classes/class-cartflows-importer.php:827
288
- msgid ""
289
- "In rare case, it is possible your website is having trouble connecting with "
290
- "ours. If you need help, please feel free to get in touch with us from our "
291
- "website.."
292
- msgstr ""
293
-
294
- #: classes/class-cartflows-importer.php:857
295
- #. translators: %s: Plugin string
296
- msgid ""
297
- "%1$s to see CartFlows templates. If you prefer another page builder tool, "
298
- "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
299
- msgstr ""
300
-
301
- #: classes/class-cartflows-importer.php:872
302
- msgid "All"
303
- msgstr ""
304
-
305
- #: classes/class-cartflows-importer.php:875
306
- msgid "Select Step Type"
307
- msgstr ""
308
-
309
- #: classes/class-cartflows-importer.php:959
310
- msgid "Import from Cloud"
311
- msgstr ""
312
-
313
- #: classes/class-cartflows-importer.php:1267
314
- msgid "Sales Landing"
315
- msgstr ""
316
-
317
- #: classes/class-cartflows-importer.php:1271
318
- #: modules/flow/classes/class-cartflows-step-post-type.php:253
319
- #: modules/flow/view/meta-flow-steps.php:12
320
- msgid "Checkout (Woo)"
321
- msgstr ""
322
-
323
- #: classes/class-cartflows-importer.php:1275
324
- #: modules/flow/classes/class-cartflows-step-post-type.php:260
325
- #: modules/flow/view/meta-flow-steps.php:13
326
- msgid "Thank You (Woo)"
327
- msgstr ""
328
-
329
- #: classes/class-cartflows-importer.php:1283
330
- #: modules/flow/classes/class-cartflows-step-post-type.php:239
331
- #: modules/flow/view/meta-flow-steps.php:11
332
- msgid "Landing"
333
- msgstr ""
334
-
335
- #: classes/class-cartflows-importer.php:1287
336
- msgid "Thank You"
337
- msgstr ""
338
-
339
- #: classes/class-cartflows-importer.php:1397
340
- #. translators: %s: template ID
341
- msgid "Invalid template id %1$s or post id %2$s."
342
- msgstr ""
343
-
344
- #: classes/class-cartflows-importer.php:1472
345
- #. translators: %s: flow ID
346
- msgid "Invalid flow id %1$s OR step type %2$s."
347
- msgstr ""
348
-
349
- #: classes/class-cartflows-importer.php:1597
350
- msgid ""
351
- "Elementor is not activated. Please activate plugin Elementor Page Builder "
352
- "to import the step."
353
- msgstr ""
354
-
355
- #: classes/class-cartflows-importer.php:1700
356
- msgid "Action failed. Invalid Security Nonce."
357
- msgstr ""
358
-
359
- #: classes/class-cartflows-importer.php:1707
360
- msgid "User have not plugin install permissions."
361
- msgstr ""
362
-
363
- #: classes/class-cartflows-importer.php:1729
364
- msgid "Plugin Successfully Activated"
365
- msgstr ""
366
-
367
- #: classes/class-cartflows-learndash-compatibility.php:86
368
- msgid "None"
369
- msgstr ""
370
-
371
- #: classes/class-cartflows-learndash-compatibility.php:113
372
- #. translators: 1: anchor start, 2: anchor close
373
- msgid ""
374
- "Non-enrolled students will redirect to the selected CartFlows template. If "
375
- "you have not created any Flow already, add new Flow from %1$shere%2$s."
376
- msgstr ""
377
-
378
- #: classes/class-cartflows-learndash-compatibility.php:119
379
- msgid "Select CartFlows Template for this Course"
380
- msgstr ""
381
-
382
- #: classes/class-cartflows-loader.php:232
383
- #. translators: %s: html tags
384
- msgid ""
385
- "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
386
- "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
387
- msgstr ""
388
-
389
- #: classes/class-cartflows-loader.php:501
390
- #. translators: %s: html tags
391
- msgid ""
392
- "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
393
- "activated."
394
- msgstr ""
395
-
396
- #: classes/class-cartflows-loader.php:511
397
- msgid "Activate WooCommerce"
398
- msgstr ""
399
-
400
- #: classes/class-cartflows-loader.php:519
401
- msgid "Install WooCommerce"
402
- msgstr ""
403
-
404
- #: classes/class-cartflows-logger.php:161
405
- msgid "Action failed. Please refresh the page and retry."
406
- msgstr ""
407
-
408
- #: classes/class-cartflows-meta-fields.php:61
409
- msgid "Thin 100"
410
- msgstr ""
411
-
412
- #: classes/class-cartflows-meta-fields.php:62
413
- msgid "Extra-Light 200"
414
- msgstr ""
415
-
416
- #: classes/class-cartflows-meta-fields.php:63
417
- msgid "Light 300"
418
- msgstr ""
419
-
420
- #: classes/class-cartflows-meta-fields.php:64
421
- msgid "Normal 400"
422
- msgstr ""
423
-
424
- #: classes/class-cartflows-meta-fields.php:65
425
- msgid "Medium 500"
426
- msgstr ""
427
-
428
- #: classes/class-cartflows-meta-fields.php:66
429
- msgid "Semi-Bold 600"
430
- msgstr ""
431
-
432
- #: classes/class-cartflows-meta-fields.php:67
433
- msgid "Bold 700"
434
- msgstr ""
435
-
436
- #: classes/class-cartflows-meta-fields.php:68
437
- msgid "Extra-Bold 800"
438
- msgstr ""
439
-
440
- #: classes/class-cartflows-meta-fields.php:69
441
- msgid "Ultra-Bold 900"
442
- msgstr ""
443
-
444
- #: classes/class-cartflows-meta-fields.php:182
445
- #. Translators: %d stock amount
446
- msgid "Stock: %d"
447
- msgstr ""
448
-
449
- #: classes/class-cartflows-meta-fields.php:765
450
- #: includes/meta-fields/generate-product-repeater.php:30
451
- msgid "Search for a product&hellip;"
452
- msgstr ""
453
-
454
- #: classes/class-cartflows-meta-fields.php:816
455
- msgid "Search for a coupon&hellip;"
456
- msgstr ""
457
-
458
- #: classes/class-cartflows-meta.php:34
459
- msgid "Update"
460
- msgstr ""
461
-
462
- #: classes/class-cartflows-meta.php:42
463
- #: modules/flow/classes/class-cartflows-flow-meta.php:95
464
- #: modules/flow/classes/class-cartflows-flow-meta.php:763
465
- msgid "Back to edit Flow"
466
- msgstr ""
467
-
468
- #: classes/class-cartflows-meta.php:63
469
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:198
470
- #: modules/landing/classes/class-cartflows-landing-meta.php:136
471
- #: modules/optin/classes/class-cartflows-optin-meta.php:156
472
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
473
- msgid "Custom Script"
474
- msgstr ""
475
-
476
- #: classes/class-cartflows-meta.php:66
477
- msgid ""
478
- "Custom script lets you add your own custom script on front end of this flow "
479
- "page."
480
- msgstr ""
481
-
482
- #: classes/class-cartflows-metabox.php:59
483
- msgid "Flow Details"
484
- msgstr ""
485
-
486
- #: classes/class-cartflows-wizard.php:94
487
- msgid "Thanks for installing and using CartFlows!"
488
- msgstr ""
489
-
490
- #: classes/class-cartflows-wizard.php:95
491
- msgid ""
492
- "It is easy to use the CartFlows. Please use the setup wizard to quick start "
493
- "setup."
494
- msgstr ""
495
-
496
- #: classes/class-cartflows-wizard.php:97
497
- msgid "Start Wizard"
498
- msgstr ""
499
-
500
- #: classes/class-cartflows-wizard.php:98
501
- msgid "Skip Setup"
502
- msgstr ""
503
-
504
- #: classes/class-cartflows-wizard.php:128
505
- msgid "Welcome"
506
- msgstr ""
507
-
508
- #: classes/class-cartflows-wizard.php:133
509
- msgid "Page Builder"
510
- msgstr ""
511
-
512
- #: classes/class-cartflows-wizard.php:137
513
- msgid "Checkout"
514
- msgstr ""
515
-
516
- #: classes/class-cartflows-wizard.php:141
517
- msgid "Training"
518
- msgstr ""
519
-
520
- #: classes/class-cartflows-wizard.php:145
521
- msgid "Ready!"
522
- msgstr ""
523
-
524
- #: classes/class-cartflows-wizard.php:220
525
- msgid "CartFlows Setup"
526
- msgstr ""
527
-
528
- #: classes/class-cartflows-wizard.php:246
529
- msgid "Exit Setup Wizard"
530
- msgstr ""
531
-
532
- #: classes/class-cartflows-wizard.php:299
533
- msgid "Welcome to CartFlows!"
534
- msgstr ""
535
-
536
- #: classes/class-cartflows-wizard.php:300
537
- msgid ""
538
- "Thank you for choosing CartFlows to get more leads, increase conversions, & "
539
- "maximize profits. This short setup wizard will guide you though configuring "
540
- "CartFlows and creating your first funnel."
541
- msgstr ""
542
-
543
- #: classes/class-cartflows-wizard.php:304
544
- msgid "Let&#x27;s Build it better!"
545
- msgstr ""
546
-
547
- #: classes/class-cartflows-wizard.php:305
548
- msgid ""
549
- "Get improved features and faster fixes by sharing non-sensitive data via "
550
- "usage tracking that shows us how CartFlows is used. No personal data is "
551
- "tracked or stored."
552
- msgstr ""
553
-
554
- #: classes/class-cartflows-wizard.php:306
555
- msgid "Learn More"
556
- msgstr ""
557
-
558
- #: classes/class-cartflows-wizard.php:309
559
- msgid "Yes, I am in."
560
- msgstr ""
561
-
562
- #: classes/class-cartflows-wizard.php:316
563
- msgid "Lets Go »"
564
- msgstr ""
565
-
566
- #: classes/class-cartflows-wizard.php:344
567
- msgid "Page Builder Setup"
568
- msgstr ""
569
-
570
- #: classes/class-cartflows-wizard.php:345
571
- msgid "Please select a page builder you would like to use with CartFlows."
572
- msgstr ""
573
-
574
- #: classes/class-cartflows-wizard.php:350
575
- msgid "Select Page Builder"
576
- msgstr ""
577
-
578
- #: classes/class-cartflows-wizard.php:357
579
- #: classes/class-cartflows-wizard.php:423
580
- #: includes/admin/cartflows-general.php:76
581
- msgid "Elementor"
582
- msgstr ""
583
-
584
- #: classes/class-cartflows-wizard.php:367
585
- msgid "Beaver Builder Plugin (Lite Version)"
586
- msgstr ""
587
-
588
- #: classes/class-cartflows-wizard.php:377
589
- #: includes/admin/cartflows-general.php:78
590
- msgid "Divi"
591
- msgstr ""
592
-
593
- #: classes/class-cartflows-wizard.php:387
594
- #: includes/admin/cartflows-general.php:79
595
- msgid "Gutenberg"
596
- msgstr ""
597
-
598
- #: classes/class-cartflows-wizard.php:397
599
- #: includes/admin/cartflows-general.php:80
600
- msgid "Other"
601
- msgstr ""
602
-
603
- #: classes/class-cartflows-wizard.php:419
604
- msgid ""
605
- "While CartFlows Should work with most page builders, we offer templates for "
606
- "the above page builders."
607
- msgstr ""
608
-
609
- #: classes/class-cartflows-wizard.php:422
610
- #: classes/class-cartflows-wizard.php:464
611
- msgid "The following plugin will be installed and activated for you:"
612
- msgstr ""
613
-
614
- #: classes/class-cartflows-wizard.php:429
615
- #: classes/class-cartflows-wizard.php:474
616
- #: classes/class-cartflows-wizard.php:684
617
- msgid "« Previous"
618
- msgstr ""
619
-
620
- #: classes/class-cartflows-wizard.php:432
621
- msgid "Skip this step"
622
- msgstr ""
623
-
624
- #: classes/class-cartflows-wizard.php:433
625
- msgid "Next »"
626
- msgstr ""
627
-
628
- #: classes/class-cartflows-wizard.php:452
629
- msgid "Choose a checkout"
630
- msgstr ""
631
-
632
- #: classes/class-cartflows-wizard.php:455
633
- msgid ""
634
- "While CartFlows is designed to use WooCommerce sell digital and physical "
635
- "products, not all funnels need a checkout system."
636
- msgstr ""
637
-
638
- #: classes/class-cartflows-wizard.php:457
639
- msgid ""
640
- "Would you like to install WooCommerce to sell digital and physical products "
641
- "in your funnels?"
642
- msgstr ""
643
-
644
- #: classes/class-cartflows-wizard.php:465
645
- msgid "WooCommerce"
646
- msgstr ""
647
-
648
- #: classes/class-cartflows-wizard.php:466
649
- msgid "WooCommerce Cart Abandonment Recovery"
650
- msgstr ""
651
-
652
- #: classes/class-cartflows-wizard.php:477
653
- #: classes/class-cartflows-wizard.php:687
654
- msgid "No thanks"
655
- msgstr ""
656
-
657
- #: classes/class-cartflows-wizard.php:478
658
- msgid "Yes"
659
- msgstr ""
660
-
661
- #: classes/class-cartflows-wizard.php:620
662
- msgid "Congratulations, You Did It!"
663
- msgstr ""
664
-
665
- #: classes/class-cartflows-wizard.php:627
666
- msgid ""
667
- "CartFlows is ready to use on your website. You've successfully completed "
668
- "the setup process and all that is left for you to do is create your first "
669
- "flow."
670
- msgstr ""
671
-
672
- #: classes/class-cartflows-wizard.php:641
673
- msgid "Create a flow"
674
- msgstr ""
675
-
676
- #: classes/class-cartflows-wizard.php:658
677
- msgid "Exclusive CartFlows Training Course Offer"
678
- msgstr ""
679
-
680
- #: classes/class-cartflows-wizard.php:669
681
- msgid ""
682
- "We want you to get off to a great start using CartFlows, so we would like "
683
- "to give access to our exclusive training course."
684
- msgstr ""
685
-
686
- #: classes/class-cartflows-wizard.php:670
687
- msgid "Get access to this couse, for free, by entering your email below."
688
- msgstr ""
689
-
690
- #: classes/class-cartflows-wizard.php:672
691
- msgid "Enter Email address"
692
- msgstr ""
693
-
694
- #: classes/class-cartflows-wizard.php:688
695
- msgid "Allow"
696
- msgstr ""
697
-
698
- #: classes/lib/notices/class-astra-notices.php:125
699
- msgid "WordPress Nonce not validated."
700
- msgstr ""
701
-
702
- #: classes/logger/class-cartflows-log-handler-file.php:351
703
- #: classes/logger/class-cartflows-log-handler-file.php:371
704
- msgid "This method should not be called before plugins_loaded."
705
- msgstr ""
706
-
707
- #: classes/logger/class-cartflows-wc-logger.php:58
708
- #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
709
- msgid "The provided handler %1$s does not implement %2$s."
710
- msgstr ""
711
-
712
- #: classes/logger/class-cartflows-wc-logger.php:136
713
- #. translators: 1: Cartflows_WC_Logger::log 2: level
714
- msgid "%1$s was called with an invalid level \"%2$s\"."
715
- msgstr ""
716
-
717
- #: includes/admin/cartflows-admin-header.php:17
718
- #: includes/admin/cartflows-admin.php:19
719
- msgid "Generate More Leads & More Sales"
720
- msgstr ""
721
-
722
- #: includes/admin/cartflows-admin.php:29
723
- msgid "Settings saved successfully."
724
- msgstr ""
725
-
726
- #: includes/admin/cartflows-error-log.php:36
727
- msgid "%1$s at %2$s"
728
- msgstr ""
729
-
730
- #: includes/admin/cartflows-error-log.php:41
731
- #: modules/flow/classes/class-cartflows-flow-meta.php:804
732
- #: modules/flow/classes/class-cartflows-flow-post-type.php:225
733
- msgid "View"
734
- msgstr ""
735
-
736
- #: includes/admin/cartflows-error-log.php:65
737
- msgid "Delete log"
738
- msgstr ""
739
-
740
- #: includes/admin/cartflows-error-log.php:70
741
- msgid "There are currently no logs to view."
742
- msgstr ""
743
-
744
- #: includes/admin/cartflows-general.php:31
745
- #: includes/admin/cartflows-general.php:40
746
- msgid "General Settings"
747
- msgstr ""
748
-
749
- #: includes/admin/cartflows-general.php:53
750
- msgid "Disallow search engines from indexing flows"
751
- msgstr ""
752
-
753
- #: includes/admin/cartflows-general.php:63
754
- #: modules/flow/view/view-flow-inner-step.php:52
755
- msgid "Global Checkout"
756
- msgstr ""
757
-
758
- #: includes/admin/cartflows-general.php:72
759
- msgid "Show Templates designed with"
760
- msgstr ""
761
-
762
- #: includes/admin/cartflows-general.php:73
763
- msgid ""
764
- "CartFlows offers flow templates that can be imported in one click. These "
765
- "templates are available in few different page builders. Please choose your "
766
- "preferred page builder from the list so you will only see templates that "
767
- "are made using that page builder.."
768
- msgstr ""
769
-
770
- #: includes/admin/cartflows-general.php:77
771
- msgid "Beaver Builder"
772
- msgstr ""
773
-
774
- #: includes/admin/cartflows-general.php:89
775
- #: includes/admin/cartflows-general.php:175
776
- #: includes/admin/cartflows-general.php:281
777
- #: includes/admin/cartflows-general.php:398
778
- msgid "Save Changes"
779
- msgstr ""
780
-
781
- #: includes/admin/cartflows-general.php:101
782
- msgid "Permalink Settings"
783
- msgstr ""
784
-
785
- #: includes/admin/cartflows-general.php:116
786
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:647
787
- #: modules/optin/classes/class-cartflows-optin-meta.php:383
788
- msgid "Default"
789
- msgstr ""
790
-
791
- #: includes/admin/cartflows-general.php:122
792
- msgid "Flow and Step Slug"
793
- msgstr ""
794
-
795
- #: includes/admin/cartflows-general.php:128
796
- msgid "Flow Slug"
797
- msgstr ""
798
-
799
- #: includes/admin/cartflows-general.php:134
800
- msgid "Step Slug"
801
- msgstr ""
802
-
803
- #: includes/admin/cartflows-general.php:146
804
- msgid "Post Type Permalink Base"
805
- msgstr ""
806
-
807
- #: includes/admin/cartflows-general.php:154
808
- msgid "Step Base"
809
- msgstr ""
810
-
811
- #: includes/admin/cartflows-general.php:164
812
- msgid "Flow Base"
813
- msgstr ""
814
-
815
- #: includes/admin/cartflows-general.php:176
816
- msgid "Set Default"
817
- msgstr ""
818
-
819
- #: includes/admin/cartflows-general.php:190
820
- msgid "Facebook Pixel Settings"
821
- msgstr ""
822
-
823
- #: includes/admin/cartflows-general.php:205
824
- msgid "Enable Facebook Pixel Tracking"
825
- msgstr ""
826
-
827
- #: includes/admin/cartflows-general.php:218
828
- msgid "Enable for the whole site"
829
- msgstr ""
830
-
831
- #: includes/admin/cartflows-general.php:226
832
- #: includes/admin/cartflows-general.php:325
833
- msgid "If this option is unchecked, it will only apply to CartFlows steps."
834
- msgstr ""
835
-
836
- #: includes/admin/cartflows-general.php:236
837
- msgid "Enter Facebook pixel ID"
838
- msgstr ""
839
-
840
- #: includes/admin/cartflows-general.php:244
841
- #: includes/admin/cartflows-general.php:343
842
- msgid "Enable Events:"
843
- msgstr ""
844
-
845
- #: includes/admin/cartflows-general.php:253
846
- msgid "Initiate Checkout"
847
- msgstr ""
848
-
849
- #: includes/admin/cartflows-general.php:262
850
- #: includes/admin/cartflows-general.php:369
851
- msgid "Add Payment Info"
852
- msgstr ""
853
-
854
- #: includes/admin/cartflows-general.php:271
855
- msgid "Purchase Complete"
856
- msgstr ""
857
-
858
- #: includes/admin/cartflows-general.php:293
859
- msgid "Google Analytics Settings"
860
- msgstr ""
861
-
862
- #: includes/admin/cartflows-general.php:304
863
- msgid "Enable Google Analytics Tracking"
864
- msgstr ""
865
-
866
- #: includes/admin/cartflows-general.php:317
867
- msgid "Enable for the whole website"
868
- msgstr ""
869
-
870
- #: includes/admin/cartflows-general.php:335
871
- msgid "Google Analytics ID"
872
- msgstr ""
873
-
874
- #: includes/admin/cartflows-general.php:337
875
- msgid ""
876
- "Log into your <a href=\"https://analytics.google.com/\" "
877
- "target=\"_blank\">google analytics account</a> to find your ID. eg: "
878
- "UA-XXXXXX-X&period;"
879
- msgstr ""
880
-
881
- #: includes/admin/cartflows-general.php:351
882
- msgid "Begin Checkout"
883
- msgstr ""
884
-
885
- #: includes/admin/cartflows-general.php:360
886
- msgid "Add To Cart"
887
- msgstr ""
888
-
889
- #: includes/admin/cartflows-general.php:378
890
- msgid "Purchase"
891
- msgstr ""
892
-
893
- #: includes/admin/cartflows-general.php:386
894
- msgid ""
895
- "Google Analytics not working correctly? <a "
896
- "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
897
- "issues/\" > Click here </a> to know more. "
898
- msgstr ""
899
-
900
- #: includes/admin/cartflows-general.php:419
901
- #: includes/admin/cartflows-home.php:43
902
- msgid "Knowledge Base"
903
- msgstr ""
904
-
905
- #: includes/admin/cartflows-general.php:423
906
- #: includes/admin/cartflows-home.php:47
907
- msgid "Not sure how something works? Take a peek at the knowledge base and learn."
908
- msgstr ""
909
-
910
- #: includes/admin/cartflows-general.php:426
911
- #: includes/admin/cartflows-home.php:50
912
- msgid "Visit Knowledge Base »"
913
- msgstr ""
914
-
915
- #: includes/admin/cartflows-general.php:434
916
- #: includes/admin/cartflows-home.php:58
917
- msgid "Community"
918
- msgstr ""
919
-
920
- #: includes/admin/cartflows-general.php:438
921
- #: includes/admin/cartflows-home.php:62
922
- msgid ""
923
- "Join the community of super helpful CartFlows users. Say hello, ask "
924
- "questions, give feedback and help each other!"
925
- msgstr ""
926
-
927
- #: includes/admin/cartflows-general.php:441
928
- #: includes/admin/cartflows-home.php:65
929
- msgid "Join Our Facebook Group »"
930
- msgstr ""
931
-
932
- #: includes/admin/cartflows-general.php:449
933
- #: includes/admin/cartflows-home.php:73
934
- msgid "Five Star Support"
935
- msgstr ""
936
-
937
- #: includes/admin/cartflows-general.php:453
938
- #: includes/admin/cartflows-home.php:77
939
- msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
940
- msgstr ""
941
-
942
- #: includes/admin/cartflows-general.php:456
943
- #: includes/admin/cartflows-home.php:80
944
- msgid "Submit a Ticket »"
945
- msgstr ""
946
-
947
- #: includes/admin/cartflows-general.php:466
948
- msgid "Load Minified CSS"
949
- msgstr ""
950
-
951
- #: includes/admin/cartflows-general.php:471
952
- msgid ""
953
- "Load the Minified CSS from here. Just Enable it by checking the below given "
954
- "checkbox."
955
- msgstr ""
956
-
957
- #: includes/admin/cartflows-general.php:478
958
- msgid "Load minified CSS & JS Files"
959
- msgstr ""
960
-
961
- #: includes/admin/cartflows-general.php:483
962
- msgid "Save"
963
- msgstr ""
964
-
965
- #: includes/admin/cartflows-home.php:20
966
- msgid "Getting Started"
967
- msgstr ""
968
-
969
- #: includes/admin/cartflows-home.php:28
970
- msgid "Modernizing WordPress eCommerce!"
971
- msgstr ""
972
-
973
- #: includes/exporter.php:12
974
- msgid "Export Flows to a JSON file"
975
- msgstr ""
976
-
977
- #: includes/exporter.php:13
978
- msgid ""
979
- "This tool allows you to generate and download a JSON file containing a list "
980
- "of all flows."
981
- msgstr ""
982
-
983
- #: includes/importer.php:12
984
- msgid "Import Flows to a JSON file"
985
- msgstr ""
986
-
987
- #: includes/importer.php:13
988
- msgid "This tool allows you to import the flows from the JSON file."
989
- msgstr ""
990
-
991
- #: includes/importer.php:21
992
- msgid "Import"
993
- msgstr ""
994
-
995
- #: includes/meta-fields/generate-product-repeater.php:36
996
- msgid "Remove"
997
- msgstr ""
998
-
999
- #: includes/meta-fields/generate-product-repeater.php:51
1000
- msgid "Product Quantity"
1001
- msgstr ""
1002
-
1003
- #: includes/meta-fields/generate-product-repeater.php:65
1004
- msgid "Discount Type"
1005
- msgstr ""
1006
-
1007
- #: includes/meta-fields/generate-product-repeater.php:69
1008
- msgid "Select Discount Type"
1009
- msgstr ""
1010
-
1011
- #: includes/meta-fields/generate-product-repeater.php:70
1012
- msgid "Original"
1013
- msgstr ""
1014
-
1015
- #: includes/meta-fields/generate-product-repeater.php:71
1016
- msgid "Percentage"
1017
- msgstr ""
1018
-
1019
- #: includes/meta-fields/generate-product-repeater.php:72
1020
- msgid "Price"
1021
- msgstr ""
1022
-
1023
- #: includes/meta-fields/generate-product-repeater.php:83
1024
- msgid "Discount Value"
1025
- msgstr ""
1026
-
1027
- #: includes/meta-fields/generate-product-repeater.php:85
1028
- msgid "Discount value will apply for each quantity of product."
1029
- msgstr ""
1030
-
1031
- #: includes/meta-fields/get-product-selection-repeater.php:112
1032
- msgid "Add New Product"
1033
- msgstr ""
1034
-
1035
- #: includes/meta-fields/get-product-selection-repeater.php:113
1036
- msgid "Create Product"
1037
- msgstr ""
1038
-
1039
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:284
1040
- #: modules/optin/classes/class-cartflows-optin-markup.php:159
1041
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1042
- msgid ""
1043
- "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1044
- "it."
1045
- msgstr ""
1046
-
1047
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:285
1048
- #: modules/optin/classes/class-cartflows-optin-markup.php:160
1049
- #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1050
- msgid "Click Here to Reload"
1051
- msgstr ""
1052
-
1053
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:303
1054
- msgid "Checkout ID not found"
1055
- msgstr ""
1056
-
1057
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:366
1058
- #: modules/checkout/templates/embed/checkout-template-simple.php:25
1059
- #: modules/checkout/templates/wcf-template.php:36
1060
- #: modules/optin/templates/optin-template-simple.php:25
1061
- msgid "Your cart is currently empty."
1062
- msgstr ""
1063
-
1064
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:432
1065
- msgid ""
1066
- "No product is selected. Please select products from the checkout meta "
1067
- "settings to continue."
1068
- msgstr ""
1069
-
1070
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:522
1071
- msgid "Variations Not set"
1072
- msgstr ""
1073
-
1074
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:530
1075
- msgid "This product can't be purchased"
1076
- msgstr ""
1077
-
1078
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:975
1079
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1018
1080
- msgid "Coupon Code"
1081
- msgstr ""
1082
-
1083
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:976
1084
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1027
1085
- msgid "Apply"
1086
- msgstr ""
1087
-
1088
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1183
1089
- msgid "Sorry there was a problem removing this coupon."
1090
- msgstr ""
1091
-
1092
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1186
1093
- msgid "Coupon has been removed."
1094
- msgstr ""
1095
-
1096
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1205
1097
- msgid "Sorry there was a problem removing "
1098
- msgstr ""
1099
-
1100
- #: modules/checkout/classes/class-cartflows-checkout-markup.php:1208
1101
- msgid " has been removed."
1102
- msgstr ""
1103
-
1104
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:65
1105
- msgid "Checkout Layout"
1106
- msgstr ""
1107
-
1108
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
1109
- #: modules/landing/classes/class-cartflows-landing-meta.php:130
1110
- #: modules/optin/classes/class-cartflows-optin-meta.php:126
1111
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
1112
- msgid "Shortcodes"
1113
- msgstr ""
1114
-
1115
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
1116
- #: modules/optin/classes/class-cartflows-optin-meta.php:132
1117
- msgid "Select Product"
1118
- msgstr ""
1119
-
1120
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:162
1121
- msgid "Product Options"
1122
- msgstr ""
1123
-
1124
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:168
1125
- msgid "Order Bump"
1126
- msgstr ""
1127
-
1128
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:174
1129
- msgid "Checkout Offer"
1130
- msgstr ""
1131
-
1132
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:180
1133
- msgid "Checkout Design"
1134
- msgstr ""
1135
-
1136
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1137
- msgid "Checkout Fields"
1138
- msgstr ""
1139
-
1140
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
1141
- msgid "Checkout Settings"
1142
- msgstr ""
1143
-
1144
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:209
1145
- msgid "Logo (Optional)"
1146
- msgstr ""
1147
-
1148
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:270
1149
- #. translators: %s: link
1150
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1151
- msgstr ""
1152
-
1153
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:281
1154
- #. translators: %s: link.
1155
- msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1156
- msgstr ""
1157
-
1158
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:309
1159
- msgid "Add this shortcode to your checkout page"
1160
- msgstr ""
1161
-
1162
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1163
- #. translators: %s: link
1164
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1165
- msgstr ""
1166
-
1167
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1168
- #. translators: %s: link
1169
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1170
- msgstr ""
1171
-
1172
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1173
- #. translators: %s: link
1174
- msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1175
- msgstr ""
1176
-
1177
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1178
- #. translators: %s: link
1179
- msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1180
- msgstr ""
1181
-
1182
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1183
- #. translators: %s: link
1184
- msgid ""
1185
- "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1186
- "feature"
1187
- msgstr ""
1188
-
1189
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
1190
- #. translators: %s: link
1191
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1192
- msgstr ""
1193
-
1194
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1195
- #: modules/optin/classes/class-cartflows-optin-meta.php:270
1196
- #. translators: %s: link
1197
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1198
- msgstr ""
1199
-
1200
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
1201
- msgid "Place Order Button Text"
1202
- msgstr ""
1203
-
1204
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
1205
- msgid "Place order"
1206
- msgstr ""
1207
-
1208
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
1209
- msgid "It will change the Place Order Button text on checkout page."
1210
- msgstr ""
1211
-
1212
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
1213
- msgid "Enable cart editing on checkout"
1214
- msgstr ""
1215
-
1216
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
1217
- #. translators: %s: link
1218
- msgid "Users will able to remove products from the checkout page."
1219
- msgstr ""
1220
-
1221
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:546
1222
- msgid "One Column (Available in CartFlows Pro) "
1223
- msgstr ""
1224
-
1225
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:547
1226
- msgid "Two Step (Available in CartFlows Pro) "
1227
- msgstr ""
1228
-
1229
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:553
1230
- msgid "Checkout Skin"
1231
- msgstr ""
1232
-
1233
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
1234
- msgid "One Column"
1235
- msgstr ""
1236
-
1237
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
1238
- msgid "Two Column"
1239
- msgstr ""
1240
-
1241
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1242
- msgid "Two Step"
1243
- msgstr ""
1244
-
1245
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:568
1246
- #: modules/optin/classes/class-cartflows-optin-meta.php:346
1247
- msgid "Primary Color"
1248
- msgstr ""
1249
-
1250
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:577
1251
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:612
1252
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:658
1253
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:750
1254
- #: modules/optin/classes/class-cartflows-optin-meta.php:355
1255
- #: modules/optin/classes/class-cartflows-optin-meta.php:394
1256
- #: modules/optin/classes/class-cartflows-optin-meta.php:506
1257
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1258
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:240
1259
- msgid "Font Family"
1260
- msgstr ""
1261
-
1262
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:585
1263
- msgid "Advance Options"
1264
- msgstr ""
1265
-
1266
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1267
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:225
1268
- msgid "Heading"
1269
- msgstr ""
1270
-
1271
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1272
- msgid "Heading Color"
1273
- msgstr ""
1274
-
1275
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1276
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:667
1277
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:759
1278
- #: modules/optin/classes/class-cartflows-optin-meta.php:403
1279
- #: modules/optin/classes/class-cartflows-optin-meta.php:515
1280
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1281
- msgid "Font Weight"
1282
- msgstr ""
1283
-
1284
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
1285
- #: modules/optin/classes/class-cartflows-optin-meta.php:366
1286
- msgid "Input Fields"
1287
- msgstr ""
1288
-
1289
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1290
- #: modules/optin/classes/class-cartflows-optin-meta.php:373
1291
- msgid "Floating Labels (Available in CartFlows Pro)"
1292
- msgstr ""
1293
-
1294
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:643
1295
- #: modules/optin/classes/class-cartflows-optin-meta.php:379
1296
- msgid "Style"
1297
- msgstr ""
1298
-
1299
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:648
1300
- #: modules/optin/classes/class-cartflows-optin-meta.php:384
1301
- msgid "Floating Labels"
1302
- msgstr ""
1303
-
1304
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:675
1305
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:767
1306
- #: modules/optin/classes/class-cartflows-optin-meta.php:411
1307
- #: modules/optin/classes/class-cartflows-optin-meta.php:523
1308
- msgid "Size"
1309
- msgstr ""
1310
-
1311
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1312
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:771
1313
- #: modules/optin/classes/class-cartflows-optin-meta.php:415
1314
- #: modules/optin/classes/class-cartflows-optin-meta.php:527
1315
- msgid "Extra Small"
1316
- msgstr ""
1317
-
1318
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:680
1319
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:772
1320
- #: modules/optin/classes/class-cartflows-optin-meta.php:416
1321
- #: modules/optin/classes/class-cartflows-optin-meta.php:528
1322
- msgid "Small"
1323
- msgstr ""
1324
-
1325
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1326
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:773
1327
- #: modules/optin/classes/class-cartflows-optin-meta.php:417
1328
- #: modules/optin/classes/class-cartflows-optin-meta.php:529
1329
- msgid "Medium"
1330
- msgstr ""
1331
-
1332
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:682
1333
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1334
- #: modules/optin/classes/class-cartflows-optin-meta.php:418
1335
- #: modules/optin/classes/class-cartflows-optin-meta.php:530
1336
- msgid "Large"
1337
- msgstr ""
1338
-
1339
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:683
1340
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:775
1341
- #: modules/optin/classes/class-cartflows-optin-meta.php:419
1342
- #: modules/optin/classes/class-cartflows-optin-meta.php:531
1343
- msgid "Extra Large"
1344
- msgstr ""
1345
-
1346
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:684
1347
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:776
1348
- #: modules/optin/classes/class-cartflows-optin-meta.php:420
1349
- #: modules/optin/classes/class-cartflows-optin-meta.php:532
1350
- msgid "Custom"
1351
- msgstr ""
1352
-
1353
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:691
1354
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:783
1355
- #: modules/optin/classes/class-cartflows-optin-meta.php:427
1356
- #: modules/optin/classes/class-cartflows-optin-meta.php:539
1357
- msgid "Top Bottom Spacing"
1358
- msgstr ""
1359
-
1360
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1361
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:791
1362
- #: modules/optin/classes/class-cartflows-optin-meta.php:435
1363
- #: modules/optin/classes/class-cartflows-optin-meta.php:547
1364
- msgid "Left Right Spacing"
1365
- msgstr ""
1366
-
1367
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:707
1368
- #: modules/optin/classes/class-cartflows-optin-meta.php:451
1369
- msgid "Text / Placeholder Color"
1370
- msgstr ""
1371
-
1372
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1373
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:815
1374
- #: modules/optin/classes/class-cartflows-optin-meta.php:459
1375
- #: modules/optin/classes/class-cartflows-optin-meta.php:584
1376
- msgid "Background Color"
1377
- msgstr ""
1378
-
1379
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1380
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:831
1381
- #: modules/optin/classes/class-cartflows-optin-meta.php:467
1382
- #: modules/optin/classes/class-cartflows-optin-meta.php:600
1383
- msgid "Border Color"
1384
- msgstr ""
1385
-
1386
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:730
1387
- #: modules/optin/classes/class-cartflows-optin-meta.php:443
1388
- msgid "Label Color"
1389
- msgstr ""
1390
-
1391
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:743
1392
- msgid "Buttons"
1393
- msgstr ""
1394
-
1395
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:799
1396
- #: modules/optin/classes/class-cartflows-optin-meta.php:568
1397
- msgid "Text Color"
1398
- msgstr ""
1399
-
1400
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:807
1401
- #: modules/optin/classes/class-cartflows-optin-meta.php:576
1402
- msgid "Text Hover Color"
1403
- msgstr ""
1404
-
1405
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:823
1406
- #: modules/optin/classes/class-cartflows-optin-meta.php:592
1407
- msgid "Background Hover Color"
1408
- msgstr ""
1409
-
1410
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:839
1411
- #: modules/optin/classes/class-cartflows-optin-meta.php:608
1412
- msgid "Border Hover Color"
1413
- msgstr ""
1414
-
1415
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:852
1416
- msgid "Sections"
1417
- msgstr ""
1418
-
1419
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:858
1420
- msgid "Highlight Area Background Color"
1421
- msgstr ""
1422
-
1423
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:897
1424
- msgid "Header Logo"
1425
- msgstr ""
1426
-
1427
- #: modules/checkout/classes/class-cartflows-checkout-meta.php:905
1428
- msgid "Logo Width (In px)"
1429
- msgstr ""
1430
-
1431
- #: modules/checkout/templates/wcf-template.php:46
1432
- msgid "Copyright &copy;"
1433
- msgstr ""
1434
-
1435
- #: modules/checkout/templates/wcf-template.php:50
1436
- msgid "All Rights Reserved"
1437
- msgstr ""
1438
-
1439
- #: modules/flow/classes/class-cartflows-flow-meta.php:265
1440
- #. translators: %s flow id
1441
- msgid "Step not deleted for flow - %s"
1442
- msgstr ""
1443
-
1444
- #: modules/flow/classes/class-cartflows-flow-meta.php:303
1445
- #. translators: %s flow id
1446
- msgid "Step deleted for flow - %s"
1447
- msgstr ""
1448
-
1449
- #: modules/flow/classes/class-cartflows-flow-meta.php:312
1450
- #. translators: %s flow id
1451
- msgid "This step can not be deleted."
1452
- msgstr ""
1453
-
1454
- #: modules/flow/classes/class-cartflows-flow-meta.php:344
1455
- #. translators: %s flow id
1456
- msgid "Steps not sorted for flow - %s"
1457
- msgstr ""
1458
-
1459
- #: modules/flow/classes/class-cartflows-flow-meta.php:380
1460
- #. translators: %s flow id
1461
- msgid "Steps sorted for flow - %s"
1462
- msgstr ""
1463
-
1464
- #: modules/flow/classes/class-cartflows-flow-meta.php:485
1465
- msgid "Analytics"
1466
- msgstr ""
1467
-
1468
- #: modules/flow/classes/class-cartflows-flow-meta.php:502
1469
- #. translators: %s: link
1470
- msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1471
- msgstr ""
1472
-
1473
- #: modules/flow/classes/class-cartflows-flow-meta.php:520
1474
- msgid "Flow Settings"
1475
- msgstr ""
1476
-
1477
- #: modules/flow/classes/class-cartflows-flow-meta.php:605
1478
- msgid "Enable Test Mode"
1479
- msgstr ""
1480
-
1481
- #: modules/flow/classes/class-cartflows-flow-meta.php:612
1482
- msgid ""
1483
- "If you are using WooCommerce plugin then test mode will add random products "
1484
- "in your flow, so you can preview it easily while testing."
1485
- msgstr ""
1486
-
1487
- #: modules/flow/classes/class-cartflows-flow-meta.php:732
1488
- #: modules/flow/view/meta-flow-steps.php:145
1489
- msgid "Add New Step"
1490
- msgstr ""
1491
-
1492
- #: modules/flow/classes/class-cartflows-flow-meta.php:802
1493
- #: modules/flow/classes/class-cartflows-step-post-type.php:166
1494
- msgid "View Step"
1495
- msgstr ""
1496
-
1497
- #: modules/flow/classes/class-cartflows-flow-meta.php:813
1498
- #: modules/flow/classes/class-cartflows-step-post-type.php:165
1499
- msgid "Edit Step"
1500
- msgstr ""
1501
-
1502
- #: modules/flow/classes/class-cartflows-flow-meta.php:815
1503
- msgid "Edit"
1504
- msgstr ""
1505
-
1506
- #: modules/flow/classes/class-cartflows-flow-meta.php:822
1507
- msgid "Clone Step"
1508
- msgstr ""
1509
-
1510
- #: modules/flow/classes/class-cartflows-flow-meta.php:833
1511
- msgid "Delete Step"
1512
- msgstr ""
1513
-
1514
- #: modules/flow/classes/class-cartflows-flow-meta.php:835
1515
- msgid "Delete"
1516
- msgstr ""
1517
-
1518
- #: modules/flow/classes/class-cartflows-flow-meta.php:844
1519
- #: modules/flow/classes/class-cartflows-flow-meta.php:846
1520
- msgid "A/B Test"
1521
- msgstr ""
1522
-
1523
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1524
- msgid "Flow: "
1525
- msgstr ""
1526
-
1527
- #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1528
- msgid "Name: "
1529
- msgstr ""
1530
-
1531
- #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1532
- msgid "Search Flows"
1533
- msgstr ""
1534
-
1535
- #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1536
- msgid "All Flows"
1537
- msgstr ""
1538
-
1539
- #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1540
- msgid "Edit Flow"
1541
- msgstr ""
1542
-
1543
- #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1544
- msgid "View Flow"
1545
- msgstr ""
1546
-
1547
- #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1548
- #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1549
- #: modules/flow/classes/class-cartflows-step-post-type.php:167
1550
- #: modules/flow/classes/class-cartflows-step-post-type.php:169
1551
- msgid "Add New"
1552
- msgstr ""
1553
-
1554
- #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1555
- msgid "Update Flow"
1556
- msgstr ""
1557
-
1558
- #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1559
- msgid "New Flow Name"
1560
- msgstr ""
1561
-
1562
- #: modules/flow/classes/class-cartflows-flow-post-type.php:190
1563
- msgid "Upgrade to CartFlows Pro"
1564
- msgstr ""
1565
-
1566
- #: modules/flow/classes/class-cartflows-flow-post-type.php:209
1567
- msgid "Slug"
1568
- msgstr ""
1569
-
1570
- #: modules/flow/classes/class-cartflows-flow-post-type.php:321
1571
- #: modules/flow/classes/class-cartflows-flow-post-type.php:322
1572
- msgid "Flows"
1573
- msgstr ""
1574
-
1575
- #: modules/flow/classes/class-cartflows-flow-post-type.php:344
1576
- #: modules/flow/classes/class-cartflows-flow-post-type.php:350
1577
- #: modules/flow/classes/class-cartflows-step-post-type.php:401
1578
- #: modules/flow/classes/class-cartflows-step-post-type.php:407
1579
- #. translators: %s: singular custom post type name
1580
- msgid "%s updated."
1581
- msgstr ""
1582
-
1583
- #: modules/flow/classes/class-cartflows-flow-post-type.php:346
1584
- #: modules/flow/classes/class-cartflows-step-post-type.php:403
1585
- #. translators: %s: singular custom post type name
1586
- msgid "Custom %s updated."
1587
- msgstr ""
1588
-
1589
- #: modules/flow/classes/class-cartflows-flow-post-type.php:348
1590
- #: modules/flow/classes/class-cartflows-step-post-type.php:405
1591
- #. translators: %s: singular custom post type name
1592
- msgid "Custom %s deleted."
1593
- msgstr ""
1594
-
1595
- #: modules/flow/classes/class-cartflows-flow-post-type.php:352
1596
- #: modules/flow/classes/class-cartflows-step-post-type.php:409
1597
- #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1598
- #. the revision
1599
- msgid "%1$s restored to revision from %2$s"
1600
- msgstr ""
1601
-
1602
- #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1603
- #: modules/flow/classes/class-cartflows-step-post-type.php:411
1604
- #. translators: %s: singular custom post type name
1605
- msgid "%s published."
1606
- msgstr ""
1607
-
1608
- #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1609
- #: modules/flow/classes/class-cartflows-step-post-type.php:413
1610
- #. translators: %s: singular custom post type name
1611
- msgid "%s saved."
1612
- msgstr ""
1613
-
1614
- #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1615
- #: modules/flow/classes/class-cartflows-step-post-type.php:415
1616
- #. translators: %s: singular custom post type name
1617
- msgid "%s submitted."
1618
- msgstr ""
1619
-
1620
- #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1621
- #: modules/flow/classes/class-cartflows-step-post-type.php:417
1622
- #. translators: %s: singular custom post type name
1623
- msgid "%s scheduled for."
1624
- msgstr ""
1625
-
1626
- #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1627
- #: modules/flow/classes/class-cartflows-step-post-type.php:419
1628
- #. translators: %s: singular custom post type name
1629
- msgid "%s draft updated."
1630
- msgstr ""
1631
-
1632
- #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1633
- #: modules/widgets/class-cartflows-next-step.php:78
1634
- msgid "Next Step"
1635
- msgstr ""
1636
-
1637
- #: modules/flow/classes/class-cartflows-step-post-type.php:163
1638
- msgid "Search Steps"
1639
- msgstr ""
1640
-
1641
- #: modules/flow/classes/class-cartflows-step-post-type.php:164
1642
- msgid "All Steps"
1643
- msgstr ""
1644
-
1645
- #: modules/flow/classes/class-cartflows-step-post-type.php:168
1646
- msgid "Update Step"
1647
- msgstr ""
1648
-
1649
- #: modules/flow/classes/class-cartflows-step-post-type.php:170
1650
- msgid "New Step Name"
1651
- msgstr ""
1652
-
1653
- #: modules/flow/classes/class-cartflows-step-post-type.php:211
1654
- msgid "Step Type"
1655
- msgstr ""
1656
-
1657
- #: modules/flow/classes/class-cartflows-step-post-type.php:221
1658
- msgid "Step Flow"
1659
- msgstr ""
1660
-
1661
- #: modules/flow/classes/class-cartflows-step-post-type.php:246
1662
- #: modules/flow/view/meta-flow-steps.php:16
1663
- msgid "Optin (Woo)"
1664
- msgstr ""
1665
-
1666
- #: modules/flow/classes/class-cartflows-step-post-type.php:267
1667
- #: modules/flow/view/meta-flow-steps.php:14
1668
- msgid "Upsell (Woo)"
1669
- msgstr ""
1670
-
1671
- #: modules/flow/classes/class-cartflows-step-post-type.php:274
1672
- #: modules/flow/view/meta-flow-steps.php:15
1673
- msgid "Downsell (Woo)"
1674
- msgstr ""
1675
-
1676
- #: modules/flow/view/view-flow-inner-step.php:30
1677
- msgid "Control"
1678
- msgstr ""
1679
-
1680
- #: modules/flow/view/view-flow-inner-step.php:32
1681
- #. translators: %s badge count
1682
- msgid "Variation-%s"
1683
- msgstr ""
1684
-
1685
- #: modules/flow/view/view-flow-inner-step.php:44
1686
- msgid "No Product Assigned"
1687
- msgstr ""
1688
-
1689
- #: modules/flow/view/view-flow-inner-step.php:48
1690
- msgid "Global Checkout - Remove selected checkout product"
1691
- msgstr ""
1692
-
1693
- #: modules/flow/view/view-remote-importer.php:19
1694
- msgid "Steps Library"
1695
- msgstr ""
1696
-
1697
- #: modules/flow/view/view-remote-importer.php:68
1698
- msgid "Create Step"
1699
- msgstr ""
1700
-
1701
- #: modules/flow/view/view-remote-importer.php:70
1702
- msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1703
- msgstr ""
1704
-
1705
- #: modules/landing/classes/class-cartflows-landing-meta.php:66
1706
- msgid "Landing Page Settings"
1707
- msgstr ""
1708
-
1709
- #: modules/landing/classes/class-cartflows-landing-meta.php:169
1710
- msgid "Next Step Link"
1711
- msgstr ""
1712
-
1713
- #: modules/optin/classes/class-cartflows-optin-markup.php:178
1714
- msgid "Please place shortcode on Optin step-type only."
1715
- msgstr ""
1716
-
1717
- #: modules/optin/classes/class-cartflows-optin-markup.php:238
1718
- msgid ""
1719
- "No product is selected. Please select a Simple, Virtual and Free product "
1720
- "from the meta settings."
1721
- msgstr ""
1722
-
1723
- #: modules/optin/classes/class-cartflows-optin-markup.php:255
1724
- msgid "Please update the selected product's price to zero (0)."
1725
- msgstr ""
1726
-
1727
- #: modules/optin/classes/class-cartflows-optin-markup.php:264
1728
- #: modules/optin/classes/class-cartflows-optin-markup.php:268
1729
- msgid "Please select a Simple, Virtual and Free product."
1730
- msgstr ""
1731
-
1732
- #: modules/optin/classes/class-cartflows-optin-meta.php:65
1733
- msgid "Optin Settings"
1734
- msgstr ""
1735
-
1736
- #: modules/optin/classes/class-cartflows-optin-meta.php:138
1737
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1738
- msgid "Design"
1739
- msgstr ""
1740
-
1741
- #: modules/optin/classes/class-cartflows-optin-meta.php:144
1742
- msgid "Form Fields"
1743
- msgstr ""
1744
-
1745
- #: modules/optin/classes/class-cartflows-optin-meta.php:213
1746
- msgid "Add this shortcode to your optin page"
1747
- msgstr ""
1748
-
1749
- #: modules/optin/classes/class-cartflows-optin-meta.php:238
1750
- msgid "Select Free Product"
1751
- msgstr ""
1752
-
1753
- #: modules/optin/classes/class-cartflows-optin-meta.php:239
1754
- msgid "Select Free and Virtual product only."
1755
- msgstr ""
1756
-
1757
- #: modules/optin/classes/class-cartflows-optin-meta.php:293
1758
- msgid "Pass Fields as URL Parameters"
1759
- msgstr ""
1760
-
1761
- #: modules/optin/classes/class-cartflows-optin-meta.php:296
1762
- msgid "Enable"
1763
- msgstr ""
1764
-
1765
- #: modules/optin/classes/class-cartflows-optin-meta.php:297
1766
- msgid ""
1767
- "You can pass specific fields from the form to next step as URL query "
1768
- "parameters."
1769
- msgstr ""
1770
-
1771
- #: modules/optin/classes/class-cartflows-optin-meta.php:308
1772
- msgid "Enter form field"
1773
- msgstr ""
1774
-
1775
- #: modules/optin/classes/class-cartflows-optin-meta.php:311
1776
- #: modules/optin/classes/class-cartflows-optin-meta.php:321
1777
- msgid "Enter comma seprated field name. E.g. first_name, last_name"
1778
- msgstr ""
1779
-
1780
- #: modules/optin/classes/class-cartflows-optin-meta.php:313
1781
- msgid "Fields to pass, separated by commas"
1782
- msgstr ""
1783
-
1784
- #: modules/optin/classes/class-cartflows-optin-meta.php:323
1785
- #. translators: %s: link
1786
- msgid ""
1787
- "You can pass field value as a URL parameter to the next step. %1$sClick "
1788
- "here%2$s for more information."
1789
- msgstr ""
1790
-
1791
- #: modules/optin/classes/class-cartflows-optin-meta.php:480
1792
- msgid "Submit Button"
1793
- msgstr ""
1794
-
1795
- #: modules/optin/classes/class-cartflows-optin-meta.php:486
1796
- msgid "Button Text"
1797
- msgstr ""
1798
-
1799
- #: modules/optin/classes/class-cartflows-optin-meta.php:497
1800
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1801
- msgid "Font Size"
1802
- msgstr ""
1803
-
1804
- #: modules/optin/classes/class-cartflows-optin-meta.php:555
1805
- msgid "Position"
1806
- msgstr ""
1807
-
1808
- #: modules/optin/classes/class-cartflows-optin-meta.php:559
1809
- msgid "Left"
1810
- msgstr ""
1811
-
1812
- #: modules/optin/classes/class-cartflows-optin-meta.php:560
1813
- msgid "Center"
1814
- msgstr ""
1815
-
1816
- #: modules/optin/classes/class-cartflows-optin-meta.php:561
1817
- msgid "Right"
1818
- msgstr ""
1819
-
1820
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1821
- msgid "Thank You Page Settings"
1822
- msgstr ""
1823
-
1824
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1825
- msgid "Edit Fields"
1826
- msgstr ""
1827
-
1828
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1829
- msgid "Order Details"
1830
- msgstr ""
1831
-
1832
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1833
- msgid "Text"
1834
- msgstr ""
1835
-
1836
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1837
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:231
1838
- msgid "Color"
1839
- msgstr ""
1840
-
1841
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:257
1842
- msgid "Advanced Options"
1843
- msgstr ""
1844
-
1845
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1846
- msgid "Container Width (In px)"
1847
- msgstr ""
1848
-
1849
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1850
- msgid "Section Background Color"
1851
- msgstr ""
1852
-
1853
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1854
- msgid "Enable Order Overview "
1855
- msgstr ""
1856
-
1857
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1858
- msgid "Enable Order Details "
1859
- msgstr ""
1860
-
1861
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1862
- msgid "Enable Billing Details "
1863
- msgstr ""
1864
-
1865
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:313
1866
- msgid "Enable Shipping Details "
1867
- msgstr ""
1868
-
1869
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:329
1870
- msgid "Thank You Page Text"
1871
- msgstr ""
1872
-
1873
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
1874
- #: woocommerce/template/checkout/thankyou.php:41
1875
- #: woocommerce/template/checkout/thankyou.php:83
1876
- msgid "Thank you. Your order has been received."
1877
- msgstr ""
1878
-
1879
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:335
1880
- msgid "It will change the default text on thank you page."
1881
- msgstr ""
1882
-
1883
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:343
1884
- msgid "Redirect After Purchase"
1885
- msgstr ""
1886
-
1887
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:352
1888
- msgid "Redirect Link"
1889
- msgstr ""
1890
-
1891
- #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:356
1892
- msgid "https://"
1893
- msgstr ""
1894
-
1895
- #: modules/widgets/class-cartflows-next-step.php:24
1896
- msgid "CartFlows Next Step"
1897
- msgstr ""
1898
-
1899
- #: modules/widgets/class-cartflows-next-step.php:26
1900
- msgid "Next Step Widgets"
1901
- msgstr ""
1902
-
1903
- #: modules/widgets/class-cartflows-next-step.php:106
1904
- msgid "New title"
1905
- msgstr ""
1906
-
1907
- #: modules/widgets/class-cartflows-next-step.php:123
1908
- msgid "Title:"
1909
- msgstr ""
1910
-
1911
- #: modules/widgets/class-cartflows-next-step.php:127
1912
- msgid "Flow ID:"
1913
- msgstr ""
1914
-
1915
- #: modules/widgets/class-cartflows-next-step.php:131
1916
- msgid "Step ID:"
1917
- msgstr ""
1918
-
1919
- #: woocommerce/template/cart/cart-shipping.php:51
1920
- #. Translators: $s shipping destination.
1921
- msgid "Estimate for %s."
1922
- msgstr ""
1923
-
1924
- #: woocommerce/template/cart/cart-shipping.php:52
1925
- msgid "Change address"
1926
- msgstr ""
1927
-
1928
- #: woocommerce/template/cart/cart-shipping.php:54
1929
- msgid "This is only an estimate. Prices will be updated during checkout."
1930
- msgstr ""
1931
-
1932
- #: woocommerce/template/cart/cart-shipping.php:61
1933
- msgid "Enter your address to view shipping options."
1934
- msgstr ""
1935
-
1936
- #: woocommerce/template/cart/cart-shipping.php:63
1937
- msgid ""
1938
- "There are no shipping methods available. Please ensure that your address "
1939
- "has been entered correctly, or contact us if you need any help."
1940
- msgstr ""
1941
-
1942
- #: woocommerce/template/cart/cart-shipping.php:66
1943
- #. Translators: $s shipping destination.
1944
- msgid "No shipping options were found for %s."
1945
- msgstr ""
1946
-
1947
- #: woocommerce/template/cart/cart-shipping.php:67
1948
- msgid "Enter a different address"
1949
- msgstr ""
1950
-
1951
- #: woocommerce/template/checkout/form-billing.php:27
1952
- msgid "Billing &amp; Shipping"
1953
- msgstr ""
1954
-
1955
- #: woocommerce/template/checkout/form-billing.php:31
1956
- msgid "Billing details"
1957
- msgstr ""
1958
-
1959
- #: woocommerce/template/checkout/form-billing.php:59
1960
- msgid "Create an account?"
1961
- msgstr ""
1962
-
1963
- #: woocommerce/template/checkout/form-checkout.php:26
1964
- msgid "You must be logged in to checkout."
1965
- msgstr ""
1966
-
1967
- #: woocommerce/template/checkout/form-checkout.php:52
1968
- msgid "Your order"
1969
- msgstr ""
1970
-
1971
- #: woocommerce/template/checkout/form-coupon.php:26
1972
- msgid "Have a coupon?"
1973
- msgstr ""
1974
-
1975
- #: woocommerce/template/checkout/form-coupon.php:26
1976
- msgid "Click here to enter your code"
1977
- msgstr ""
1978
-
1979
- #: woocommerce/template/checkout/form-coupon.php:31
1980
- msgid "If you have a coupon code, please apply it below."
1981
- msgstr ""
1982
-
1983
- #: woocommerce/template/checkout/form-coupon.php:34
1984
- msgid "Coupon code"
1985
- msgstr ""
1986
-
1987
- #: woocommerce/template/checkout/form-coupon.php:38
1988
- msgid "Apply coupon"
1989
- msgstr ""
1990
-
1991
- #: woocommerce/template/checkout/form-login.php:26
1992
- msgid "Returning customer?"
1993
- msgstr ""
1994
-
1995
- #: woocommerce/template/checkout/form-login.php:26
1996
- msgid "Click here to login"
1997
- msgstr ""
1998
-
1999
- #: woocommerce/template/checkout/form-login.php:32
2000
- msgid ""
2001
- "If you have shopped with us before, please enter your details below. If you "
2002
- "are a new customer, please proceed to the Billing &amp; Shipping section."
2003
- msgstr ""
2004
-
2005
- #: woocommerce/template/checkout/form-shipping.php:26
2006
- msgid "Ship to a different address?"
2007
- msgstr ""
2008
-
2009
- #: woocommerce/template/checkout/form-shipping.php:57
2010
- msgid "Additional information"
2011
- msgstr ""
2012
-
2013
- #: woocommerce/template/checkout/payment.php:33
2014
- msgid ""
2015
- "Sorry, it seems that there are no available payment methods for your state. "
2016
- "Please contact us if you require assistance or wish to make alternate "
2017
- "arrangements."
2018
- msgstr ""
2019
-
2020
- #: woocommerce/template/checkout/payment.php:33
2021
- msgid "Please fill in your details above to see available payment methods."
2022
- msgstr ""
2023
-
2024
- #: woocommerce/template/checkout/payment.php:42
2025
- #. translators: $1 and $2 opening and closing emphasis tags respectively
2026
- msgid ""
2027
- "Since your browser does not support JavaScript, or it is disabled, please "
2028
- "ensure you click the %1$sUpdate Totals%2$s button before placing your "
2029
- "order. You may be charged more than the amount stated above if you fail to "
2030
- "do so."
2031
- msgstr ""
2032
-
2033
- #: woocommerce/template/checkout/payment.php:44
2034
- msgid "Update totals"
2035
- msgstr ""
2036
-
2037
- #: woocommerce/template/checkout/review-order.php:26
2038
- #: woocommerce/template/order/order-details.php:51
2039
- msgid "Product"
2040
- msgstr ""
2041
-
2042
- #: woocommerce/template/checkout/review-order.php:27
2043
- #: woocommerce/template/checkout/review-order.php:107
2044
- #: woocommerce/template/order/order-details.php:52
2045
- msgid "Total"
2046
- msgstr ""
2047
-
2048
- #: woocommerce/template/checkout/review-order.php:60
2049
- msgid "Subtotal"
2050
- msgstr ""
2051
-
2052
- #: woocommerce/template/checkout/thankyou.php:30
2053
- msgid ""
2054
- "Unfortunately your order cannot be processed as the originating "
2055
- "bank/merchant has declined your transaction. Please attempt your purchase "
2056
- "again."
2057
- msgstr ""
2058
-
2059
- #: woocommerce/template/checkout/thankyou.php:33
2060
- msgid "Pay"
2061
- msgstr ""
2062
-
2063
- #: woocommerce/template/checkout/thankyou.php:35
2064
- msgid "My account"
2065
- msgstr ""
2066
-
2067
- #: woocommerce/template/checkout/thankyou.php:46
2068
- msgid "Order number:"
2069
- msgstr ""
2070
-
2071
- #: woocommerce/template/checkout/thankyou.php:51
2072
- msgid "Date:"
2073
- msgstr ""
2074
-
2075
- #: woocommerce/template/checkout/thankyou.php:57
2076
- msgid "Email:"
2077
- msgstr ""
2078
-
2079
- #: woocommerce/template/checkout/thankyou.php:63
2080
- msgid "Total:"
2081
- msgstr ""
2082
-
2083
- #: woocommerce/template/checkout/thankyou.php:69
2084
- msgid "Payment method:"
2085
- msgstr ""
2086
-
2087
- #: woocommerce/template/global/form-login.php:34
2088
- msgid "Username or email"
2089
- msgstr ""
2090
-
2091
- #: woocommerce/template/global/form-login.php:38
2092
- msgid "Password"
2093
- msgstr ""
2094
-
2095
- #: woocommerce/template/global/form-login.php:48
2096
- msgid "Login"
2097
- msgstr ""
2098
-
2099
- #: woocommerce/template/global/form-login.php:53
2100
- msgid "Remember me"
2101
- msgstr ""
2102
-
2103
- #: woocommerce/template/global/form-login.php:57
2104
- msgid "Lost your password?"
2105
- msgstr ""
2106
-
2107
- #: woocommerce/template/order/order-details.php:45
2108
- msgid "Order details"
2109
- msgstr ""
2110
-
2111
- #: woocommerce/template/order/order-details.php:93
2112
- msgid "Note:"
2113
- msgstr ""
2114
-
2115
- #. Plugin Name of the plugin/theme
2116
- msgid "CartFlows"
2117
- msgstr ""
2118
-
2119
- #. Author URI of the plugin/theme
2120
- msgid "https://cartflows.com/"
2121
- msgstr ""
2122
-
2123
- #. Description of the plugin/theme
2124
- msgid "Create beautiful checkout pages & sales flows for WooCommerce."
2125
- msgstr ""
2126
-
2127
- #. Author of the plugin/theme
2128
- msgid "CartFlows Inc"
2129
- msgstr ""
2130
-
2131
- #: modules/flow/classes/class-cartflows-flow-post-type.php:99
2132
- msgctxt "flow general name"
2133
- msgid "Flows"
2134
- msgstr ""
2135
-
2136
- #: modules/flow/classes/class-cartflows-flow-post-type.php:100
2137
- msgctxt "flow singular name"
2138
- msgid "Flow"
2139
- msgstr ""
2140
-
2141
- #: modules/flow/classes/class-cartflows-step-post-type.php:161
2142
- msgctxt "flow step general name"
2143
- msgid "Steps"
2144
- msgstr ""
2145
-
2146
- #: modules/flow/classes/class-cartflows-step-post-type.php:162
2147
- msgctxt "flow step singular name"
2148
- msgid "Step"
2149
- msgstr ""
2150
-
2151
- #: modules/flow/classes/class-cartflows-step-post-type.php:315
2152
- msgctxt "cartflows"
2153
- msgid "CartFlows — Boxed"
2154
- msgstr ""
2155
-
2156
- #: modules/flow/classes/class-cartflows-step-post-type.php:316
2157
- msgctxt "cartflows"
2158
- msgid "Template for Page Builders"
2159
  msgstr ""
1
+ # Copyright (C) 2020 CartFlows Inc
2
+ # This file is distributed under the same license as the CartFlows package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: CartFlows 1.5.16\n"
6
+ "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/cartflows\n"
7
+ "POT-Creation-Date: 2020-08-25 07:56:45+00:00\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=utf-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
+ "Language-Team: LANGUAGE <LL@li.org>\n"
14
+ "Language: en\n"
15
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+ "X-Poedit-Country: United States\n"
17
+ "X-Poedit-SourceCharset: UTF-8\n"
18
+ "X-Poedit-KeywordsList: "
19
+ "__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
20
+ "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
21
+ "X-Poedit-Basepath: ../\n"
22
+ "X-Poedit-SearchPath-0: .\n"
23
+ "X-Poedit-Bookmarks: \n"
24
+ "X-Textdomain-Support: yes\n"
25
+ "X-Generator: grunt-wp-i18n 1.0.3\n"
26
+
27
+ #: admin/bsf-analytics/class-bsf-analytics.php:211
28
+ #. translators: %s product name
29
+ msgid ""
30
+ "Want to help make <strong>%1s</strong> even more awesome? Allow us to "
31
+ "collect non-sensitive diagnostic data and usage information. "
32
+ msgstr ""
33
+
34
+ #: admin/bsf-analytics/class-bsf-analytics.php:214
35
+ msgid "This will be applicable for all sites from the network."
36
+ msgstr ""
37
+
38
+ #: admin/bsf-analytics/class-bsf-analytics.php:238
39
+ #. translators: %s usage doc link
40
+ msgid " Know More."
41
+ msgstr ""
42
+
43
+ #: admin/bsf-analytics/class-bsf-analytics.php:246
44
+ msgid "Yes! Allow it"
45
+ msgstr ""
46
+
47
+ #: admin/bsf-analytics/class-bsf-analytics.php:255
48
+ msgid "No Thanks"
49
+ msgstr ""
50
+
51
+ #: admin/bsf-analytics/class-bsf-analytics.php:359
52
+ msgid "Usage Tracking"
53
+ msgstr ""
54
+
55
+ #: admin/bsf-analytics/class-bsf-analytics.php:403
56
+ #. translators: %s Product title
57
+ msgid "Allow %s products to track non-sensitive usage tracking data."
58
+ msgstr ""
59
+
60
+ #: admin/bsf-analytics/class-bsf-analytics.php:406
61
+ msgid " This will be applicable for all sites from the network."
62
+ msgstr ""
63
+
64
+ #: admin/bsf-analytics/class-bsf-analytics.php:411
65
+ msgid "Learn More."
66
+ msgstr ""
67
+
68
+ #: classes/batch-process/class-cartflows-importer-elementor.php:44
69
+ msgid "Invalid content."
70
+ msgstr ""
71
+
72
+ #: classes/batch-process/class-cartflows-importer-elementor.php:56
73
+ msgid "Invalid content. Expected an array."
74
+ msgstr ""
75
+
76
+ #: classes/batch-process/helpers/class-wp-background-process.php:435
77
+ msgid "Every %d Minutes"
78
+ msgstr ""
79
+
80
+ #: classes/class-cartflows-admin-fields.php:235
81
+ msgid "Select"
82
+ msgstr ""
83
+
84
+ #: classes/class-cartflows-admin-fields.php:238
85
+ msgid "No Checkout Steps"
86
+ msgstr ""
87
+
88
+ #: classes/class-cartflows-admin-fields.php:264
89
+ #. translators: %s: link
90
+ msgid ""
91
+ "Be sure not to add any product in above selected Global Checkout step. "
92
+ "Please read information about how to set up Global Checkout %1$shere%2$s."
93
+ msgstr ""
94
+
95
+ #: classes/class-cartflows-admin.php:159 includes/admin/cartflows-home.php:11
96
+ msgid "Home"
97
+ msgstr ""
98
+
99
+ #: classes/class-cartflows-admin.php:164 classes/class-cartflows-admin.php:165
100
+ #: modules/optin/classes/class-cartflows-optin-meta.php:150
101
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:148
102
+ msgid "Settings"
103
+ msgstr ""
104
+
105
+ #: classes/class-cartflows-admin.php:453
106
+ msgid "Installing and activating.."
107
+ msgstr ""
108
+
109
+ #: classes/class-cartflows-admin.php:454
110
+ msgid "There was an error with the installation of plugin."
111
+ msgstr ""
112
+
113
+ #: classes/class-cartflows-admin.php:516
114
+ msgid "Flows Library"
115
+ msgstr ""
116
+
117
+ #: classes/class-cartflows-admin.php:523
118
+ #: modules/flow/view/view-remote-importer.php:26
119
+ msgid "Ready Templates"
120
+ msgstr ""
121
+
122
+ #: classes/class-cartflows-admin.php:526
123
+ #: modules/flow/view/view-remote-importer.php:29
124
+ msgid "Create Your Own"
125
+ msgstr ""
126
+
127
+ #: classes/class-cartflows-admin.php:537
128
+ #: modules/flow/view/view-remote-importer.php:41
129
+ msgid "Search Sites"
130
+ msgstr ""
131
+
132
+ #: classes/class-cartflows-admin.php:538
133
+ #: modules/flow/view/view-remote-importer.php:42
134
+ msgid "Search Flow..."
135
+ msgstr ""
136
+
137
+ #: classes/class-cartflows-admin.php:555
138
+ msgid "Design Your Flow"
139
+ msgstr ""
140
+
141
+ #: classes/class-cartflows-admin.php:556
142
+ #: classes/class-cartflows-importer.php:665
143
+ #: classes/class-cartflows-importer.php:764
144
+ #: modules/flow/view/view-remote-importer.php:72
145
+ msgid "Learn How"
146
+ msgstr ""
147
+
148
+ #: classes/class-cartflows-api.php:369
149
+ msgid "Request successfully processed!"
150
+ msgstr ""
151
+
152
+ #: classes/class-cartflows-cloning.php:284
153
+ #. translators: %s flow id
154
+ msgid "Can't clone this step - %1$s. Flow - %2$s"
155
+ msgstr ""
156
+
157
+ #: classes/class-cartflows-cloning.php:401
158
+ #. translators: %s flow id
159
+ msgid "Step - %1$s cloned. Flow - %2$s"
160
+ msgstr ""
161
+
162
+ #: classes/class-cartflows-cloning.php:427
163
+ msgid "Clone this flow"
164
+ msgstr ""
165
+
166
+ #: classes/class-cartflows-cloning.php:427
167
+ #: modules/flow/classes/class-cartflows-flow-meta.php:824
168
+ msgid "Clone"
169
+ msgstr ""
170
+
171
+ #: classes/class-cartflows-default-meta.php:745
172
+ #: modules/optin/classes/class-cartflows-optin-meta.php:490
173
+ msgid "Submit"
174
+ msgstr ""
175
+
176
+ #: classes/class-cartflows-flow-frontend.php:53
177
+ msgid ""
178
+ "Test mode is active — which displays random products for previewing. It can "
179
+ "be deactivated from the flow settings in the admin dashboard."
180
+ msgstr ""
181
+
182
+ #: classes/class-cartflows-flow-frontend.php:58
183
+ msgid "Click here to disable it"
184
+ msgstr ""
185
+
186
+ #: classes/class-cartflows-importer.php:81
187
+ msgid "Export this flow"
188
+ msgstr ""
189
+
190
+ #: classes/class-cartflows-importer.php:81 includes/exporter.php:18
191
+ msgid "Export"
192
+ msgstr ""
193
+
194
+ #: classes/class-cartflows-importer.php:92
195
+ msgid "Flow Export"
196
+ msgstr ""
197
+
198
+ #: classes/class-cartflows-importer.php:93
199
+ msgid "Flow Import"
200
+ msgstr ""
201
+
202
+ #: classes/class-cartflows-importer.php:104
203
+ msgid "No post to export has been supplied!"
204
+ msgstr ""
205
+
206
+ #: classes/class-cartflows-importer.php:278
207
+ msgid "Please upload a valid .json file"
208
+ msgstr ""
209
+
210
+ #: classes/class-cartflows-importer.php:284
211
+ msgid "Please upload a file to import"
212
+ msgstr ""
213
+
214
+ #: classes/class-cartflows-importer.php:506
215
+ msgid "Successfully imported flows."
216
+ msgstr ""
217
+
218
+ #: classes/class-cartflows-importer.php:538
219
+ msgid "Loading Steps"
220
+ msgstr ""
221
+
222
+ #: classes/class-cartflows-importer.php:540
223
+ msgid "Getting steps from the cloud. Please wait for the moment."
224
+ msgstr ""
225
+
226
+ #: classes/class-cartflows-importer.php:551
227
+ msgid "Searching Template.."
228
+ msgstr ""
229
+
230
+ #: classes/class-cartflows-importer.php:553
231
+ msgid "Getting templates from the cloud. Please wait for the moment."
232
+ msgstr ""
233
+
234
+ #: classes/class-cartflows-importer.php:562
235
+ msgid "Importing.."
236
+ msgstr ""
237
+
238
+ #: classes/class-cartflows-importer.php:571
239
+ #: classes/class-cartflows-importer.php:611
240
+ msgid "Imported"
241
+ msgstr ""
242
+
243
+ #: classes/class-cartflows-importer.php:572
244
+ #: classes/class-cartflows-importer.php:612
245
+ msgid "Thanks for patience"
246
+ msgstr ""
247
+
248
+ #: classes/class-cartflows-importer.php:581
249
+ #: classes/class-cartflows-importer.php:593
250
+ msgid "Coming Soon!"
251
+ msgstr ""
252
+
253
+ #: classes/class-cartflows-importer.php:612
254
+ msgid "Redirecting to the Elementor edit window."
255
+ msgstr ""
256
+
257
+ #: classes/class-cartflows-importer.php:658
258
+ #: classes/class-cartflows-importer.php:774
259
+ msgid "Pro"
260
+ msgstr ""
261
+
262
+ #: classes/class-cartflows-importer.php:699
263
+ #: classes/class-cartflows-importer.php:806
264
+ msgid "Activate License"
265
+ msgstr ""
266
+
267
+ #: classes/class-cartflows-importer.php:701
268
+ #: classes/class-cartflows-importer.php:808
269
+ #: modules/flow/classes/class-cartflows-flow-meta.php:503
270
+ msgid "Get Pro"
271
+ msgstr ""
272
+
273
+ #: classes/class-cartflows-importer.php:726
274
+ msgid "Create"
275
+ msgstr ""
276
+
277
+ #: classes/class-cartflows-importer.php:825
278
+ msgid "Under Maintenance.."
279
+ msgstr ""
280
+
281
+ #: classes/class-cartflows-importer.php:826
282
+ msgid ""
283
+ "If you are seeing this message, most likely our servers are under routine "
284
+ "maintenance and we will be back shortly."
285
+ msgstr ""
286
+
287
+ #: classes/class-cartflows-importer.php:827
288
+ msgid ""
289
+ "In rare case, it is possible your website is having trouble connecting with "
290
+ "ours. If you need help, please feel free to get in touch with us from our "
291
+ "website.."
292
+ msgstr ""
293
+
294
+ #: classes/class-cartflows-importer.php:857
295
+ #. translators: %s: Plugin string
296
+ msgid ""
297
+ "%1$s to see CartFlows templates. If you prefer another page builder tool, "
298
+ "you can <a href=\"%2$s\" target=\"blank\">select it here</a>."
299
+ msgstr ""
300
+
301
+ #: classes/class-cartflows-importer.php:872
302
+ msgid "All"
303
+ msgstr ""
304
+
305
+ #: classes/class-cartflows-importer.php:875
306
+ msgid "Select Step Type"
307
+ msgstr ""
308
+
309
+ #: classes/class-cartflows-importer.php:959
310
+ msgid "Import from Cloud"
311
+ msgstr ""
312
+
313
+ #: classes/class-cartflows-importer.php:1267
314
+ msgid "Sales Landing"
315
+ msgstr ""
316
+
317
+ #: classes/class-cartflows-importer.php:1271
318
+ #: modules/flow/classes/class-cartflows-step-post-type.php:253
319
+ #: modules/flow/view/meta-flow-steps.php:12
320
+ msgid "Checkout (Woo)"
321
+ msgstr ""
322
+
323
+ #: classes/class-cartflows-importer.php:1275
324
+ #: modules/flow/classes/class-cartflows-step-post-type.php:260
325
+ #: modules/flow/view/meta-flow-steps.php:13
326
+ msgid "Thank You (Woo)"
327
+ msgstr ""
328
+
329
+ #: classes/class-cartflows-importer.php:1283
330
+ #: modules/flow/classes/class-cartflows-step-post-type.php:239
331
+ #: modules/flow/view/meta-flow-steps.php:11
332
+ msgid "Landing"
333
+ msgstr ""
334
+
335
+ #: classes/class-cartflows-importer.php:1287
336
+ msgid "Thank You"
337
+ msgstr ""
338
+
339
+ #: classes/class-cartflows-importer.php:1397
340
+ #. translators: %s: template ID
341
+ msgid "Invalid template id %1$s or post id %2$s."
342
+ msgstr ""
343
+
344
+ #: classes/class-cartflows-importer.php:1472
345
+ #. translators: %s: flow ID
346
+ msgid "Invalid flow id %1$s OR step type %2$s."
347
+ msgstr ""
348
+
349
+ #: classes/class-cartflows-importer.php:1597
350
+ msgid ""
351
+ "Elementor is not activated. Please activate plugin Elementor Page Builder "
352
+ "to import the step."
353
+ msgstr ""
354
+
355
+ #: classes/class-cartflows-importer.php:1700
356
+ msgid "Action failed. Invalid Security Nonce."
357
+ msgstr ""
358
+
359
+ #: classes/class-cartflows-importer.php:1707
360
+ msgid "User have not plugin install permissions."
361
+ msgstr ""
362
+
363
+ #: classes/class-cartflows-importer.php:1729
364
+ msgid "Plugin Successfully Activated"
365
+ msgstr ""
366
+
367
+ #: classes/class-cartflows-learndash-compatibility.php:86
368
+ msgid "None"
369
+ msgstr ""
370
+
371
+ #: classes/class-cartflows-learndash-compatibility.php:113
372
+ #. translators: 1: anchor start, 2: anchor close
373
+ msgid ""
374
+ "Non-enrolled students will redirect to the selected CartFlows template. If "
375
+ "you have not created any Flow already, add new Flow from %1$shere%2$s."
376
+ msgstr ""
377
+
378
+ #: classes/class-cartflows-learndash-compatibility.php:119
379
+ msgid "Select CartFlows Template for this Course"
380
+ msgstr ""
381
+
382
+ #: classes/class-cartflows-loader.php:232
383
+ #. translators: %s: html tags
384
+ msgid ""
385
+ "You are using an older version of %1$sCartFlows Pro%2$s. Please update "
386
+ "%1$sCartFlows Pro%2$s plugin to version %1$s%3$s%2$s or higher."
387
+ msgstr ""
388
+
389
+ #: classes/class-cartflows-loader.php:501
390
+ #. translators: %s: html tags
391
+ msgid ""
392
+ "This %1$sCartFlows%2$s page requires %1$sWooCommerce%2$s plugin installed & "
393
+ "activated."
394
+ msgstr ""
395
+
396
+ #: classes/class-cartflows-loader.php:511
397
+ msgid "Activate WooCommerce"
398
+ msgstr ""
399
+
400
+ #: classes/class-cartflows-loader.php:519
401
+ msgid "Install WooCommerce"
402
+ msgstr ""
403
+
404
+ #: classes/class-cartflows-logger.php:161
405
+ msgid "Action failed. Please refresh the page and retry."
406
+ msgstr ""
407
+
408
+ #: classes/class-cartflows-meta-fields.php:61
409
+ msgid "Thin 100"
410
+ msgstr ""
411
+
412
+ #: classes/class-cartflows-meta-fields.php:62
413
+ msgid "Extra-Light 200"
414
+ msgstr ""
415
+
416
+ #: classes/class-cartflows-meta-fields.php:63
417
+ msgid "Light 300"
418
+ msgstr ""
419
+
420
+ #: classes/class-cartflows-meta-fields.php:64
421
+ msgid "Normal 400"
422
+ msgstr ""
423
+
424
+ #: classes/class-cartflows-meta-fields.php:65
425
+ msgid "Medium 500"
426
+ msgstr ""
427
+
428
+ #: classes/class-cartflows-meta-fields.php:66
429
+ msgid "Semi-Bold 600"
430
+ msgstr ""
431
+
432
+ #: classes/class-cartflows-meta-fields.php:67
433
+ msgid "Bold 700"
434
+ msgstr ""
435
+
436
+ #: classes/class-cartflows-meta-fields.php:68
437
+ msgid "Extra-Bold 800"
438
+ msgstr ""
439
+
440
+ #: classes/class-cartflows-meta-fields.php:69
441
+ msgid "Ultra-Bold 900"
442
+ msgstr ""
443
+
444
+ #: classes/class-cartflows-meta-fields.php:182
445
+ #. Translators: %d stock amount
446
+ msgid "Stock: %d"
447
+ msgstr ""
448
+
449
+ #: classes/class-cartflows-meta-fields.php:765
450
+ #: includes/meta-fields/generate-product-repeater.php:30
451
+ msgid "Search for a product&hellip;"
452
+ msgstr ""
453
+
454
+ #: classes/class-cartflows-meta-fields.php:816
455
+ msgid "Search for a coupon&hellip;"
456
+ msgstr ""
457
+
458
+ #: classes/class-cartflows-meta.php:34
459
+ msgid "Update"
460
+ msgstr ""
461
+
462
+ #: classes/class-cartflows-meta.php:42
463
+ #: modules/flow/classes/class-cartflows-flow-meta.php:95
464
+ #: modules/flow/classes/class-cartflows-flow-meta.php:763
465
+ msgid "Back to edit Flow"
466
+ msgstr ""
467
+
468
+ #: classes/class-cartflows-meta.php:63
469
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:198
470
+ #: modules/landing/classes/class-cartflows-landing-meta.php:136
471
+ #: modules/optin/classes/class-cartflows-optin-meta.php:156
472
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:154
473
+ msgid "Custom Script"
474
+ msgstr ""
475
+
476
+ #: classes/class-cartflows-meta.php:66
477
+ msgid ""
478
+ "Custom script lets you add your own custom script on front end of this flow "
479
+ "page."
480
+ msgstr ""
481
+
482
+ #: classes/class-cartflows-metabox.php:59
483
+ msgid "Flow Details"
484
+ msgstr ""
485
+
486
+ #: classes/class-cartflows-wizard.php:94
487
+ msgid "Thanks for installing and using CartFlows!"
488
+ msgstr ""
489
+
490
+ #: classes/class-cartflows-wizard.php:95
491
+ msgid ""
492
+ "It is easy to use the CartFlows. Please use the setup wizard to quick start "
493
+ "setup."
494
+ msgstr ""
495
+
496
+ #: classes/class-cartflows-wizard.php:97
497
+ msgid "Start Wizard"
498
+ msgstr ""
499
+
500
+ #: classes/class-cartflows-wizard.php:98
501
+ msgid "Skip Setup"
502
+ msgstr ""
503
+
504
+ #: classes/class-cartflows-wizard.php:128
505
+ msgid "Welcome"
506
+ msgstr ""
507
+
508
+ #: classes/class-cartflows-wizard.php:133
509
+ msgid "Page Builder"
510
+ msgstr ""
511
+
512
+ #: classes/class-cartflows-wizard.php:137
513
+ msgid "Checkout"
514
+ msgstr ""
515
+
516
+ #: classes/class-cartflows-wizard.php:141
517
+ msgid "Training"
518
+ msgstr ""
519
+
520
+ #: classes/class-cartflows-wizard.php:145
521
+ msgid "Ready!"
522
+ msgstr ""
523
+
524
+ #: classes/class-cartflows-wizard.php:220
525
+ msgid "CartFlows Setup"
526
+ msgstr ""
527
+
528
+ #: classes/class-cartflows-wizard.php:246
529
+ msgid "Exit Setup Wizard"
530
+ msgstr ""
531
+
532
+ #: classes/class-cartflows-wizard.php:299
533
+ msgid "Welcome to CartFlows!"
534
+ msgstr ""
535
+
536
+ #: classes/class-cartflows-wizard.php:300
537
+ msgid ""
538
+ "Thank you for choosing CartFlows to get more leads, increase conversions, & "
539
+ "maximize profits. This short setup wizard will guide you though configuring "
540
+ "CartFlows and creating your first funnel."
541
+ msgstr ""
542
+
543
+ #: classes/class-cartflows-wizard.php:304
544
+ msgid "Let&#x27;s Build it better!"
545
+ msgstr ""
546
+
547
+ #: classes/class-cartflows-wizard.php:305
548
+ msgid ""
549
+ "Get improved features and faster fixes by sharing non-sensitive data via "
550
+ "usage tracking that shows us how CartFlows is used. No personal data is "
551
+ "tracked or stored."
552
+ msgstr ""
553
+
554
+ #: classes/class-cartflows-wizard.php:306
555
+ msgid "Learn More"
556
+ msgstr ""
557
+
558
+ #: classes/class-cartflows-wizard.php:309
559
+ msgid "Yes, I am in."
560
+ msgstr ""
561
+
562
+ #: classes/class-cartflows-wizard.php:316
563
+ msgid "Lets Go »"
564
+ msgstr ""
565
+
566
+ #: classes/class-cartflows-wizard.php:344
567
+ msgid "Page Builder Setup"
568
+ msgstr ""
569
+
570
+ #: classes/class-cartflows-wizard.php:345
571
+ msgid "Please select a page builder you would like to use with CartFlows."
572
+ msgstr ""
573
+
574
+ #: classes/class-cartflows-wizard.php:350
575
+ msgid "Select Page Builder"
576
+ msgstr ""
577
+
578
+ #: classes/class-cartflows-wizard.php:357
579
+ #: classes/class-cartflows-wizard.php:423
580
+ #: includes/admin/cartflows-general.php:76
581
+ msgid "Elementor"
582
+ msgstr ""
583
+
584
+ #: classes/class-cartflows-wizard.php:367
585
+ msgid "Beaver Builder Plugin (Lite Version)"
586
+ msgstr ""
587
+
588
+ #: classes/class-cartflows-wizard.php:377
589
+ #: includes/admin/cartflows-general.php:78
590
+ msgid "Divi"
591
+ msgstr ""
592
+
593
+ #: classes/class-cartflows-wizard.php:387
594
+ #: includes/admin/cartflows-general.php:79
595
+ msgid "Gutenberg"
596
+ msgstr ""
597
+
598
+ #: classes/class-cartflows-wizard.php:397
599
+ #: includes/admin/cartflows-general.php:80
600
+ msgid "Other"
601
+ msgstr ""
602
+
603
+ #: classes/class-cartflows-wizard.php:419
604
+ msgid ""
605
+ "While CartFlows Should work with most page builders, we offer templates for "
606
+ "the above page builders."
607
+ msgstr ""
608
+
609
+ #: classes/class-cartflows-wizard.php:422
610
+ #: classes/class-cartflows-wizard.php:464
611
+ msgid "The following plugin will be installed and activated for you:"
612
+ msgstr ""
613
+
614
+ #: classes/class-cartflows-wizard.php:429
615
+ #: classes/class-cartflows-wizard.php:474
616
+ #: classes/class-cartflows-wizard.php:684
617
+ msgid "« Previous"
618
+ msgstr ""
619
+
620
+ #: classes/class-cartflows-wizard.php:432
621
+ msgid "Skip this step"
622
+ msgstr ""
623
+
624
+ #: classes/class-cartflows-wizard.php:433
625
+ msgid "Next »"
626
+ msgstr ""
627
+
628
+ #: classes/class-cartflows-wizard.php:452
629
+ msgid "Choose a checkout"
630
+ msgstr ""
631
+
632
+ #: classes/class-cartflows-wizard.php:455
633
+ msgid ""
634
+ "While CartFlows is designed to use WooCommerce sell digital and physical "
635
+ "products, not all funnels need a checkout system."
636
+ msgstr ""
637
+
638
+ #: classes/class-cartflows-wizard.php:457
639
+ msgid ""
640
+ "Would you like to install WooCommerce to sell digital and physical products "
641
+ "in your funnels?"
642
+ msgstr ""
643
+
644
+ #: classes/class-cartflows-wizard.php:465
645
+ msgid "WooCommerce"
646
+ msgstr ""
647
+
648
+ #: classes/class-cartflows-wizard.php:466
649
+ msgid "WooCommerce Cart Abandonment Recovery"
650
+ msgstr ""
651
+
652
+ #: classes/class-cartflows-wizard.php:477
653
+ #: classes/class-cartflows-wizard.php:687
654
+ msgid "No thanks"
655
+ msgstr ""
656
+
657
+ #: classes/class-cartflows-wizard.php:478
658
+ msgid "Yes"
659
+ msgstr ""
660
+
661
+ #: classes/class-cartflows-wizard.php:620
662
+ msgid "Congratulations, You Did It!"
663
+ msgstr ""
664
+
665
+ #: classes/class-cartflows-wizard.php:627
666
+ msgid ""
667
+ "CartFlows is ready to use on your website. You've successfully completed "
668
+ "the setup process and all that is left for you to do is create your first "
669
+ "flow."
670
+ msgstr ""
671
+
672
+ #: classes/class-cartflows-wizard.php:641
673
+ msgid "Create a flow"
674
+ msgstr ""
675
+
676
+ #: classes/class-cartflows-wizard.php:658
677
+ msgid "Exclusive CartFlows Training Course Offer"
678
+ msgstr ""
679
+
680
+ #: classes/class-cartflows-wizard.php:669
681
+ msgid ""
682
+ "We want you to get off to a great start using CartFlows, so we would like "
683
+ "to give access to our exclusive training course."
684
+ msgstr ""
685
+
686
+ #: classes/class-cartflows-wizard.php:670
687
+ msgid "Get access to this couse, for free, by entering your email below."
688
+ msgstr ""
689
+
690
+ #: classes/class-cartflows-wizard.php:672
691
+ msgid "Enter Email address"
692
+ msgstr ""
693
+
694
+ #: classes/class-cartflows-wizard.php:688
695
+ msgid "Allow"
696
+ msgstr ""
697
+
698
+ #: classes/lib/notices/class-astra-notices.php:125
699
+ msgid "WordPress Nonce not validated."
700
+ msgstr ""
701
+
702
+ #: classes/logger/class-cartflows-log-handler-file.php:351
703
+ #: classes/logger/class-cartflows-log-handler-file.php:371
704
+ msgid "This method should not be called before plugins_loaded."
705
+ msgstr ""
706
+
707
+ #: classes/logger/class-cartflows-wc-logger.php:58
708
+ #. translators: 1: class name 2: Cartflows_Log_Handler_Interface
709
+ msgid "The provided handler %1$s does not implement %2$s."
710
+ msgstr ""
711
+
712
+ #: classes/logger/class-cartflows-wc-logger.php:136
713
+ #. translators: 1: Cartflows_WC_Logger::log 2: level
714
+ msgid "%1$s was called with an invalid level \"%2$s\"."
715
+ msgstr ""
716
+
717
+ #: includes/admin/cartflows-admin-header.php:17
718
+ #: includes/admin/cartflows-admin.php:19
719
+ msgid "Generate More Leads & More Sales"
720
+ msgstr ""
721
+
722
+ #: includes/admin/cartflows-admin.php:29
723
+ msgid "Settings saved successfully."
724
+ msgstr ""
725
+
726
+ #: includes/admin/cartflows-error-log.php:36
727
+ msgid "%1$s at %2$s"
728
+ msgstr ""
729
+
730
+ #: includes/admin/cartflows-error-log.php:41
731
+ #: modules/flow/classes/class-cartflows-flow-meta.php:804
732
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:225
733
+ msgid "View"
734
+ msgstr ""
735
+
736
+ #: includes/admin/cartflows-error-log.php:65
737
+ msgid "Delete log"
738
+ msgstr ""
739
+
740
+ #: includes/admin/cartflows-error-log.php:70
741
+ msgid "There are currently no logs to view."
742
+ msgstr ""
743
+
744
+ #: includes/admin/cartflows-general.php:31
745
+ #: includes/admin/cartflows-general.php:40
746
+ msgid "General Settings"
747
+ msgstr ""
748
+
749
+ #: includes/admin/cartflows-general.php:53
750
+ msgid "Disallow search engines from indexing flows"
751
+ msgstr ""
752
+
753
+ #: includes/admin/cartflows-general.php:63
754
+ #: modules/flow/view/view-flow-inner-step.php:52
755
+ msgid "Global Checkout"
756
+ msgstr ""
757
+
758
+ #: includes/admin/cartflows-general.php:72
759
+ msgid "Show Templates designed with"
760
+ msgstr ""
761
+
762
+ #: includes/admin/cartflows-general.php:73
763
+ msgid ""
764
+ "CartFlows offers flow templates that can be imported in one click. These "
765
+ "templates are available in few different page builders. Please choose your "
766
+ "preferred page builder from the list so you will only see templates that "
767
+ "are made using that page builder.."
768
+ msgstr ""
769
+
770
+ #: includes/admin/cartflows-general.php:77
771
+ msgid "Beaver Builder"
772
+ msgstr ""
773
+
774
+ #: includes/admin/cartflows-general.php:89
775
+ #: includes/admin/cartflows-general.php:175
776
+ #: includes/admin/cartflows-general.php:281
777
+ #: includes/admin/cartflows-general.php:398
778
+ msgid "Save Changes"
779
+ msgstr ""
780
+
781
+ #: includes/admin/cartflows-general.php:101
782
+ msgid "Permalink Settings"
783
+ msgstr ""
784
+
785
+ #: includes/admin/cartflows-general.php:116
786
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:647
787
+ #: modules/optin/classes/class-cartflows-optin-meta.php:383
788
+ msgid "Default"
789
+ msgstr ""
790
+
791
+ #: includes/admin/cartflows-general.php:122
792
+ msgid "Flow and Step Slug"
793
+ msgstr ""
794
+
795
+ #: includes/admin/cartflows-general.php:128
796
+ msgid "Flow Slug"
797
+ msgstr ""
798
+
799
+ #: includes/admin/cartflows-general.php:134
800
+ msgid "Step Slug"
801
+ msgstr ""
802
+
803
+ #: includes/admin/cartflows-general.php:146
804
+ msgid "Post Type Permalink Base"
805
+ msgstr ""
806
+
807
+ #: includes/admin/cartflows-general.php:154
808
+ msgid "Step Base"
809
+ msgstr ""
810
+
811
+ #: includes/admin/cartflows-general.php:164
812
+ msgid "Flow Base"
813
+ msgstr ""
814
+
815
+ #: includes/admin/cartflows-general.php:176
816
+ msgid "Set Default"
817
+ msgstr ""
818
+
819
+ #: includes/admin/cartflows-general.php:190
820
+ msgid "Facebook Pixel Settings"
821
+ msgstr ""
822
+
823
+ #: includes/admin/cartflows-general.php:205
824
+ msgid "Enable Facebook Pixel Tracking"
825
+ msgstr ""
826
+
827
+ #: includes/admin/cartflows-general.php:218
828
+ msgid "Enable for the whole site"
829
+ msgstr ""
830
+
831
+ #: includes/admin/cartflows-general.php:226
832
+ #: includes/admin/cartflows-general.php:325
833
+ msgid "If this option is unchecked, it will only apply to CartFlows steps."
834
+ msgstr ""
835
+
836
+ #: includes/admin/cartflows-general.php:236
837
+ msgid "Enter Facebook pixel ID"
838
+ msgstr ""
839
+
840
+ #: includes/admin/cartflows-general.php:244
841
+ #: includes/admin/cartflows-general.php:343
842
+ msgid "Enable Events:"
843
+ msgstr ""
844
+
845
+ #: includes/admin/cartflows-general.php:253
846
+ msgid "Initiate Checkout"
847
+ msgstr ""
848
+
849
+ #: includes/admin/cartflows-general.php:262
850
+ #: includes/admin/cartflows-general.php:369
851
+ msgid "Add Payment Info"
852
+ msgstr ""
853
+
854
+ #: includes/admin/cartflows-general.php:271
855
+ msgid "Purchase Complete"
856
+ msgstr ""
857
+
858
+ #: includes/admin/cartflows-general.php:293
859
+ msgid "Google Analytics Settings"
860
+ msgstr ""
861
+
862
+ #: includes/admin/cartflows-general.php:304
863
+ msgid "Enable Google Analytics Tracking"
864
+ msgstr ""
865
+
866
+ #: includes/admin/cartflows-general.php:317
867
+ msgid "Enable for the whole website"
868
+ msgstr ""
869
+
870
+ #: includes/admin/cartflows-general.php:335
871
+ msgid "Google Analytics ID"
872
+ msgstr ""
873
+
874
+ #: includes/admin/cartflows-general.php:337
875
+ msgid ""
876
+ "Log into your <a href=\"https://analytics.google.com/\" "
877
+ "target=\"_blank\">google analytics account</a> to find your ID. eg: "
878
+ "UA-XXXXXX-X&period;"
879
+ msgstr ""
880
+
881
+ #: includes/admin/cartflows-general.php:351
882
+ msgid "Begin Checkout"
883
+ msgstr ""
884
+
885
+ #: includes/admin/cartflows-general.php:360
886
+ msgid "Add To Cart"
887
+ msgstr ""
888
+
889
+ #: includes/admin/cartflows-general.php:378
890
+ msgid "Purchase"
891
+ msgstr ""
892
+
893
+ #: includes/admin/cartflows-general.php:386
894
+ msgid ""
895
+ "Google Analytics not working correctly? <a "
896
+ "href=\"https://cartflows.com/docs/troubleshooting-google-analytics-tracking-"
897
+ "issues/\" > Click here </a> to know more. "
898
+ msgstr ""
899
+
900
+ #: includes/admin/cartflows-general.php:419
901
+ #: includes/admin/cartflows-home.php:43
902
+ msgid "Knowledge Base"
903
+ msgstr ""
904
+
905
+ #: includes/admin/cartflows-general.php:423
906
+ #: includes/admin/cartflows-home.php:47
907
+ msgid "Not sure how something works? Take a peek at the knowledge base and learn."
908
+ msgstr ""
909
+
910
+ #: includes/admin/cartflows-general.php:426
911
+ #: includes/admin/cartflows-home.php:50
912
+ msgid "Visit Knowledge Base »"
913
+ msgstr ""
914
+
915
+ #: includes/admin/cartflows-general.php:434
916
+ #: includes/admin/cartflows-home.php:58
917
+ msgid "Community"
918
+ msgstr ""
919
+
920
+ #: includes/admin/cartflows-general.php:438
921
+ #: includes/admin/cartflows-home.php:62
922
+ msgid ""
923
+ "Join the community of super helpful CartFlows users. Say hello, ask "
924
+ "questions, give feedback and help each other!"
925
+ msgstr ""
926
+
927
+ #: includes/admin/cartflows-general.php:441
928
+ #: includes/admin/cartflows-home.php:65
929
+ msgid "Join Our Facebook Group »"
930
+ msgstr ""
931
+
932
+ #: includes/admin/cartflows-general.php:449
933
+ #: includes/admin/cartflows-home.php:73
934
+ msgid "Five Star Support"
935
+ msgstr ""
936
+
937
+ #: includes/admin/cartflows-general.php:453
938
+ #: includes/admin/cartflows-home.php:77
939
+ msgid "Got a question? Get in touch with CartFlows developers. We're happy to help!"
940
+ msgstr ""
941
+
942
+ #: includes/admin/cartflows-general.php:456
943
+ #: includes/admin/cartflows-home.php:80
944
+ msgid "Submit a Ticket »"
945
+ msgstr ""
946
+
947
+ #: includes/admin/cartflows-general.php:466
948
+ msgid "Load Minified CSS"
949
+ msgstr ""
950
+
951
+ #: includes/admin/cartflows-general.php:471
952
+ msgid ""
953
+ "Load the Minified CSS from here. Just Enable it by checking the below given "
954
+ "checkbox."
955
+ msgstr ""
956
+
957
+ #: includes/admin/cartflows-general.php:478
958
+ msgid "Load minified CSS & JS Files"
959
+ msgstr ""
960
+
961
+ #: includes/admin/cartflows-general.php:483
962
+ msgid "Save"
963
+ msgstr ""
964
+
965
+ #: includes/admin/cartflows-home.php:20
966
+ msgid "Getting Started"
967
+ msgstr ""
968
+
969
+ #: includes/admin/cartflows-home.php:28
970
+ msgid "Modernizing WordPress eCommerce!"
971
+ msgstr ""
972
+
973
+ #: includes/exporter.php:12
974
+ msgid "Export Flows to a JSON file"
975
+ msgstr ""
976
+
977
+ #: includes/exporter.php:13
978
+ msgid ""
979
+ "This tool allows you to generate and download a JSON file containing a list "
980
+ "of all flows."
981
+ msgstr ""
982
+
983
+ #: includes/importer.php:12
984
+ msgid "Import Flows to a JSON file"
985
+ msgstr ""
986
+
987
+ #: includes/importer.php:13
988
+ msgid "This tool allows you to import the flows from the JSON file."
989
+ msgstr ""
990
+
991
+ #: includes/importer.php:21
992
+ msgid "Import"
993
+ msgstr ""
994
+
995
+ #: includes/meta-fields/generate-product-repeater.php:36
996
+ msgid "Remove"
997
+ msgstr ""
998
+
999
+ #: includes/meta-fields/generate-product-repeater.php:51
1000
+ msgid "Product Quantity"
1001
+ msgstr ""
1002
+
1003
+ #: includes/meta-fields/generate-product-repeater.php:65
1004
+ msgid "Discount Type"
1005
+ msgstr ""
1006
+
1007
+ #: includes/meta-fields/generate-product-repeater.php:69
1008
+ msgid "Select Discount Type"
1009
+ msgstr ""
1010
+
1011
+ #: includes/meta-fields/generate-product-repeater.php:70
1012
+ msgid "Original"
1013
+ msgstr ""
1014
+
1015
+ #: includes/meta-fields/generate-product-repeater.php:71
1016
+ msgid "Percentage"
1017
+ msgstr ""
1018
+
1019
+ #: includes/meta-fields/generate-product-repeater.php:72
1020
+ msgid "Price"
1021
+ msgstr ""
1022
+
1023
+ #: includes/meta-fields/generate-product-repeater.php:83
1024
+ msgid "Discount Value"
1025
+ msgstr ""
1026
+
1027
+ #: includes/meta-fields/generate-product-repeater.php:85
1028
+ msgid "Discount value will apply for each quantity of product."
1029
+ msgstr ""
1030
+
1031
+ #: includes/meta-fields/get-product-selection-repeater.php:112
1032
+ msgid "Add New Product"
1033
+ msgstr ""
1034
+
1035
+ #: includes/meta-fields/get-product-selection-repeater.php:113
1036
+ msgid "Create Product"
1037
+ msgstr ""
1038
+
1039
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:284
1040
+ #: modules/optin/classes/class-cartflows-optin-markup.php:166
1041
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:90
1042
+ msgid ""
1043
+ "WooCommerce functions do not exist. If you are in an IFrame, please reload "
1044
+ "it."
1045
+ msgstr ""
1046
+
1047
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:285
1048
+ #: modules/optin/classes/class-cartflows-optin-markup.php:167
1049
+ #: modules/thankyou/classes/class-cartflows-thankyou-markup.php:91
1050
+ msgid "Click Here to Reload"
1051
+ msgstr ""
1052
+
1053
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:303
1054
+ msgid "Checkout ID not found"
1055
+ msgstr ""
1056
+
1057
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:366
1058
+ #: modules/checkout/templates/embed/checkout-template-simple.php:25
1059
+ #: modules/checkout/templates/wcf-template.php:36
1060
+ #: modules/optin/templates/optin-template-simple.php:25
1061
+ msgid "Your cart is currently empty."
1062
+ msgstr ""
1063
+
1064
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:432
1065
+ msgid ""
1066
+ "No product is selected. Please select products from the checkout meta "
1067
+ "settings to continue."
1068
+ msgstr ""
1069
+
1070
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:522
1071
+ msgid "Variations Not set"
1072
+ msgstr ""
1073
+
1074
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:530
1075
+ msgid "This product can't be purchased"
1076
+ msgstr ""
1077
+
1078
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:975
1079
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1018
1080
+ msgid "Coupon Code"
1081
+ msgstr ""
1082
+
1083
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:976
1084
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1027
1085
+ msgid "Apply"
1086
+ msgstr ""
1087
+
1088
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1183
1089
+ msgid "Sorry there was a problem removing this coupon."
1090
+ msgstr ""
1091
+
1092
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1186
1093
+ msgid "Coupon has been removed."
1094
+ msgstr ""
1095
+
1096
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1205
1097
+ msgid "Sorry there was a problem removing "
1098
+ msgstr ""
1099
+
1100
+ #: modules/checkout/classes/class-cartflows-checkout-markup.php:1208
1101
+ msgid " has been removed."
1102
+ msgstr ""
1103
+
1104
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:65
1105
+ msgid "Checkout Layout"
1106
+ msgstr ""
1107
+
1108
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:150
1109
+ #: modules/landing/classes/class-cartflows-landing-meta.php:130
1110
+ #: modules/optin/classes/class-cartflows-optin-meta.php:126
1111
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:130
1112
+ msgid "Shortcodes"
1113
+ msgstr ""
1114
+
1115
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:156
1116
+ #: modules/optin/classes/class-cartflows-optin-meta.php:132
1117
+ msgid "Select Product"
1118
+ msgstr ""
1119
+
1120
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:162
1121
+ msgid "Product Options"
1122
+ msgstr ""
1123
+
1124
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:168
1125
+ msgid "Order Bump"
1126
+ msgstr ""
1127
+
1128
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:174
1129
+ msgid "Checkout Offer"
1130
+ msgstr ""
1131
+
1132
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:180
1133
+ msgid "Checkout Design"
1134
+ msgstr ""
1135
+
1136
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:186
1137
+ msgid "Checkout Fields"
1138
+ msgstr ""
1139
+
1140
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:192
1141
+ msgid "Checkout Settings"
1142
+ msgstr ""
1143
+
1144
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:209
1145
+ msgid "Logo (Optional)"
1146
+ msgstr ""
1147
+
1148
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:270
1149
+ #. translators: %s: link
1150
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Product Options feature."
1151
+ msgstr ""
1152
+
1153
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:281
1154
+ #. translators: %s: link.
1155
+ msgid "Update %1$sCartFlows Pro%2$s to %3$s or above for Product Options"
1156
+ msgstr ""
1157
+
1158
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:309
1159
+ msgid "Add this shortcode to your checkout page"
1160
+ msgstr ""
1161
+
1162
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:345
1163
+ #. translators: %s: link
1164
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Pre-applied Coupon."
1165
+ msgstr ""
1166
+
1167
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:372
1168
+ #. translators: %s: link
1169
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Checkout Offer feature"
1170
+ msgstr ""
1171
+
1172
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:382
1173
+ #. translators: %s: link
1174
+ msgid "Update to %1$sCartFlows Pro%2$s to %3$s or above for Checkout Offer feature"
1175
+ msgstr ""
1176
+
1177
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:409
1178
+ #. translators: %s: link
1179
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for animate browser tab feature"
1180
+ msgstr ""
1181
+
1182
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:419
1183
+ #. translators: %s: link
1184
+ msgid ""
1185
+ "Update to %1$sCartFlows Pro%2$s to %3$s or above for animate browser tab "
1186
+ "feature"
1187
+ msgstr ""
1188
+
1189
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:442
1190
+ #. translators: %s: link
1191
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Order Bump feature."
1192
+ msgstr ""
1193
+
1194
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:469
1195
+ #: modules/optin/classes/class-cartflows-optin-meta.php:270
1196
+ #. translators: %s: link
1197
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Custom Fields feature."
1198
+ msgstr ""
1199
+
1200
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:492
1201
+ msgid "Place Order Button Text"
1202
+ msgstr ""
1203
+
1204
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:496
1205
+ msgid "Place order"
1206
+ msgstr ""
1207
+
1208
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:498
1209
+ msgid "It will change the Place Order Button text on checkout page."
1210
+ msgstr ""
1211
+
1212
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:508
1213
+ msgid "Enable cart editing on checkout"
1214
+ msgstr ""
1215
+
1216
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:516
1217
+ #. translators: %s: link
1218
+ msgid "Users will able to remove products from the checkout page."
1219
+ msgstr ""
1220
+
1221
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:546
1222
+ msgid "One Column (Available in CartFlows Pro) "
1223
+ msgstr ""
1224
+
1225
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:547
1226
+ msgid "Two Step (Available in CartFlows Pro) "
1227
+ msgstr ""
1228
+
1229
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:553
1230
+ msgid "Checkout Skin"
1231
+ msgstr ""
1232
+
1233
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:557
1234
+ msgid "One Column"
1235
+ msgstr ""
1236
+
1237
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:558
1238
+ msgid "Two Column"
1239
+ msgstr ""
1240
+
1241
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:559
1242
+ msgid "Two Step"
1243
+ msgstr ""
1244
+
1245
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:568
1246
+ #: modules/optin/classes/class-cartflows-optin-meta.php:346
1247
+ msgid "Primary Color"
1248
+ msgstr ""
1249
+
1250
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:577
1251
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:612
1252
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:658
1253
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:750
1254
+ #: modules/optin/classes/class-cartflows-optin-meta.php:355
1255
+ #: modules/optin/classes/class-cartflows-optin-meta.php:394
1256
+ #: modules/optin/classes/class-cartflows-optin-meta.php:506
1257
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:209
1258
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:240
1259
+ msgid "Font Family"
1260
+ msgstr ""
1261
+
1262
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:585
1263
+ msgid "Advance Options"
1264
+ msgstr ""
1265
+
1266
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:597
1267
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:225
1268
+ msgid "Heading"
1269
+ msgstr ""
1270
+
1271
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:603
1272
+ msgid "Heading Color"
1273
+ msgstr ""
1274
+
1275
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:621
1276
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:667
1277
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:759
1278
+ #: modules/optin/classes/class-cartflows-optin-meta.php:403
1279
+ #: modules/optin/classes/class-cartflows-optin-meta.php:515
1280
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:249
1281
+ msgid "Font Weight"
1282
+ msgstr ""
1283
+
1284
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:629
1285
+ #: modules/optin/classes/class-cartflows-optin-meta.php:366
1286
+ msgid "Input Fields"
1287
+ msgstr ""
1288
+
1289
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:637
1290
+ #: modules/optin/classes/class-cartflows-optin-meta.php:373
1291
+ msgid "Floating Labels (Available in CartFlows Pro)"
1292
+ msgstr ""
1293
+
1294
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:643
1295
+ #: modules/optin/classes/class-cartflows-optin-meta.php:379
1296
+ msgid "Style"
1297
+ msgstr ""
1298
+
1299
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:648
1300
+ #: modules/optin/classes/class-cartflows-optin-meta.php:384
1301
+ msgid "Floating Labels"
1302
+ msgstr ""
1303
+
1304
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:675
1305
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:767
1306
+ #: modules/optin/classes/class-cartflows-optin-meta.php:411
1307
+ #: modules/optin/classes/class-cartflows-optin-meta.php:523
1308
+ msgid "Size"
1309
+ msgstr ""
1310
+
1311
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:679
1312
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:771
1313
+ #: modules/optin/classes/class-cartflows-optin-meta.php:415
1314
+ #: modules/optin/classes/class-cartflows-optin-meta.php:527
1315
+ msgid "Extra Small"
1316
+ msgstr ""
1317
+
1318
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:680
1319
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:772
1320
+ #: modules/optin/classes/class-cartflows-optin-meta.php:416
1321
+ #: modules/optin/classes/class-cartflows-optin-meta.php:528
1322
+ msgid "Small"
1323
+ msgstr ""
1324
+
1325
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:681
1326
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:773
1327
+ #: modules/optin/classes/class-cartflows-optin-meta.php:417
1328
+ #: modules/optin/classes/class-cartflows-optin-meta.php:529
1329
+ msgid "Medium"
1330
+ msgstr ""
1331
+
1332
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:682
1333
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:774
1334
+ #: modules/optin/classes/class-cartflows-optin-meta.php:418
1335
+ #: modules/optin/classes/class-cartflows-optin-meta.php:530
1336
+ msgid "Large"
1337
+ msgstr ""
1338
+
1339
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:683
1340
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:775
1341
+ #: modules/optin/classes/class-cartflows-optin-meta.php:419
1342
+ #: modules/optin/classes/class-cartflows-optin-meta.php:531
1343
+ msgid "Extra Large"
1344
+ msgstr ""
1345
+
1346
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:684
1347
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:776
1348
+ #: modules/optin/classes/class-cartflows-optin-meta.php:420
1349
+ #: modules/optin/classes/class-cartflows-optin-meta.php:532
1350
+ msgid "Custom"
1351
+ msgstr ""
1352
+
1353
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:691
1354
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:783
1355
+ #: modules/optin/classes/class-cartflows-optin-meta.php:427
1356
+ #: modules/optin/classes/class-cartflows-optin-meta.php:539
1357
+ msgid "Top Bottom Spacing"
1358
+ msgstr ""
1359
+
1360
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:699
1361
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:791
1362
+ #: modules/optin/classes/class-cartflows-optin-meta.php:435
1363
+ #: modules/optin/classes/class-cartflows-optin-meta.php:547
1364
+ msgid "Left Right Spacing"
1365
+ msgstr ""
1366
+
1367
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:707
1368
+ #: modules/optin/classes/class-cartflows-optin-meta.php:451
1369
+ msgid "Text / Placeholder Color"
1370
+ msgstr ""
1371
+
1372
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:715
1373
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:815
1374
+ #: modules/optin/classes/class-cartflows-optin-meta.php:459
1375
+ #: modules/optin/classes/class-cartflows-optin-meta.php:584
1376
+ msgid "Background Color"
1377
+ msgstr ""
1378
+
1379
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:723
1380
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:831
1381
+ #: modules/optin/classes/class-cartflows-optin-meta.php:467
1382
+ #: modules/optin/classes/class-cartflows-optin-meta.php:600
1383
+ msgid "Border Color"
1384
+ msgstr ""
1385
+
1386
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:730
1387
+ #: modules/optin/classes/class-cartflows-optin-meta.php:443
1388
+ msgid "Label Color"
1389
+ msgstr ""
1390
+
1391
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:743
1392
+ msgid "Buttons"
1393
+ msgstr ""
1394
+
1395
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:799
1396
+ #: modules/optin/classes/class-cartflows-optin-meta.php:568
1397
+ msgid "Text Color"
1398
+ msgstr ""
1399
+
1400
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:807
1401
+ #: modules/optin/classes/class-cartflows-optin-meta.php:576
1402
+ msgid "Text Hover Color"
1403
+ msgstr ""
1404
+
1405
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:823
1406
+ #: modules/optin/classes/class-cartflows-optin-meta.php:592
1407
+ msgid "Background Hover Color"
1408
+ msgstr ""
1409
+
1410
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:839
1411
+ #: modules/optin/classes/class-cartflows-optin-meta.php:608
1412
+ msgid "Border Hover Color"
1413
+ msgstr ""
1414
+
1415
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:852
1416
+ msgid "Sections"
1417
+ msgstr ""
1418
+
1419
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:858
1420
+ msgid "Highlight Area Background Color"
1421
+ msgstr ""
1422
+
1423
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:897
1424
+ msgid "Header Logo"
1425
+ msgstr ""
1426
+
1427
+ #: modules/checkout/classes/class-cartflows-checkout-meta.php:905
1428
+ msgid "Logo Width (In px)"
1429
+ msgstr ""
1430
+
1431
+ #: modules/checkout/templates/wcf-template.php:46
1432
+ msgid "Copyright &copy;"
1433
+ msgstr ""
1434
+
1435
+ #: modules/checkout/templates/wcf-template.php:50
1436
+ msgid "All Rights Reserved"
1437
+ msgstr ""
1438
+
1439
+ #: modules/flow/classes/class-cartflows-flow-meta.php:265
1440
+ #. translators: %s flow id
1441
+ msgid "Step not deleted for flow - %s"
1442
+ msgstr ""
1443
+
1444
+ #: modules/flow/classes/class-cartflows-flow-meta.php:303
1445
+ #. translators: %s flow id
1446
+ msgid "Step deleted for flow - %s"
1447
+ msgstr ""
1448
+
1449
+ #: modules/flow/classes/class-cartflows-flow-meta.php:312
1450
+ #. translators: %s flow id
1451
+ msgid "This step can not be deleted."
1452
+ msgstr ""
1453
+
1454
+ #: modules/flow/classes/class-cartflows-flow-meta.php:344
1455
+ #. translators: %s flow id
1456
+ msgid "Steps not sorted for flow - %s"
1457
+ msgstr ""
1458
+
1459
+ #: modules/flow/classes/class-cartflows-flow-meta.php:380
1460
+ #. translators: %s flow id
1461
+ msgid "Steps sorted for flow - %s"
1462
+ msgstr ""
1463
+
1464
+ #: modules/flow/classes/class-cartflows-flow-meta.php:485
1465
+ msgid "Analytics"
1466
+ msgstr ""
1467
+
1468
+ #: modules/flow/classes/class-cartflows-flow-meta.php:502
1469
+ #. translators: %s: link
1470
+ msgid "Upgrade to %1$sCartFlows Pro%2$s for Analytics feature"
1471
+ msgstr ""
1472
+
1473
+ #: modules/flow/classes/class-cartflows-flow-meta.php:520
1474
+ msgid "Flow Settings"
1475
+ msgstr ""
1476
+
1477
+ #: modules/flow/classes/class-cartflows-flow-meta.php:605
1478
+ msgid "Enable Test Mode"
1479
+ msgstr ""
1480
+
1481
+ #: modules/flow/classes/class-cartflows-flow-meta.php:612
1482
+ msgid ""
1483
+ "If you are using WooCommerce plugin then test mode will add random products "
1484
+ "in your flow, so you can preview it easily while testing."
1485
+ msgstr ""
1486
+
1487
+ #: modules/flow/classes/class-cartflows-flow-meta.php:732
1488
+ #: modules/flow/view/meta-flow-steps.php:145
1489
+ msgid "Add New Step"
1490
+ msgstr ""
1491
+
1492
+ #: modules/flow/classes/class-cartflows-flow-meta.php:802
1493
+ #: modules/flow/classes/class-cartflows-step-post-type.php:166
1494
+ msgid "View Step"
1495
+ msgstr ""
1496
+
1497
+ #: modules/flow/classes/class-cartflows-flow-meta.php:813
1498
+ #: modules/flow/classes/class-cartflows-step-post-type.php:165
1499
+ msgid "Edit Step"
1500
+ msgstr ""
1501
+
1502
+ #: modules/flow/classes/class-cartflows-flow-meta.php:815
1503
+ msgid "Edit"
1504
+ msgstr ""
1505
+
1506
+ #: modules/flow/classes/class-cartflows-flow-meta.php:822
1507
+ msgid "Clone Step"
1508
+ msgstr ""
1509
+
1510
+ #: modules/flow/classes/class-cartflows-flow-meta.php:833
1511
+ msgid "Delete Step"
1512
+ msgstr ""
1513
+
1514
+ #: modules/flow/classes/class-cartflows-flow-meta.php:835
1515
+ msgid "Delete"
1516
+ msgstr ""
1517
+
1518
+ #: modules/flow/classes/class-cartflows-flow-meta.php:844
1519
+ #: modules/flow/classes/class-cartflows-flow-meta.php:846
1520
+ msgid "A/B Test"
1521
+ msgstr ""
1522
+
1523
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1524
+ msgid "Flow: "
1525
+ msgstr ""
1526
+
1527
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:69
1528
+ msgid "Name: "
1529
+ msgstr ""
1530
+
1531
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:101
1532
+ msgid "Search Flows"
1533
+ msgstr ""
1534
+
1535
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:102
1536
+ msgid "All Flows"
1537
+ msgstr ""
1538
+
1539
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:103
1540
+ msgid "Edit Flow"
1541
+ msgstr ""
1542
+
1543
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:104
1544
+ msgid "View Flow"
1545
+ msgstr ""
1546
+
1547
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:105
1548
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:107
1549
+ #: modules/flow/classes/class-cartflows-step-post-type.php:167
1550
+ #: modules/flow/classes/class-cartflows-step-post-type.php:169
1551
+ msgid "Add New"
1552
+ msgstr ""
1553
+
1554
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:106
1555
+ msgid "Update Flow"
1556
+ msgstr ""
1557
+
1558
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:108
1559
+ msgid "New Flow Name"
1560
+ msgstr ""
1561
+
1562
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:190
1563
+ msgid "Upgrade to CartFlows Pro"
1564
+ msgstr ""
1565
+
1566
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:209
1567
+ msgid "Slug"
1568
+ msgstr ""
1569
+
1570
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:321
1571
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:322
1572
+ msgid "Flows"
1573
+ msgstr ""
1574
+
1575
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:344
1576
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:350
1577
+ #: modules/flow/classes/class-cartflows-step-post-type.php:401
1578
+ #: modules/flow/classes/class-cartflows-step-post-type.php:407
1579
+ #. translators: %s: singular custom post type name
1580
+ msgid "%s updated."
1581
+ msgstr ""
1582
+
1583
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:346
1584
+ #: modules/flow/classes/class-cartflows-step-post-type.php:403
1585
+ #. translators: %s: singular custom post type name
1586
+ msgid "Custom %s updated."
1587
+ msgstr ""
1588
+
1589
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:348
1590
+ #: modules/flow/classes/class-cartflows-step-post-type.php:405
1591
+ #. translators: %s: singular custom post type name
1592
+ msgid "Custom %s deleted."
1593
+ msgstr ""
1594
+
1595
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:352
1596
+ #: modules/flow/classes/class-cartflows-step-post-type.php:409
1597
+ #. translators: %1$s: singular custom post type name ,%2$s: date and time of
1598
+ #. the revision
1599
+ msgid "%1$s restored to revision from %2$s"
1600
+ msgstr ""
1601
+
1602
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:354
1603
+ #: modules/flow/classes/class-cartflows-step-post-type.php:411
1604
+ #. translators: %s: singular custom post type name
1605
+ msgid "%s published."
1606
+ msgstr ""
1607
+
1608
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:356
1609
+ #: modules/flow/classes/class-cartflows-step-post-type.php:413
1610
+ #. translators: %s: singular custom post type name
1611
+ msgid "%s saved."
1612
+ msgstr ""
1613
+
1614
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:358
1615
+ #: modules/flow/classes/class-cartflows-step-post-type.php:415
1616
+ #. translators: %s: singular custom post type name
1617
+ msgid "%s submitted."
1618
+ msgstr ""
1619
+
1620
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:360
1621
+ #: modules/flow/classes/class-cartflows-step-post-type.php:417
1622
+ #. translators: %s: singular custom post type name
1623
+ msgid "%s scheduled for."
1624
+ msgstr ""
1625
+
1626
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:362
1627
+ #: modules/flow/classes/class-cartflows-step-post-type.php:419
1628
+ #. translators: %s: singular custom post type name
1629
+ msgid "%s draft updated."
1630
+ msgstr ""
1631
+
1632
+ #: modules/flow/classes/class-cartflows-flow-shortcodes.php:148
1633
+ #: modules/widgets/class-cartflows-next-step.php:78
1634
+ msgid "Next Step"
1635
+ msgstr ""
1636
+
1637
+ #: modules/flow/classes/class-cartflows-step-post-type.php:163
1638
+ msgid "Search Steps"
1639
+ msgstr ""
1640
+
1641
+ #: modules/flow/classes/class-cartflows-step-post-type.php:164
1642
+ msgid "All Steps"
1643
+ msgstr ""
1644
+
1645
+ #: modules/flow/classes/class-cartflows-step-post-type.php:168
1646
+ msgid "Update Step"
1647
+ msgstr ""
1648
+
1649
+ #: modules/flow/classes/class-cartflows-step-post-type.php:170
1650
+ msgid "New Step Name"
1651
+ msgstr ""
1652
+
1653
+ #: modules/flow/classes/class-cartflows-step-post-type.php:211
1654
+ msgid "Step Type"
1655
+ msgstr ""
1656
+
1657
+ #: modules/flow/classes/class-cartflows-step-post-type.php:221
1658
+ msgid "Step Flow"
1659
+ msgstr ""
1660
+
1661
+ #: modules/flow/classes/class-cartflows-step-post-type.php:246
1662
+ #: modules/flow/view/meta-flow-steps.php:16
1663
+ msgid "Optin (Woo)"
1664
+ msgstr ""
1665
+
1666
+ #: modules/flow/classes/class-cartflows-step-post-type.php:267
1667
+ #: modules/flow/view/meta-flow-steps.php:14
1668
+ msgid "Upsell (Woo)"
1669
+ msgstr ""
1670
+
1671
+ #: modules/flow/classes/class-cartflows-step-post-type.php:274
1672
+ #: modules/flow/view/meta-flow-steps.php:15
1673
+ msgid "Downsell (Woo)"
1674
+ msgstr ""
1675
+
1676
+ #: modules/flow/view/view-flow-inner-step.php:30
1677
+ msgid "Control"
1678
+ msgstr ""
1679
+
1680
+ #: modules/flow/view/view-flow-inner-step.php:32
1681
+ #. translators: %s badge count
1682
+ msgid "Variation-%s"
1683
+ msgstr ""
1684
+
1685
+ #: modules/flow/view/view-flow-inner-step.php:44
1686
+ msgid "No Product Assigned"
1687
+ msgstr ""
1688
+
1689
+ #: modules/flow/view/view-flow-inner-step.php:48
1690
+ msgid "Global Checkout - Remove selected checkout product"
1691
+ msgstr ""
1692
+
1693
+ #: modules/flow/view/view-remote-importer.php:19
1694
+ msgid "Steps Library"
1695
+ msgstr ""
1696
+
1697
+ #: modules/flow/view/view-remote-importer.php:68
1698
+ msgid "Create Step"
1699
+ msgstr ""
1700
+
1701
+ #: modules/flow/view/view-remote-importer.php:70
1702
+ msgid "You need a Cartflows Pro version to import Upsell / Downsell"
1703
+ msgstr ""
1704
+
1705
+ #: modules/landing/classes/class-cartflows-landing-meta.php:66
1706
+ msgid "Landing Page Settings"
1707
+ msgstr ""
1708
+
1709
+ #: modules/landing/classes/class-cartflows-landing-meta.php:169
1710
+ msgid "Next Step Link"
1711
+ msgstr ""
1712
+
1713
+ #: modules/optin/classes/class-cartflows-optin-markup.php:185
1714
+ msgid "Please place shortcode on Optin step-type only."
1715
+ msgstr ""
1716
+
1717
+ #: modules/optin/classes/class-cartflows-optin-markup.php:245
1718
+ msgid ""
1719
+ "No product is selected. Please select a Simple, Virtual and Free product "
1720
+ "from the meta settings."
1721
+ msgstr ""
1722
+
1723
+ #: modules/optin/classes/class-cartflows-optin-markup.php:262
1724
+ msgid "Please update the selected product's price to zero (0)."
1725
+ msgstr ""
1726
+
1727
+ #: modules/optin/classes/class-cartflows-optin-markup.php:271
1728
+ #: modules/optin/classes/class-cartflows-optin-markup.php:275
1729
+ msgid "Please select a Simple, Virtual and Free product."
1730
+ msgstr ""
1731
+
1732
+ #: modules/optin/classes/class-cartflows-optin-meta.php:65
1733
+ msgid "Optin Settings"
1734
+ msgstr ""
1735
+
1736
+ #: modules/optin/classes/class-cartflows-optin-meta.php:138
1737
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:136
1738
+ msgid "Design"
1739
+ msgstr ""
1740
+
1741
+ #: modules/optin/classes/class-cartflows-optin-meta.php:144
1742
+ msgid "Form Fields"
1743
+ msgstr ""
1744
+
1745
+ #: modules/optin/classes/class-cartflows-optin-meta.php:213
1746
+ msgid "Add this shortcode to your optin page"
1747
+ msgstr ""
1748
+
1749
+ #: modules/optin/classes/class-cartflows-optin-meta.php:238
1750
+ msgid "Select Free Product"
1751
+ msgstr ""
1752
+
1753
+ #: modules/optin/classes/class-cartflows-optin-meta.php:239
1754
+ msgid "Select Free and Virtual product only."
1755
+ msgstr ""
1756
+
1757
+ #: modules/optin/classes/class-cartflows-optin-meta.php:293
1758
+ msgid "Pass Fields as URL Parameters"
1759
+ msgstr ""
1760
+
1761
+ #: modules/optin/classes/class-cartflows-optin-meta.php:296
1762
+ msgid "Enable"
1763
+ msgstr ""
1764
+
1765
+ #: modules/optin/classes/class-cartflows-optin-meta.php:297
1766
+ msgid ""
1767
+ "You can pass specific fields from the form to next step as URL query "
1768
+ "parameters."
1769
+ msgstr ""
1770
+
1771
+ #: modules/optin/classes/class-cartflows-optin-meta.php:308
1772
+ msgid "Enter form field"
1773
+ msgstr ""
1774
+
1775
+ #: modules/optin/classes/class-cartflows-optin-meta.php:311
1776
+ #: modules/optin/classes/class-cartflows-optin-meta.php:321
1777
+ msgid "Enter comma seprated field name. E.g. first_name, last_name"
1778
+ msgstr ""
1779
+
1780
+ #: modules/optin/classes/class-cartflows-optin-meta.php:313
1781
+ msgid "Fields to pass, separated by commas"
1782
+ msgstr ""
1783
+
1784
+ #: modules/optin/classes/class-cartflows-optin-meta.php:323
1785
+ #. translators: %s: link
1786
+ msgid ""
1787
+ "You can pass field value as a URL parameter to the next step. %1$sClick "
1788
+ "here%2$s for more information."
1789
+ msgstr ""
1790
+
1791
+ #: modules/optin/classes/class-cartflows-optin-meta.php:480
1792
+ msgid "Submit Button"
1793
+ msgstr ""
1794
+
1795
+ #: modules/optin/classes/class-cartflows-optin-meta.php:486
1796
+ msgid "Button Text"
1797
+ msgstr ""
1798
+
1799
+ #: modules/optin/classes/class-cartflows-optin-meta.php:497
1800
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:217
1801
+ msgid "Font Size"
1802
+ msgstr ""
1803
+
1804
+ #: modules/optin/classes/class-cartflows-optin-meta.php:555
1805
+ msgid "Position"
1806
+ msgstr ""
1807
+
1808
+ #: modules/optin/classes/class-cartflows-optin-meta.php:559
1809
+ msgid "Left"
1810
+ msgstr ""
1811
+
1812
+ #: modules/optin/classes/class-cartflows-optin-meta.php:560
1813
+ msgid "Center"
1814
+ msgstr ""
1815
+
1816
+ #: modules/optin/classes/class-cartflows-optin-meta.php:561
1817
+ msgid "Right"
1818
+ msgstr ""
1819
+
1820
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:65
1821
+ msgid "Thank You Page Settings"
1822
+ msgstr ""
1823
+
1824
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:142
1825
+ msgid "Edit Fields"
1826
+ msgstr ""
1827
+
1828
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:182
1829
+ msgid "Order Details"
1830
+ msgstr ""
1831
+
1832
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:194
1833
+ msgid "Text"
1834
+ msgstr ""
1835
+
1836
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:200
1837
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:231
1838
+ msgid "Color"
1839
+ msgstr ""
1840
+
1841
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:257
1842
+ msgid "Advanced Options"
1843
+ msgstr ""
1844
+
1845
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:267
1846
+ msgid "Container Width (In px)"
1847
+ msgstr ""
1848
+
1849
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:275
1850
+ msgid "Section Background Color"
1851
+ msgstr ""
1852
+
1853
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:289
1854
+ msgid "Enable Order Overview "
1855
+ msgstr ""
1856
+
1857
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:297
1858
+ msgid "Enable Order Details "
1859
+ msgstr ""
1860
+
1861
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:305
1862
+ msgid "Enable Billing Details "
1863
+ msgstr ""
1864
+
1865
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:313
1866
+ msgid "Enable Shipping Details "
1867
+ msgstr ""
1868
+
1869
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:329
1870
+ msgid "Thank You Page Text"
1871
+ msgstr ""
1872
+
1873
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:333
1874
+ #: woocommerce/template/checkout/thankyou.php:41
1875
+ #: woocommerce/template/checkout/thankyou.php:83
1876
+ msgid "Thank you. Your order has been received."
1877
+ msgstr ""
1878
+
1879
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:335
1880
+ msgid "It will change the default text on thank you page."
1881
+ msgstr ""
1882
+
1883
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:343
1884
+ msgid "Redirect After Purchase"
1885
+ msgstr ""
1886
+
1887
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:352
1888
+ msgid "Redirect Link"
1889
+ msgstr ""
1890
+
1891
+ #: modules/thankyou/classes/class-cartflows-thankyou-meta.php:356
1892
+ msgid "https://"
1893
+ msgstr ""
1894
+
1895
+ #: modules/widgets/class-cartflows-next-step.php:24
1896
+ msgid "CartFlows Next Step"
1897
+ msgstr ""
1898
+
1899
+ #: modules/widgets/class-cartflows-next-step.php:26
1900
+ msgid "Next Step Widgets"
1901
+ msgstr ""
1902
+
1903
+ #: modules/widgets/class-cartflows-next-step.php:106
1904
+ msgid "New title"
1905
+ msgstr ""
1906
+
1907
+ #: modules/widgets/class-cartflows-next-step.php:123
1908
+ msgid "Title:"
1909
+ msgstr ""
1910
+
1911
+ #: modules/widgets/class-cartflows-next-step.php:127
1912
+ msgid "Flow ID:"
1913
+ msgstr ""
1914
+
1915
+ #: modules/widgets/class-cartflows-next-step.php:131
1916
+ msgid "Step ID:"
1917
+ msgstr ""
1918
+
1919
+ #: woocommerce/template/cart/cart-shipping.php:51
1920
+ #. Translators: $s shipping destination.
1921
+ msgid "Estimate for %s."
1922
+ msgstr ""
1923
+
1924
+ #: woocommerce/template/cart/cart-shipping.php:52
1925
+ msgid "Change address"
1926
+ msgstr ""
1927
+
1928
+ #: woocommerce/template/cart/cart-shipping.php:54
1929
+ msgid "This is only an estimate. Prices will be updated during checkout."
1930
+ msgstr ""
1931
+
1932
+ #: woocommerce/template/cart/cart-shipping.php:61
1933
+ msgid "Enter your address to view shipping options."
1934
+ msgstr ""
1935
+
1936
+ #: woocommerce/template/cart/cart-shipping.php:63
1937
+ msgid ""
1938
+ "There are no shipping methods available. Please ensure that your address "
1939
+ "has been entered correctly, or contact us if you need any help."
1940
+ msgstr ""
1941
+
1942
+ #: woocommerce/template/cart/cart-shipping.php:66
1943
+ #. Translators: $s shipping destination.
1944
+ msgid "No shipping options were found for %s."
1945
+ msgstr ""
1946
+
1947
+ #: woocommerce/template/cart/cart-shipping.php:67
1948
+ msgid "Enter a different address"
1949
+ msgstr ""
1950
+
1951
+ #: woocommerce/template/checkout/form-billing.php:27
1952
+ msgid "Billing &amp; Shipping"
1953
+ msgstr ""
1954
+
1955
+ #: woocommerce/template/checkout/form-billing.php:31
1956
+ msgid "Billing details"
1957
+ msgstr ""
1958
+
1959
+ #: woocommerce/template/checkout/form-billing.php:59
1960
+ msgid "Create an account?"
1961
+ msgstr ""
1962
+
1963
+ #: woocommerce/template/checkout/form-checkout.php:26
1964
+ msgid "You must be logged in to checkout."
1965
+ msgstr ""
1966
+
1967
+ #: woocommerce/template/checkout/form-checkout.php:52
1968
+ msgid "Your order"
1969
+ msgstr ""
1970
+
1971
+ #: woocommerce/template/checkout/form-coupon.php:26
1972
+ msgid "Have a coupon?"
1973
+ msgstr ""
1974
+
1975
+ #: woocommerce/template/checkout/form-coupon.php:26
1976
+ msgid "Click here to enter your code"
1977
+ msgstr ""
1978
+
1979
+ #: woocommerce/template/checkout/form-coupon.php:31
1980
+ msgid "If you have a coupon code, please apply it below."
1981
+ msgstr ""
1982
+
1983
+ #: woocommerce/template/checkout/form-coupon.php:34
1984
+ msgid "Coupon code"
1985
+ msgstr ""
1986
+
1987
+ #: woocommerce/template/checkout/form-coupon.php:38
1988
+ msgid "Apply coupon"
1989
+ msgstr ""
1990
+
1991
+ #: woocommerce/template/checkout/form-login.php:26
1992
+ msgid "Returning customer?"
1993
+ msgstr ""
1994
+
1995
+ #: woocommerce/template/checkout/form-login.php:26
1996
+ msgid "Click here to login"
1997
+ msgstr ""
1998
+
1999
+ #: woocommerce/template/checkout/form-login.php:32
2000
+ msgid ""
2001
+ "If you have shopped with us before, please enter your details below. If you "
2002
+ "are a new customer, please proceed to the Billing &amp; Shipping section."
2003
+ msgstr ""
2004
+
2005
+ #: woocommerce/template/checkout/form-shipping.php:26
2006
+ msgid "Ship to a different address?"
2007
+ msgstr ""
2008
+
2009
+ #: woocommerce/template/checkout/form-shipping.php:57
2010
+ msgid "Additional information"
2011
+ msgstr ""
2012
+
2013
+ #: woocommerce/template/checkout/payment.php:33
2014
+ msgid ""
2015
+ "Sorry, it seems that there are no available payment methods for your state. "
2016
+ "Please contact us if you require assistance or wish to make alternate "
2017
+ "arrangements."
2018
+ msgstr ""
2019
+
2020
+ #: woocommerce/template/checkout/payment.php:33
2021
+ msgid "Please fill in your details above to see available payment methods."
2022
+ msgstr ""
2023
+
2024
+ #: woocommerce/template/checkout/payment.php:42
2025
+ #. translators: $1 and $2 opening and closing emphasis tags respectively
2026
+ msgid ""
2027
+ "Since your browser does not support JavaScript, or it is disabled, please "
2028
+ "ensure you click the %1$sUpdate Totals%2$s button before placing your "
2029
+ "order. You may be charged more than the amount stated above if you fail to "
2030
+ "do so."
2031
+ msgstr ""
2032
+
2033
+ #: woocommerce/template/checkout/payment.php:44
2034
+ msgid "Update totals"
2035
+ msgstr ""
2036
+
2037
+ #: woocommerce/template/checkout/review-order.php:26
2038
+ #: woocommerce/template/order/order-details.php:51
2039
+ msgid "Product"
2040
+ msgstr ""
2041
+
2042
+ #: woocommerce/template/checkout/review-order.php:27
2043
+ #: woocommerce/template/checkout/review-order.php:107
2044
+ #: woocommerce/template/order/order-details.php:52
2045
+ msgid "Total"
2046
+ msgstr ""
2047
+
2048
+ #: woocommerce/template/checkout/review-order.php:60
2049
+ msgid "Subtotal"
2050
+ msgstr ""
2051
+
2052
+ #: woocommerce/template/checkout/thankyou.php:30
2053
+ msgid ""
2054
+ "Unfortunately your order cannot be processed as the originating "
2055
+ "bank/merchant has declined your transaction. Please attempt your purchase "
2056
+ "again."
2057
+ msgstr ""
2058
+
2059
+ #: woocommerce/template/checkout/thankyou.php:33
2060
+ msgid "Pay"
2061
+ msgstr ""
2062
+
2063
+ #: woocommerce/template/checkout/thankyou.php:35
2064
+ msgid "My account"
2065
+ msgstr ""
2066
+
2067
+ #: woocommerce/template/checkout/thankyou.php:46
2068
+ msgid "Order number:"
2069
+ msgstr ""
2070
+
2071
+ #: woocommerce/template/checkout/thankyou.php:51
2072
+ msgid "Date:"
2073
+ msgstr ""
2074
+
2075
+ #: woocommerce/template/checkout/thankyou.php:57
2076
+ msgid "Email:"
2077
+ msgstr ""
2078
+
2079
+ #: woocommerce/template/checkout/thankyou.php:63
2080
+ msgid "Total:"
2081
+ msgstr ""
2082
+
2083
+ #: woocommerce/template/checkout/thankyou.php:69
2084
+ msgid "Payment method:"
2085
+ msgstr ""
2086
+
2087
+ #: woocommerce/template/global/form-login.php:34
2088
+ msgid "Username or email"
2089
+ msgstr ""
2090
+
2091
+ #: woocommerce/template/global/form-login.php:38
2092
+ msgid "Password"
2093
+ msgstr ""
2094
+
2095
+ #: woocommerce/template/global/form-login.php:48
2096
+ msgid "Login"
2097
+ msgstr ""
2098
+
2099
+ #: woocommerce/template/global/form-login.php:53
2100
+ msgid "Remember me"
2101
+ msgstr ""
2102
+
2103
+ #: woocommerce/template/global/form-login.php:57
2104
+ msgid "Lost your password?"
2105
+ msgstr ""
2106
+
2107
+ #: woocommerce/template/order/order-details.php:45
2108
+ msgid "Order details"
2109
+ msgstr ""
2110
+
2111
+ #: woocommerce/template/order/order-details.php:93
2112
+ msgid "Note:"
2113
+ msgstr ""
2114
+
2115
+ #. Plugin Name of the plugin/theme
2116
+ msgid "CartFlows"
2117
+ msgstr ""
2118
+
2119
+ #. Author URI of the plugin/theme
2120
+ msgid "https://cartflows.com/"
2121
+ msgstr ""
2122
+
2123
+ #. Description of the plugin/theme
2124
+ msgid "Create beautiful checkout pages & sales flows for WooCommerce."
2125
+ msgstr ""
2126
+
2127
+ #. Author of the plugin/theme
2128
+ msgid "CartFlows Inc"
2129
+ msgstr ""
2130
+
2131
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:99
2132
+ msgctxt "flow general name"
2133
+ msgid "Flows"
2134
+ msgstr ""
2135
+
2136
+ #: modules/flow/classes/class-cartflows-flow-post-type.php:100
2137
+ msgctxt "flow singular name"
2138
+ msgid "Flow"
2139
+ msgstr ""
2140
+
2141
+ #: modules/flow/classes/class-cartflows-step-post-type.php:161
2142
+ msgctxt "flow step general name"
2143
+ msgid "Steps"
2144
+ msgstr ""
2145
+
2146
+ #: modules/flow/classes/class-cartflows-step-post-type.php:162
2147
+ msgctxt "flow step singular name"
2148
+ msgid "Step"
2149
+ msgstr ""
2150
+
2151
+ #: modules/flow/classes/class-cartflows-step-post-type.php:315
2152
+ msgctxt "cartflows"
2153
+ msgid "CartFlows — Boxed"
2154
+ msgstr ""
2155
+
2156
+ #: modules/flow/classes/class-cartflows-step-post-type.php:316
2157
+ msgctxt "cartflows"
2158
+ msgid "Template for Page Builders"
2159
  msgstr ""
modules/optin/classes/class-cartflows-optin-markup.php CHANGED
@@ -1,729 +1,736 @@
1
- <?php
2
- /**
3
- * Checkout markup.
4
- *
5
- * @package CartFlows
6
- */
7
-
8
- /**
9
- * Checkout Markup
10
- *
11
- * @since 1.0.0
12
- */
13
- class Cartflows_Optin_Markup {
14
-
15
- /**
16
- * Member Variable
17
- *
18
- * @var object instance
19
- */
20
- private static $instance;
21
-
22
- /**
23
- * Initiator
24
- */
25
- public static function get_instance() {
26
- if ( ! isset( self::$instance ) ) {
27
- self::$instance = new self();
28
- }
29
- return self::$instance;
30
- }
31
-
32
- /**
33
- * Constructor
34
- */
35
- public function __construct() {
36
-
37
- /* Set is checkout flag */
38
- add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
-
40
- add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_optin_fields' ), 10, 2 );
41
-
42
- /* Optin Shortcode */
43
- add_shortcode( 'cartflows_optin', array( $this, 'optin_shortcode_markup' ) );
44
-
45
- /* Preconfigured cart data */
46
- add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
47
-
48
- /* Optin shortcode data */
49
- add_action( 'wp', array( $this, 'shortcode_load_data' ), 1000 );
50
-
51
- /* Ajax Endpoint */
52
- add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ), 10, 2 );
53
- add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
54
-
55
- /* Optin Fields */
56
- add_filter( 'woocommerce_default_address_fields', array( $this, 'set_optin_default_fields' ), 1000 );
57
- /**
58
- * It may required later
59
- * add_filter( 'woocommerce_checkout_fields', array( $this, 'set_optin_fields' ) );
60
- */
61
- add_filter( 'woocommerce_billing_fields', array( $this, 'billing_optin_fields' ), 1000, 2 );
62
-
63
- add_filter( 'woocommerce_checkout_required_field_notice', array( $this, 'change_field_label_in_required_notice' ), 100, 2 );
64
-
65
- add_action( 'init', array( $this, 'remove_login_actions' ) );
66
-
67
- $this->elementor_editor_compatibility();
68
- }
69
-
70
- /**
71
- * Elementor editor compatibility.
72
- */
73
- public function elementor_editor_compatibility() {
74
-
75
- if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
76
-
77
- if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
78
-
79
- if ( _wcf_check_is_optin_by_id( intval( $_GET['post'] ) ) ) { //phpcs:ignore
80
-
81
- /* Submit Button */
82
- add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
83
- }
84
- }
85
- }
86
- }
87
-
88
- /**
89
- * Remove login and registration actions.
90
- */
91
- public function remove_login_actions() {
92
-
93
- if ( _is_wcf_doing_optin_ajax() ) {
94
- add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
95
- add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
96
- }
97
- }
98
-
99
- /**
100
- * Change order button text .
101
- *
102
- * @param string $woo_button_text place order.
103
- * @return string
104
- */
105
- public function place_order_button_text( $woo_button_text ) {
106
-
107
- $optin_id = get_the_ID();
108
-
109
- $wcf_order_button_text = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
110
-
111
- if ( ! empty( $wcf_order_button_text ) ) {
112
- $woo_button_text = $wcf_order_button_text;
113
- }
114
-
115
- return $woo_button_text;
116
- }
117
-
118
- /**
119
- * Display all WooCommerce notices.
120
- *
121
- * @since 1.1.5
122
- */
123
- public function display_woo_notices() {
124
-
125
- if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
126
- woocommerce_output_all_notices();
127
- }
128
- }
129
-
130
- /**
131
- * Check for checkout flag
132
- *
133
- * @param bool $is_checkout is checkout.
134
- *
135
- * @return bool
136
- */
137
- public function woo_checkout_flag( $is_checkout ) {
138
-
139
- if ( ! is_admin() ) {
140
-
141
- if ( _is_wcf_optin_type() ) {
142
-
143
- $is_checkout = true;
144
- }
145
- }
146
-
147
- return $is_checkout;
148
- }
149
-
150
- /**
151
- * Render checkout shortcode markup.
152
- *
153
- * @param array $atts attributes.
154
- * @return string
155
- */
156
- public function optin_shortcode_markup( $atts ) {
157
-
158
- if ( ! function_exists( 'wc_print_notices' ) ) {
159
- $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
160
- $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
161
-
162
- return $notice_out;
163
- }
164
-
165
- $atts = shortcode_atts(
166
- array(
167
- 'id' => 0,
168
- ),
169
- $atts
170
- );
171
-
172
- $optin_id = intval( $atts['id'] );
173
-
174
- if ( empty( $optin_id ) ) {
175
-
176
- if ( ! _is_wcf_optin_type() ) {
177
-
178
- return '<h4>' . __( 'Please place shortcode on Optin step-type only.', 'cartflows' ) . '</h4>';
179
- }
180
-
181
- global $post;
182
-
183
- $optin_id = intval( $post->ID );
184
- }
185
-
186
- $output = '';
187
-
188
- ob_start();
189
-
190
- do_action( 'cartflows_optin_form_before', $optin_id );
191
-
192
- $optin_layout = 'default';
193
-
194
- $template_default = CARTFLOWS_OPTIN_DIR . 'templates/optin-template-simple.php';
195
-
196
- include $template_default;
197
-
198
- $output .= ob_get_clean();
199
-
200
- return $output;
201
- }
202
-
203
- /**
204
- * Configure Cart Data.
205
- *
206
- * @since 1.0.0
207
- *
208
- * @return void
209
- */
210
- public function preconfigured_cart_data() {
211
-
212
- if ( is_admin() ) {
213
- return;
214
- }
215
-
216
- global $post;
217
-
218
- if ( _is_wcf_optin_type() ) {
219
-
220
- if ( wp_doing_ajax() ) {
221
- return;
222
- } else {
223
-
224
- $optin_id = $post->ID;
225
-
226
- do_action( 'cartflows_optin_before_configure_cart', $optin_id );
227
-
228
- $products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
229
-
230
- if ( ! is_array( $products ) ) {
231
- return;
232
- }
233
-
234
- /* Empty the current cart */
235
- WC()->cart->empty_cart();
236
-
237
- if ( is_array( $products ) && count( $products ) < 1 ) {
238
- wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
239
- return;
240
- }
241
-
242
- /* Set customer session if not set */
243
- if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
244
- WC()->session->set_customer_session_cookie( true );
245
- }
246
-
247
- $product_id = reset( $products );
248
- $_product = wc_get_product( $product_id );
249
-
250
- if ( ! empty( $_product ) ) {
251
-
252
- if ( $_product->is_type( 'simple' ) && $_product->is_virtual() ) {
253
-
254
- if ( $_product->get_price() > 0 ) {
255
- wc_add_notice( __( 'Please update the selected product\'s price to zero (0).', 'cartflows' ), 'error' );
256
- } else {
257
-
258
- $quantity = 1;
259
-
260
- WC()->cart->add_to_cart( $product_id, $quantity );
261
- }
262
- } else {
263
-
264
- wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
265
- }
266
- } else {
267
-
268
- wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
269
- }
270
-
271
- do_action( 'cartflows_optin_after_configure_cart', $optin_id );
272
- }
273
- }
274
- }
275
-
276
- /**
277
- * Load shortcode data.
278
- *
279
- * @return void
280
- */
281
- public function shortcode_load_data() {
282
-
283
- if ( _is_wcf_optin_type() ) {
284
-
285
- add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
286
-
287
- add_action( 'wp_enqueue_scripts', array( $this, 'compatibility_scripts' ), 101 );
288
-
289
- /* Show notices if cart has errors */
290
- add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
291
-
292
- // Outputting the hidden field in checkout page.
293
- add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
294
- add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
295
-
296
- /* Remove unnecessary option */
297
- add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
298
- add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
299
-
300
- remove_all_actions( 'woocommerce_before_checkout_form' );
301
- remove_all_actions( 'woocommerce_checkout_billing' );
302
- remove_all_actions( 'woocommerce_checkout_shipping' );
303
- remove_all_actions( 'woocommerce_checkout_before_order_review' );
304
- remove_all_actions( 'woocommerce_checkout_order_review' );
305
- remove_all_actions( 'woocommerce_checkout_after_order_review' );
306
- add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
307
- add_filter( 'woocommerce_available_payment_gateways', array( $this, 'disable_payment_gateways' ) );
308
-
309
- /* Paypal Expresss remove */
310
-
311
- if ( function_exists( 'wc_gateway_ppec' ) ) {
312
- remove_action( 'wp_enqueue_scripts', array( wc_gateway_ppec()->cart, 'enqueue_scripts' ) );
313
- }
314
-
315
- // Hook in actions once.
316
- add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );
317
- add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
318
- add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
319
- add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
320
-
321
- /* Submit Button */
322
- add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
323
-
324
- add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
325
-
326
- /* Remove login actions */
327
- add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
328
- add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
329
-
330
- global $post;
331
-
332
- $optin_id = $post->ID;
333
-
334
- do_action( 'cartflows_optin_before_shortcode', $optin_id );
335
- }
336
- }
337
-
338
- /**
339
- * Disable payment gateways.
340
- *
341
- * @param array $available_gateways gateways.
342
- * @return array
343
- */
344
- public function disable_payment_gateways( $available_gateways ) {
345
-
346
- if ( ! is_admin() ) {
347
-
348
- $available_gateways = array();
349
- }
350
-
351
- return $available_gateways;
352
- }
353
-
354
- /**
355
- * Render checkout ID hidden field.
356
- *
357
- * @param array $checkout checkout session data.
358
- * @return void
359
- */
360
- public function checkout_shortcode_post_id( $checkout ) {
361
-
362
- if ( ! _is_wcf_optin_type() ) {
363
- return;
364
- }
365
-
366
- global $post;
367
-
368
- $optin_id = $post->ID;
369
-
370
- $flow_id = get_post_meta( $optin_id, 'wcf-flow-id', true );
371
-
372
- echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
373
- echo '<input type="hidden" class="input-hidden _wcf_optin_id" name="_wcf_optin_id" value="' . intval( $optin_id ) . '">';
374
- }
375
-
376
- /**
377
- * Load shortcode scripts.
378
- *
379
- * @return void
380
- */
381
- public function shortcode_scripts() {
382
-
383
- wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
384
-
385
- wp_enqueue_script(
386
- 'wcf-optin-template',
387
- wcf()->utils->get_js_url( 'optin-template' ),
388
- array( 'jquery' ),
389
- CARTFLOWS_VER,
390
- true
391
- );
392
-
393
- do_action( 'cartflows_optin_scripts' );
394
-
395
- $style = $this->generate_style();
396
-
397
- wp_add_inline_style( 'wcf-optin-template', $style );
398
- }
399
-
400
- /**
401
- * Load compatibility scripts.
402
- *
403
- * @return void
404
- */
405
- public function compatibility_scripts() {
406
-
407
- global $post;
408
-
409
- $optin_id = $post->ID;
410
-
411
- // Add DIVI Compatibility css if DIVI theme is enabled.
412
- if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
413
- Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id )
414
- ) {
415
- wp_enqueue_style( 'wcf-optin-template-divi', wcf()->utils->get_css_url( 'optin-template-divi' ), '', CARTFLOWS_VER );
416
- }
417
- }
418
-
419
- /**
420
- * Generate styles.
421
- *
422
- * @return string
423
- */
424
- public function generate_style() {
425
-
426
- global $post;
427
-
428
- $optin_id = $post->ID;
429
-
430
- /* Load all fonts */
431
- CartFlows_Font_Families::render_fonts( $optin_id );
432
-
433
- $r = '';
434
- $g = '';
435
- $b = '';
436
- $output = '';
437
-
438
- /* Global */
439
- $primary_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-primary-color' );
440
- $base_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-base-font-family' );
441
-
442
- /* Input Fields */
443
- $input_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-family' );
444
- $input_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-weight' );
445
- $field_input_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-field-size' );
446
- $field_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-tb-padding' );
447
- $field_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-lr-padding' );
448
- $field_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-color' );
449
- $field_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-bg-color' );
450
- $field_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-border-color' );
451
- $field_label_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-label-color' );
452
-
453
- if ( 'custom' == $field_input_size ) {
454
- $field_input_size = '38px';
455
- }
456
-
457
- /* Submit Button */
458
- $submit_button_width = '100%';
459
- $optin_button_position = '';
460
- $button_font_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-font-size' );
461
- $button_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-family' );
462
- $button_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-weight' );
463
- $submit_button_height = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-size' );
464
- $submit_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-tb-padding' );
465
- $submit_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-lr-padding' );
466
- $submit_button_position = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-position' );
467
- $submit_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-color' );
468
- $submit_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-hover-color' );
469
- $submit_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-color', $primary_color );
470
- $submit_bg_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-hover-color', $primary_color );
471
- $submit_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-color', $primary_color );
472
- $submit_border_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-hover-color', $primary_color );
473
-
474
- if ( 'custom' == $submit_button_height ) {
475
- $submit_button_height = '38px';
476
- $submit_button_width = 'auto';
477
-
478
- switch ( $submit_button_position ) {
479
- case 'left':
480
- $optin_button_position = '0 auto 0 0';
481
- break;
482
- case 'center':
483
- $optin_button_position = '0 auto';
484
- break;
485
- case 'right':
486
- $optin_button_position = '0 0 0 auto';
487
- break;
488
-
489
- default:
490
- $optin_button_position = '0 auto';
491
- break;
492
- }
493
- }
494
-
495
- if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
496
- Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id ) ) {
497
-
498
- include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-divi-css.php';
499
-
500
- } else {
501
- include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-css.php';
502
- }
503
-
504
- return $output;
505
- }
506
-
507
- /**
508
- * Get ajax end points.
509
- *
510
- * @param string $endpoint_url end point URL.
511
- * @param string $request end point request.
512
- * @return string
513
- */
514
- public function get_ajax_endpoint( $endpoint_url, $request ) {
515
-
516
- global $post;
517
-
518
- if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
519
-
520
- if ( _is_wcf_optin_type() ) {
521
-
522
- if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) {
523
-
524
- if ( '' === $request ) {
525
- $query_args = array(
526
- 'wc-ajax' => '%%endpoint%%',
527
- );
528
- } else {
529
- $query_args = array(
530
- 'wc-ajax' => $request,
531
- );
532
- }
533
-
534
- $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore
535
- $uri = $uri[0];
536
-
537
- $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
538
- }
539
- }
540
- }
541
-
542
- return $endpoint_url;
543
- }
544
-
545
-
546
- /**
547
- * Save checkout fields.
548
- *
549
- * @param int $order_id order id.
550
- * @param array $posted posted data.
551
- * @return void
552
- */
553
- public function save_optin_fields( $order_id, $posted ) {
554
-
555
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
556
-
557
- $optin_id = wc_clean( wp_unslash( $_POST['_wcf_optin_id'] ) ); //phpcs:ignore
558
-
559
- update_post_meta( $order_id, '_wcf_optin_id', $optin_id );
560
-
561
- if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
562
-
563
- $flow_id = wc_clean( wp_unslash( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore
564
-
565
- update_post_meta( $order_id, '_wcf_flow_id', $flow_id );
566
- }
567
- }
568
-
569
- }
570
-
571
- /**
572
- * Redirect users to our checkout if hidden param
573
- *
574
- * @param string $redirect redirect url.
575
- * @param object $user user.
576
- * @return string
577
- */
578
- public function after_login_redirect( $redirect, $user ) {
579
-
580
- if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
581
-
582
- $optin_id = intval( $_POST['_wcf_optin_id'] ); //phpcs:ignore
583
-
584
- $redirect = get_permalink( $optin_id );
585
- }
586
-
587
- return $redirect;
588
- }
589
-
590
-
591
- /**
592
- * Add custom class to the fields to change the UI to three column.
593
- *
594
- * @param array $fields fields.
595
- */
596
- public function set_optin_default_fields( $fields ) {
597
-
598
- if ( _is_wcf_optin_type() ) {
599
-
600
- global $post;
601
-
602
- $optin_id = $post->ID;
603
- } else {
604
-
605
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
606
-
607
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
608
- } else {
609
- return $fields;
610
- }
611
- }
612
-
613
- $first_name = $fields['first_name'];
614
- $last_name = $fields['last_name'];
615
-
616
- /* Make fields required */
617
- $first_name['required'] = true;
618
- $last_name['required'] = true;
619
-
620
- $fields = array(
621
- 'first_name' => $first_name,
622
- 'last_name' => $last_name,
623
- );
624
-
625
- return apply_filters( 'cartflows_optin_default_fields', $fields, $optin_id );
626
- }
627
-
628
- /**
629
- * Add custom class to the fields to change the UI to three column.
630
- *
631
- * @param array $fields fields.
632
- */
633
- public function set_optin_fields( $fields ) {
634
-
635
- if ( _is_wcf_optin_type() ) {
636
-
637
- global $post;
638
-
639
- $optin_id = $post->ID;
640
- } else {
641
-
642
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
643
-
644
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
645
- } else {
646
- return $fields;
647
- }
648
- }
649
-
650
- $billing_first_name = $fields['billing']['billing_first_name'];
651
- $billing_last_name = $fields['billing']['billing_last_name'];
652
- $billing_email = $fields['billing']['billing_email'];
653
-
654
- $fields['billing'] = array(
655
- 'billing_first_name' => $billing_first_name,
656
- 'billing_last_name' => $billing_last_name,
657
- 'billing_email' => $billing_email,
658
- );
659
-
660
- return apply_filters( 'cartflows_optin_fields', $fields, $optin_id );
661
- }
662
-
663
- /**
664
- * Billing field customization.
665
- *
666
- * @param array $fields fields data.
667
- * @param string $country country name.
668
- * @return array
669
- */
670
- public function billing_optin_fields( $fields, $country ) {
671
-
672
- if ( _is_wcf_optin_type() ) {
673
-
674
- global $post;
675
-
676
- $optin_id = $post->ID;
677
- } else {
678
-
679
- if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
680
- $optin_id = wcf()->utils->get_optin_id_from_post_data();
681
- } else {
682
- return $fields;
683
- }
684
- }
685
-
686
- if ( is_wc_endpoint_url( 'edit-address' ) ) {
687
- return $fields;
688
- }
689
-
690
- $billing_first_name = $fields['billing_first_name'];
691
- $billing_last_name = $fields['billing_last_name'];
692
- $billing_email = $fields['billing_email'];
693
-
694
- /* Make fields required */
695
- $billing_first_name['required'] = true;
696
- $billing_last_name['required'] = true;
697
-
698
- $fields = array(
699
- 'billing_first_name' => $billing_first_name,
700
- 'billing_last_name' => $billing_last_name,
701
- 'billing_email' => $billing_email,
702
- );
703
-
704
- return apply_filters( 'cartflows_billing_optin_fields', $fields, $country, $optin_id );
705
- }
706
-
707
-
708
- /**
709
- * Replace billing label.
710
- *
711
- * @param string $notice Notice.
712
- * @param string $field_label Field name.
713
- * @return string
714
- */
715
- public function change_field_label_in_required_notice( $notice, $field_label ) {
716
-
717
- if ( _is_wcf_doing_optin_ajax() ) {
718
-
719
- $notice = str_replace( 'Billing ', '', $notice );
720
- }
721
-
722
- return $notice;
723
- }
724
- }
725
-
726
- /**
727
- * Kicking this off by calling 'get_instance()' method
728
- */
729
- Cartflows_Optin_Markup::get_instance();
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Checkout markup.
4
+ *
5
+ * @package CartFlows
6
+ */
7
+
8
+ /**
9
+ * Checkout Markup
10
+ *
11
+ * @since 1.0.0
12
+ */
13
+ class Cartflows_Optin_Markup {
14
+
15
+ /**
16
+ * Member Variable
17
+ *
18
+ * @var object instance
19
+ */
20
+ private static $instance;
21
+
22
+ /**
23
+ * Initiator
24
+ */
25
+ public static function get_instance() {
26
+ if ( ! isset( self::$instance ) ) {
27
+ self::$instance = new self();
28
+ }
29
+ return self::$instance;
30
+ }
31
+
32
+ /**
33
+ * Constructor
34
+ */
35
+ public function __construct() {
36
+
37
+ /* Set is checkout flag */
38
+ add_filter( 'woocommerce_is_checkout', array( $this, 'woo_checkout_flag' ), 9999 );
39
+
40
+ add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'save_optin_fields' ), 10, 2 );
41
+
42
+ /* Optin Shortcode */
43
+ add_shortcode( 'cartflows_optin', array( $this, 'optin_shortcode_markup' ) );
44
+
45
+ /* Preconfigured cart data */
46
+ add_action( 'wp', array( $this, 'preconfigured_cart_data' ), 1 );
47
+
48
+ /* Optin shortcode data */
49
+ add_action( 'wp', array( $this, 'shortcode_load_data' ), 1000 );
50
+
51
+ /* Ajax Endpoint */
52
+ add_filter( 'woocommerce_ajax_get_endpoint', array( $this, 'get_ajax_endpoint' ), 10, 2 );
53
+ add_filter( 'woocommerce_login_redirect', array( $this, 'after_login_redirect' ), 10, 2 );
54
+
55
+ /* Optin Fields */
56
+ add_filter( 'woocommerce_default_address_fields', array( $this, 'set_optin_default_fields' ), 1000 );
57
+ /**
58
+ * It may required later
59
+ * add_filter( 'woocommerce_checkout_fields', array( $this, 'set_optin_fields' ) );
60
+ */
61
+ add_filter( 'woocommerce_billing_fields', array( $this, 'billing_optin_fields' ), 1000, 2 );
62
+
63
+ add_filter( 'woocommerce_checkout_required_field_notice', array( $this, 'change_field_label_in_required_notice' ), 100, 2 );
64
+
65
+ add_action( 'init', array( $this, 'remove_login_actions' ) );
66
+
67
+ $this->elementor_editor_compatibility();
68
+ }
69
+
70
+ /**
71
+ * Elementor editor compatibility.
72
+ */
73
+ public function elementor_editor_compatibility() {
74
+
75
+ if ( ! empty( $_REQUEST['action'] ) && 'elementor' === $_REQUEST['action'] && is_admin() ) { //phpcs:ignore
76
+
77
+ if ( isset( $_GET['post'] ) && ! empty( $_GET['post'] ) ) { //phpcs:ignore
78
+
79
+ if ( _wcf_check_is_optin_by_id( intval( $_GET['post'] ) ) ) { //phpcs:ignore
80
+
81
+ /* Submit Button */
82
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
83
+ }
84
+ }
85
+ }
86
+ }
87
+
88
+ /**
89
+ * Remove login and registration actions.
90
+ */
91
+ public function remove_login_actions() {
92
+
93
+ if ( _is_wcf_doing_optin_ajax() ) {
94
+
95
+ if ( isset( $_POST['billing_email'] ) && ! empty( $_POST['billing_email'] ) ) { //phpcs:ignore
96
+
97
+ if ( email_exists( sanitize_email( wp_unslash( $_POST['billing_email'] ) ) ) ) { // phpcs:ignore
98
+ add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
99
+ }
100
+ }
101
+
102
+ add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
103
+ }
104
+ }
105
+
106
+ /**
107
+ * Change order button text .
108
+ *
109
+ * @param string $woo_button_text place order.
110
+ * @return string
111
+ */
112
+ public function place_order_button_text( $woo_button_text ) {
113
+
114
+ $optin_id = get_the_ID();
115
+
116
+ $wcf_order_button_text = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-text' );
117
+
118
+ if ( ! empty( $wcf_order_button_text ) ) {
119
+ $woo_button_text = $wcf_order_button_text;
120
+ }
121
+
122
+ return $woo_button_text;
123
+ }
124
+
125
+ /**
126
+ * Display all WooCommerce notices.
127
+ *
128
+ * @since 1.1.5
129
+ */
130
+ public function display_woo_notices() {
131
+
132
+ if ( null != WC()->session && function_exists( 'woocommerce_output_all_notices' ) ) {
133
+ woocommerce_output_all_notices();
134
+ }
135
+ }
136
+
137
+ /**
138
+ * Check for checkout flag
139
+ *
140
+ * @param bool $is_checkout is checkout.
141
+ *
142
+ * @return bool
143
+ */
144
+ public function woo_checkout_flag( $is_checkout ) {
145
+
146
+ if ( ! is_admin() ) {
147
+
148
+ if ( _is_wcf_optin_type() ) {
149
+
150
+ $is_checkout = true;
151
+ }
152
+ }
153
+
154
+ return $is_checkout;
155
+ }
156
+
157
+ /**
158
+ * Render checkout shortcode markup.
159
+ *
160
+ * @param array $atts attributes.
161
+ * @return string
162
+ */
163
+ public function optin_shortcode_markup( $atts ) {
164
+
165
+ if ( ! function_exists( 'wc_print_notices' ) ) {
166
+ $notice_out = '<p class="woocommerce-notice">' . __( 'WooCommerce functions do not exist. If you are in an IFrame, please reload it.', 'cartflows' ) . '</p>';
167
+ $notice_out .= '<button onClick="location.reload()">' . __( 'Click Here to Reload', 'cartflows' ) . '</button>';
168
+
169
+ return $notice_out;
170
+ }
171
+
172
+ $atts = shortcode_atts(
173
+ array(
174
+ 'id' => 0,
175
+ ),
176
+ $atts
177
+ );
178
+
179
+ $optin_id = intval( $atts['id'] );
180
+
181
+ if ( empty( $optin_id ) ) {
182
+
183
+ if ( ! _is_wcf_optin_type() ) {
184
+
185
+ return '<h4>' . __( 'Please place shortcode on Optin step-type only.', 'cartflows' ) . '</h4>';
186
+ }
187
+
188
+ global $post;
189
+
190
+ $optin_id = intval( $post->ID );
191
+ }
192
+
193
+ $output = '';
194
+
195
+ ob_start();
196
+
197
+ do_action( 'cartflows_optin_form_before', $optin_id );
198
+
199
+ $optin_layout = 'default';
200
+
201
+ $template_default = CARTFLOWS_OPTIN_DIR . 'templates/optin-template-simple.php';
202
+
203
+ include $template_default;
204
+
205
+ $output .= ob_get_clean();
206
+
207
+ return $output;
208
+ }
209
+
210
+ /**
211
+ * Configure Cart Data.
212
+ *
213
+ * @since 1.0.0
214
+ *
215
+ * @return void
216
+ */
217
+ public function preconfigured_cart_data() {
218
+
219
+ if ( is_admin() ) {
220
+ return;
221
+ }
222
+
223
+ global $post;
224
+
225
+ if ( _is_wcf_optin_type() ) {
226
+
227
+ if ( wp_doing_ajax() ) {
228
+ return;
229
+ } else {
230
+
231
+ $optin_id = $post->ID;
232
+
233
+ do_action( 'cartflows_optin_before_configure_cart', $optin_id );
234
+
235
+ $products = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-optin-product' );
236
+
237
+ if ( ! is_array( $products ) ) {
238
+ return;
239
+ }
240
+
241
+ /* Empty the current cart */
242
+ WC()->cart->empty_cart();
243
+
244
+ if ( is_array( $products ) && count( $products ) < 1 ) {
245
+ wc_add_notice( __( 'No product is selected. Please select a Simple, Virtual and Free product from the meta settings.', 'cartflows' ), 'error' );
246
+ return;
247
+ }
248
+
249
+ /* Set customer session if not set */
250
+ if ( ! is_user_logged_in() && WC()->cart->is_empty() ) {
251
+ WC()->session->set_customer_session_cookie( true );
252
+ }
253
+
254
+ $product_id = reset( $products );
255
+ $_product = wc_get_product( $product_id );
256
+
257
+ if ( ! empty( $_product ) ) {
258
+
259
+ if ( $_product->is_type( 'simple' ) && $_product->is_virtual() ) {
260
+
261
+ if ( $_product->get_price() > 0 ) {
262
+ wc_add_notice( __( 'Please update the selected product\'s price to zero (0).', 'cartflows' ), 'error' );
263
+ } else {
264
+
265
+ $quantity = 1;
266
+
267
+ WC()->cart->add_to_cart( $product_id, $quantity );
268
+ }
269
+ } else {
270
+
271
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
272
+ }
273
+ } else {
274
+
275
+ wc_add_notice( __( 'Please select a Simple, Virtual and Free product.', 'cartflows' ), 'error' );
276
+ }
277
+
278
+ do_action( 'cartflows_optin_after_configure_cart', $optin_id );
279
+ }
280
+ }
281
+ }
282
+
283
+ /**
284
+ * Load shortcode data.
285
+ *
286
+ * @return void
287
+ */
288
+ public function shortcode_load_data() {
289
+
290
+ if ( _is_wcf_optin_type() ) {
291
+
292
+ add_action( 'wp_enqueue_scripts', array( $this, 'shortcode_scripts' ), 21 );
293
+
294
+ add_action( 'wp_enqueue_scripts', array( $this, 'compatibility_scripts' ), 101 );
295
+
296
+ /* Show notices if cart has errors */
297
+ add_action( 'woocommerce_cart_has_errors', 'woocommerce_output_all_notices' );
298
+
299
+ // Outputting the hidden field in checkout page.
300
+ add_action( 'woocommerce_after_order_notes', array( $this, 'checkout_shortcode_post_id' ), 99 );
301
+ add_action( 'woocommerce_login_form_end', array( $this, 'checkout_shortcode_post_id' ), 99 );
302
+
303
+ /* Remove unnecessary option */
304
+ add_filter( 'woocommerce_enable_order_notes_field', '__return_false' );
305
+ add_filter( 'woocommerce_cart_needs_shipping_address', '__return_false' );
306
+
307
+ remove_all_actions( 'woocommerce_before_checkout_form' );
308
+ remove_all_actions( 'woocommerce_checkout_billing' );
309
+ remove_all_actions( 'woocommerce_checkout_shipping' );
310
+ remove_all_actions( 'woocommerce_checkout_before_order_review' );
311
+ remove_all_actions( 'woocommerce_checkout_order_review' );
312
+ remove_all_actions( 'woocommerce_checkout_after_order_review' );
313
+ add_filter( 'woocommerce_cart_needs_payment', '__return_false' );
314
+ add_filter( 'woocommerce_available_payment_gateways', array( $this, 'disable_payment_gateways' ) );
315
+
316
+ /* Paypal Expresss remove */
317
+
318
+ if ( function_exists( 'wc_gateway_ppec' ) ) {
319
+ remove_action( 'wp_enqueue_scripts', array( wc_gateway_ppec()->cart, 'enqueue_scripts' ) );
320
+ }
321
+
322
+ // Hook in actions once.
323
+ add_action( 'woocommerce_before_checkout_form', 'woocommerce_output_all_notices', 10 );
324
+ add_action( 'woocommerce_checkout_billing', array( WC()->checkout, 'checkout_form_billing' ) );
325
+ add_action( 'woocommerce_checkout_shipping', array( WC()->checkout, 'checkout_form_shipping' ) );
326
+ add_action( 'woocommerce_checkout_order_review', 'woocommerce_checkout_payment', 20 );
327
+
328
+ /* Submit Button */
329
+ add_filter( 'woocommerce_order_button_text', array( $this, 'place_order_button_text' ), 10, 1 );
330
+
331
+ add_filter( 'woocommerce_get_terms_and_conditions_checkbox_text', '__return_false' );
332
+
333
+ /* Remove login actions */
334
+ add_filter( 'woocommerce_checkout_registration_enabled', '__return_false' );
335
+ add_filter( 'woocommerce_checkout_registration_required', '__return_false' );
336
+
337
+ global $post;
338
+
339
+ $optin_id = $post->ID;
340
+
341
+ do_action( 'cartflows_optin_before_shortcode', $optin_id );
342
+ }
343
+ }
344
+
345
+ /**
346
+ * Disable payment gateways.
347
+ *
348
+ * @param array $available_gateways gateways.
349
+ * @return array
350
+ */
351
+ public function disable_payment_gateways( $available_gateways ) {
352
+
353
+ if ( ! is_admin() ) {
354
+
355
+ $available_gateways = array();
356
+ }
357
+
358
+ return $available_gateways;
359
+ }
360
+
361
+ /**
362
+ * Render checkout ID hidden field.
363
+ *
364
+ * @param array $checkout checkout session data.
365
+ * @return void
366
+ */
367
+ public function checkout_shortcode_post_id( $checkout ) {
368
+
369
+ if ( ! _is_wcf_optin_type() ) {
370
+ return;
371
+ }
372
+
373
+ global $post;
374
+
375
+ $optin_id = $post->ID;
376
+
377
+ $flow_id = get_post_meta( $optin_id, 'wcf-flow-id', true );
378
+
379
+ echo '<input type="hidden" class="input-hidden _wcf_flow_id" name="_wcf_flow_id" value="' . intval( $flow_id ) . '">';
380
+ echo '<input type="hidden" class="input-hidden _wcf_optin_id" name="_wcf_optin_id" value="' . intval( $optin_id ) . '">';
381
+ }
382
+
383
+ /**
384
+ * Load shortcode scripts.
385
+ *
386
+ * @return void
387
+ */
388
+ public function shortcode_scripts() {
389
+
390
+ wp_enqueue_style( 'wcf-optin-template', wcf()->utils->get_css_url( 'optin-template' ), '', CARTFLOWS_VER );
391
+
392
+ wp_enqueue_script(
393
+ 'wcf-optin-template',
394
+ wcf()->utils->get_js_url( 'optin-template' ),
395
+ array( 'jquery' ),
396
+ CARTFLOWS_VER,
397
+ true
398
+ );
399
+
400
+ do_action( 'cartflows_optin_scripts' );
401
+
402
+ $style = $this->generate_style();
403
+
404
+ wp_add_inline_style( 'wcf-optin-template', $style );
405
+ }
406
+
407
+ /**
408
+ * Load compatibility scripts.
409
+ *
410
+ * @return void
411
+ */
412
+ public function compatibility_scripts() {
413
+
414
+ global $post;
415
+
416
+ $optin_id = $post->ID;
417
+
418
+ // Add DIVI Compatibility css if DIVI theme is enabled.
419
+ if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
420
+ Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id )
421
+ ) {
422
+ wp_enqueue_style( 'wcf-optin-template-divi', wcf()->utils->get_css_url( 'optin-template-divi' ), '', CARTFLOWS_VER );
423
+ }
424
+ }
425
+
426
+ /**
427
+ * Generate styles.
428
+ *
429
+ * @return string
430
+ */
431
+ public function generate_style() {
432
+
433
+ global $post;
434
+
435
+ $optin_id = $post->ID;
436
+
437
+ /* Load all fonts */
438
+ CartFlows_Font_Families::render_fonts( $optin_id );
439
+
440
+ $r = '';
441
+ $g = '';
442
+ $b = '';
443
+ $output = '';
444
+
445
+ /* Global */
446
+ $primary_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-primary-color' );
447
+ $base_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-base-font-family' );
448
+
449
+ /* Input Fields */
450
+ $input_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-family' );
451
+ $input_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-font-weight' );
452
+ $field_input_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-input-field-size' );
453
+ $field_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-tb-padding' );
454
+ $field_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-lr-padding' );
455
+ $field_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-color' );
456
+ $field_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-bg-color' );
457
+ $field_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-border-color' );
458
+ $field_label_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-field-label-color' );
459
+
460
+ if ( 'custom' == $field_input_size ) {
461
+ $field_input_size = '38px';
462
+ }
463
+
464
+ /* Submit Button */
465
+ $submit_button_width = '100%';
466
+ $optin_button_position = '';
467
+ $button_font_size = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-font-size' );
468
+ $button_font_family = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-family' );
469
+ $button_font_weight = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-button-font-weight' );
470
+ $submit_button_height = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-size' );
471
+ $submit_tb_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-tb-padding' );
472
+ $submit_lr_padding = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-lr-padding' );
473
+ $submit_button_position = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-button-position' );
474
+ $submit_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-color' );
475
+ $submit_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-hover-color' );
476
+ $submit_bg_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-color', $primary_color );
477
+ $submit_bg_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-bg-hover-color', $primary_color );
478
+ $submit_border_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-color', $primary_color );
479
+ $submit_border_hover_color = wcf()->options->get_optin_meta_value( $optin_id, 'wcf-submit-border-hover-color', $primary_color );
480
+
481
+ if ( 'custom' == $submit_button_height ) {
482
+ $submit_button_height = '38px';
483
+ $submit_button_width = 'auto';
484
+
485
+ switch ( $submit_button_position ) {
486
+ case 'left':
487
+ $optin_button_position = '0 auto 0 0';
488
+ break;
489
+ case 'center':
490
+ $optin_button_position = '0 auto';
491
+ break;
492
+ case 'right':
493
+ $optin_button_position = '0 0 0 auto';
494
+ break;
495
+
496
+ default:
497
+ $optin_button_position = '0 auto';
498
+ break;
499
+ }
500
+ }
501
+
502
+ if ( Cartflows_Compatibility::get_instance()->is_divi_enabled() ||
503
+ Cartflows_Compatibility::get_instance()->is_divi_builder_enabled( $optin_id ) ) {
504
+
505
+ include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-divi-css.php';
506
+
507
+ } else {
508
+ include CARTFLOWS_OPTIN_DIR . 'includes/optin-dynamic-css.php';
509
+ }
510
+
511
+ return $output;
512
+ }
513
+
514
+ /**
515
+ * Get ajax end points.
516
+ *
517
+ * @param string $endpoint_url end point URL.
518
+ * @param string $request end point request.
519
+ * @return string
520
+ */
521
+ public function get_ajax_endpoint( $endpoint_url, $request ) {
522
+
523
+ global $post;
524
+
525
+ if ( ! empty( $post ) && ! empty( $_SERVER['REQUEST_URI'] ) ) {
526
+
527
+ if ( _is_wcf_optin_type() ) {
528
+
529
+ if ( mb_strpos( $endpoint_url, 'checkout', 0, 'utf-8' ) === false ) {
530
+
531
+ if ( '' === $request ) {
532
+ $query_args = array(
533
+ 'wc-ajax' => '%%endpoint%%',
534
+ );
535
+ } else {
536
+ $query_args = array(
537
+ 'wc-ajax' => $request,
538
+ );
539
+ }
540
+
541
+ $uri = explode( '?', $_SERVER['REQUEST_URI'], 2 ); //phpcs:ignore
542
+ $uri = $uri[0];
543
+
544
+ $endpoint_url = esc_url( add_query_arg( $query_args, $uri ) );
545
+ }
546
+ }
547
+ }
548
+
549
+ return $endpoint_url;
550
+ }
551
+
552
+
553
+ /**
554
+ * Save checkout fields.
555
+ *
556
+ * @param int $order_id order id.
557
+ * @param array $posted posted data.
558
+ * @return void
559
+ */
560
+ public function save_optin_fields( $order_id, $posted ) {
561
+
562
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
563
+
564
+ $optin_id = wc_clean( wp_unslash( $_POST['_wcf_optin_id'] ) ); //phpcs:ignore
565
+
566
+ update_post_meta( $order_id, '_wcf_optin_id', $optin_id );
567
+
568
+ if ( isset( $_POST['_wcf_flow_id'] ) ) { //phpcs:ignore
569
+
570
+ $flow_id = wc_clean( wp_unslash( $_POST['_wcf_flow_id'] ) ); //phpcs:ignore
571
+
572
+ update_post_meta( $order_id, '_wcf_flow_id', $flow_id );
573
+ }
574
+ }
575
+
576
+ }
577
+
578
+ /**
579
+ * Redirect users to our checkout if hidden param
580
+ *
581
+ * @param string $redirect redirect url.
582
+ * @param object $user user.
583
+ * @return string
584
+ */
585
+ public function after_login_redirect( $redirect, $user ) {
586
+
587
+ if ( isset( $_POST['_wcf_optin_id'] ) ) { //phpcs:ignore
588
+
589
+ $optin_id = intval( $_POST['_wcf_optin_id'] ); //phpcs:ignore
590
+
591
+ $redirect = get_permalink( $optin_id );
592
+ }
593
+
594
+ return $redirect;
595
+ }
596
+
597
+
598
+ /**
599
+ * Add custom class to the fields to change the UI to three column.
600
+ *
601
+ * @param array $fields fields.
602
+ */
603
+ public function set_optin_default_fields( $fields ) {
604
+
605
+ if ( _is_wcf_optin_type() ) {
606
+
607
+ global $post;
608
+
609
+ $optin_id = $post->ID;
610
+ } else {
611
+
612
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
613
+
614
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
615
+ } else {
616
+ return $fields;
617
+ }
618
+ }
619
+
620
+ $first_name = $fields['first_name'];
621
+ $last_name = $fields['last_name'];
622
+
623
+ /* Make fields required */
624
+ $first_name['required'] = true;
625
+ $last_name['required'] = true;
626
+
627
+ $fields = array(
628
+ 'first_name' => $first_name,
629
+ 'last_name' => $last_name,
630
+ );
631
+
632
+ return apply_filters( 'cartflows_optin_default_fields', $fields, $optin_id );
633
+ }
634
+
635
+ /**
636
+ * Add custom class to the fields to change the UI to three column.
637
+ *
638
+ * @param array $fields fields.
639
+ */
640
+ public function set_optin_fields( $fields ) {
641
+
642
+ if ( _is_wcf_optin_type() ) {
643
+
644
+ global $post;
645
+
646
+ $optin_id = $post->ID;
647
+ } else {
648
+
649
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
650
+
651
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
652
+ } else {
653
+ return $fields;
654
+ }
655
+ }
656
+
657
+ $billing_first_name = $fields['billing']['billing_first_name'];
658
+ $billing_last_name = $fields['billing']['billing_last_name'];
659
+ $billing_email = $fields['billing']['billing_email'];
660
+
661
+ $fields['billing'] = array(
662
+ 'billing_first_name' => $billing_first_name,
663
+ 'billing_last_name' => $billing_last_name,
664
+ 'billing_email' => $billing_email,
665
+ );
666
+
667
+ return apply_filters( 'cartflows_optin_fields', $fields, $optin_id );
668
+ }
669
+
670
+ /**
671
+ * Billing field customization.
672
+ *
673
+ * @param array $fields fields data.
674
+ * @param string $country country name.
675
+ * @return array
676
+ */
677
+ public function billing_optin_fields( $fields, $country ) {
678
+
679
+ if ( _is_wcf_optin_type() ) {
680
+
681
+ global $post;
682
+
683
+ $optin_id = $post->ID;
684
+ } else {
685
+
686
+ if ( _is_wcf_doing_optin_ajax() && wcf()->utils->get_optin_id_from_post_data() ) {
687
+ $optin_id = wcf()->utils->get_optin_id_from_post_data();
688
+ } else {
689
+ return $fields;
690
+ }
691
+ }
692
+
693
+ if ( is_wc_endpoint_url( 'edit-address' ) ) {
694
+ return $fields;
695
+ }
696
+
697
+ $billing_first_name = $fields['billing_first_name'];
698
+ $billing_last_name = $fields['billing_last_name'];
699
+ $billing_email = $fields['billing_email'];
700
+
701
+ /* Make fields required */
702
+ $billing_first_name['required'] = true;
703
+ $billing_last_name['required'] = true;
704
+
705
+ $fields = array(
706
+ 'billing_first_name' => $billing_first_name,
707
+ 'billing_last_name' => $billing_last_name,
708
+ 'billing_email' => $billing_email,
709
+ );
710
+
711
+ return apply_filters( 'cartflows_billing_optin_fields', $fields, $country, $optin_id );
712
+ }
713
+
714
+
715
+ /**
716
+ * Replace billing label.
717
+ *
718
+ * @param string $notice Notice.
719
+ * @param string $field_label Field name.
720
+ * @return string
721
+ */
722
+ public function change_field_label_in_required_notice( $notice, $field_label ) {
723
+
724
+ if ( _is_wcf_doing_optin_ajax() ) {
725
+
726
+ $notice = str_replace( 'Billing ', '', $notice );
727
+ }
728
+
729
+ return $notice;
730
+ }
731
+ }
732
+
733
+ /**
734
+ * Kicking this off by calling 'get_instance()' method
735
+ */
736
+ Cartflows_Optin_Markup::get_instance();
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/BrainstormForce
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
  Tested up to: 5.5
7
- Stable tag: 1.5.15
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -127,6 +127,12 @@ Glad you asked! Most normal users have less than 3 funnels on a single website,
127
 
128
  == Changelog ==
129
 
 
 
 
 
 
 
130
  = Version 1.5.15 - Wednesday, 12th August 2020 =
131
  * Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
132
  * Improvement: Added WordPress 5.5 Compatibility.
4
  Tags: woocommerce, funnel builder, sales funnels, elementor, beaver builder
5
  Requires at least: 4.4
6
  Tested up to: 5.5
7
+ Stable tag: 1.5.16
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
127
 
128
  == Changelog ==
129
 
130
+ = Version 1.5.16 - Tuesday, 25th August 2020 =
131
+ * Improvement: Hardened the security of the plugin.
132
+ * Fix: User's account was not getting created from the Optin step.
133
+ * Fix: Import notice was not displaying if the import step limit is over.
134
+ * Fix: Facebook Pixel and Google Analytics tracking events were not getting triggered in some cases.
135
+
136
  = Version 1.5.15 - Wednesday, 12th August 2020 =
137
  * Improvement: Added Split Testing compatibility for a future release of CartFlows Pro.
138
  * Improvement: Added WordPress 5.5 Compatibility.