PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.3.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.3.0
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 / modules / content-generation / class-cartflows-ai-init.php

class-cartflows-ai-init.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.3.0, at modules/content-generation/class-cartflows-ai-init.php

77 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * AI Initialization.
4 *
5 * @package cartflows
6 */
7
8 // Exit if accessed directly.
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12 /**
13 * AI Initialization.
14 *
15 * @since x.x.x
16 */
17 class Cartflows_Ai_Init {
18
19 /**
20 * Member Variable
21 *
22 * @var object instance
23 */
24 private static $instance;
25
26 /**
27 * Initiator
28 */
29 public static function get_instance() {
30
31 if ( ! isset( self::$instance ) ) {
32 self::$instance = new self();
33 }
34
35 return self::$instance;
36 }
37
38 /**
39 * Constructor
40 *
41 * @since x.x.x
42 */
43 public function __construct() {
44 if ( apply_filters( 'cartflows_ai_auth_enabled', true ) ) {
45 include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-utils.php';
46 include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-auth.php';
47 include_once CARTFLOWS_DIR . 'modules/content-generation/class-cartflows-ai-api.php';
48
49 add_action( 'admin_notices', array( $this, 'render_auth_connected_notice' ) );
50 }
51 }
52
53 /**
54 * Render a one-shot success banner right after the account is connected.
55 *
56 * @since x.x.x
57 * @return void
58 */
59 public function render_auth_connected_notice() {
60 if ( ! get_transient( 'cartflows_auth_connected_notice' ) ) {
61 return;
62 }
63
64 delete_transient( 'cartflows_auth_connected_notice' );
65
66 printf(
67 '<div class="notice notice-success is-dismissible"><p>%s</p></div>',
68 esc_html__( 'Your CartFlows account is now connected. Auto Suggest and related Pro features are ready to use.', 'cartflows' )
69 );
70 }
71 }
72
73 /**
74 * Kicking this off by calling 'get_instance()' method
75 */
76 Cartflows_Ai_Init::get_instance();
77