PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.0.1
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.0.1
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / classes / class-cartflows-admin-notices.php

class-cartflows-admin-notices.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.0.1, at classes/class-cartflows-admin-notices.php

619 lines 21.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * CartFlows Admin Notices.
4 *
5 * @package CartFlows
6 */
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12 /**
13 * Class Cartflows_Admin_Notices.
14 */
15 class Cartflows_Admin_Notices {
16
17 /**
18 * Instance
19 *
20 * @access private
21 * @var object Class object.
22 * @since 1.0.0
23 */
24 private static $instance;
25
26 /**
27 * Initiator
28 *
29 * @since 1.0.0
30 * @return object initialized object of class.
31 */
32 public static function get_instance() {
33 if ( ! isset( self::$instance ) ) {
34 self::$instance = new self();
35 }
36 return self::$instance;
37 }
38
39 /**
40 * Constructor
41 *
42 * @since 1.0.0
43 */
44 public function __construct() {
45 // Add the notices script.
46 add_action( 'admin_enqueue_scripts', array( $this, 'notices_scripts' ) );
47
48 // Group the admin notices actions.
49 $this->register_admin_notices();
50
51 // Group the ajax action callbacks.
52 $this->register_ajax_callbacks();
53 }
54
55 /**
56 * Registers admin notices for CartFlows.
57 *
58 * Hooks the methods responsible for displaying admin and NPS notices
59 * to appropriate WordPress admin actions.
60 *
61 * @since 2.1.17
62 * @return void
63 */
64 public function register_admin_notices() {
65 add_action( 'admin_head', array( $this, 'show_admin_notices' ) );
66
67 add_action( 'admin_footer', array( $this, 'show_nps_notice' ), 999 );
68 }
69
70 /**
71 * Registers AJAX callbacks for various CartFlows admin notices.
72 *
73 * This method hooks AJAX actions to their corresponding handler functions,
74 * allowing notices (such as Gutenberg, weekly report email, and custom offer notices)
75 * to be dismissed or acknowledged via AJAX requests in the WordPress admin area.
76 *
77 * @since 2.1.17
78 * @return void
79 */
80 public function register_ajax_callbacks() {
81 add_action( 'wp_ajax_cartflows_ignore_gutenberg_notice', array( $this, 'ignore_gb_notice' ) );
82 add_action( 'wp_ajax_cartflows_disable_weekly_report_email_notice', array( $this, 'disable_weekly_report_email_notice' ) );
83 add_action( 'wp_ajax_cartflows_snooze_script_migration', array( $this, 'snooze_script_migration_notice' ) );
84 add_action( 'wp_ajax_cartflows_dismiss_script_migration_complete_notice', array( $this, 'dismiss_script_migration_complete_notice' ) );
85 add_action( 'wp_ajax_cartflows_dismiss_new_ui_notice', array( $this, 'dismiss_new_ui_notice' ) );
86 }
87
88 /**
89 * Persist the "Switch to New UI" dismissal for the current user.
90 *
91 * Writes the same `notice-dismissed` user_meta key that Astra_Notices uses
92 * so the WP admin_notices banner and the React-shell banner stay in sync —
93 * dismissing either one hides both on the next load.
94 *
95 * @since 2.2.4
96 * @return void
97 */
98 public function dismiss_new_ui_notice() {
99
100 if ( ! current_user_can( 'cartflows_manage_settings' ) ) {
101 wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'cartflows' ) ) );
102 }
103
104 if ( ! check_ajax_referer( 'cartflows_dismiss_new_ui_notice', 'security', false ) ) {
105 wp_send_json_error( array( 'message' => __( 'Security check failed.', 'cartflows' ) ) );
106 }
107
108 update_user_meta( get_current_user_id(), 'cartflows-switch-to-new-ui-notice', 'notice-dismissed' );
109
110 wp_send_json_success();
111 }
112
113 /**
114 * Show the weekly email Notice
115 *
116 * @return void
117 */
118 public function show_weekly_report_email_settings_notice() {
119
120 if ( ! $this->allowed_screen_for_notices() ) {
121 return;
122 }
123
124 $is_show_notice = get_option( 'cartflows_show_weekly_report_email_notice', 'no' );
125
126 if ( 'yes' === $is_show_notice && current_user_can( 'manage_options' ) ) {
127
128 $setting_url = admin_url( 'admin.php?page=cartflows&path=settings#other_settings' );
129
130 /* translators: %1$s Software Title, %2$s Plugin, %3$s Anchor opening tag, %4$s Anchor closing tag, %5$s Software Title. */
131 $message = sprintf( __( '%1$sCartFlows:%2$s We just introduced an awesome new feature, weekly store revenue reports via email. Now you can see how many revenue we are generating for your store each week, without having to log into your website. You can set the email address for these email from %3$shere.%4$s', 'cartflows' ), '<strong>', '</strong>', '<a class="wcf-redirect-to-settings" target="_blank" href=" ' . esc_url( $setting_url ) . ' ">', '</a>' );
132 $output = '<div class="wcf-notice weekly-report-email-notice wcf-dismissible-notice notice notice-info is-dismissible">';
133 $output .= '<p>' . $message . '</p>';
134 $output .= '</div>';
135
136 echo wp_kses_post( $output );
137 }
138 }
139
140 /**
141 * Disable the weekly email Notice
142 *
143 * @return void
144 */
145 public function disable_weekly_report_email_notice() {
146
147 if ( ! current_user_can( 'manage_options' ) ) {
148 return;
149 }
150
151 check_ajax_referer( 'cartflows-disable-weekly-report-email-notice', 'security' );
152 delete_option( 'cartflows_show_weekly_report_email_notice' );
153 // Track weekly report notice dismissed event.
154 Cartflows_Helper::set_analytics_flag( 'weekly_report_notice_dismissed' );
155 wp_send_json_success();
156 }
157
158 /**
159 * Show the custom script migration notice.
160 *
161 * Renders an admin notice prompting users to migrate custom script data
162 * from the old textarea format to the new CodeMirror editor format.
163 *
164 * @since 2.2.2
165 * @return void
166 */
167 public function show_script_migration_notice() {
168
169 if ( ! $this->allowed_screen_for_notices() ) {
170 return;
171 }
172
173 if ( ! current_user_can( 'manage_options' ) ) {
174 return;
175 }
176
177 if ( ! Cartflows_Update::get_instance()->should_show_migration_notice() ) {
178 return;
179 }
180
181 $output = '<div class="wcf-notice script-migration-notice wcf-dismissible-notice notice notice-warning">';
182 $output .= '<p>';
183 $output .= '<strong>' . esc_html__( 'CartFlows: Custom Script Migration', 'cartflows' ) . '</strong><br>';
184 $output .= esc_html__( 'CartFlows now has dedicated JavaScript and CSS editors for custom scripts in your funnels and steps. Click "Migrate Data" to move your existing scripts to the new editors, or choose "Remind Me Later" to be notified again in 7 days.', 'cartflows' );
185 $output .= '</p>';
186 $output .= '<p>';
187 $output .= '<button class="button button-primary wcf-migrate-scripts-btn" data-action="migrate_scripts">' . esc_html__( 'Migrate Data', 'cartflows' ) . '</button>';
188 $output .= '&nbsp;';
189 $output .= '<button class="button button-secondary wcf-snooze-migration-btn" data-action="remind_later">' . esc_html__( 'Remind Me Later', 'cartflows' ) . '</button>';
190 $output .= '</p>';
191 $output .= '</div>';
192
193 echo wp_kses_post( $output );
194 }
195
196 /**
197 * Handle snooze (remind me later) AJAX request for the script migration notice.
198 *
199 * Increments the skip counter and updates the skip timestamp.
200 * After 2 skips, sets the status to 'accepted' to stop showing the notice.
201 *
202 * @since 2.2.2
203 * @return void
204 */
205 public function snooze_script_migration_notice() {
206
207 if ( ! check_ajax_referer( 'cartflows-snooze-script-migration', 'security', false ) ) {
208 wp_send_json_error( array( 'message' => __( 'Invalid nonce.', 'cartflows' ) ) );
209 }
210
211 if ( ! current_user_can( 'manage_options' ) ) {
212 wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'cartflows' ) ) );
213 }
214
215 $update = Cartflows_Update::get_instance();
216
217 if ( $update instanceof Cartflows_Update ) {
218 $update->set_script_migration_status( 'skipped' );
219 $update->increment_migration_skip_count();
220
221 // After 2 skips, stop showing the notice permanently.
222 if ( $update->get_migration_skip_count() >= 2 ) {
223 $update->set_script_migration_status( 'accepted' );
224 }
225
226 wp_send_json_success( array( 'message' => __( 'You will be reminded in 7 days.', 'cartflows' ) ) );
227 }
228
229 wp_send_json_error( array( 'message' => __( 'Unable to update migration status.', 'cartflows' ) ) );
230 }
231
232 /**
233 * After save of permalinks.
234 */
235 public function notices_scripts() {
236
237 if ( ! $this->allowed_screen_for_notices() || ! current_user_can( 'cartflows_manage_flows_steps' ) ) {
238 return;
239 }
240
241 wp_enqueue_style( 'cartflows-custom-notices', CARTFLOWS_URL . 'admin/assets/css/notices.css', array(), CARTFLOWS_VER );
242
243 wp_enqueue_script( 'cartflows-notices', CARTFLOWS_URL . 'admin/assets/js/ui-notice.js', array( 'jquery' ), CARTFLOWS_VER, true );
244
245 $localize_vars = array(
246 'ignore_gb_notice' => wp_create_nonce( 'cartflows-ignore-gutenberg-notice' ),
247 'dismiss_weekly_report_email_notice' => wp_create_nonce( 'cartflows-disable-weekly-report-email-notice' ),
248 'snooze_script_migration' => wp_create_nonce( 'cartflows-snooze-script-migration' ),
249 'migrate_custom_scripts' => wp_create_nonce( 'cartflows_migrate_custom_scripts' ),
250 'dismiss_migration_complete_notice' => wp_create_nonce( 'cartflows-dismiss-script-migration-complete-notice' ),
251 );
252
253 wp_localize_script( 'cartflows-notices', 'cartflows_notices', $localize_vars );
254 }
255
256 /**
257 * After save of permalinks.
258 */
259 public function show_admin_notices() {
260
261 if ( ! $this->allowed_screen_for_notices() || ! current_user_can( 'cartflows_manage_flows_steps' ) ) {
262 return;
263 }
264
265 global $wp_version;
266
267 if ( version_compare( $wp_version, '5.0', '>=' ) && is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
268 add_action( 'admin_notices', array( $this, 'gutenberg_plugin_deactivate_notice' ) );
269 }
270
271 add_action( 'admin_notices', array( $this, 'show_weekly_report_email_settings_notice' ) );
272 add_action( 'admin_notices', array( $this, 'show_script_migration_notice' ) );
273 add_action( 'admin_notices', array( $this, 'show_script_migration_complete_notice' ) );
274
275 $image_path = esc_url( CARTFLOWS_URL . 'assets/images/cartflows-logo-small.jpg' );
276 Astra_Notices::add_notice(
277 array(
278 'id' => 'cartflows-5-start-notice',
279 'type' => 'info',
280 'class' => 'cartflows-5-star cartflows-admin-notice',
281 'show_if' => true,
282 /* translators: %1$s white label plugin name and %2$s deactivation link */
283 'message' => sprintf(
284 '<div class="notice-image" style="display: block;">
285 <img src="%1$s" class="custom-logo" alt="CartFlows Icon" itemprop="logo" style="max-width: 90px; border-radius: 50px;"></div>
286 <div class="notice-content">
287 <div class="notice-heading">
288 %2$s
289 </div>
290 <div class="notice-description">
291 %3$s
292 </div>
293 <div class="astra-review-notice-container">
294 <a href="%4$s" class="astra-notice-close astra-review-notice button-primary" target="_blank">
295 <span class="dashicons dashicons-yes"></span>
296 %5$s
297 </a>
298
299 <a href="#" data-repeat-notice-after="%6$s" class="astra-notice-close astra-review-notice">
300 <span class="dashicons dashicons-calendar"></span>
301 %7$s
302 </a>
303
304 <a href="#" class="astra-notice-close astra-review-notice">
305 <span class="dashicons dashicons-smiley"></span>
306 <u>%8$s</u>
307 </a>
308 </div>
309 </div>',
310 $image_path,
311 __( 'Hi there! You recently used CartFlows to build a sales funnel &mdash; Thanks a ton!', 'cartflows' ),
312 __( 'It would be awesome if you could leave us a 5-star review-it helps us grow and guide others in choosing CartFlows!', 'cartflows' ),
313 'https://wordpress.org/support/plugin/cartflows/reviews/?filter=5#new-post',
314 __( 'Ok, you deserve it', 'cartflows' ),
315 MONTH_IN_SECONDS,
316 __( 'Nope, maybe later', 'cartflows' ),
317 __( 'I already did', 'cartflows' )
318 ),
319 'repeat-notice-after' => MONTH_IN_SECONDS,
320 'display-notice-after' => ( 2 * WEEK_IN_SECONDS ), // Display notice after 2 weeks.
321 )
322 );
323
324 // CartFlows 3.0 — soft notice inviting legacy users to opt into the new admin UI.
325 // Registered through Astra_Notices so it inherits the standard notice
326 // design, dismiss handling and per-user storage the rest of CartFlows uses.
327 if ( $this->is_new_ui_notice_visible() ) {
328 $this->enqueue_new_ui_notice_assets();
329
330 Astra_Notices::add_notice(
331 array(
332 'id' => 'cartflows-switch-to-new-ui-notice',
333 'type' => 'info',
334 'class' => 'cartflows-switch-ui-notice cartflows-admin-notice',
335 'show_if' => true,
336 'is_dismissible' => true,
337 'priority' => 5,
338 'capability' => 'cartflows_manage_settings',
339 'message' => sprintf(
340 '<div class="notice-image" style="display: block;">
341 <img src="%1$s" class="custom-logo" alt="CartFlows Icon" itemprop="logo" style="max-width: 90px; border-radius: 50px;"></div>
342 <div class="notice-content">
343 <div class="notice-heading">%2$s</div>
344 <div class="notice-description">%3$s</div>
345 <div class="astra-review-notice-container">
346 <button type="button" class="astra-review-notice button-primary" data-wcf-action="switch">
347 <span class="dashicons dashicons-yes"></span>
348 %4$s
349 </button>
350 <a href="#" class="astra-notice-close astra-review-notice">
351 <span class="dashicons dashicons-no-alt"></span>
352 %5$s
353 </a>
354 </div>
355 </div>',
356 esc_url( CARTFLOWS_URL . 'assets/images/cartflows-logo-small.jpg' ),
357 esc_html__( 'Your CartFlows got a fresh new look ✨', 'cartflows' ),
358 esc_html__( 'Enjoy a faster, cleaner dashboard designed to help you work smarter. Not ready? You can always switch back from Settings → Advanced.', 'cartflows' ),
359 esc_html__( 'Try the New Experience', 'cartflows' ),
360 esc_html__( 'Maybe Later', 'cartflows' )
361 ),
362 )
363 );
364 }
365 }
366
367 /**
368 * Render CartFlows NPS Survey Notice.
369 *
370 * @since 2.1.6
371 * @return void
372 */
373 public function show_nps_notice() {
374
375 Nps_Survey::show_nps_notice(
376 'nps-survey-cartflows',
377 array(
378 'show_if' => $this->should_display_nps_survey_notice(),
379 'dismiss_timespan' => 2 * WEEK_IN_SECONDS,
380 'display_after' => 0,
381 'plugin_slug' => 'cartflows',
382 'show_on_screens' => array( 'edit-cartflows_flow', 'toplevel_page_cartflows' ),
383 'message' => array(
384
385 // Step 1 i.e rating input.
386 'logo' => esc_url( CARTFLOWS_URL . 'admin-core/assets/images/cartflows-icon.svg' ),
387 'plugin_name' => __( 'CartFlows', 'cartflows' ),
388 'nps_rating_message' => __( 'How likely are you to recommend #pluginname to your friends or colleagues?', 'cartflows' ),
389
390 // Step 2A i.e. positive.
391 'feedback_content' => __( 'Could you please do us a favor and give us a 5-star rating on WordPress? It would help others choose CartFlows with confidence. Thank you!', 'cartflows' ),
392 'plugin_rating_link' => esc_url( 'https://wordpress.org/support/plugin/cartflows/reviews/?filter=5#new-post' ),
393
394 // Step 2B i.e. negative.
395 'plugin_rating_title' => __( 'Thank you for your feedback', 'cartflows' ),
396 'plugin_rating_content' => __( 'We value your input. How can we improve your experience?', 'cartflows' ),
397 ),
398 )
399 );
400 }
401
402 /**
403 * Show Deactivate gutenberg plugin notice.
404 *
405 * @since 1.1.19
406 *
407 * @return void
408 */
409 public function gutenberg_plugin_deactivate_notice() {
410
411 $ignore_notice = get_option( 'wcf_ignore_gutenberg_notice', false );
412
413 if ( 'yes' !== $ignore_notice ) {
414 printf(
415 '<div class="notice notice-error wcf_notice_gutenberg_plugin is-dismissible"><p>%s</p>%s</div>',
416 wp_kses_post(
417 sprintf(
418 /* translators: %1$s: HTML, %2$s: HTML */
419 __( 'Heads up! The Gutenberg plugin is not recommended on production sites as it may contain non-final features that cause compatibility issues with CartFlows and other plugins. %1$s Please deactivate the Gutenberg plugin %2$s to ensure the proper functioning of your website.', 'cartflows' ),
420 '<strong>',
421 '</strong>'
422 )
423 ),
424 ''
425 );
426 }
427 }
428
429 /**
430 * Ignore admin notice.
431 */
432 public function ignore_gb_notice() {
433
434 if ( ! current_user_can( 'cartflows_manage_flows_steps' ) ) {
435 return;
436 }
437
438 check_ajax_referer( 'cartflows-ignore-gutenberg-notice', 'security' );
439
440 update_option( 'wcf_ignore_gutenberg_notice', 'yes' );
441 }
442
443 /**
444 * Show the custom script migration complete notice.
445 *
446 * Renders an admin notice informing users that their custom scripts
447 * have been successfully migrated to the new dedicated code editors.
448 *
449 * @since 2.2.2
450 * @return void
451 */
452 public function show_script_migration_complete_notice() {
453
454 if ( ! $this->allowed_screen_for_notices() ) {
455 return;
456 }
457
458 if ( ! current_user_can( 'manage_options' ) ) {
459 return;
460 }
461
462 if ( 'completed' !== \CartFlows_Helper::get_script_migration_status() ) {
463 return;
464 }
465
466 if ( 'yes' === get_option( 'cartflows_script_migration_complete_notice_dismissed', 'no' ) ) {
467 return;
468 }
469
470 $output = '<div class="wcf-notice script-migration-complete-notice wcf-dismissible-notice notice notice-success is-dismissible">';
471 $output .= '<p>';
472 $output .= '<strong>' . esc_html__( 'CartFlows: Custom Script Migration Complete', 'cartflows' ) . '</strong><br>';
473 $output .= esc_html__( 'Your scripts have been successfully migrated to the dedicated JavaScript and CSS editors.', 'cartflows' );
474 $output .= '</p>';
475 $output .= '</div>';
476
477 echo wp_kses_post( $output );
478 }
479
480 /**
481 * Handle dismiss AJAX request for the script migration complete notice.
482 *
483 * Permanently hides the migration complete notice once the user dismisses it.
484 *
485 * @since 2.2.2
486 * @return void
487 */
488 public function dismiss_script_migration_complete_notice() {
489
490 if ( ! current_user_can( 'manage_options' ) ) {
491 wp_send_json_error( array( 'message' => __( 'You do not have permission to perform this action.', 'cartflows' ) ) );
492 }
493
494 check_ajax_referer( 'cartflows-dismiss-script-migration-complete-notice', 'security' );
495
496 update_option( 'cartflows_script_migration_complete_notice_dismissed', 'yes' );
497
498 wp_send_json_success();
499 }
500
501 /**
502 * Check allowed screen for notices.
503 *
504 * @since 1.0.0
505 *
506 * @param array $exclude_page_ids Optional. Array of screen IDs to exclude from displaying notices.
507 * @return bool True if the notice should be displayed, false otherwise.
508 */
509 public function allowed_screen_for_notices( $exclude_page_ids = array() ) {
510
511 $screen = get_current_screen();
512 $screen_id = $screen ? $screen->id : '';
513 $allowed_screens = array(
514 'dashboard',
515 'plugins',
516 );
517
518 // Exclude any page ids passed in $exclude_page_ids from $allowed_screens.
519 if ( ! empty( $exclude_page_ids ) && is_array( $exclude_page_ids ) ) {
520 $allowed_screens = array_diff( $allowed_screens, $exclude_page_ids );
521 }
522
523 if ( in_array( $screen_id, $allowed_screens, true ) ) {
524 return true;
525 }
526
527 return false;
528 }
529
530 /**
531 * Whether the "Switch to New UI" promo should be shown to the current user.
532 *
533 * Centralises the gating logic so the WP `admin_notices` render and the
534 * React-shell banner both honour the exact same conditions.
535 *
536 * @since 2.2.4
537 * @return bool
538 */
539 public function is_new_ui_notice_visible() {
540
541 if ( ! current_user_can( 'cartflows_manage_settings' ) ) {
542 return false;
543 }
544
545 // Only relevant when the legacy admin is the active UI. The constant is
546 // defined by the loader and accepts the 'enable'/'disable' string forms
547 // the toggle stores, so don't read the option directly here.
548 if ( ! defined( 'CARTFLOWS_LEGACY_ADMIN' ) || ! CARTFLOWS_LEGACY_ADMIN ) {
549 return false;
550 }
551
552 // Astra_Notices' own astra-notice-close JS writes 'notice-dismissed' to
553 // this user_meta key when the user dismisses the notice.
554 if ( 'notice-dismissed' === get_user_meta( get_current_user_id(), 'cartflows-switch-to-new-ui-notice', true ) ) {
555 return false;
556 }
557
558 return true;
559 }
560
561 /**
562 * Enqueue the vanilla JS that wires the Switch button of the "Switch to
563 * New UI" notice. Called from `show_admin_notices()` so the asset only
564 * loads on screens where the Astra notice actually renders.
565 *
566 * @since 2.2.4
567 * @return void
568 */
569 public function enqueue_new_ui_notice_assets() {
570
571 $handle = 'wcf-new-ui-notice';
572
573 if ( wp_script_is( $handle, 'enqueued' ) ) {
574 return;
575 }
576
577 wp_enqueue_script(
578 $handle,
579 CARTFLOWS_URL . 'admin-legacy-core/assets/js/new-ui-notice.js',
580 array(),
581 CARTFLOWS_VER,
582 true
583 );
584
585 wp_localize_script(
586 $handle,
587 'wcfNewUiNotice',
588 array(
589 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
590 'switchAction' => 'cartflows_switch_to_new_ui',
591 'switchNonce' => wp_create_nonce( 'cartflows_switch_to_new_ui' ),
592 )
593 );
594 }
595
596 /**
597 * Check if the user has completed the onboarding, skipped the onboarding on ready step, and the store checkout is imported.
598 *
599 * @since 2.1.6
600 * @return bool
601 */
602 public function should_display_nps_survey_notice() {
603
604 $is_store_checkout_imported = (bool) get_option( '_cartflows_wizard_store_checkout_set', false ); // Must be true.
605 $onboarding_completed = (bool) get_option( 'wcf_setup_complete', false ); // Must be true.
606 $is_first_funnel_imported = (bool) get_option( 'wcf_first_flow_imported', false ); // Must be true.
607 $total_funnels = intval( wp_count_posts( CARTFLOWS_FLOW_POST_TYPE )->publish ); // Must be greater than or equal to 1.
608
609 /**
610 * Show the notice in two conditions.
611 * 1. If completed the onboarding steps/process of plugin and sets their first store checkout funnel successfully.
612 * 2. If sets up the first funnel manually and makes it live.
613 */
614 return ( true === $is_store_checkout_imported && true === $onboarding_completed ) || ( true === $is_first_funnel_imported && ! empty( $total_funnels ) && 1 >= $total_funnels ) || ( ! empty( $total_funnels ) && 1 >= $total_funnels );
615 }
616 }
617
618 Cartflows_Admin_Notices::get_instance();
619