WP-Chatbot for Facebook Messenger Customer Chat - Version 4.4

Version Description

Bug fixes and stability

Download this release

Release Info

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

Code changes from version 4.3 to 4.4

admin/admin.php CHANGED
@@ -44,6 +44,7 @@ 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
 
@@ -108,4 +109,4 @@ function ht_cc_service_content_hide_ajax() {
108
  update_option( 'ht_cc_service_content', 'hide' );
109
 
110
  wp_die();
111
- }
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
+ add_action('wp_ajax_ht_cc_admin_sidebar__hide_mobile_app_banner', array($admin,'ht_cc_admin_sidebar__hide_mobile_app_banner'));
48
 
49
 
50
 
109
  update_option( 'ht_cc_service_content', 'hide' );
110
 
111
  wp_die();
112
+ }
admin/assets/css/admin-styles.css CHANGED
@@ -2356,6 +2356,7 @@ p.billed{
2356
  width: 100%;
2357
  height: 12px;
2358
  border-radius: 10px;
 
2359
  }
2360
  .percentage-bar__used-percentage{
2361
  height: 9px;
@@ -3058,6 +3059,19 @@ span.qa-question-result {
3058
  width: 85%;
3059
  }
3060
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
3061
  .mobile__wrapper{
3062
  display: flex;
3063
  flex-direction: column;
@@ -3067,6 +3081,18 @@ span.qa-question-result {
3067
  align-items: center;
3068
  width: 170px;
3069
  }
 
 
 
 
 
 
 
 
 
 
 
 
3070
 
3071
  .logo_promo{
3072
  background: url("../img/mmL_logo.png");
@@ -3120,3 +3146,204 @@ span.qa-question-result {
3120
  display: flex;
3121
  cursor: pointer;
3122
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2356
  width: 100%;
2357
  height: 12px;
2358
  border-radius: 10px;
2359
+ overflow: hidden;
2360
  }
2361
  .percentage-bar__used-percentage{
2362
  height: 9px;
3059
  width: 85%;
3060
  }
3061
  }
3062
+ @media (max-width: 520px) {
3063
+ .tab-link .limit__notice_tooltip{
3064
+ top: 60px;
3065
+ left: 2%;
3066
+ }
3067
+ .tab-link .limit__notice_tooltip:after{
3068
+ border-color: #FD397A transparent transparent transparent;
3069
+ top: -24px;
3070
+ left: 172px;
3071
+ transform: rotate(180deg);
3072
+ }
3073
+ }
3074
+
3075
  .mobile__wrapper{
3076
  display: flex;
3077
  flex-direction: column;
3081
  align-items: center;
3082
  width: 170px;
3083
  }
3084
+ .ht-cc-admin-sidebar__dismiss_button_container {
3085
+ position: relative;
3086
+ right: 36px;
3087
+ top: 20px;
3088
+ margin-left: -10px;
3089
+ }
3090
+ .ht-cc-admin-sidebar__dismiss_button_container .dismiss_button {
3091
+ cursor: pointer;
3092
+ color: #000;
3093
+ font-size: 14px;
3094
+ padding: 4px;
3095
+ }
3096
 
3097
  .logo_promo{
3098
  background: url("../img/mmL_logo.png");
3146
  display: flex;
3147
  cursor: pointer;
3148
  }
3149
+ .ios_code{
3150
+ background: url('../img/31c07c81b2d635598c3776cfb31eb240.png');
3151
+ margin-left: auto;
3152
+ margin-right: auto;
3153
+ height: 300px;
3154
+ width: 300px;
3155
+ }
3156
+ .promo-app__wrapper .android_app img{
3157
+ width: 270px;
3158
+ }
3159
+ .promo-app__wrapper .ios_app{
3160
+ width: 235px;
3161
+ cursor: pointer;
3162
+ }
3163
+ .promo-app__wrapper{
3164
+ text-align: center;
3165
+ margin-bottom: 25px;
3166
+ }
3167
+ .promo-app__wrapper a{
3168
+ display: block;
3169
+ }
3170
+ .promo-app__wrapper a:hover,.promo-app__wrapper a:active,.promo-app__wrapper a:focus{
3171
+ border: none;
3172
+ box-shadow: none;
3173
+ }
3174
+ .ios-app__wrap p {
3175
+ margin-top: 41px;
3176
+ }
3177
+ .ios-app__wrap{
3178
+ display: none;
3179
+ }
3180
+ .modal-overlays {
3181
+ position: fixed;
3182
+ margin-left: -20px;
3183
+ right: 0;
3184
+ height: auto;
3185
+ width: auto;
3186
+ background: #000;
3187
+ will-change: opacity;
3188
+ opacity: 0.4;
3189
+ z-index: 998;
3190
+ top: -25%;
3191
+ left: 0;
3192
+ bottom: 0;
3193
+ display: none;
3194
+ }
3195
+ #promo_app{
3196
+ z-index: 999;
3197
+ transition: all 0.5s ease;
3198
+ background-color: #FFFFFF;
3199
+ display: none;
3200
+ position: fixed;
3201
+ top: 30%;
3202
+ left: 0;
3203
+ right: 0;
3204
+ width: 563px;
3205
+ margin: 0 auto;
3206
+ color: #525252;
3207
+ border: 1px solid #000;
3208
+ border-radius: 10px;
3209
+ }
3210
+ #promo_app{
3211
+ border: none;
3212
+ width: 400px;
3213
+ height: auto;
3214
+ }
3215
+ #promo_app p{
3216
+ font-family: "Open Sans",sans-serif;
3217
+ font-style: normal;
3218
+ font-weight: bold;
3219
+ font-size: 18px;
3220
+ line-height: 25px;
3221
+ color: #525252;
3222
+ text-align: center;
3223
+ margin-top: 35px;
3224
+ }
3225
+ #promo_app .modal_close {
3226
+ background-size: contain;
3227
+ width: 15px;
3228
+ height: 15px;
3229
+ background-repeat: no-repeat;
3230
+ background-position: center;
3231
+ position: absolute;
3232
+ right: 12px;
3233
+ top: 12px;
3234
+ cursor: pointer;
3235
+ z-index: 999;
3236
+ }
3237
+ #promo_app .modal_close{
3238
+ color: #A6A3A3;
3239
+ }
3240
+ .limit__wrapper{
3241
+ background-color: #FD397A;
3242
+ width: 32px;
3243
+ height: 32px;
3244
+ display: flex;
3245
+ align-items: center;
3246
+ justify-content: center;
3247
+ border-radius: 50%;
3248
+ margin-left: 12px;
3249
+ }
3250
+ .limit_notice{
3251
+ height: 20px;
3252
+ width: 20px;
3253
+ border: 2px solid #fff;
3254
+ border-radius: 50%;
3255
+ display: flex;
3256
+ justify-content: center;
3257
+ }
3258
+ .limit_notice i {
3259
+ font-size: 14px;
3260
+ color: #fff;
3261
+ display: flex;
3262
+ align-items: center;
3263
+ line-height: 16px;
3264
+ }
3265
+ .limit__notice_tooltip{
3266
+ position: absolute;
3267
+ background-color: #FD397A;
3268
+ left: 100%;
3269
+ max-width: 300px;
3270
+ min-width: 280px;
3271
+ padding: 20px;
3272
+ height: auto;
3273
+ display: flex;
3274
+ border-radius: 7px;
3275
+ flex-direction: column;
3276
+ font-weight: 600;
3277
+ line-height: 22px;
3278
+ color: #FFFFFF;
3279
+ font-family: "Open Sans",sans-serif;
3280
+ z-index: 9;
3281
+ }
3282
+ .limit__notice_tooltip p{
3283
+ font-size: 16px;
3284
+
3285
+ }
3286
+ .limit__notice_tooltip p b{
3287
+ font-size: 30px;
3288
+ font-weight: 600;
3289
+ line-height: 14px;
3290
+ }
3291
+ .limit__button{
3292
+ color: #FD397A;
3293
+ font-family: "Open Sans",sans-serif;
3294
+ font-size: 15px;
3295
+ font-weight: bold;
3296
+ display: flex;
3297
+ line-height: 22px;
3298
+ background-color: #fff;
3299
+ text-align: center;
3300
+ width: 60%;
3301
+ justify-content: center;
3302
+ align-self: center;
3303
+ margin-top: 20px;
3304
+ padding: 10px;
3305
+ border-radius: 5px;
3306
+ }
3307
+ .limit__button:hover,.limit__button:focus{
3308
+ border: none;
3309
+ color: #FD397A;
3310
+ box-shadow:none;
3311
+ }
3312
+ .limit__notice_tooltip span{
3313
+ border-top: 1px solid #fff;
3314
+ padding-top: 10px;
3315
+ font-size: 14px;
3316
+ }
3317
+ .limit__notice_tooltip:after {
3318
+ content: "";
3319
+ position: absolute;
3320
+ width: 0;
3321
+ height: 0;
3322
+ border-width: 12px;
3323
+ border-style: solid;
3324
+ border-color: transparent #FD397A transparent transparent;
3325
+ top: 43%;
3326
+ left: -24px;
3327
+ }
3328
+ .limit-notify-close{
3329
+ position: absolute;
3330
+ right: 5px;
3331
+ top: 5px;
3332
+ width: 15px;
3333
+ height: 14px;
3334
+ cursor: pointer;
3335
+ }
3336
+ .limit-notify-close:before, .limit-notify-close:after{
3337
+ position: absolute;
3338
+ content: ' ';
3339
+ right: 7px;
3340
+ height: 13px;
3341
+ width: 3px;
3342
+ background-color: #fff;
3343
+ }
3344
+ .limit-notify-close:before{
3345
+ transform: rotate(45deg);
3346
+ }
3347
+ .limit-notify-close:after{
3348
+ transform: rotate(-45deg);
3349
+ }
admin/assets/img/exclamation.png ADDED
Binary file
admin/assets/js/admin.js CHANGED
@@ -972,7 +972,11 @@ jQuery(document).ready(function($){
972
  let current = $('.percentage-bar__card-used-number').data('value');
973
  let max = $('.percentage-bar__card-max-number').data('value');
974
  let wit = current/max*$('.percentage-bar__bar').width()+'px';
975
- $('.percentage-bar__used-percentage').css({'width':wit})
 
 
 
 
976
 
977
  $(document).on("click",".pro_button__link,#button_update", function(e) {
978
  e.preventDefault();
@@ -1130,6 +1134,9 @@ jQuery(document).ready(function($){
1130
  }
1131
  });
1132
  });
 
 
 
1133
  $(document).on("click",".add_qa_question", function( event ) {
1134
  event.preventDefault();
1135
  let fieldsetId = $(this).parents(".main-qa").find(".qa-question-result").last().attr("data-index");
@@ -1491,7 +1498,16 @@ jQuery(document).ready(function($){
1491
  }
1492
  });
1493
 
1494
-
 
 
 
 
 
 
 
 
 
1495
 
1496
 
1497
  });
972
  let current = $('.percentage-bar__card-used-number').data('value');
973
  let max = $('.percentage-bar__card-max-number').data('value');
974
  let wit = current/max*$('.percentage-bar__bar').width()+'px';
975
+ if (current>max){
976
+ $('.percentage-bar__used-percentage').css({'width':wit,'background-color':'red'})
977
+ }else {
978
+ $('.percentage-bar__used-percentage').css({'width':wit})
979
+ }
980
 
981
  $(document).on("click",".pro_button__link,#button_update", function(e) {
982
  e.preventDefault();
1134
  }
1135
  });
1136
  });
1137
+ $(document).on("click",".limit-notify-close", function( event ) {
1138
+ $('.limit__notice_tooltip').fadeOut(500, function(){ $(this).remove();});
1139
+ });
1140
  $(document).on("click",".add_qa_question", function( event ) {
1141
  event.preventDefault();
1142
  let fieldsetId = $(this).parents(".main-qa").find(".qa-question-result").last().attr("data-index");
1498
  }
1499
  });
1500
 
1501
+ $(document).on("click", ".button_download_app", function() {
1502
+ $('#promo_app').show();
1503
+ $('#promo_app').find(".ios-app__wrap").hide();
1504
+ $('#promo_app').find(".promo-app__wrapper").show();
1505
+ $('#modal-overlay').show();
1506
+ });
1507
+ $(document).on("click",".ios_app",function () {
1508
+ $(this).parent(".promo-app__wrapper").hide();
1509
+ $(this).parents("#promo_app").find('.ios-app__wrap').show();
1510
+ });
1511
 
1512
 
1513
  });
admin/class-htcc-admin.php CHANGED
@@ -219,7 +219,13 @@ if (!class_exists('HTCC_Admin')) :
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
 
219
  public function notice_promo_off()
220
  {
221
  $response= array('done'=>true);
222
+ set_transient( 'promo_notice_off', true);
223
+ wp_send_json_success ($response);
224
+ }
225
+ public function ht_cc_admin_sidebar__hide_mobile_app_banner()
226
+ {
227
+ $response= array('done'=>true);
228
+ set_transient( 'ht_cc_admin_sidebar__hide_mobile_app_banner', true);
229
  wp_send_json_success ($response);
230
  }
231
 
admin/commons/ht-cc-admin-limit-tooltip.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $limit = !$subscribe?1000:$limit;
3
+ $count = !$count?0:$count;
4
+ $percent = $count!=0 && $limit>0?number_format( ($count/$limit)*100, 0 ):0;
5
+ if ($percent>=80){ ?>
6
+ <?php
7
+ if ($is_wp){?>
8
+ <div class="limit__wrapper"><div class="limit_notice"><i class="fa fa-exclamation" aria-hidden="true"></i></div></div>
9
+ <div class="limit__notice_tooltip pro__limit">
10
+ <?php
11
+ if ($percent<=99){
12
+ ?>
13
+ <p>This page has reached <b><?php echo $percent?>%</b> of the annual send limit.</p>
14
+ <span>Bots will shut down soon! Upgrade to MobileMonkey PRO plan now to increase your send limit.</span>
15
+ <?php
16
+ }else{
17
+ ?>
18
+ <p>This page has exceeded the annual send limit.</p>
19
+ <span>Bots will shut down! Upgrade to MobileMonkey PRO now to continue sending messages.</span>
20
+ <?php
21
+ }
22
+ ?>
23
+ <a target="_blank" href="https://app.mobilemonkey.com/settings/billing" class="limit__button">Learn more</a>
24
+ <div class="limit-notify-close"></div>
25
+ </div>
26
+ <?php
27
+ }elseif(!$subscribe){?>
28
+ <div class="limit__wrapper"><div class="limit_notice"><i class="fa fa-exclamation" aria-hidden="true"></i></div></div>
29
+ <div class="limit__notice_tooltip free__limit">
30
+ <?php
31
+ if ($percent<=99){
32
+ ?>
33
+ <p>This page has reached <b><?php echo $percent?>%</b> of the monthly send limit.</p>
34
+ <span>Bots will shut down soon! Upgrade to WP-Chatbot PRO plan now to increase your send limit.</span>
35
+ <?php
36
+ }else{
37
+ ?>
38
+ <p>This page has exceeded the annual send limit.</p>
39
+ <span>Bots will shut down! Upgrade to WP-Chatbot PRO plan now to increase your send limit.</span>
40
+ <?php
41
+ }
42
+ ?>
43
+ <div id="button_update" class="limit__button">Upgrade now</div>
44
+ <div class="limit-notify-close"></div>
45
+ </div>
46
+ <?php
47
+
48
+ }
49
+ }
50
+ ?>
admin/commons/ht-cc-admin-settings-form.php CHANGED
@@ -12,12 +12,16 @@ $table = new MobileMonkey_Contacts_List_Table();
12
  $table->prepare_items();
13
  $curren = get_transient( 'current-tab' );
14
  $tab = get_transient( 'done-tab' );
15
- foreach ($tab as $key => $value) {
16
- if ($value == "true") {
17
- $tabs[$key] = 'done';
18
- } else {
19
- $tabs[$key]= '';
20
- }
 
 
 
 
21
  }
22
  $tabs[$curren] .= ' current';
23
 
@@ -38,8 +42,17 @@ $tabs[$curren] .= ' current';
38
  <span class="tab_header">Leads</span>
39
  <span class="tab_contacts__count"><?php echo $table->totalItems ?></span>
40
  </li>
41
- <li class="tab-link <?php echo $tabs[4] ?>" data-tab="tab-4">
42
  <span class="tab_header">Your Subscription</span>
 
 
 
 
 
 
 
 
 
43
  </li>
44
 
45
  </ul>
12
  $table->prepare_items();
13
  $curren = get_transient( 'current-tab' );
14
  $tab = get_transient( 'done-tab' );
15
+ if ($tab){
16
+ foreach ($tab as $key => $value) {
17
+ if ($value == "true") {
18
+ $tabs[$key] = 'done';
19
+ } else {
20
+ $tabs[$key]= '';
21
+ }
22
+ }
23
+ }else {
24
+ $tabs[1] = "done current";
25
  }
26
  $tabs[$curren] .= ' current';
27
 
42
  <span class="tab_header">Leads</span>
43
  <span class="tab_contacts__count"><?php echo $table->totalItems ?></span>
44
  </li>
45
+ <li class="tab-link <?php echo $tabs[4] ?>" style="position: relative;" data-tab="tab-4">
46
  <span class="tab_header">Your Subscription</span>
47
+ <?php
48
+
49
+ $limit = [
50
+ 'limit' => $wp_plan_info->outgoing_messages_limit,
51
+ 'count' => $message_statistic->count,
52
+ 'is_wp'=> $page_info['is_wp_subscribe'],
53
+ 'subscribe'=> $subscribe_info
54
+ ];
55
+ HT_CC::view('ht-cc-admin-limit-tooltip', $limit); ?>
56
  </li>
57
 
58
  </ul>
admin/settings_page.php CHANGED
@@ -15,13 +15,14 @@ $token = $this->api->connectMobileMonkey();
15
  $internal = $this->api->getActivePageId();
16
  $update = false;
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">
25
  <div class="mobilemonkey-logo">
26
  <?php
27
  if ($api->getActiveBotId()){
@@ -104,25 +105,52 @@ $cg_notice = get_transient( 'cg_notice_off' );
104
  ?>
105
 
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
 
127
 
128
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  $internal = $this->api->getActivePageId();
16
  $update = false;
17
  $cg_notice = get_transient( 'cg_notice_off' );
18
+ $hide_mobile_app_banner = get_transient( 'ht_cc_admin_sidebar__hide_mobile_app_banner' );
19
+ $main_css_classes = $hide_mobile_app_banner ? 'm12 x12' : 'm9 x9';
20
  ?>
21
 
22
  <!-- style="display: flex; flex-wrap: wrap;" -->
 
23
  <div class="wrap">
24
  <div class="row mobile_wrap">
25
+ <div class="col s12 <?php echo $main_css_classes ?>options ht-cc-admin__main">
26
  <div class="mobilemonkey-logo">
27
  <?php
28
  if ($api->getActiveBotId()){
105
  ?>
106
 
107
  </div>
108
+ <?php if ($hide_mobile_app_banner != true) { ?>
109
 
110
+ <div class="col s12 m3 x3 ht-cc-admin-sidebar">
111
+ <div class="side-bar">
112
+ <div class="phone">
113
+ <div class="mobile__wrapper">
114
+ <div class="logo_promo"></div>
115
+ <div class="text__wrap">
116
+ <div class="dot_icon">
117
+ <div class="white_circle"></div>
118
+ <div class="green_circle"></div>
119
+ </div>
120
+ <div class="dialog_block">Want to chat with your leads while you’re on the go? Download our mobile app!</div>
121
+ </div>
122
+ <div class="button_download_app">Download App</div>
123
+ </div>
124
+ <div class="ht-cc-admin-sidebar__dismiss_button_container">
125
+ <span class="button__wrapper_text dismiss_button"><i class="fa fa-times" aria-hidden="true"></i></span>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ </div>
130
+ </div>
131
 
132
 
133
+ </div>
134
+ <script>
135
+ jQuery(document).ready(function($){
136
+ $('.ht-cc-admin-sidebar .dismiss_button').on('click',function (e) {
137
+ $.ajax({
138
+ type: 'POST',
139
+ url: ajaxurl,
140
+ data: {
141
+ action:'ht_cc_admin_sidebar__hide_mobile_app_banner'
142
+ },
143
+ dataType: 'json',
144
+ success: function (data,response) {
145
+ $('.ht-cc-admin-sidebar .dismiss_button').parents('.ht-cc-admin-sidebar').fadeOut(300, function(){
146
+ $(this).remove();
147
+ $('.ht-cc-admin__main').removeClass('m9 x9').addClass('m12 x12');
148
+ });;
149
+
150
+ }
151
+ });
152
+ });
153
+ });
154
+
155
+ </script>
156
+ <?php } ?>
inc/MobileMonkeyApi.php CHANGED
@@ -501,7 +501,6 @@ class MobileMonkeyApi
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",
@@ -861,29 +860,31 @@ class MobileMonkeyApi
861
  $data_widget['fb_as_state'] = 0;
862
  update_option('htcc_as_options', $data_widget);
863
  }else {
864
- foreach ($options as $key => $value) {
865
- if (strpos($key, 'qa_') !== false) {
866
- if (!empty($value['phrases']) && !empty($value['bot_responses'])) {
867
- unset($options[$key]);
 
 
868
  }
869
  }
870
- }
871
- $data_widget = array_merge($options, $triggers);
872
- if (!$options) {
873
- foreach ($data_widget as $k => $v) {
874
- if (strpos($k, 'qa_') !== false) {
875
- $trig = false;
 
 
 
 
876
  }
877
  }
878
- if ($trig) {
879
- $data_widget['qa_1']['phrases'] = '';
880
- $data_widget['qa_1']['bot_responses'] = '';
881
- }
882
  }
883
- $data_widget['fb_welcome_message'] = $current_welcome_message;
884
- $data_widget['answering_service_mm_only_mode'] = true;
885
- $data_widget['advanced_triggers_present'] = $triggers['advanced_triggers_present'];
886
- update_option('htcc_as_options', $data_widget);
887
  }
888
  }
889
  if ($this->as_mm == false) {
@@ -919,6 +920,7 @@ class MobileMonkeyApi
919
  $data_widget['advanced_triggers_present'] = $triggers['advanced_triggers_present'];
920
  update_option('htcc_as_options', $data_widget);
921
  }else {
 
922
  foreach ($options as $key => $value) {
923
  if (strpos($key, 'qa_') !== false) {
924
  if (!empty($value['phrases']) && !empty($value['bot_responses'])) {
@@ -928,6 +930,7 @@ class MobileMonkeyApi
928
  }
929
  $data_widget['answering_service_mm_only_mode'] = empty($data_widget) ? true : '';
930
  $data_widget = array_merge($options, $triggers);
 
931
  if (!$options) {
932
  foreach ($data_widget as $k => $v) {
933
  if (strpos($k, 'qa_') !== false) {
@@ -1307,7 +1310,6 @@ class MobileMonkeyApi
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,7 +1318,7 @@ class MobileMonkeyApi
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
  }
@@ -1397,4 +1399,4 @@ class MobileMonkeyApi
1397
  $this->setPagination($contacts->pagination);
1398
  }
1399
  }
1400
- }
501
  delete_transient( 'done-tab' );
502
  delete_transient( 'current-tab' );
503
  delete_transient( 'cg_notice_off' );
 
504
  delete_transient( 'lead_notice_off' );
505
  $done_tab = array(
506
  '1'=>"true",
860
  $data_widget['fb_as_state'] = 0;
861
  update_option('htcc_as_options', $data_widget);
862
  }else {
863
+ if ($options){
864
+ foreach ($options as $key => $value) {
865
+ if (strpos($key, 'qa_') !== false) {
866
+ if (!empty($value['phrases']) && !empty($value['bot_responses'])) {
867
+ unset($options[$key]);
868
+ }
869
  }
870
  }
871
+ $data_widget = array_merge($options, $triggers);
872
+ if (!$options) {
873
+ foreach ($data_widget as $k => $v) {
874
+ if (strpos($k, 'qa_') !== false) {
875
+ $trig = false;
876
+ }
877
+ }
878
+ if ($trig) {
879
+ $data_widget['qa_1']['phrases'] = '';
880
+ $data_widget['qa_1']['bot_responses'] = '';
881
  }
882
  }
883
+ $data_widget['fb_welcome_message'] = $current_welcome_message;
884
+ $data_widget['answering_service_mm_only_mode'] = true;
885
+ $data_widget['advanced_triggers_present'] = $triggers['advanced_triggers_present'];
886
+ update_option('htcc_as_options', $data_widget);
887
  }
 
 
 
 
888
  }
889
  }
890
  if ($this->as_mm == false) {
920
  $data_widget['advanced_triggers_present'] = $triggers['advanced_triggers_present'];
921
  update_option('htcc_as_options', $data_widget);
922
  }else {
923
+ if ($options){
924
  foreach ($options as $key => $value) {
925
  if (strpos($key, 'qa_') !== false) {
926
  if (!empty($value['phrases']) && !empty($value['bot_responses'])) {
930
  }
931
  $data_widget['answering_service_mm_only_mode'] = empty($data_widget) ? true : '';
932
  $data_widget = array_merge($options, $triggers);
933
+ }
934
  if (!$options) {
935
  foreach ($data_widget as $k => $v) {
936
  if (strpos($k, 'qa_') !== false) {
1310
  $content = wp_remote_retrieve_body($response);
1311
  $connect_response = json_decode($content);
1312
  $code = wp_remote_retrieve_response_code( $response );
 
1313
  $type = "<style>#setting-error-settings_updated{display: none;}</style>";
1314
  if (isset($code) && $code == 200) {
1315
  $type ='';
1318
  $this->renderError('Error code: ' . $connect_response->error_code);
1319
  if (!empty($connect_response->errors)) {
1320
  foreach ($connect_response->errors as $error) {
1321
+ $this->renderError('Error: ' . $error);
1322
  }
1323
  return $error;
1324
  }
1399
  $this->setPagination($contacts->pagination);
1400
  }
1401
  }
1402
+ }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 5.2
4
  Requires PHP: 5.6
5
  Contributors: larrykim, yankovski
6
- Stable tag: 4.3
7
  Tags: messenger, customer chat plugin, customer chat, facebook customer chat, facebook chat, chatbot, messenger chatbot, messenger customer chat, facebook live chat, live chat, messenger live chat, facebook, facebook messenger, mobilemonkey
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -579,6 +579,9 @@ WP-Chatbot is extremely flexible, versatile, and compatible. Because it works se
579
 
580
  == Changelog ==
581
 
 
 
 
582
  = 4.3 =
583
  Enhance usability on notifications
584
 
3
  Tested up to: 5.2
4
  Requires PHP: 5.6
5
  Contributors: larrykim, yankovski
6
+ Stable tag: 4.4
7
  Tags: messenger, customer chat plugin, customer chat, facebook customer chat, facebook chat, chatbot, messenger chatbot, messenger customer chat, facebook live chat, live chat, messenger live chat, facebook, facebook messenger, mobilemonkey
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
579
 
580
  == Changelog ==
581
 
582
+ = 4.4 =
583
+ Bug fixes and stability
584
+
585
  = 4.3 =
586
  Enhance usability on notifications
587