WP-Chatbot for Facebook Messenger Customer Chat - Version 4.3

Version Description

Enhance usability on notifications

Download this release

Release Info

Developer yankovski
Plugin Icon 128x128 WP-Chatbot for Facebook Messenger Customer Chat
Version 4.3
Comparing to
See all releases

Code changes from version 4.2 to 4.3

admin/admin.php CHANGED
@@ -32,6 +32,7 @@ add_action( 'admin_init', array( $admin, 'htcc_incomplete_setup' ) );
32
  add_action('admin_init', 'htcc_admin_notice');
33
  add_action('admin_notices', array( $admin, 'example_admin_notice'));
34
  add_action('admin_notices', array( $admin, 'new_leads'));
 
35
  add_action('wp_ajax_send_done', array($admin,'set_tab_done'));
36
  add_action('wp_ajax_email_section', array($admin,'email_section'));
37
  add_action('wp_ajax_get_done', array($admin,'get_tab_done'));
@@ -41,7 +42,8 @@ add_action('wp_ajax_set_current_tab', array($admin,'set_current_tab'));
41
  add_action('wp_ajax_create_subscribe', array($api,'create_subscribe'));
42
  add_action('wp_ajax_cancel_subscribe', array($api,'cancel_subscribe'));
43
  add_action('wp_ajax_csv', array($api,'csv'));
44
- add_action('wp_ajax_notice', array($admin,'notice_off'));
 
45
 
46
 
47
 
32
  add_action('admin_init', 'htcc_admin_notice');
33
  add_action('admin_notices', array( $admin, 'example_admin_notice'));
34
  add_action('admin_notices', array( $admin, 'new_leads'));
35
+ add_action('admin_notices', array( $admin, 'mobile_promo'));
36
  add_action('wp_ajax_send_done', array($admin,'set_tab_done'));
37
  add_action('wp_ajax_email_section', array($admin,'email_section'));
38
  add_action('wp_ajax_get_done', array($admin,'get_tab_done'));
42
  add_action('wp_ajax_create_subscribe', array($api,'create_subscribe'));
43
  add_action('wp_ajax_cancel_subscribe', array($api,'cancel_subscribe'));
44
  add_action('wp_ajax_csv', array($api,'csv'));
45
+ add_action('wp_ajax_notice_lead', array($admin,'notice_lead_off'));
46
+ add_action('wp_ajax_notice_promo', array($admin,'notice_promo_off'));
47
 
48
 
49
 
admin/assets/css/admin-styles.css CHANGED
@@ -1071,6 +1071,7 @@ p.submit{
1071
  border-radius: 10px;
1072
  }
1073
 
 
1074
  #to_pro .modal_close,#unsaved_option .modal_close,#pro_option .modal_close, #mm_option .modal_close,#cancel .modal_close {
1075
  background-size: contain;
1076
  width: 15px;
@@ -1084,6 +1085,7 @@ p.submit{
1084
  z-index: 999;
1085
  }
1086
 
 
1087
  #to_pro .upgrade__wrapper,#unsaved_option .unsaved__wrapper,#cancel .cancel__wrapper,#mm_option .mm__wrapper{
1088
  position: relative;
1089
  height: 302px;
@@ -2171,7 +2173,7 @@ p.billed{
2171
  display: flex;
2172
  flex-direction: column;
2173
  align-items: center;
2174
- font-family: 'Open-sans', sans-serif;
2175
  }
2176
 
2177
  .checkout-form__name-fields {
@@ -2200,7 +2202,7 @@ p.billed{
2200
  .billing-modal-body label{
2201
  font-size: 14px;
2202
  font-weight: bold;
2203
- font-family: 'Open-sans', sans-serif;
2204
  color: #666;
2205
  }
2206
  .checkout-form .billing-modal-body input[type=email]:not(.browser-default):focus:not([readonly]),
@@ -2297,7 +2299,7 @@ p.billed{
2297
  .subscribe__wrap .page_name__wrap h2.subscribe_page_name{
2298
  margin: 0;
2299
  font-size: 2.5rem;
2300
- font-family: 'Open-Sans',sans-serif;
2301
  }
2302
  .subscribe__wrap .page_name__wrap span.pro{
2303
  border-radius: 5px;
@@ -3005,4 +3007,116 @@ span.qa-question-result {
3005
  .disabled{
3006
  pointer-events: none;
3007
  opacity: 0.6;
3008
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1071
  border-radius: 10px;
1072
  }
1073
 
1074
+
1075
  #to_pro .modal_close,#unsaved_option .modal_close,#pro_option .modal_close, #mm_option .modal_close,#cancel .modal_close {
1076
  background-size: contain;
1077
  width: 15px;
1085
  z-index: 999;
1086
  }
1087
 
1088
+
1089
  #to_pro .upgrade__wrapper,#unsaved_option .unsaved__wrapper,#cancel .cancel__wrapper,#mm_option .mm__wrapper{
1090
  position: relative;
1091
  height: 302px;
2173
  display: flex;
2174
  flex-direction: column;
2175
  align-items: center;
2176
+ font-family: 'Open Sans', sans-serif;
2177
  }
2178
 
2179
  .checkout-form__name-fields {
2202
  .billing-modal-body label{
2203
  font-size: 14px;
2204
  font-weight: bold;
2205
+ font-family: 'Open Sans', sans-serif;
2206
  color: #666;
2207
  }
2208
  .checkout-form .billing-modal-body input[type=email]:not(.browser-default):focus:not([readonly]),
2299
  .subscribe__wrap .page_name__wrap h2.subscribe_page_name{
2300
  margin: 0;
2301
  font-size: 2.5rem;
2302
+ font-family: 'Open Sans',sans-serif;
2303
  }
2304
  .subscribe__wrap .page_name__wrap span.pro{
2305
  border-radius: 5px;
3007
  .disabled{
3008
  pointer-events: none;
3009
  opacity: 0.6;
3010
+ }
3011
+
3012
+ .phone{
3013
+ background: url("../img/iphone_x.png");
3014
+ padding: 0;
3015
+ margin-top: 200px;
3016
+ height: 415px;
3017
+ width: 220px;
3018
+ background-repeat: no-repeat;
3019
+ background-position: center center;
3020
+ display: flex;
3021
+ margin-right: auto;
3022
+ margin-left: auto;
3023
+ }
3024
+ @media (max-width: 720px) {
3025
+ .phone{
3026
+ margin-top: 0;
3027
+ }
3028
+ .options table td{
3029
+ width: 95%;
3030
+ }
3031
+ .del_as{
3032
+ right: -32px;
3033
+ }
3034
+ .answer-input__block{
3035
+ flex-direction: column;
3036
+ }
3037
+ .answer-input__add{
3038
+ display: flex;
3039
+ text-align: center;
3040
+ justify-content: center;
3041
+ }
3042
+ .add_qa_question {
3043
+ width: 50%;
3044
+ padding: 10px;
3045
+
3046
+ }
3047
+ .question_button_wrap{
3048
+ flex-direction: column;
3049
+ align-items: center;
3050
+ }
3051
+ .test-bot-button{
3052
+ top: 7px;
3053
+ }
3054
+ .row .col.s12 .questions-wrapper{
3055
+ margin-top: 20px;
3056
+ }
3057
+ .tab-content .email__wrap input[type=text]:not(.browser-default){
3058
+ width: 85%;
3059
+ }
3060
+ }
3061
+ .mobile__wrapper{
3062
+ display: flex;
3063
+ flex-direction: column;
3064
+ justify-content: space-evenly;
3065
+ margin-right: auto;
3066
+ margin-left: auto;
3067
+ align-items: center;
3068
+ width: 170px;
3069
+ }
3070
+
3071
+ .logo_promo{
3072
+ background: url("../img/mmL_logo.png");
3073
+ height: 76px;
3074
+ width: 116px;
3075
+ background-size: contain;
3076
+ margin-top: 20px;
3077
+ background-repeat: no-repeat;
3078
+ }
3079
+ .dialog_block{
3080
+ background-color: #fff;
3081
+ border-radius: 10px;
3082
+ margin: 0 10px 0 10px;
3083
+ padding: 5px 13px;
3084
+ font-size: 12px;
3085
+ font-weight: 600;
3086
+ }
3087
+ .text__wrap{
3088
+ display: flex;
3089
+ height: auto;
3090
+ flex-direction: row;
3091
+ }
3092
+ .dot_icon{
3093
+ width: 20px;
3094
+ height: 20px;
3095
+ position: relative;
3096
+ }
3097
+ .dot_icon .white_circle{
3098
+ width: 20px;
3099
+ height: 20px;
3100
+ background-color: #ffff;
3101
+ border-radius: 50%;
3102
+ margin-left: 5px;
3103
+ }
3104
+ .dot_icon .green_circle{
3105
+ position: absolute;
3106
+ height: 10px;
3107
+ width: 10px;
3108
+ border-radius: 50%;
3109
+ background: #9EE10E;
3110
+ border: 1px solid #FFFFFF;
3111
+ right: -8px;
3112
+ bottom: -5px;
3113
+ }
3114
+ .button_download_app{
3115
+ background: linear-gradient(31.47deg, #935CF7 21.84%, #586CF5 81.11%);
3116
+ border-radius: 5px;
3117
+ padding: 5px 15px;
3118
+ color: #fff;
3119
+ margin-bottom: 40px;
3120
+ display: flex;
3121
+ cursor: pointer;
3122
+ }
admin/assets/img/31c07c81b2d635598c3776cfb31eb240.png ADDED
Binary file
admin/assets/img/iphone_x.png ADDED
Binary file
admin/assets/img/mmL_logo.png ADDED
Binary file
admin/assets/js/admin.js CHANGED
@@ -937,20 +937,7 @@ jQuery(document).ready(function($){
937
  set_current_tab('tab-1');
938
  });
939
 
940
- $('.dismiss_but').on('click',function (e) {
941
- $.ajax({
942
- type: 'POST',
943
- url: ajaxurl,
944
- data: {
945
- action: 'notice'
946
- },
947
- dataType: 'json',
948
- success: function (data,response) {
949
- $('.dismiss_but').parents('.main_notice__wrap').fadeOut(300, function(){ $(this).remove();});;
950
 
951
- }
952
- });
953
- });
954
 
955
 
956
  $('.button_cancel').on('click',function (e) {
937
  set_current_tab('tab-1');
938
  });
939
 
 
 
 
 
 
 
 
 
 
 
940
 
 
 
 
941
 
942
 
943
  $('.button_cancel').on('click',function (e) {
admin/class-htcc-admin.php CHANGED
@@ -135,7 +135,7 @@ if (!class_exists('HTCC_Admin')) :
135
  }
136
  public function new_leads() {
137
  if ($this->fb_page_id && $this->token && $this->internal){
138
- $notice = get_transient( 'notice_off' );
139
  $contacts = $this->api->getContacts();
140
  $count = 0;
141
  if (isset($contacts)){
@@ -152,13 +152,35 @@ if (!class_exists('HTCC_Admin')) :
152
  }
153
  if ($count>=2&&!$this->options_as['email']){
154
  if ($notice != true ){
 
155
  $leads_info = [
156
- 'leads_count'=> $count
 
 
 
157
  ];
158
- HT_CC::view('ht-cc-admin-new-leads',$leads_info);
159
  }
160
  }
161
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
163
  /**
164
  * Options page Content -
@@ -187,13 +209,20 @@ if (!class_exists('HTCC_Admin')) :
187
  wp_send_json_success ($response);
188
  }
189
 
190
- public function notice_off()
191
  {
192
  $response= array('done'=>true);
193
- set_transient( 'notice_off', true, WEEK_IN_SECONDS*2);
194
  wp_send_json_success ($response);
195
  }
196
 
 
 
 
 
 
 
 
197
  public function pre_val(){
198
  set_transient( 'pre_value', false, YEAR_IN_SECONDS );
199
  $response= array('done'=>true);
135
  }
136
  public function new_leads() {
137
  if ($this->fb_page_id && $this->token && $this->internal){
138
+ $notice = get_transient( 'lead_notice_off' );
139
  $contacts = $this->api->getContacts();
140
  $count = 0;
141
  if (isset($contacts)){
152
  }
153
  if ($count>=2&&!$this->options_as['email']){
154
  if ($notice != true ){
155
+ $this->api->notice = true;
156
  $leads_info = [
157
+ 'header_text' => "You had $count new leads on your website in the last 3 days. ",
158
+ 'p_text'=>"Set up notifications in WP-Chatbot to get an email each time a new lead is detected!",
159
+ 'button_text'=>"SET UP NOTIFICATION",
160
+ 'type'=>'lead'
161
  ];
162
+ HT_CC::view('ht-cc-admin-top-banner',$leads_info);
163
  }
164
  }
165
  }
166
+
167
+ }
168
+ public function mobile_promo() {
169
+ if ($this->fb_page_id && $this->token && $this->internal) {
170
+ if ($this->api->notice != true){
171
+ $notice = get_transient( 'promo_notice_off' );
172
+ if ($notice != true ) {
173
+ $leads_info = [
174
+ 'header_text' => "Heard about our mobile app?",
175
+ 'p_text' => " Install the app now to respond to customers straight from your phone",
176
+ 'button_text' => "Download App",
177
+ 'type' => 'promo'
178
+ ];
179
+ HT_CC::view('ht-cc-admin-top-banner', $leads_info);
180
+ }
181
+
182
+ }
183
+ }
184
  }
185
  /**
186
  * Options page Content -
209
  wp_send_json_success ($response);
210
  }
211
 
212
+ public function notice_lead_off()
213
  {
214
  $response= array('done'=>true);
215
+ set_transient( 'lead_notice_off', true, WEEK_IN_SECONDS*2);
216
  wp_send_json_success ($response);
217
  }
218
 
219
+ public function notice_promo_off()
220
+ {
221
+ $response= array('done'=>true);
222
+ set_transient( 'promo_notice_off', true, WEEK_IN_SECONDS*2);
223
+ wp_send_json_success ($response);
224
+ }
225
+
226
  public function pre_val(){
227
  set_transient( 'pre_value', false, YEAR_IN_SECONDS );
228
  $response= array('done'=>true);
admin/class-htcc-enqueue.php CHANGED
@@ -40,7 +40,7 @@ class HTCC_Enqueue {
40
 
41
  wp_enqueue_script( 'htcc_admin_js', plugins_url( 'admin/assets/js/admin.js', HTCC_PLUGIN_FILE ), array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
42
  wp_enqueue_script( 'htcc_admin_recurly_js', 'https://js.recurly.com/v4/recurly.js', array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
43
- wp_enqueue_script( 'htcc_admin_md_js', plugins_url( 'admin/assets/js/materialize.min.js', HTCC_PLUGIN_FILE ), array('wp-color-picker', 'jquery' ), HTCC_VERSION, true );
44
 
45
 
46
  }
40
 
41
  wp_enqueue_script( 'htcc_admin_js', plugins_url( 'admin/assets/js/admin.js', HTCC_PLUGIN_FILE ), array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
42
  wp_enqueue_script( 'htcc_admin_recurly_js', 'https://js.recurly.com/v4/recurly.js', array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
43
+ // wp_enqueue_script( 'htcc_admin_md_js', plugins_url( 'admin/assets/js/materialize.min.js', HTCC_PLUGIN_FILE ), array('wp-color-picker', 'jquery' ), HTCC_VERSION, true );
44
 
45
 
46
  }
admin/commons/ht-cc-admin-comment-guard.php CHANGED
@@ -22,7 +22,7 @@ if (!defined('ABSPATH')) exit;
22
  font-weight: normal;
23
  font-size: 13px;
24
  position: absolute;
25
- z-index: 99999999;
26
  box-sizing: border-box;
27
  opacity: 1;
28
  transition: all 0.5s ease;
22
  font-weight: normal;
23
  font-size: 13px;
24
  position: absolute;
25
+ z-index: 10;
26
  box-sizing: border-box;
27
  opacity: 1;
28
  transition: all 0.5s ease;
admin/commons/ht-cc-admin-new-leads.php DELETED
@@ -1,142 +0,0 @@
1
- <?php
2
-
3
- /**
4
- *
5
- *
6
- * This file is used to markup the admin-facing aspects of the plugin.
7
- *
8
- *
9
- */
10
- ?>
11
- <link href="https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap" rel="stylesheet">
12
- <style>
13
- .mobile-button {
14
- background: linear-gradient(180deg, #3952FA 0%, #945DF8 100%);
15
- border-radius: 6px;
16
- text-decoration: none;
17
- height: 80px;
18
- width: 100%;
19
- }
20
- h3, p {
21
- margin-bottom: 10px;
22
- margin-top: 0;
23
- }
24
- .main_notice__wrap{
25
- position: relative;
26
- width: 98%;
27
- margin-top: 54px;
28
- display: flex;
29
- }
30
- .notification__wrapper {
31
- display: flex;
32
- width: 100%;
33
- justify-content: space-between;
34
- color: #fff;
35
- align-items: center;
36
- }
37
- .notification__button {
38
- margin-left: auto;
39
- padding: 0;
40
- font-weight: 900;
41
- font-size: 18px;
42
- flex-basis: 30%;
43
- text-align: center;
44
- flex-direction: column;
45
- display: flex;
46
- align-items: flex-end;
47
- margin-right: 55px;
48
- }
49
-
50
- .notification__info {
51
- padding: 0;
52
- }
53
- .info__heading{
54
- color: #FFFFFF;
55
- font-family: "Open-Sans",sans-serif;
56
- font-style: normal;
57
- font-weight: normal;
58
- font-size: 17px;
59
- line-height: 31px;
60
- margin-bottom: 5px;
61
- }
62
- .info__heading b{
63
- display: flex;
64
- line-height: 19px;
65
- margin-top: 1px;
66
- }
67
- .complete__button{
68
- width: 121px;
69
- padding: 5px;
70
- line-height: 16px;
71
- background: #FFFFFF;
72
- border-radius: 5px;
73
- }
74
- .complete__button span{
75
- font-family: "Open-Sans",sans-serif;
76
- font-style: normal;
77
- font-weight: normal;
78
- font-size: 13px;
79
- line-height: 18px;
80
- color: #525252;
81
- }
82
- .dismiss__button{
83
- position: absolute;
84
- top: 3px;
85
- right: 5px;
86
- display: flex;
87
- align-self: flex-end;
88
- cursor: pointer;
89
- }
90
- .dismiss__button .button__wrapper_text{
91
- color: #F1F1F1;
92
- font-family: "Open-Sans",sans-serif;
93
- font-weight: 900;
94
- line-height: 32px;
95
- display: flex;
96
- font-size: 15px;
97
- }
98
- @media (max-width: 720px) {
99
- .notification__wrapper{
100
- flex-direction: column;
101
- }
102
- }
103
-
104
- @media (max-width: 992px) {
105
-
106
- }
107
-
108
- @media (max-width: 1200px) {
109
-
110
-
111
- }
112
- .notification__images{
113
- background-image: url(<?php echo plugins_url('admin/assets/img/phone.png',HTCC_PLUGIN_FILE)?>)!important;
114
- background-repeat: no-repeat;
115
- background-size: cover;
116
- background-position: center center;
117
- height: 80px;
118
- width: 125px;
119
- position: relative;
120
- margin: 0 30px;
121
- }
122
- </style>
123
- <div class="main_notice__wrap">
124
- <div class="dismiss__button">
125
- <span class="button__wrapper_text dismiss_but"><i class="fa fa-times" aria-hidden="true"></i></span>
126
- </div>
127
- <a class="mobile-button new_leads" href="<?php echo admin_url( 'admin.php?page=wp-chatbot' )?>">
128
- <div class="notification__wrapper">
129
- <div class="notification__images">
130
- </div>
131
- <div class="notification__info">
132
- <h3 class="info__heading">You had <?php echo $leads_count ?> new leads on your website in the last 3 days. <b>Set up notifications in WP-Chatbot to get an email each time a new lead is detected!</b></h3>
133
- </div>
134
- <div class="notification__button">
135
- <div class="complete__button">
136
- <span class="button__wrapper_text">SET UP NOTIFICATION</span>
137
- </div>
138
- </div>
139
- </div>
140
- </a>
141
- </div>
142
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/commons/ht-cc-admin-settings-form.php CHANGED
@@ -290,6 +290,18 @@ $tabs[$curren] .= ' current';
290
  </form>
291
  </div>
292
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
293
  <div class="modal-overlays" id="modal-overlay">
294
  </div>
295
 
290
  </form>
291
  </div>
292
  </div>
293
+ <div id="promo_app" class="modal">
294
+ <div class="modal_close"><i class="fa fa-times" aria-hidden="true"></i></div>
295
+ <div class="promo-app__wrapper">
296
+ <p>Download App</p>
297
+ <a target="_blank" class="android_app" href='https://play.google.com/store/apps/details?id=com.mobilemonkey&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>
298
+ <img src="https://linkmaker.itunes.apple.com/en-us/badge-lrg.svg?releaseDate=2019-10-03&kind=iossoftware&bubble=ios_apps" alt="" class="ios_app">
299
+ </div>
300
+ <div class="ios-app__wrap">
301
+ <p>Scan on your mobile device to view in the App Store</p>
302
+ <div class="ios_code"></div>
303
+ </div>
304
+ </div>
305
  <div class="modal-overlays" id="modal-overlay">
306
  </div>
307
 
admin/commons/ht-cc-admin-top-banner.php ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ *
5
+ *
6
+ * This file is used to markup the admin-facing aspects of the plugin.
7
+ *
8
+ *
9
+ */
10
+ ?>
11
+ <link href="https://fonts.googleapis.com/css?family=Nunito+Sans&display=swap" rel="stylesheet">
12
+ <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
13
+ <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800&display=swap" rel="stylesheet">
14
+ <style>
15
+ #promo_app{
16
+ z-index: 999;
17
+ transition: all 0.5s ease;
18
+ background-color: #FFFFFF;
19
+ display: none;
20
+ position: fixed;
21
+ top: 30%;
22
+ left: 0;
23
+ right: 0;
24
+ width: 563px;
25
+ margin: 0 auto;
26
+ color: #525252;
27
+ border: 1px solid #000;
28
+ border-radius: 10px;
29
+ }
30
+ #promo_app{
31
+ border: none;
32
+ width: 400px;
33
+ height: auto;
34
+ }
35
+ #promo_app p{
36
+ font-family: "Open Sans",sans-serif;
37
+ font-style: normal;
38
+ font-weight: bold;
39
+ font-size: 18px;
40
+ line-height: 25px;
41
+ color: #525252;
42
+ text-align: center;
43
+ margin-top: 35px;
44
+ }
45
+ #promo_app .modal_close {
46
+ background-size: contain;
47
+ width: 15px;
48
+ height: 15px;
49
+ background-repeat: no-repeat;
50
+ background-position: center;
51
+ position: absolute;
52
+ right: 12px;
53
+ top: 12px;
54
+ cursor: pointer;
55
+ z-index: 999;
56
+ }
57
+ #promo_app .modal_close{
58
+ color: #A6A3A3;
59
+ }
60
+ .mobile-button {
61
+ background: linear-gradient(180deg, #3952FA 0%, #945DF8 100%);
62
+ border-radius: 6px;
63
+ text-decoration: none;
64
+ width: 100%;
65
+ }
66
+ .mobile-button:focus,.mobile-button:active,.mobile-button:hover{
67
+ box-shadow: none;
68
+ }
69
+ h3, p {
70
+ margin-bottom: 10px;
71
+ margin-top: 0;
72
+ }
73
+ .main_notice__wrap{
74
+ position: relative;
75
+ width: 98%;
76
+ margin-top: 54px;
77
+ display: flex;
78
+ }
79
+ .notification__wrapper {
80
+ display: flex;
81
+ width: 100%;
82
+ justify-content: space-between;
83
+ color: #fff;
84
+ align-items: center;
85
+ }
86
+ .notification__button {
87
+ margin-left: auto;
88
+ padding: 0;
89
+ font-weight: 900;
90
+ font-size: 18px;
91
+ flex-basis: 30%;
92
+ text-align: center;
93
+ flex-direction: column;
94
+ display: flex;
95
+ align-items: flex-end;
96
+ margin-right: 55px;
97
+ }
98
+
99
+ .notification__info {
100
+ padding: 0;
101
+ }
102
+ .info__heading{
103
+ color: #FFFFFF;
104
+ font-family: "Open Sans",sans-serif;
105
+ font-style: normal;
106
+ font-weight: normal;
107
+ font-size: 17px;
108
+ line-height: 31px;
109
+ margin-bottom: 5px;
110
+ }
111
+ .info__heading b{
112
+ display: flex;
113
+ line-height: 19px;
114
+ margin-top: 1px;
115
+ }
116
+ .complete__button{
117
+ width: 121px;
118
+ padding: 5px;
119
+ line-height: 16px;
120
+ background: #FFFFFF;
121
+ border-radius: 5px;
122
+ cursor: pointer;
123
+ }
124
+ .complete__button span{
125
+ font-family: "Open Sans",sans-serif;
126
+ font-style: normal;
127
+ font-weight: normal;
128
+ font-size: 13px;
129
+ line-height: 18px;
130
+ color: #525252;
131
+ }
132
+ .ios_code{
133
+ background: url(<?php echo plugins_url('admin/assets/img/31c07c81b2d635598c3776cfb31eb240.png',HTCC_PLUGIN_FILE)?>);
134
+ margin-left: auto;
135
+ margin-right: auto;
136
+ height: 300px;
137
+ width: 300px;
138
+ }
139
+ .dismiss__button{
140
+ position: absolute;
141
+ top: 3px;
142
+ right: 5px;
143
+ display: flex;
144
+ align-self: flex-end;
145
+ cursor: pointer;
146
+ }
147
+ .dismiss__button .button__wrapper_text{
148
+ color: #F1F1F1;
149
+ font-family: "Open Sans",sans-serif;
150
+ font-weight: 900;
151
+ line-height: 32px;
152
+ display: flex;
153
+ font-size: 15px;
154
+ }
155
+ @media (max-width: 720px) {
156
+ .notification__wrapper{
157
+ flex-direction: column;
158
+ }
159
+ .notification__button {
160
+ margin-left: 0;
161
+ margin-bottom: 15px;
162
+ margin-right: 0;
163
+ }
164
+ .main_notice__wrap{
165
+ text-align: center;
166
+ }
167
+ }
168
+
169
+ @media (max-width: 992px) {
170
+
171
+ }
172
+
173
+ @media (max-width: 1200px) {
174
+
175
+
176
+ }
177
+ .notification__images{
178
+ background-image: url(<?php echo plugins_url('admin/assets/img/phone.png',HTCC_PLUGIN_FILE)?>)!important;
179
+ background-repeat: no-repeat;
180
+ background-size: cover;
181
+ background-position: center center;
182
+ height: 80px;
183
+ width: 125px;
184
+ position: relative;
185
+ margin: 0 30px;
186
+ }
187
+ .promo-app__wrapper .android_app img{
188
+ width: 270px;
189
+ }
190
+ .promo-app__wrapper .ios_app{
191
+ width: 235px;
192
+ cursor: pointer;
193
+ }
194
+ .promo-app__wrapper{
195
+ text-align: center;
196
+ margin-bottom: 25px;
197
+ }
198
+ .promo-app__wrapper a{
199
+ display: block;
200
+ }
201
+ .promo-app__wrapper a:hover,.promo-app__wrapper a:active,.promo-app__wrapper a:focus{
202
+ border: none;
203
+ box-shadow: none;
204
+ }
205
+ .ios-app__wrap p {
206
+ margin-top: 41px;
207
+ }
208
+ .ios-app__wrap{
209
+ display: none;
210
+ }
211
+ .modal-overlays {
212
+ position: fixed;
213
+ margin-left: -20px;
214
+ right: 0;
215
+ height: auto;
216
+ width: auto;
217
+ background: #000;
218
+ will-change: opacity;
219
+ opacity: 0.4;
220
+ z-index: 998;
221
+ top: -25%;
222
+ left: 0;
223
+ bottom: 0;
224
+ display: none;
225
+ }
226
+ </style>
227
+ <script>
228
+ jQuery(document).ready(function($){
229
+ $(document).on("click", ".button_download_app", function() {
230
+ $('#promo_app').show();
231
+ $('#promo_app').find(".ios-app__wrap").hide();
232
+ $('#promo_app').find(".promo-app__wrapper").show();
233
+ $('#modal-overlay').show();
234
+ });
235
+ $(document).on("click",".ios_app",function () {
236
+ $(this).parent(".promo-app__wrapper").hide();
237
+ $(this).parents("#promo_app").find('.ios-app__wrap').show();
238
+ });
239
+ $(document).on("click",".promo .complete__button",function () {
240
+ $('#promo_app').show();
241
+ $('#promo_app').find(".ios-app__wrap").hide();
242
+ $('#promo_app').find(".promo-app__wrapper").show();
243
+ $('#modal-overlay').show();
244
+ });
245
+ $('.dismiss_but').on('click',function (e) {
246
+ let type = $(this).attr('data-type');
247
+ console.log(type);
248
+ $.ajax({
249
+ type: 'POST',
250
+ url: ajaxurl,
251
+ data: {
252
+ action:'notice_'+type
253
+ },
254
+ dataType: 'json',
255
+ success: function (data,response) {
256
+ $('.dismiss_but').parents('.main_notice__wrap').fadeOut(300, function(){ $(this).remove();});;
257
+
258
+ }
259
+ });
260
+ });
261
+ $(".modal .modal_close").on("click", function(event) {
262
+ event.preventDefault();
263
+ $(".modal").hide();
264
+ $('body').css({'overflow': 'auto'});
265
+ $('#modal-overlay').hide();
266
+ });
267
+ });
268
+
269
+ </script>
270
+ <?php
271
+ $href='';
272
+ if ($type!=='promo') {
273
+ $href = " href=" . admin_url('admin.php?page=wp-chatbot');
274
+ } ?>
275
+ <div class="main_notice__wrap">
276
+ <div class="dismiss__button" >
277
+ <span data-type="<?php echo $type ?>" class="button__wrapper_text dismiss_but"><i class="fa fa-times" aria-hidden="true"></i></span>
278
+ </div>
279
+ <a class="mobile-button new_leads <?php echo $type ?>"<?php echo $href?>>
280
+ <div class="notification__wrapper">
281
+ <div class="notification__images">
282
+ </div>
283
+ <div class="notification__info">
284
+ <h3 class="info__heading"><?php echo $header_text ?><b><?php echo $p_text ?></b></h3>
285
+ </div>
286
+ <div class="notification__button">
287
+ <div class="complete__button">
288
+ <span class="button__wrapper_text"><?php echo $button_text ?></span>
289
+ </div>
290
+ </div>
291
+ </div>
292
+ </a>
293
+ </div>
294
+ <div id="promo_app" class="modal">
295
+ <div class="modal_close"><i class="fa fa-times" aria-hidden="true"></i></div>
296
+ <div class="promo-app__wrapper">
297
+ <p>Download App</p>
298
+ <a target="_blank" class="android_app" href='https://play.google.com/store/apps/details?id=com.mobilemonkey&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1'><img alt='Get it on Google Play' src='https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png'/></a>
299
+ <img src="https://linkmaker.itunes.apple.com/en-us/badge-lrg.svg?releaseDate=2019-10-03&kind=iossoftware&bubble=ios_apps" alt="" class="ios_app">
300
+ </div>
301
+ <div class="ios-app__wrap">
302
+ <p>Scan on your mobile device to view in the App Store</p>
303
+ <div class="ios_code"></div>
304
+ </div>
305
+ </div>
306
+ <div class="modal-overlays" id="modal-overlay">
307
+ </div>
308
+
admin/settings_page.php CHANGED
@@ -17,6 +17,8 @@ $update = false;
17
  $cg_notice = get_transient( 'cg_notice_off' );
18
  ?>
19
 
 
 
20
  <div class="wrap">
21
  <div class="row mobile_wrap">
22
  <div class="col s12 m9 x9 options">
@@ -104,7 +106,21 @@ $cg_notice = get_transient( 'cg_notice_off' );
104
  </div>
105
 
106
  <div class="col s12 m3 x3 ht-cc-admin-sidebar">
107
- <?php include_once 'commons/ht-cc-admin-sidebar.php'; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
108
  </div>
109
  </div>
110
 
17
  $cg_notice = get_transient( 'cg_notice_off' );
18
  ?>
19
 
20
+ <!-- style="display: flex; flex-wrap: wrap;" -->
21
+
22
  <div class="wrap">
23
  <div class="row mobile_wrap">
24
  <div class="col s12 m9 x9 options">
106
  </div>
107
 
108
  <div class="col s12 m3 x3 ht-cc-admin-sidebar">
109
+ <div class="side-bar">
110
+ <div class="phone">
111
+ <div class="mobile__wrapper">
112
+ <div class="logo_promo"></div>
113
+ <div class="text__wrap">
114
+ <div class="dot_icon">
115
+ <div class="white_circle"></div>
116
+ <div class="green_circle"></div>
117
+ </div>
118
+ <div class="dialog_block">Want to chat with your leads while you’re on the go? Download our mobile app!</div>
119
+ </div>
120
+ <div class="button_download_app">Download App</div>
121
+ </div>
122
+ </div>
123
+ </div>
124
  </div>
125
  </div>
126
 
inc/MobileMonkeyApi.php CHANGED
@@ -16,6 +16,7 @@ class MobileMonkeyApi
16
  private $bot_id;
17
  public $available_company;
18
  public $as_mm = false;
 
19
 
20
  private function getApiDomain()
21
  {
@@ -143,7 +144,7 @@ class MobileMonkeyApi
143
  ];
144
  $pagesObj = NULL;
145
  $pages = [];
146
- $response = wp_remote_get($this->getApiDomain() . 'api/facebook_pages/available_options?src=' . $this->getSrc().'&v=' . HTCC_VERSION.'.3', $args);
147
  $content = wp_remote_retrieve_body($response);
148
  if (!empty($content)) {
149
  $pagesObj = json_decode($content);
@@ -499,6 +500,9 @@ class MobileMonkeyApi
499
  update_option('htcc_options', $options);
500
  delete_transient( 'done-tab' );
501
  delete_transient( 'current-tab' );
 
 
 
502
  $done_tab = array(
503
  '1'=>"true",
504
  '2'=>"false",
@@ -1303,6 +1307,7 @@ class MobileMonkeyApi
1303
  $content = wp_remote_retrieve_body($response);
1304
  $connect_response = json_decode($content);
1305
  $code = wp_remote_retrieve_response_code( $response );
 
1306
  $type = "<style>#setting-error-settings_updated{display: none;}</style>";
1307
  if (isset($code) && $code == 200) {
1308
  $type ='';
@@ -1311,17 +1316,22 @@ class MobileMonkeyApi
1311
  $this->renderError('Error code: ' . $connect_response->error_code);
1312
  if (!empty($connect_response->errors)) {
1313
  foreach ($connect_response->errors as $error) {
1314
- $this->renderError('Error: ' . $error);
1315
  }
1316
  return $error;
1317
  }
1318
  } elseif (!empty($connect_response->errors)) {
1319
  foreach ($connect_response->errors as $error) {
1320
  if ($code==422||$code==401||$code==404){
1321
- delete_option('mobilemonkey_active_page_info');
1322
- break;
 
 
1323
  }
1324
  }
 
 
 
1325
  } else {
1326
  if ($point=="Welcome Message" && $code==422){
1327
  return true;
16
  private $bot_id;
17
  public $available_company;
18
  public $as_mm = false;
19
+ public $notice = false;
20
 
21
  private function getApiDomain()
22
  {
144
  ];
145
  $pagesObj = NULL;
146
  $pages = [];
147
+ $response = wp_remote_get($this->getApiDomain() . 'api/facebook_pages/available_options?src=' . $this->getSrc().'&limit=150&v=' . HTCC_VERSION.'.3', $args);
148
  $content = wp_remote_retrieve_body($response);
149
  if (!empty($content)) {
150
  $pagesObj = json_decode($content);
500
  update_option('htcc_options', $options);
501
  delete_transient( 'done-tab' );
502
  delete_transient( 'current-tab' );
503
+ delete_transient( 'cg_notice_off' );
504
+ delete_transient( 'promo_notice_off' );
505
+ delete_transient( 'lead_notice_off' );
506
  $done_tab = array(
507
  '1'=>"true",
508
  '2'=>"false",
1307
  $content = wp_remote_retrieve_body($response);
1308
  $connect_response = json_decode($content);
1309
  $code = wp_remote_retrieve_response_code( $response );
1310
+ /*wp_die(print_r($code));*/
1311
  $type = "<style>#setting-error-settings_updated{display: none;}</style>";
1312
  if (isset($code) && $code == 200) {
1313
  $type ='';
1316
  $this->renderError('Error code: ' . $connect_response->error_code);
1317
  if (!empty($connect_response->errors)) {
1318
  foreach ($connect_response->errors as $error) {
1319
+ $this->renderError('Error123: ' . $error);
1320
  }
1321
  return $error;
1322
  }
1323
  } elseif (!empty($connect_response->errors)) {
1324
  foreach ($connect_response->errors as $error) {
1325
  if ($code==422||$code==401||$code==404){
1326
+ if ($point!="Welcome Message") {
1327
+ delete_option('mobilemonkey_active_page_info');
1328
+ break;
1329
+ }
1330
  }
1331
  }
1332
+ }elseif ($code==404){
1333
+ delete_option('mobilemonkey_active_page_info');
1334
+ return false;
1335
  } else {
1336
  if ($point=="Welcome Message" && $code==422){
1337
  return true;