PluginProbe
Connector Wizard (formerly LC Wizard) / 2.2.2
Connector Wizard (formerly LC Wizard) v2.2.2
2.2.8 2.2.7 2.2.6 trunk 1.0.0 1.0.01 1.0.02 1.0.03 1.0.04 1.0.05 1.0.06 1.0.07 1.0.08 1.0.09 1.1.0 1.1.01 1.1.02 1.1.03 1.2.0 1.2.01 1.2.02 1.2.03 1.2.04 1.2.05 1.2.06 All 61 releases
ghl-wizard / ghl-wizard.php

ghl-wizard.php in Connector Wizard (formerly LC Wizard) 2.2.2, at ghl-wizard.php

128 lines 4.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @wordpress-plugin
4 * Plugin Name: Connector Wizard (formerly LC Wizard)
5 * Plugin URI: https://betterwizard.com/lead-connector-wizard/
6 * Description: Connect WordPress with the popular LeadConnector CRM(HighLevel) and combine the power of automation and excellent user experience. Including memberships, content protection, WooCommerce automation, custom fields & many more...
7 * Version: 2.2.2
8 * Author: Better Wizard
9 * Author URI: https://connectorwizard.app/
10 * Requires PHP: 7.4
11 * Requires at least: 6.2
12 * License: GPLv2 or later
13 * Text Domain: ghl-wizard
14 */
15
16 if ( ! defined( 'ABSPATH' )) {
17 exit();
18 }
19
20
21 /***********************************
22 Create Tables
23 @ v: 1.1
24 ***********************************/
25 register_activation_hook( __FILE__, "lcw_activation_hook" );
26
27 if ( ! function_exists( 'lcw_activation_hook' ) ) {
28 function lcw_activation_hook() {
29
30 // create db table
31 lcw_create_location_and_contact_table();
32
33 }
34 }
35
36
37 /***********************************
38 Default Values
39 ***********************************/
40 define( 'HLWPW_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
41 define( 'HLWPW_LOCATION_CONNECTED', false );
42 define( 'LCW_PLUGIN_VERSION', '2.1.0' );
43 define( 'LCW_DB_VERSION', '1.3' );
44 define( 'LCW_PLUGIN_FILE', __FILE__ );
45
46 /***********************************
47 Load JS & CSS Files
48 ***********************************/
49 if ( ! function_exists( 'hlwpw_style_and_scripts' ) ) {
50 function hlwpw_style_and_scripts() {
51
52 wp_enqueue_style( 'hlwpw_style', plugins_url( '/css/styles.css', __FILE__ ), '', LCW_PLUGIN_VERSION );
53 wp_enqueue_script( 'hlwpw_script', plugins_url( '/js/scripts.js', __FILE__ ) , array('jquery'), LCW_PLUGIN_VERSION, true);
54 wp_enqueue_script( 'lcw_autologin_script', plugins_url( '/js/autologin.js', __FILE__ ) , '', LCW_PLUGIN_VERSION, false);
55 wp_localize_script( 'hlwpw_script', 'hlwpw_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
56 wp_localize_script( 'lcw_autologin_script', 'hlwpw_ajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
57
58 }
59 add_action( 'wp_enqueue_scripts', 'hlwpw_style_and_scripts' );
60 }
61
62 /***********************************
63 Load JS & CSS for admin screen
64 ***********************************/
65 if ( ! function_exists( 'hlwpw_admin_style_and_scripts' ) ) {
66 function hlwpw_admin_style_and_scripts() {
67
68 wp_enqueue_script( 'select2', plugins_url( '/js/select2.min.js', __FILE__ ) , array('jquery'), LCW_PLUGIN_VERSION, true );
69 wp_enqueue_script( 'hlwpw_admin_script', plugins_url( '/js/admin-scripts.js', __FILE__ ) , array('jquery'), LCW_PLUGIN_VERSION, true );
70 wp_enqueue_style( 'select2_css', plugins_url( '/css/select2.min.css', __FILE__ ), [], LCW_PLUGIN_VERSION );
71 wp_enqueue_style( 'hlwpw_admin_style', plugins_url( '/css/admin-styles.css', __FILE__ ), [], LCW_PLUGIN_VERSION );
72 }
73 add_action( 'admin_enqueue_scripts', 'hlwpw_admin_style_and_scripts' );
74 }
75
76
77 /***********************************
78 Admin Notice
79 ***********************************/
80
81 add_action( 'admin_notices', function(){
82
83 $hlwpw_location_connected = get_option( 'hlwpw_location_connected', HLWPW_LOCATION_CONNECTED );
84
85 if ( $hlwpw_location_connected == 1 ) {
86 return;
87 }
88
89 $class = 'notice notice-error';
90 $url = admin_url('admin.php?page=connector-wizard-app');
91 $link_text = __('Connect Here','hlwpw');
92 $message = __( 'Your WordPress isn\'t connected with the CRM. You must connect it to make "Connector Wizard" plugin work.', 'hlwpw' );
93
94 printf( '<div class="%1$s"><p>%2$s <a href="%3$s"> %4$s </a></p></div>', esc_attr( $class ), esc_html( $message ), $url, esc_html($link_text) );
95
96 });
97
98
99 /**
100 * Initialize the plugin tracker
101 *
102 * @return void
103 */
104 function appsero_init_tracker_ghl_wizard() {
105
106 if ( ! class_exists( 'Appsero\Client' ) ) {
107 require_once __DIR__ . '/lib/client/src/Client.php';
108 }
109
110 $client = new Appsero\Client( '72d4c258-70c6-4454-84a7-67dd3938836b', 'LeadConnector Wizard', __FILE__ );
111
112 // Active insights
113 $opt_in_message = "Allow <strong>Connector Wizard</strong> to collect diagnostic data to enhance your journey. We never collect any sensitive data. Allow now for a smoother, personalized experience!";
114 $client->insights()
115 ->notice( $opt_in_message )
116 ->init();
117
118 }
119 appsero_init_tracker_ghl_wizard();
120
121
122 /***********************************
123 Required Files
124 ***********************************/
125
126 require_once( plugin_dir_path( __FILE__ ) . 'api/apis.php' );
127 require_once( plugin_dir_path( __FILE__ ) . 'inc/includes.php' );
128