WP-Chatbot for Facebook Messenger Customer Chat - Version 4.1.2

Version Description

= From Dashboard ( WordPress admin ) = * If plugin new version released - you can see 'update now' link at wp-admin -> plugins * click on 'update now'

= using FTP or similar = * Delete wp-chatbot folder - your setting will not lost. * unzip wp-chatbot file and * Upload "wp-chatbot" folder to the "/wp-content/plugins/" directory. * Activate the plugin through the "Plugins" menu in WordPress.

Download this release

Release Info

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

Code changes from version 4.0.9 to 4.1.2

admin/admin.php CHANGED
@@ -23,9 +23,19 @@ require_once('class-htcc-enqueue.php');
23
 
24
 
25
  $admin = new HTCC_Admin();
 
26
  add_action('admin_menu', array( $admin, 'htcc_options_page') );
27
  add_action( 'admin_init', array( $admin, 'htcc_custom_settings' ) );
28
- add_action('admin_init', 'general_admin_notice');
 
 
 
 
 
 
 
 
 
29
 
30
 
31
  #premium
@@ -35,8 +45,9 @@ if ( 'true' == HTCC_PRO ) {
35
  }
36
 
37
 
38
- function general_admin_notice(){
39
- if ($_GET['activate']) {
 
40
  if( version_compare( get_bloginfo('version'), HTCC_WP_MIN_VERSION, '<') ) {
41
  echo '<style>.update-nag, .updated, .error, .is-dismissible ,.settings{ display: none; }</style>';
42
  echo '<style>.settings{ display: block; }</style><div class="updated error is-dismissible" style="display: block">
23
 
24
 
25
  $admin = new HTCC_Admin();
26
+ $api = new MobileMonkeyApi();
27
  add_action('admin_menu', array( $admin, 'htcc_options_page') );
28
  add_action( 'admin_init', array( $admin, 'htcc_custom_settings' ) );
29
+ add_action( 'admin_init', array( $admin, 'htcc_incomplete_setup' ) );
30
+ add_action('admin_init', 'htcc_admin_notice');
31
+ add_action('admin_notices', array( $admin, 'example_admin_notice'));
32
+ add_action('wp_ajax_send_done', array($admin,'set_tab_done'));
33
+ add_action('wp_ajax_get_done', array($admin,'get_tab_done'));
34
+ add_action('wp_ajax_set_current_tab', array($admin,'set_current_tab'));
35
+ add_action('wp_ajax_create_subscribe', array($api,'create_subscribe'));
36
+ add_action('wp_ajax_cancel_subscribe', array($api,'cancel_subscribe'));
37
+
38
+
39
 
40
 
41
  #premium
45
  }
46
 
47
 
48
+ function htcc_admin_notice(){
49
+
50
+ if (isset($_GET['activate'])&&($_GET['activate'])) {
51
  if( version_compare( get_bloginfo('version'), HTCC_WP_MIN_VERSION, '<') ) {
52
  echo '<style>.update-nag, .updated, .error, .is-dismissible ,.settings{ display: none; }</style>';
53
  echo '<style>.settings{ display: block; }</style><div class="updated error is-dismissible" style="display: block">
admin/assets/css/admin-styles.css CHANGED
@@ -6,7 +6,6 @@
6
  .submit {
7
  position: sticky !important;
8
  bottom: 1px;
9
- float: right;
10
  }
11
 
12
 
@@ -38,9 +37,7 @@
38
  }
39
 
40
  .connected-page {
41
- padding: 15px;
42
- background: #eaeaea;
43
- margin-bottom: 30px;
44
  }
45
 
46
  .connected-page .connected-page-title {
@@ -53,11 +50,13 @@
53
  color: green;
54
  }
55
 
56
- .connected-page .connected-page-settings {
57
  position: relative;
 
58
  }
59
 
60
- .connected-page .connected-page-settings a {
 
61
  background-color: #ca4646;
62
  display: inline-block;
63
  padding: 3px 8px;
@@ -67,7 +66,7 @@
67
  border-radius: 5px;
68
  }
69
 
70
- .connected-page .connected-page-settings a:hover {
71
  color: #3a3a3a;
72
  background: #e8e8e8;
73
  }
@@ -129,7 +128,8 @@
129
 
130
  .logout-mobilemonkey {
131
  text-align: right;
132
- margin: 15px;
 
133
  }
134
 
135
  .logout-mobilemonkey a {
@@ -233,18 +233,55 @@
233
  background: url(../img/lazyload.svg) center no-repeat;
234
  width: 100%;
235
  bottom: 0;
 
 
 
 
236
  }
237
 
238
  .connect-page .lazyload, .connected-page-settings .lazyload {
239
  top: -8px;
 
240
  }
241
 
242
  .active-page-info {
243
  display: flex;
244
- justify-content: space-between;
 
 
 
 
 
 
 
 
245
  align-items: center;
246
  }
247
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  /* .active-page-image, .active-page-info {
249
  display: inline-block;
250
  vertical-align: middle;
@@ -339,57 +376,10 @@
339
  }
340
 
341
 
342
- .toc-tab-box h3.acc-title {
343
- color: #002d5b;
344
- background: #F3FAFD;
345
- padding: 20px 0px 20px 30px;
346
- font-size: 20px;
347
- font-weight: 400;
348
- margin: 0px;
349
- margin-bottom: 4px;
350
- cursor: pointer;
351
- position: relative;
352
- transition: all 0.5s ease;
353
- width: 100%;
354
- float: left;
355
- }
356
-
357
- .toc-tab-box table.form-table, .acc-content {
358
- width: 100%;
359
- margin-bottom: 4px;
360
- float: left;
361
- padding: 15px 30px 30px 60px;
362
- font-size: 14px;
363
- position: relative;
364
- overflow: hidden;
365
- background-color: #FFFFFF;
366
- }
367
-
368
 
369
- .step_fa {
370
- float: right;
371
- margin-right: 20px;
372
- font-size: 48px;
373
- font-weight: bolder;
374
- color: #666;
375
- vertical-align: middle;
376
- }
377
 
378
- .circle {
379
- width: 50px;
380
- height: 50px;
381
- border-radius: 25px;
382
- color: #fff;
383
- background: #647BE0;
384
- display: inline-block;
385
- font-size: 35px;
386
- line-height: 42px;
387
- text-align: center;
388
- vertical-align: middle;
389
- margin-right: 20px;
390
- }
391
 
392
- .answering-service .switch {
393
  position: relative;
394
  display: inline-block;
395
  width: 60px;
@@ -491,54 +481,46 @@ body .toc-tab-box .button {
491
  .toc-tab-box .form-table th {
492
  width: 1px;
493
  }
 
 
 
494
 
 
 
 
495
 
496
- .toc-tab-box .answering-service .mm_only h6 {
497
  line-height: 1.6rem;
498
- margin: 0px;
499
  font-weight: 600;
500
  font-size: 16px;
501
  letter-spacing: 1px;
502
  }
503
 
504
- .mm_only a.button {
505
- margin-top: 20px;
506
  height: auto;
507
- background-color: darkgreen;
508
- padding: 25px 40px;
509
- border: 1px solid #000;
510
  color: #fff;
511
  }
512
 
513
- .mm_only a.button:active, .mm_only a.button:focus {
514
- background-color: darkgreen;
515
- border: 1px solid #000;
516
- color: #fff;
517
- }
518
 
519
- .test-bot-button {
520
- float: right;
521
- }
522
 
523
- .acc-content .testchat {
524
- float: right;
525
- background-color: #6071fb;
526
- color: #FFFFFF;
527
- box-shadow: none;
528
- border: 0px;
529
  }
530
-
531
- .acc-content .button.testchat {
532
- padding: 15px;
533
- margin-right: 8px;
534
- margin-bottom: 2px;
535
  }
536
 
537
- .acc-content .testchat:hover,.button.testchat:active {
538
- background-color: #6071fb;
539
- color: #FFFFFF;
540
  }
541
 
 
542
  .test-bot-button__button-wrapper {
543
  height: 29px;
544
  width: 137px;
@@ -570,13 +552,14 @@ body .toc-tab-box .button {
570
  position: absolute;
571
  left: 0;
572
  top: 0;
573
- width: 135px;
574
  padding-right: 0px;
575
  z-index: 2;
576
- padding-left: 12px;
577
  -webkit-transition: background-color .3s ease-in-out;
578
  transition: background-color .3s ease-in-out;
579
  cursor: pointer;
 
580
  }
581
 
582
  .fb_iframe_widget span {
@@ -586,4 +569,1708 @@ body .toc-tab-box .button {
586
  }
587
  .sp-input{
588
  text-transform: uppercase;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
589
  }
6
  .submit {
7
  position: sticky !important;
8
  bottom: 1px;
 
9
  }
10
 
11
 
37
  }
38
 
39
  .connected-page {
40
+ padding: 0 15px 15px 0;
 
 
41
  }
42
 
43
  .connected-page .connected-page-title {
50
  color: green;
51
  }
52
 
53
+ .connected-page-settings {
54
  position: relative;
55
+ float: right;
56
  }
57
 
58
+ .connected-page-settings #button_disconnect_page {
59
+ cursor: pointer;
60
  background-color: #ca4646;
61
  display: inline-block;
62
  padding: 3px 8px;
66
  border-radius: 5px;
67
  }
68
 
69
+ .connected-page-settings #button_disconnect_page:hover {
70
  color: #3a3a3a;
71
  background: #e8e8e8;
72
  }
128
 
129
  .logout-mobilemonkey {
130
  text-align: right;
131
+ margin: 0 0 15px 0;
132
+ overflow: hidden;
133
  }
134
 
135
  .logout-mobilemonkey a {
233
  background: url(../img/lazyload.svg) center no-repeat;
234
  width: 100%;
235
  bottom: 0;
236
+ left: 0;
237
+ }
238
+ .save_change{
239
+ position: relative;
240
  }
241
 
242
  .connect-page .lazyload, .connected-page-settings .lazyload {
243
  top: -8px;
244
+
245
  }
246
 
247
  .active-page-info {
248
  display: flex;
249
+ align-items: flex-start;
250
+ flex-direction: column;
251
+ }
252
+ .connect_check .fa{
253
+ display: inline;
254
+ }
255
+ .page_name__wrap{
256
+ display: flex;
257
+ flex-direction: row;
258
  align-items: center;
259
  }
260
+ span.pro,span.free{
261
+ padding: 3px 10px 3px 10px;
262
+ width: 50px;
263
+ height: 25px;
264
+ color: #FFFFFF;
265
+ font-family: "Open Sans",sans-serif;
266
+ font-size: 13px;
267
+ font-weight: bold;
268
+ line-height: 19px;
269
+ text-align: center;
270
+ border-radius: 7px;
271
+ margin-left: 11px;
272
+ background: -webkit-gradient(linear, left top, right top, from(#db8700), to(#f0b537));
273
+ background: linear-gradient(to right, #db8700 0%, #f0b537 100%);
274
+ background: -webkit-linear-gradient(left, #db8700 0%, #f0b537 100%);
275
+ }
276
+ span.pro{
277
+ background: -webkit-gradient(linear, left top, right top, from(#db8700), to(#f0b537));
278
+ background: linear-gradient(to right, #db8700 0%, #f0b537 100%);
279
+ background: -webkit-linear-gradient(left, #db8700 0%, #f0b537 100%);
280
+ }
281
+ span.free{
282
+ background: none;
283
+ background-color: #C8C8CE;
284
+ }
285
  /* .active-page-image, .active-page-info {
286
  display: inline-block;
287
  vertical-align: middle;
376
  }
377
 
378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
379
 
 
 
 
 
 
 
 
 
380
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
 
382
+ .switch {
383
  position: relative;
384
  display: inline-block;
385
  width: 60px;
481
  .toc-tab-box .form-table th {
482
  width: 1px;
483
  }
484
+ .form-table td p{
485
+ display: block;
486
+ }
487
 
488
+ .form-table{
489
+ position: relative;
490
+ }
491
 
492
+ .mm_only_block h6 {
493
  line-height: 1.6rem;
494
+ margin: 0 0 20px 0;
495
  font-weight: 600;
496
  font-size: 16px;
497
  letter-spacing: 1px;
498
  }
499
 
500
+ .mm_only_block a.go_mm{
 
501
  height: auto;
502
+ padding: 5px 15px;
503
+ border-radius: 4px;
 
504
  color: #fff;
505
  }
506
 
 
 
 
 
 
507
 
 
 
 
508
 
509
+ .mm_only_block a.go_mm{
510
+ background-color: #324ef8;
 
 
 
 
511
  }
512
+ .mm_only_block .but__wrap{
513
+ margin-top: 20px;
514
+ display: flex;
515
+ flex-direction: row;
 
516
  }
517
 
518
+ .test-bot-button {
519
+ position: absolute;
520
+ right: 0;
521
  }
522
 
523
+
524
  .test-bot-button__button-wrapper {
525
  height: 29px;
526
  width: 137px;
552
  position: absolute;
553
  left: 0;
554
  top: 0;
555
+ width: 140px;
556
  padding-right: 0px;
557
  z-index: 2;
558
+ padding-left: 8px;
559
  -webkit-transition: background-color .3s ease-in-out;
560
  transition: background-color .3s ease-in-out;
561
  cursor: pointer;
562
+ font-family: "Open Sans", sans-serif;
563
  }
564
 
565
  .fb_iframe_widget span {
569
  }
570
  .sp-input{
571
  text-transform: uppercase;
572
+ }
573
+
574
+
575
+
576
+ body {
577
+ margin-top: 100px;
578
+ font-family: 'Trebuchet MS', serif;
579
+ line-height: 1.6;
580
+ background-color: #efefef;
581
+ }
582
+
583
+ .step-wrapper {
584
+ margin: 0 auto;
585
+ background-color: #ffffff;
586
+ border-radius: 10px;
587
+ margin-bottom: 100px;
588
+ -webkit-box-shadow: 0px 0px 5px -2px rgba(0, 0, 0, 0.75);
589
+ box-shadow: 0px 0px 5px -2px rgba(0, 0, 0, 0.75);
590
+ }
591
+
592
+ .step-wrapper .tab_header {
593
+ display: -webkit-box;
594
+ display: -ms-flexbox;
595
+ display: flex;
596
+ -webkit-box-align: center;
597
+ -ms-flex-align: center;
598
+ align-items: center;
599
+ background-color: #f7f8fa;
600
+ }
601
+ .step-wrapper .tab-link.current span.tab_header{
602
+ background-color: #ffffff;
603
+ }
604
+ .step-wrapper .tab_header .setup_statement {
605
+ width: auto;
606
+ margin-left: auto;
607
+ margin-right: 2em;
608
+ font-size: 18px;
609
+ text-transform: uppercase;
610
+ color: #ca4646;
611
+ font-weight: 600;
612
+ }
613
+
614
+ .step-wrapper ul.tabs_wrapper {
615
+ margin: 0px;
616
+ padding: 0px;
617
+ list-style: none;
618
+ border-radius: 12px;
619
+
620
+ }
621
+
622
+ .step-wrapper ul li {
623
+ color: #222;
624
+ display: -ms-inline-flexbox;
625
+ display: inline-flex;
626
+ -webkit-box-align: center;
627
+ -ms-flex-align: center;
628
+ align-items: center;
629
+ padding: 0 1em;
630
+ font-size: 18px;
631
+ cursor: pointer;
632
+ margin-bottom: 0px;
633
+ height: 50px;
634
+ }
635
+
636
+ .step-wrapper ul li .tab_number {
637
+ width: 30px;
638
+ height: 30px;
639
+ display: block;
640
+ background-color: #fff;
641
+ display: -webkit-box;
642
+ display: -ms-flexbox;
643
+ display: flex;
644
+ -webkit-box-align: center;
645
+ -ms-flex-align: center;
646
+ align-items: center;
647
+ -webkit-box-pack: center;
648
+ -ms-flex-pack: center;
649
+ justify-content: center;
650
+ border-radius: 50%;
651
+ color: #3c59e4;
652
+ margin-right: 0.7rem;
653
+ border: 2px solid #3c59e4;
654
+ }
655
+
656
+ .step-wrapper ul li .tab_contacts__count {
657
+ margin-left: 0.5em;
658
+ background-color: #1ac9b7;
659
+ padding: 0.1em 0.8em;
660
+ font-size: 14px;
661
+ color: #fff;
662
+ border-radius: 5px;
663
+ }
664
+
665
+ .step-wrapper ul li.current {
666
+ background-color: #fff;
667
+ color: #222;
668
+ border: 2px solid #3c59e4;
669
+ border-bottom: 0;
670
+ border-top-left-radius: 5px;
671
+ border-top-right-radius: 5px;
672
+ height: 52px;
673
+ }
674
+ .step-wrapper ul li.done .tab_number{
675
+ background-color: #3c59e4;
676
+ color: #fff;
677
+ border: 2px solid #3c59e4;
678
+ }
679
+ /*.step-wrapper ul li.done.incomplete{
680
+ pointer-events: none;
681
+ opacity: 0.6;
682
+ }*/
683
+ .step-wrapper ul li.current .tab_number {
684
+ background-color: #3c59e4;
685
+ color: #fff;
686
+ border: 2px solid #3c59e4;
687
+ }
688
+
689
+
690
+ .tab-content {
691
+ display: none;
692
+ border-bottom-right-radius: 5px;
693
+ border-bottom-left-radius: 5px;
694
+ }
695
+
696
+ .tab-content .tab-content__wrapper {
697
+ background: #fff;
698
+ padding: 1em 2em;
699
+ border-bottom-right-radius: 10px;
700
+ border-bottom-left-radius: 10px;
701
+ }
702
+
703
+ .tab-content.current {
704
+ display: inherit;
705
+ }
706
+
707
+ .tab-content h1 {
708
+ color: #525252;
709
+ font-family: "Open Sans",sans-serif;
710
+ font-size: 36px;
711
+ font-weight: bold;
712
+ line-height: 49px;
713
+ margin: 0 0 0.7em;
714
+ }
715
+
716
+ .tab-content h3 {
717
+ text-transform: uppercase;
718
+ color: #525252;
719
+ font-family: "Open Sans",sans-serif;
720
+ font-size: 16px;
721
+ font-weight: 800;
722
+ letter-spacing: 0.15px;
723
+ line-height: 22px;
724
+ margin-bottom: 0;
725
+ }
726
+
727
+ .tab-content p {
728
+ color: #949494;
729
+ font-family: "Open Sans",sans-serif;
730
+ font-size: 16px;
731
+ line-height: 22px;
732
+ margin: 0.7em 0;
733
+ }
734
+
735
+ .tab-content textarea, .tab-content input[type=text]:not(.browser-default) {
736
+ padding: 20px;
737
+ width: 100%;
738
+ border: 1px solid #979797;
739
+ margin: .5em 0;
740
+ line-height: 20px;
741
+ border-radius: 5px;
742
+ font-size: 16px;
743
+ -webkit-box-sizing: border-box;
744
+ box-sizing: border-box;
745
+ }
746
+
747
+ .tab-content .input-field {
748
+ display: -webkit-box;
749
+ display: -ms-flexbox;
750
+ display: flex;
751
+ -webkit-box-orient: vertical;
752
+ -webkit-box-direction: normal;
753
+ -ms-flex-direction: column;
754
+ flex-direction: column;
755
+ width: 100%;
756
+ }
757
+
758
+ .tab-content .input-field__email input[type=email]:not(.browser-default) {
759
+ width: 250px;
760
+ padding: .5em;
761
+ background-color: #e7e7e7;
762
+ -webkit-box-sizing: border-box;
763
+ box-sizing: border-box;
764
+ }
765
+
766
+ .tab-content .upgrade_button {
767
+ padding: .7em;
768
+ border: none;
769
+ border-radius: 5px;
770
+ color: #fff;
771
+ background: -webkit-gradient(linear, left top, right top, from(#db8700), to(#f0b537));
772
+ background: linear-gradient(to right, #db8700 0%, #f0b537 100%);
773
+ background: -webkit-linear-gradient(left, #db8700 0%, #f0b537 100%);
774
+ font-size: 14px;
775
+ font-weight: 600;
776
+ text-decoration: none;
777
+ }
778
+
779
+ .tab-content .tab-content__footer {
780
+ margin-top: 50px;
781
+ display: -webkit-box;
782
+ display: -ms-flexbox;
783
+ display: flex;
784
+ -webkit-box-pack: end;
785
+ -ms-flex-pack: end;
786
+ justify-content: flex-end;
787
+ }
788
+
789
+ .tab-content .button-primary{
790
+ padding: 10px 30px;
791
+ background-color: #324ef8;
792
+ border-radius: 5px;
793
+ color: #fff;
794
+ text-decoration: none;
795
+ text-transform: uppercase;
796
+ font-size: 16px;
797
+ height: auto;
798
+ border: none;
799
+ width: auto;
800
+ }
801
+ p.submit{
802
+ margin-top: 30px;
803
+ text-align: right;
804
+ width: 100%;
805
+ }
806
+ .tab-content .button-primary:hover,.tab-content .button-primary:active,.tab-content .button-primary:focus {
807
+ opacity: 0.75;
808
+ background-color: #324ef8;
809
+ border: none;
810
+ }
811
+
812
+
813
+ .as_row {
814
+ display: -webkit-box;
815
+ display: -ms-flexbox;
816
+ display: flex;
817
+ -webkit-box-orient: horizontal;
818
+ -webkit-box-direction: normal;
819
+ -ms-flex-direction: row;
820
+ flex-direction: row;
821
+ -webkit-box-align: center;
822
+ -ms-flex-align: center;
823
+ align-items: center;
824
+ }
825
+
826
+ .as_row .switch {
827
+ position: relative;
828
+ display: inline-block;
829
+ width: 52px;
830
+ height: 27px;
831
+ margin: 0;
832
+ margin-right: 20px;
833
+ }
834
+
835
+ .as_row .switch input {
836
+ opacity: 0;
837
+ width: 0;
838
+ height: 0;
839
+ }
840
+
841
+ .as_row .slider {
842
+ position: absolute;
843
+ cursor: pointer;
844
+ top: 0;
845
+ left: 0;
846
+ right: 0;
847
+ bottom: 0;
848
+ background-color: #ccc;
849
+ -webkit-transition: .4s;
850
+ transition: .4s;
851
+ }
852
+
853
+ .as_row .slider:before {
854
+ position: absolute;
855
+ content: "";
856
+ height: 19px;
857
+ width: 19px;
858
+ left: 4px;
859
+ bottom: 4px;
860
+ background-color: white;
861
+ -webkit-transition: .4s;
862
+ transition: .4s;
863
+ }
864
+
865
+ .as_row input:checked + .slider {
866
+ background-color: #2196F3;
867
+ }
868
+
869
+ .as_row input:focus + .slider {
870
+ -webkit-box-shadow: 0 0 1px #2196F3;
871
+ box-shadow: 0 0 1px #2196F3;
872
+ }
873
+
874
+ .as_row input:checked + .slider:before {
875
+ -webkit-transform: translateX(25px);
876
+ transform: translateX(25px);
877
+ }
878
+
879
+ .as_row .slider.round {
880
+ border-radius: 34px;
881
+ }
882
+
883
+ .as_row .slider.round:before {
884
+ border-radius: 50%;
885
+ }
886
+
887
+ .customization_button__wrapper, .pro_button__wrapper {
888
+ background: -webkit-gradient(linear, left top, right top, from(#3d5afe), to(#7c4dff));
889
+ background: linear-gradient(to right, #3d5afe 0%, #7c4dff 100%);
890
+ padding: 1em 1.5em;
891
+ border-radius: 18px;
892
+ -webkit-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.75);
893
+ box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.75);
894
+ }
895
+ .pro_button__wrapper{
896
+ position: absolute;
897
+ display: flex;
898
+ align-items: center;
899
+ top: -4px;
900
+ width: 107%;
901
+ height: 60px;
902
+ left: -15px;
903
+ }
904
+
905
+ .customization_button__wrapper .customization_button__link, .pro_button__wrapper .pro_button__link {
906
+ text-decoration: none;
907
+ }
908
+ .pro_button__wrapper .pro_button__link{
909
+ width: 100%;
910
+ }
911
+ .pro_button__wrapper .pro_button__link:focus{
912
+ border: 0;
913
+ box-shadow: none;
914
+ }
915
+
916
+ .customization_button__wrapper .customization_button__image {
917
+ background-image: url("../img/monkey_head.png");
918
+ background-size: contain;
919
+ width: 45px;
920
+ height: 45px;
921
+ display: block;
922
+ background-repeat: no-repeat;
923
+ background-position: center;
924
+ margin: 0 0.3em;
925
+ }
926
+
927
+ .customization_button__wrapper .customization_button,.pro_button__wrapper .pro_button {
928
+ display: -webkit-box;
929
+ display: -ms-flexbox;
930
+ display: flex;
931
+ -webkit-box-pack: justify;
932
+ -ms-flex-pack: justify;
933
+ justify-content: space-between;
934
+ -webkit-box-align: center;
935
+ -ms-flex-align: center;
936
+ align-items: center;
937
+ }
938
+ .pro_button__wrapper .pro_button{
939
+ display: flex;
940
+ justify-content: space-between;
941
+ }
942
+
943
+ .customization_button__wrapper .customization_button .customization_button__content,.pro_button__wrapper .pro_button .pro_button__content {
944
+ display: -webkit-box;
945
+ display: -ms-flexbox;
946
+ display: flex;
947
+ -webkit-box-align: center;
948
+ -ms-flex-align: center;
949
+ align-items: center;
950
+ color: #fff;
951
+ font-size: 22px;
952
+ font-weight: bold;
953
+ line-height: 30px;
954
+ }
955
+
956
+ .customization_button__wrapper .customization_button__action, .pro_button__wrapper .pro_button__action{
957
+ padding: 1em 2em;
958
+ background-color: #fff;
959
+ border-radius: 10px;
960
+ display: -webkit-box;
961
+ display: -ms-flexbox;
962
+ display: flex;
963
+ -webkit-box-align: center;
964
+ -ms-flex-align: center;
965
+ align-items: center;
966
+ }
967
+ .pro_button__wrapper .pro_button__action{
968
+ padding: 0.6rem 2rem;
969
+ }
970
+ .customization_button__wrapper .customization_button__action .button_action__text , .pro_button__wrapper .pro_button_action__text{
971
+ font-size: 18px;
972
+ font-weight: 800;
973
+ line-height: 24px;
974
+ text-transform: uppercase;
975
+ color: #7e74fe;
976
+ }
977
+
978
+ .customize_section input, .customize_section select{
979
+ width: 30%;
980
+ }
981
+ .select-1{
982
+ margin: 15px 0;
983
+ }
984
+
985
+ .customize_section input.select_numbers, .customize_section select.select_numbers {
986
+ width: 100px;
987
+ }
988
+
989
+ .customize_section .greeting_display__wrapper span {
990
+ color: #949494;
991
+ font-family: "Open Sans",sans-serif;
992
+ font-size: 16px;
993
+ line-height: 22px;
994
+ margin-left: 1.2em;
995
+ }
996
+
997
+ .list_tabs__button {
998
+ display: none;
999
+
1000
+ background-size: contain;
1001
+ width: 20px;
1002
+ height: 20px;
1003
+ background-repeat: no-repeat;
1004
+ background-position: center;
1005
+ }
1006
+
1007
+ .list_tabs__button .list_tabs {
1008
+ display: none;
1009
+ }
1010
+ .form-table p.description{
1011
+ font-style: normal;
1012
+ }
1013
+ #to_pro,#unsaved_option, #pro_option,#cancel {
1014
+ z-index: 999;
1015
+ transition: all 0.5s ease;
1016
+ background-color: #FFFFFF;
1017
+ display: none;
1018
+ position: fixed;
1019
+ top: 30%;
1020
+ left: 0;
1021
+ right: 0;
1022
+ width: 563px;
1023
+ margin: 0 auto;
1024
+ color: #525252;
1025
+ border: 1px solid #000;
1026
+ border-radius: 10px;
1027
+ }
1028
+
1029
+ #to_pro .modal_close,#unsaved_option .modal_close,#pro_option .modal_close,#cancel .modal_close{
1030
+ background-size: contain;
1031
+ width: 15px;
1032
+ height: 15px;
1033
+ background-repeat: no-repeat;
1034
+ background-position: center;
1035
+ position: absolute;
1036
+ right: 12px;
1037
+ top: 12px;
1038
+ cursor: pointer;
1039
+ z-index: 999;
1040
+ }
1041
+
1042
+ #to_pro .upgrade__wrapper,#unsaved_option .unsaved__wrapper,#cancel .cancel__wrapper{
1043
+ position: relative;
1044
+ height: 302px;
1045
+ padding-top: 1em;
1046
+ }
1047
+
1048
+ #to_pro .upgrade__content,#unsaved_option .unsaved__content,#cancel .cancel__content{
1049
+ padding: 1.5em;
1050
+ }
1051
+
1052
+
1053
+
1054
+ #to_pro .upgrade__button, #unsaved_option .unsaved__button,#cancel .cancel__button{
1055
+ padding: 1.5em 2em;
1056
+ text-align: center;
1057
+ position: absolute;
1058
+ width: 100%;
1059
+ max-width: 564px;
1060
+ bottom: 0px;
1061
+ display: flex;
1062
+ justify-content: flex-end;
1063
+ align-items: baseline;
1064
+ }
1065
+ #unsaved_option .unsaved__button{
1066
+ flex-direction: row-reverse;
1067
+ justify-content: flex-start;
1068
+ }
1069
+
1070
+ #to_pro .upgrade__button .reds,#unsaved_option .unsaved__button .reds,#cancel .cancel__button .reds{
1071
+ padding: 5px 15px;
1072
+ background-color: #ca4646;
1073
+ border-radius: 5px;
1074
+ color: #fff;
1075
+ text-decoration: none;
1076
+ text-transform: uppercase;
1077
+ font-size: 16px;
1078
+ border: none;
1079
+ flex-basis: 25%;
1080
+ position: relative;
1081
+ margin: 0 10px;
1082
+ }
1083
+ #cancel .cancel__button .reds{
1084
+ flex-basis: 40%;
1085
+ }
1086
+ .subscribe_succes_cancel{
1087
+ font-size: 19px;
1088
+ padding: 20px;
1089
+ height: 80%;
1090
+ display: flex;
1091
+ align-items: center;
1092
+ }
1093
+ #to_pro .upgrade__button .reds:hover,#unsaved_option .unsaved__button .reds:hover,#cancel .cancel__button .reds:hover{
1094
+ opacity: 0.75;
1095
+ background-color: #ca4646;
1096
+ border: none;
1097
+ }
1098
+ #unsaved_option .unsaved__button #discard_button{
1099
+ background-color: #fff;
1100
+ color: #ca4646;
1101
+ }
1102
+ #unsaved_option .unsaved__button #discard_button:hover{
1103
+ text-decoration: underline;
1104
+ background-color: #fff;
1105
+ opacity: 1;
1106
+ }
1107
+ #unsaved_option .unsaved__button #discard_button:focus{
1108
+ box-shadow: none;
1109
+ }
1110
+ .modal a.blues{
1111
+ cursor: pointer;
1112
+ padding: 5px 15px;
1113
+ background-color: #324ef8;
1114
+ border-radius: 5px;
1115
+ color: #fff;
1116
+ text-decoration: none;
1117
+ font-size: 16px;
1118
+ border: none;
1119
+ margin: 0 10px;
1120
+ position: relative;
1121
+ }
1122
+ .modal .mm__content{
1123
+ color: #525252;
1124
+ }
1125
+ .modal a.gray{
1126
+ padding: 5px 15px;
1127
+ border-radius: 5px;
1128
+ background-color: gray;
1129
+ cursor: pointer;
1130
+ color: #fff;
1131
+ text-decoration: none;
1132
+ font-size: 16px;
1133
+ border: none;
1134
+ margin: 0 10px;
1135
+ }
1136
+ .modal .upgrade__button .blues,.modal .unsaved__button .blues{
1137
+ text-transform: uppercase;
1138
+ flex-basis: 25%;
1139
+ }
1140
+ .modal a.blues:hover,.modal a.blues:hover{
1141
+ opacity: 0.75;
1142
+ background-color: #324ef8;
1143
+ border: none;
1144
+ }
1145
+ .mobile_wrap .modal-overlays {
1146
+ position: fixed;
1147
+ margin-left: -20px;
1148
+ right: 0;
1149
+ height: auto;
1150
+ width: auto;
1151
+ background: #000;
1152
+ will-change: opacity;
1153
+ opacity: 0.4;
1154
+ z-index: 998;
1155
+ top: -25%;
1156
+ left: 0;
1157
+ bottom: 0;
1158
+ display: none;
1159
+ }
1160
+ .mobile_wrap{
1161
+ overflow: hidden;
1162
+ width: 100%;
1163
+ }
1164
+
1165
+ #modal_form {
1166
+ display: none;
1167
+ position: fixed;
1168
+ top: 5%;
1169
+ right: 0;
1170
+ left: 0;
1171
+ width: 650px;
1172
+ margin: 0 auto;
1173
+ background-color: #4558fe;
1174
+ font-size: 18px;
1175
+ border-radius: 0.9em;
1176
+ -webkit-box-shadow: 0px 0px 5px -2px rgba(0, 0, 0, 0.75);
1177
+ box-shadow: 0px 0px 5px -2px rgba(0, 0, 0, 0.75);
1178
+ }
1179
+
1180
+ #modal_form .modal_form__wrapper {
1181
+ padding: 0.5em;
1182
+ }
1183
+
1184
+ #modal_form .modal_form__header {
1185
+ padding: 0 1.7em;
1186
+ color: #fff;
1187
+ }
1188
+
1189
+ #modal_form .modal_form__header .customization_button__image {
1190
+ background-size: contain;
1191
+ width: 45px;
1192
+ height: 45px;
1193
+ display: block;
1194
+ background-repeat: no-repeat;
1195
+ background-position: center;
1196
+ margin: 0 1em;
1197
+ }
1198
+
1199
+ #modal_form .modal_form__header .logo_header {
1200
+ display: -webkit-box;
1201
+ display: -ms-flexbox;
1202
+ display: flex;
1203
+ -webkit-box-pack: center;
1204
+ -ms-flex-pack: center;
1205
+ justify-content: center;
1206
+ -webkit-box-align: center;
1207
+ -ms-flex-align: center;
1208
+ align-items: center;
1209
+ color: #FFFFFF;
1210
+ font-size: 20px;
1211
+ font-weight: bold;
1212
+ line-height: 19px;
1213
+ }
1214
+
1215
+ #modal_form .modal_form__header .version_name__header {
1216
+ display: -webkit-box;
1217
+ display: -ms-flexbox;
1218
+ display: flex;
1219
+ -webkit-box-orient: vertical;
1220
+ -webkit-box-direction: normal;
1221
+ -ms-flex-direction: column;
1222
+ flex-direction: column;
1223
+ -webkit-box-pack: center;
1224
+ -ms-flex-pack: center;
1225
+ justify-content: center;
1226
+ -webkit-box-align: center;
1227
+ -ms-flex-align: center;
1228
+ align-items: center;
1229
+ margin-bottom: 1em;
1230
+ }
1231
+
1232
+ #modal_form .modal_form__header .version_name__header .version_header__text {
1233
+ color: #FFFFFF;
1234
+ font-size: 56px;
1235
+ font-weight: 800;
1236
+ line-height: 77px;
1237
+ }
1238
+
1239
+ #modal_form .modal_form__header .version_name__header .version_header__price {
1240
+ font-size: 32px;
1241
+ font-weight: 800;
1242
+ line-height: 43px;
1243
+ text-align: right;
1244
+ }
1245
+
1246
+ #modal_form .modal_form__header .version_name__header .version_header__price span {
1247
+ font-size: 24px;
1248
+ font-weight: bold;
1249
+ line-height: 32px;
1250
+ }
1251
+
1252
+ #modal_form .modal_form__header .header_variations {
1253
+ display: -webkit-box;
1254
+ display: -ms-flexbox;
1255
+ display: flex;
1256
+ }
1257
+
1258
+ #modal_form .modal_form__header .header_variations span {
1259
+ background-size: 15px;
1260
+ width: 15px;
1261
+ height: 15px;
1262
+ padding: 0.5em;
1263
+ background-repeat: no-repeat;
1264
+ background-position: center;
1265
+ }
1266
+
1267
+ #modal_form .modal_form__header .header_variations .variation_item {
1268
+ margin-right: 2em;
1269
+ color: #FFFFFF;
1270
+ font-size: 16px;
1271
+ font-weight: 600;
1272
+ line-height: 22px;
1273
+ }
1274
+
1275
+ #modal_form .modal_form__header .header_input {
1276
+ background-color: #fff;
1277
+ border-radius: 0.7em;
1278
+ padding: 0.7em 1em;
1279
+ display: -webkit-box;
1280
+ display: -ms-flexbox;
1281
+ display: flex;
1282
+ -webkit-box-align: center;
1283
+ -ms-flex-align: center;
1284
+ align-items: center;
1285
+ margin: 1em 0;
1286
+ }
1287
+
1288
+ #modal_form .modal_form__header .header_input .checkbox_image {
1289
+ background-size: 25px;
1290
+ width: 28px;
1291
+ height: 28px;
1292
+ padding: 0.5em;
1293
+ background-repeat: no-repeat;
1294
+ background-position: center;
1295
+ background-color: #5455fe;
1296
+ border-radius: 50%;
1297
+ }
1298
+
1299
+ #modal_form .modal_form__header .header_input .header_input__content {
1300
+ margin-left: 3em;
1301
+ }
1302
+
1303
+ #modal_form .modal_form__header .header_input .header_input__name {
1304
+ color: #525252;
1305
+ font-size: 20px;
1306
+ font-weight: bold;
1307
+ line-height: 27px;
1308
+ }
1309
+
1310
+ #modal_form .modal_form__header .header_input .header_input__date {
1311
+ color: #525252;
1312
+ font-size: 14px;
1313
+ line-height: 19px;
1314
+ }
1315
+
1316
+ #modal_form .form_row {
1317
+ display: -webkit-box;
1318
+ display: -ms-flexbox;
1319
+ display: flex;
1320
+ padding: 0.5em;
1321
+ }
1322
+
1323
+ #modal_form .form_input {
1324
+ -webkit-box-orient: vertical;
1325
+ -webkit-box-direction: normal;
1326
+ -ms-flex-direction: column;
1327
+ flex-direction: column;
1328
+ width: 100%;
1329
+ max-width: 100%;
1330
+ padding: 0 1.2em;
1331
+ color: #fff;
1332
+ }
1333
+
1334
+ #modal_form .form_input label {
1335
+ color: #FFFFFF;
1336
+ font-size: 16px;
1337
+ font-weight: 800;
1338
+ line-height: 22px;
1339
+ text-transform: uppercase;
1340
+ }
1341
+
1342
+ #modal_form .form_input input {
1343
+ padding: 0.8em 1.5em;
1344
+ border-radius: 0.7em;
1345
+ border: none;
1346
+ font-size: 18px;
1347
+ line-height: 20px;
1348
+ width: 100%;
1349
+ max-width: 100%;
1350
+ -webkit-box-sizing: border-box;
1351
+ box-sizing: border-box;
1352
+ }
1353
+
1354
+ #modal_form .form_input a {
1355
+ color: #FFFFFF;
1356
+ font-size: 14px;
1357
+ font-weight: bold;
1358
+ line-height: 19px;
1359
+ }
1360
+
1361
+ #modal_form .form_privacy {
1362
+ padding: 0.5em;
1363
+ }
1364
+
1365
+ #modal_form .form_privacy .form_checkbox {
1366
+ padding: 0 1.2em;
1367
+ }
1368
+
1369
+ #modal_form .form_checkbox {
1370
+ color: #FFFFFF;
1371
+ font-size: 14px;
1372
+ line-height: 19px;
1373
+ }
1374
+
1375
+ #modal_form .form_checkbox a {
1376
+ color: #FFFFFF;
1377
+ font-size: 14px;
1378
+ font-weight: bold;
1379
+ line-height: 19px;
1380
+ }
1381
+
1382
+ #modal_form .form_submit {
1383
+ display: -webkit-box;
1384
+ display: -ms-flexbox;
1385
+ display: flex;
1386
+ -webkit-box-pack: center;
1387
+ -ms-flex-pack: center;
1388
+ justify-content: center;
1389
+ }
1390
+
1391
+ #modal_form .form_submit a {
1392
+ color: #5456FF;
1393
+ font-size: 30px;
1394
+ font-weight: bold;
1395
+ line-height: 41px;
1396
+ background-color: #fff;
1397
+ padding: 0.5em 1.9em;
1398
+ text-decoration: none;
1399
+ display: inline-block;
1400
+ border-radius: 0.7em;
1401
+ }
1402
+ .setup_section table tbody tr:first-child th{
1403
+ float: left;
1404
+ padding: 10px 0;
1405
+ font-size: 16px;
1406
+ font-weight: 800;
1407
+ }
1408
+ .tab-content .tab-content__wrapper .testchat{
1409
+ position: absolute;
1410
+ right: 0;
1411
+ background-color: #6071fb;
1412
+ color: #fff;
1413
+ border:none;
1414
+ box-shadow: none;
1415
+ width: 140px;
1416
+ text-align: center;
1417
+ font-family: "Open Sans", sans-serif;
1418
+ font-size: 14px;
1419
+ font-weight: 500;
1420
+ }
1421
+ .tab-content table th{
1422
+ font-family: "Open Sans",sans-serif;
1423
+ font-weight: bold;
1424
+ color: #525252;
1425
+ font-size: 14px;
1426
+ letter-spacing: 0.15px;
1427
+ line-height: 22px;
1428
+ padding: 0;
1429
+ text-transform: uppercase;
1430
+ }
1431
+ .tab-content label.gray{
1432
+ color: #949494;
1433
+ font-family: "Open Sans",sans-serif;
1434
+ font-size: 16px;
1435
+ line-height: 22px;
1436
+ padding: 10px 0;
1437
+ }
1438
+ .tab-content .form-table td p{
1439
+ font-family: "Open Sans",sans-serif;
1440
+ font-size: 16px;
1441
+ }
1442
+ .tab-content table label{
1443
+ color: #525252;
1444
+ font-family: "Open Sans",sans-serif;
1445
+ font-size: 14px;
1446
+ letter-spacing: 0.13px;
1447
+ line-height: 19px;
1448
+ padding-bottom: 10px;
1449
+ }
1450
+ .tab-content .input-field{
1451
+ padding: 0;
1452
+ }
1453
+ .tab-content .as_state{
1454
+ display: flex;
1455
+ flex-direction: row;
1456
+ }
1457
+ .tab-content .as_state p {
1458
+ color: #525252;
1459
+ font-family: "Open Sans",sans-serif;
1460
+ font-size: 14px;
1461
+ font-weight: 600;
1462
+ line-height: 19px;
1463
+ padding-left: 20px;
1464
+ }
1465
+ .tab-content .as h6{
1466
+ font-size: 14px;
1467
+ font-weight: bold;
1468
+ line-height: 19px;
1469
+ text-transform: uppercase;
1470
+ }
1471
+ .tab-content .sp-replacer{
1472
+ margin-top: 20px;
1473
+ background: none;
1474
+ padding: 0;
1475
+ }
1476
+ .tab-content input[type=checkbox]{
1477
+ width: auto;
1478
+ }
1479
+ .tab-content input[type=number]{
1480
+ width: 30%!important;
1481
+ }
1482
+ .tab-content .sp-replacer,.sp-preview{
1483
+ width: 80px;
1484
+ height: 80px;
1485
+ border: none;
1486
+ }
1487
+ .tab-content .sp-dd{
1488
+ display: none;
1489
+ }
1490
+
1491
+ .customize_section table th, td {
1492
+ margin-bottom: 10px;
1493
+ }
1494
+ .options table td{
1495
+ margin-bottom: 15px;
1496
+ padding: 0;
1497
+ width: 80%;
1498
+ }
1499
+ .wrap__pro{
1500
+ position: relative;
1501
+ }
1502
+ .customize_section table th{
1503
+ font-family: "Open Sans",sans-serif;
1504
+ font-weight: 800;
1505
+ color: #525252;
1506
+ font-size: 16px;
1507
+ letter-spacing: 0.15px;
1508
+ line-height: 22px;
1509
+ padding: 0;
1510
+ text-transform: uppercase;
1511
+ }
1512
+
1513
+ .setup_section th,td{
1514
+ display: block;
1515
+ width: auto;
1516
+ }
1517
+ .customize_section th,td{
1518
+ display: block!important;
1519
+ width: auto;
1520
+ }
1521
+ .options .contact_tab table td{
1522
+ display: table-cell!important;
1523
+ padding: 0 20px;
1524
+ }
1525
+ .options .contact_tab table{
1526
+ border: none;
1527
+ -webkit-filter: blur(2px);
1528
+ filter: blur(2px);
1529
+ }
1530
+ .contact_tab{
1531
+ padding: 20px;
1532
+ }
1533
+ .contact_tab .table__wrap .displaying-num{
1534
+ display: none;
1535
+ }
1536
+ .contact_tab .table__wrap{
1537
+ padding-bottom: 5rem;
1538
+ }
1539
+ .tab-content .contact_head__wrap h4,.tab-content .contact_head__wrap p{
1540
+ display: inline-block;
1541
+ font-size: 18px;
1542
+ }
1543
+ .contact_head__wrap{
1544
+ display: flex;
1545
+ justify-content: space-between;
1546
+ align-items: center;
1547
+ margin-bottom: 20px;
1548
+ }
1549
+
1550
+ .contact_head__wrap a{
1551
+ color: #324EF8;
1552
+ font-family: "Open Sans",sans-serif;
1553
+ font-size: 16px;
1554
+ font-weight: 600;
1555
+ line-height: 22px;
1556
+ box-shadow: 0 0 10px #cfcfcf;
1557
+ border-radius: 9px;
1558
+ padding: 10px;
1559
+ }
1560
+ .contact_head__wrap a:active{
1561
+ box-shadow: none;
1562
+ }
1563
+ .contact_head__wrap a>i{
1564
+ color: #324EF8;
1565
+ margin-right: 8px;
1566
+ }
1567
+ .contact_head__wrap .download__wrap{
1568
+ position: relative;
1569
+ width: 60%;
1570
+ height: 100%;
1571
+ text-align: right;
1572
+ }
1573
+ .contact_head__wrap .pro_button__wrapper{
1574
+ display: flex;
1575
+ align-items: center;
1576
+ top: -57px;
1577
+ width: 100%;
1578
+ height: fit-content;
1579
+ left: 0;
1580
+ padding: 0;
1581
+ }
1582
+ .contact_head__wrap .pro_button__wrapper a{
1583
+ padding: 1em 1.5em;
1584
+ }
1585
+
1586
+ .contact_head__wrap .pro_button__wrapper a{
1587
+ box-shadow: none;
1588
+ }
1589
+
1590
+
1591
+ .tab-content .contact_head__wrap h4{
1592
+ margin: 0 10px 0 0;
1593
+ color: #525252;
1594
+ font-family: "Open Sans",sans-serif;
1595
+ font-size: 36px;
1596
+ font-weight: bold;
1597
+ }
1598
+ .table__wrap{
1599
+ position: relative;
1600
+ -moz-user-select: none; /* Firefox */
1601
+ -ms-user-select: none; /* Internet Explorer/Edge */
1602
+ user-select: none;
1603
+ }
1604
+ .table__wrap table{
1605
+ pointer-events: none;
1606
+ }
1607
+ .connected-page .connect_check{
1608
+ display: inline-block;
1609
+ margin: 10px 0 0 0;
1610
+ padding: 1px 10px;
1611
+ background-color: green;
1612
+ border-radius: 5px;
1613
+ color: #fff;
1614
+ text-decoration: none;
1615
+ text-transform: uppercase;
1616
+ font-size: 13px;
1617
+ height: auto;
1618
+ border: none;
1619
+ width: fit-content;
1620
+
1621
+ }
1622
+ .connected-page .connect_check:hover {
1623
+ opacity: 0.75;
1624
+ border: none;
1625
+ }
1626
+ .connect_check .fa-check{
1627
+ margin-right: 5px;
1628
+ }
1629
+ .page_name{
1630
+ color: #525252;
1631
+ font-family: "Open Sans",sans-serif;
1632
+ font-size: 26px;
1633
+ font-weight: bold;
1634
+ letter-spacing: 0.24px;
1635
+ line-height: 32px;
1636
+ margin: 0;
1637
+ vertical-align: middle;
1638
+
1639
+ }
1640
+ #contacts_modal {
1641
+ width: 65%;
1642
+ -webkit-user-drag:none;
1643
+ user-drag:none;
1644
+ -moz-user-drag:none;
1645
+ -ms-user-drag:none;
1646
+ position: absolute;
1647
+ padding: 1em 2em;
1648
+ color: #fff;
1649
+ top: 20%;
1650
+ left: 0;
1651
+ right: 0;
1652
+ margin: 0 auto;
1653
+ background: -webkit-gradient(linear, left top, right top, from(#3d5afe), to(#7c4dff));
1654
+ background: linear-gradient(to right, #3d5afe 0%, #7c4dff 100%);
1655
+ border-radius: 18px;
1656
+ -webkit-box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75);
1657
+ box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.75);
1658
+ }
1659
+
1660
+ #contacts_modal .contact_modal__wrapper {
1661
+ display: -webkit-box;
1662
+ display: -ms-flexbox;
1663
+ display: flex;
1664
+ -webkit-box-pack: justify;
1665
+ -ms-flex-pack: justify;
1666
+ justify-content: space-between;
1667
+ -webkit-box-align: center;
1668
+ -ms-flex-align: center;
1669
+ align-items: center;
1670
+ }
1671
+
1672
+ #contacts_modal .contact_modal__content {
1673
+ display: -webkit-box;
1674
+ display: -ms-flexbox;
1675
+ display: flex;
1676
+ -webkit-box-align: center;
1677
+ -ms-flex-align: center;
1678
+ align-items: center;
1679
+ }
1680
+ #contacts_modal .contact_modal__content p {
1681
+ color: #FFFFFF;
1682
+ font-size: 22px;
1683
+ font-weight: bold;
1684
+ line-height: 30px;
1685
+ }
1686
+ #contacts_modal .contact_modal__content .logo_name {
1687
+ color: #FFFFFF;
1688
+ font-family: "Open Sans",sans-serif;
1689
+ font-size: 20px;
1690
+ font-weight: bold;
1691
+ line-height: 19px;
1692
+ }
1693
+
1694
+ #contacts_modal .contact_modal__button {
1695
+ background-color: #fff;
1696
+ padding: 0.7em 1.5em;
1697
+ font-size: 18px;
1698
+ font-weight: 800;
1699
+ line-height: 24px;
1700
+ text-transform: uppercase;
1701
+ border-radius: 9px;
1702
+ }
1703
+
1704
+ #contacts_modal .contact_modal__button a {
1705
+ text-decoration: none;
1706
+ }
1707
+
1708
+ #contacts_modal .customization_button__image {
1709
+ background-image: url("../img/monkey_head.png");
1710
+ background-size: contain;
1711
+ width: 45px;
1712
+ height: 45px;
1713
+ background-repeat: no-repeat;
1714
+ background-position: center;
1715
+ margin: 0 .3em;
1716
+ display: inline-block;
1717
+ }
1718
+ .connected-page-bottom .active-page-info{
1719
+ display: block;
1720
+ }
1721
+ .log_out__wrapper,.disconnect_page__wrapper{
1722
+ margin-top: 10px;
1723
+ display: flex;
1724
+ justify-content: space-between;
1725
+ align-items: center;
1726
+ }
1727
+ .log_out__wrapper h5{
1728
+ margin: 0;
1729
+ padding: 0;
1730
+ }
1731
+ .log_out__wrapper .logout-mobilemonkey{
1732
+ margin: 0;
1733
+ }
1734
+ .disconnect_page__wrapper{
1735
+ padding: 0 20px;
1736
+ background-color: #25252525;
1737
+ }
1738
+ .disconnect_page__wrapper p b {
1739
+ color: green;
1740
+ }
1741
+ .disconnect_page__wrapper p {
1742
+ color: #000;
1743
+ }
1744
+ .mm_only-state{
1745
+ background-color: #000000;
1746
+ }
1747
+ .contact_modal__button div{
1748
+ color: #5F52FE;
1749
+ }
1750
+ .mobilemonkey-settings h5{
1751
+ color: #525252;
1752
+ font-family: "Open Sans",sans-serif;
1753
+ font-size: 36px;
1754
+ font-weight: bold;
1755
+ letter-spacing: 0.33px;
1756
+ line-height: 49px;
1757
+ margin: 20px 0 0 0;
1758
+ }
1759
+ .mobilemonkey-settings p.get_start{
1760
+ color: #525252; font-family: "Open Sans",sans-serif;
1761
+ font-size: 24px;
1762
+ letter-spacing: 0.22px;
1763
+ line-height: 33px;
1764
+ margin: 0 0 30px 0;
1765
+ }
1766
+ .mobilemonkey-settings p{
1767
+ margin-top: 15px;
1768
+ }
1769
+ .tab-content .as_state .as_text{
1770
+ font-size: 16px;
1771
+ font-weight: 800;
1772
+ font-family: "Open Sans",sans-serif;
1773
+ letter-spacing: 0.15px;
1774
+ line-height: 22px;
1775
+ }
1776
+
1777
+ @media (max-width: 575.98px) {
1778
+ #to_pro, #unsaved_option{
1779
+ width: 90%;
1780
+ }
1781
+ .service-content {
1782
+ text-align: center;
1783
+ }
1784
+ .service-content iframe{
1785
+ width: 250px!important;
1786
+ }
1787
+ .contact_tab{
1788
+ padding-bottom: 100px;
1789
+ }
1790
+ .customization_button,#contacts_modal .contact_modal__wrapper{
1791
+ flex-direction: column;
1792
+ }
1793
+ .customization_button .customization_button__action,#contacts_modal .contact_modal__button{
1794
+ margin-top: 20px;
1795
+ }
1796
+ #contacts_modal {
1797
+ width: 100%;
1798
+ }
1799
+ #contacts_modal .contact_modal__content{
1800
+ flex-direction: column;
1801
+ text-align: center;
1802
+ }
1803
+ .contact_tab .table__wrap{
1804
+ padding-bottom: 10rem;
1805
+ }
1806
+ .customization_button__wrapper .customization_button .customization_button__content{
1807
+ flex-direction: column;
1808
+ text-align: center;
1809
+ }
1810
+ }
1811
+
1812
+ @media (min-width: 576px) and (max-width: 767.98px) {
1813
+ .contact_tab{
1814
+ padding-bottom: 100px;
1815
+ }
1816
+ .customization_button,#contacts_modal .contact_modal__wrapper{
1817
+ flex-direction: column;
1818
+ }
1819
+ .customization_button .customization_button__action,#contacts_modal .contact_modal__button{
1820
+ margin-top: 20px;
1821
+ }
1822
+ #contacts_modal {
1823
+ width: 100%;
1824
+ }
1825
+ .download__wrap .pro_button__wrapper{
1826
+ padding: 0;
1827
+ }
1828
+ .download__wrap .pro_button__wrapper .pro_button{
1829
+ flex-direction: column;
1830
+ text-align: center;
1831
+ }
1832
+ }
1833
+
1834
+
1835
+ @media (min-width: 768px) and (max-width: 991.98px) {
1836
+ .contact_tab{
1837
+ padding-bottom: 100px;
1838
+ }
1839
+ .customization_button,#contacts_modal .contact_modal__wrapper{
1840
+ flex-direction: column;
1841
+ }
1842
+ .customization_button .customization_button__action,#contacts_modal .contact_modal__button{
1843
+ margin-top: 20px;
1844
+ }
1845
+ .download__wrap .pro_button__wrapper{
1846
+ padding: 0;
1847
+ }
1848
+ .download__wrap .pro_button__wrapper .pro_button{
1849
+ flex-direction: column;
1850
+ text-align: center;
1851
+ }
1852
+ }
1853
+
1854
+
1855
+ @media (min-width: 992px) and (max-width: 1199.98px) {
1856
+ .customization_button,#contacts_modal .contact_modal__wrapper{
1857
+ flex-direction: column;
1858
+ }
1859
+ .download__wrap .pro_button__wrapper{
1860
+ padding: 0;
1861
+ }
1862
+ .download__wrap .pro_button__wrapper .pro_button{
1863
+ flex-direction: column;
1864
+ text-align: center;
1865
+ }
1866
+ }
1867
+
1868
+
1869
+ @media (min-width: 1200px) {
1870
+
1871
+ }
1872
+
1873
+
1874
+ /*PRO modal*/
1875
+
1876
+ #pro_option{
1877
+ border-radius: 0;
1878
+ border: 0;
1879
+ background-color: transparent;
1880
+ top: 10%;
1881
+ max-height: 100%;
1882
+ }
1883
+ #pro_option .modal_close i{
1884
+ color: #fff;
1885
+ font-size: 20px;
1886
+ }
1887
+ .billing-modal-header {
1888
+ width: 100%;
1889
+ display: flex;
1890
+ background-color: #4F57FF;
1891
+ align-items: center;
1892
+ flex-direction: column;
1893
+ color: #fff;
1894
+ border-radius: 10px 10px 0 0;
1895
+ }
1896
+ .billing-modal-header__plan-name {
1897
+ font-size: 43px;
1898
+ font-weight: 700;
1899
+ text-transform: uppercase;
1900
+ line-height: 45px;
1901
+ text-align: center;
1902
+ }
1903
+
1904
+ .billing-modal-header__plan-price {
1905
+ font-size: 23px;
1906
+ font-weight: 800;
1907
+ }
1908
+
1909
+ .billing-modal-header__logo div{
1910
+ background-image: url("../img/monkey_head.png");
1911
+ background-size: contain;
1912
+ width: 35px;
1913
+ height: 35px;
1914
+ display: block;
1915
+ background-repeat: no-repeat;
1916
+ background-position: center;
1917
+ margin: 0 0.3em;
1918
+ }
1919
+
1920
+ .billing-modal-header__logo{
1921
+ margin: 1rem 0;
1922
+ display: flex;
1923
+ align-items: center;
1924
+ }
1925
+
1926
+ .billing-modal-header__logo span{
1927
+ color: #fff;
1928
+ font-size: 18px;
1929
+ font-weight: bold;
1930
+ }
1931
+
1932
+ .billing-page-details {
1933
+ width: 90%;
1934
+ background-color: #fff;
1935
+ display: flex;
1936
+ padding: 10px 15px;
1937
+ align-items: center;
1938
+ justify-content: space-between;
1939
+ margin-top: 10px;
1940
+ border-radius: 12px;
1941
+ margin-bottom: 1rem;
1942
+ }
1943
+
1944
+ .billing-page-details__image {
1945
+ width: 50px;
1946
+ height: 50px;
1947
+ border-radius: 100%;
1948
+ background-color: grey;
1949
+ }
1950
+
1951
+ .billing-page-details__name {
1952
+ font-weight: 800;
1953
+ font-size: 20px;
1954
+ color: #525252;
1955
+ margin: 5px 0;
1956
+ }
1957
+
1958
+ .billing-page-details__middle {
1959
+ align-self: flex-start;
1960
+ margin-left: 15px;
1961
+ }
1962
+
1963
+ .billing-page-details__check-circle {
1964
+ background-color: #de8f08;
1965
+ border-radius: 100%;
1966
+ width: 40px;
1967
+ height: 40px;
1968
+ display: flex;
1969
+ justify-content: center;
1970
+ align-items: center;
1971
+ }
1972
+
1973
+
1974
+ .billing-page-details__left-section {
1975
+ display: flex;
1976
+ align-items: center;
1977
+ }
1978
+
1979
+ .billing-page-details__sends-text {
1980
+ color: #de8f08;
1981
+ font-size: 16px;
1982
+ font-weight: 600;
1983
+ }
1984
+
1985
+ .billing-modal {
1986
+ width: 525px;
1987
+ color: #525252;
1988
+ display: flex;
1989
+ align-items: center;
1990
+ flex-direction: column;
1991
+ padding: 0;
1992
+ overflow: hidden;
1993
+ }
1994
+ .checkout-form {
1995
+ display: flex;
1996
+ flex-direction: column;
1997
+ align-items: center;
1998
+ font-family: 'Open-sans', sans-serif;
1999
+ }
2000
+
2001
+ .checkout-form__name-fields {
2002
+ width: 100%;
2003
+ display: flex;
2004
+ flex-direction: row;
2005
+ justify-content: space-between;
2006
+ }
2007
+
2008
+ .billing-modal-body{
2009
+ padding: 30px 30px 0 30px;
2010
+ width: 100%;
2011
+ background-color:#fff;
2012
+ }
2013
+ .billing_info_wrap{
2014
+ display: flex;
2015
+ justify-content: center;
2016
+ }
2017
+ .billing-modal-body .name__wrap,.billing-modal-body .card__wrap{
2018
+ display: flex;
2019
+ justify-content: space-between;
2020
+ }
2021
+ .name__wrap .firstname__wrap,.name__wrap .lastname__wrap{
2022
+ width: 45%;
2023
+ }
2024
+ .billing-modal-body label{
2025
+ font-size: 14px;
2026
+ font-weight: bold;
2027
+ font-family: 'Open-sans', sans-serif;
2028
+ color: #666;
2029
+ }
2030
+ .checkout-form .billing-modal-body input[type=email]:not(.browser-default):focus:not([readonly]),
2031
+ .checkout-form .billing-modal-body input[type=text]:not(.browser-default):focus:not([readonly]),
2032
+ .checkout-form .billing-modal-body select:focus
2033
+ {
2034
+ border-bottom: 1px solid #dfdfdf;
2035
+ box-shadow: none;
2036
+ }
2037
+ .checkout-form .billing-modal-body input[type=email],
2038
+ .checkout-form .billing-modal-body input[type=text],
2039
+ .checkout-form .billing-modal-body select
2040
+ {
2041
+ padding: 20px;
2042
+ width: 100%;
2043
+ border: 1px solid #dfdfdf;
2044
+ margin: .5em 0;
2045
+ line-height: 20px;
2046
+ border-radius: 5px;
2047
+ font-size: 16px;
2048
+ -webkit-box-sizing: border-box;
2049
+ box-sizing: border-box;
2050
+ }
2051
+ .checkout-form .billing-modal-body select{
2052
+ padding: 0 20px;
2053
+ height: 45px;
2054
+ }
2055
+ .billing-modal-footer {
2056
+ font-family: "Open Sans", sans-serif;
2057
+ border-radius: 0 0 10px 10px;
2058
+ background-color: #fff;
2059
+ width: 100%;
2060
+ padding: 5px 30px 25px 30px;
2061
+ display: flex;
2062
+ flex-direction: column;
2063
+ }
2064
+ .billing-modal-body hr{
2065
+ border-top: 1px solid #CFCFCF;
2066
+ margin: 15px 0;
2067
+ }
2068
+ .more_info{
2069
+ margin: 15px 0 0 0;
2070
+ }
2071
+ .billing-modal-footer input[type=checkbox]{
2072
+ background: #999;
2073
+ }
2074
+ .billing-modal-footer input[type=checkbox]:before{
2075
+ color: #fff;
2076
+ }
2077
+ .billing-modal-footer .term__wrap{
2078
+ margin: 10px 0;
2079
+ }
2080
+
2081
+ .modal a.oranges,.modal button.oranges{
2082
+ cursor: pointer;
2083
+ padding: 13px 25px;
2084
+ background-color: RGB(236,182,83);
2085
+ border-radius: 10px;
2086
+ color: #fff;
2087
+ text-decoration: none;
2088
+ font-size: 20px;
2089
+ font-family: "Open Sans", sans-serif;
2090
+ font-weight: 700;
2091
+ border: none;
2092
+ margin: 0 10px;
2093
+ position: relative;
2094
+ align-self: center;
2095
+ }
2096
+ .billing-page-details__check-circle i {
2097
+ font-size: 28px;
2098
+ }
2099
+ .recurly-hosted-field{
2100
+ height: 3.5rem;
2101
+ margin-top: 0;
2102
+ }
2103
+
2104
+ .card__wrap input[type=text]:not(.browser-default){
2105
+ border-radius: 0;
2106
+ border-right: 0;
2107
+ border-left: 0;
2108
+ }
2109
+
2110
+ .card__wrap #card_number{
2111
+ width: 100%;
2112
+ }
2113
+ .terms-label a{
2114
+ color: #525252;
2115
+ font-weight: bold;
2116
+ }
2117
+ #pro_option{
2118
+ width: 640px;
2119
+ }
2120
+
2121
+ .subscribe__wrap .page_name__wrap h2.subscribe_page_name{
2122
+ margin: 0;
2123
+ font-size: 2.5rem;
2124
+ font-family: 'Open-Sans',sans-serif;
2125
+ }
2126
+ .subscribe__wrap .page_name__wrap span.pro{
2127
+ border-radius: 5px;
2128
+ width: auto;
2129
+ height: auto;
2130
+ line-height: 22px;
2131
+ align-self: center;
2132
+ font-size: 1.2rem;
2133
+ padding: 7px;
2134
+ }
2135
+ .subscribe_connect p {
2136
+ color: #888;
2137
+ font-size: 15px;
2138
+ }
2139
+ .page_info__wrap{
2140
+ border: 1px solid #EFEFEF;
2141
+ padding: 20px 35px 30px;
2142
+ border-radius: 10px;
2143
+ display: flex;
2144
+ justify-content: space-between;
2145
+ }
2146
+
2147
+ .percentage-bar__body-wrapper {
2148
+ display: -webkit-box;
2149
+ display: -ms-flexbox;
2150
+ display: flex;
2151
+ -webkit-box-orient: horizontal;
2152
+ -webkit-box-direction: normal;
2153
+ -ms-flex-direction: column;
2154
+ flex-direction: column;
2155
+ -webkit-box-align: center;
2156
+ -ms-flex-align: center;
2157
+ align-items: center;
2158
+ width: 80%;
2159
+ margin-top: 10px;
2160
+ }
2161
+ .percentage-bar__card-used-number,.percentage-bar__card-max-number {
2162
+ font-weight: 800;
2163
+ font-size: 16px;
2164
+ margin-right: -20px;
2165
+ }
2166
+ .number__wrap{
2167
+ display: flex;
2168
+ flex-direction: row;
2169
+ justify-content: space-between;
2170
+ width: 100%;
2171
+ }
2172
+ .percentage-bar__bar {
2173
+ height: 9px;
2174
+ }
2175
+ .percentage-bar__bar {
2176
+ position: relative;
2177
+ background-color: #cbcbcb;
2178
+ width: 100%;
2179
+ height: 12px;
2180
+ border-radius: 10px;
2181
+ }
2182
+ .percentage-bar__used-percentage{
2183
+ height: 9px;
2184
+ }
2185
+ .percentage-bar__used-percentage {
2186
+ position: absolute;
2187
+ left: 0;
2188
+ background-color: #ff943f;
2189
+ height: 12px;
2190
+ border-radius: 10px;
2191
+ }
2192
+ .message_sent__wrap label{
2193
+ font-size: 0.9rem;
2194
+ text-transform: uppercase;
2195
+ color: #555;
2196
+ font-weight: bold;
2197
+ }
2198
+ .message_sent__wrap{
2199
+ margin-top: 2rem;
2200
+ }
2201
+ .button_cancel,.button_edit{
2202
+ padding: 5px 15px;
2203
+ border-radius: 5px;
2204
+ background-color: gray;
2205
+ cursor: pointer;
2206
+ color: #fff;
2207
+ text-decoration: none;
2208
+ font-size: 16px;
2209
+ border: none;
2210
+ margin: 0 10px;
2211
+ }
2212
+ a.button_cancel:hover,a.button_cancel:focus,a.button_edit:focus,a.button_edit:hover{
2213
+ color: #fff;
2214
+ }
2215
+ .button_go{
2216
+ margin-top: 20px;
2217
+ height: auto;
2218
+ background-color: darkgreen;
2219
+ padding: 10px 15px;
2220
+ border: 1px solid #000;
2221
+ color: #fff;
2222
+ }
2223
+ .button_go:hover,.button_go:focus{
2224
+ color: #fff;
2225
+ }
2226
+ .invoice_info_wrap a{
2227
+ text-decoration: underline;
2228
+ margin-right: 25px;
2229
+ }
2230
+ .subscribe_info__wrap,.invoice_info_wrap{
2231
+ display: flex;
2232
+ justify-content: space-between;
2233
+ }
2234
+ .button__wrap{
2235
+ align-self: center;
2236
+ }
2237
+ .subscribe_info__wrap{
2238
+ padding: 0 0 20px 0;
2239
+ }
2240
+ .button_update{
2241
+ background-color: #324ef8;
2242
+ height: auto;
2243
+ padding: 12px 20px;
2244
+ border-radius: 4px;
2245
+ color: #fff;
2246
+ font-size: 18px;
2247
+ }
2248
+ .button_update:focus,.button_update:hover{
2249
+ color: #fff;
2250
+ }
2251
+ .payment_info{
2252
+ background-color: #DDE3FE;
2253
+ border-radius: 14px;
2254
+ width: 50%;
2255
+ display: flex;
2256
+ flex-direction: column;
2257
+ padding: 10px 24px;
2258
+ margin-bottom: 20px;
2259
+ }
2260
+ .billed_with{
2261
+ color: #ADB0B9;
2262
+ }
2263
+ #errors{
2264
+ color: red;
2265
+ text-align: center;
2266
+ height: 50px;
2267
+ background-color: #1111;
2268
+ border-radius: 14px;
2269
+ width: 50%;
2270
+ display: flex;
2271
+ align-self: center;
2272
+ justify-content: center;
2273
+ align-items: center;
2274
+ margin-bottom: 30px;
2275
+ display: none;
2276
  }
admin/assets/img/logo.png ADDED
Binary file
admin/assets/img/monkey.png ADDED
Binary file
admin/assets/img/monkey_head.png ADDED
Binary file
admin/assets/img/notice_icon_new.png ADDED
Binary file
admin/assets/img/pacebook_logo.png ADDED
Binary file
admin/assets/js/admin.js CHANGED
@@ -18,6 +18,14 @@ var cc_g_position = document.querySelectorAll('.cc_g_position');
18
 
19
  var cc_i_position_mobile = document.querySelectorAll('.cc_i_position-mobile');
20
  var cc_g_position_mobile = document.querySelectorAll('.cc_g_position-mobile');
 
 
 
 
 
 
 
 
21
 
22
  // incase display-block is added remove it ..
23
  var cc_i_remove = function cc_i_remove() {
@@ -402,10 +410,12 @@ jQuery(document).ready(function($){
402
  });
403
  }
404
  }
405
-
 
 
406
  $('.button-lazy-load').click(function () {
407
  $(this).addClass('opacity-button');
408
- $(this).siblings('.lazyload').css('display', 'block');
409
  });
410
 
411
  $('.button-copy').click(function () {
@@ -431,6 +441,7 @@ jQuery(document).ready(function($){
431
 
432
  function getFacebookSDK() {
433
  if (window.FB) {
 
434
  return Promise.resolve(window.FB);
435
  }
436
 
@@ -496,20 +507,38 @@ jQuery(document).ready(function($){
496
  });
497
  });
498
 
499
- $('h3.acc-title').each(function( index ) {
500
- if ($(this).hasClass('open')){
501
- $(this).next().css('display','block');
502
- }else
503
- if ($(this).hasClass('colapse')){
504
- $(this).next().css('display','none');
505
- }else {
506
- $(this).css('pointer-events','none');
507
- $(this).css('opacity','0.6');
508
- $(this).next().css('display','none');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
509
  }
510
  });
511
 
512
- $('.toc-tab-box .acc-title, table.form-table h3.acc-title').off().on('click', function (event) {
 
 
 
513
  if (!$(this).hasClass('open')) {
514
  $(this).addClass('open');
515
  $(this).next().slideDown();
@@ -519,26 +548,417 @@ jQuery(document).ready(function($){
519
  $(this).next().slideUp();
520
  }
521
  });
522
- $('.acc-content').each(function() {
523
- if ($(this).hasClass('disabled')) {
524
- $(this).find("table").css('display', 'none');
525
- $(this).find(".mm_only").css('display', 'block');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  }
527
  });
528
- $('.trigger').on('click', function() {
529
- $('.modal-wrapper-mobilemonkey').removeClass("open");
530
- $('.modal-wrapper-mobilemonkey').toggleClass('close');
531
- return false;
 
 
 
 
 
 
 
532
  });
533
- if (!$('#htcc_fb_as_state').prop('checked')){
534
- $('.as').css({'pointer-events':'none','opacity':'0.6'});
535
  }
536
- $('#htcc_fb_as_state').on('change', function (event) {
537
- if(!$(this).prop('checked')){
538
- $('.as').css({'pointer-events':'none','opacity':'0.6'});
539
- }else{
540
- $('.as').css({'pointer-events':'all','opacity':'1'});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
541
  }
542
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
543
  });
544
 
18
 
19
  var cc_i_position_mobile = document.querySelectorAll('.cc_i_position-mobile');
20
  var cc_g_position_mobile = document.querySelectorAll('.cc_g_position-mobile');
21
+ $("#fb_greeting_dialog_delay").on("keypress", function( event ) {
22
+ var key = event.charCode ? event.charCode : event.keyCode;
23
+ if (key > 31 && (key < 48 || key > 57))
24
+ {
25
+ event.preventDefault();
26
+ return false;
27
+ }
28
+ });
29
 
30
  // incase display-block is added remove it ..
31
  var cc_i_remove = function cc_i_remove() {
410
  });
411
  }
412
  }
413
+ $('.htcc-color-wp').on("dragstop.spectrum", function(e, color) {
414
+ $("#htcc-color-wp").val(color.toHexString());
415
+ });
416
  $('.button-lazy-load').click(function () {
417
  $(this).addClass('opacity-button');
418
+ $(this).find('.lazyload').css('display', 'block');
419
  });
420
 
421
  $('.button-copy').click(function () {
441
 
442
  function getFacebookSDK() {
443
  if (window.FB) {
444
+
445
  return Promise.resolve(window.FB);
446
  }
447
 
507
  });
508
  });
509
 
510
+ $('.step-wrapper ul li.tab-link').each(function () {
511
+ if ($(this).hasClass('current')){
512
+ var cattr = $(this).attr('data-tab');
513
+ $("#toplevel_page_wp-chatbot ul li").removeClass('current');
514
+ $("#toplevel_page_wp-chatbot ul li span[data-tab='" + cattr +"']").parents('li').addClass('current');
515
+ }
516
+ });
517
+ if (!$('#htcc_fb_as_state').prop('checked')){
518
+ $('.as').css({'pointer-events':'none','opacity':'0.6'});
519
+ if (!$('.connected-page').hasClass('pro')) {
520
+ $('.as').last().find('label,input').css({'pointer-events': 'none', 'opacity': '0.6'});
521
+ $('.as').last().css({'pointer-events':'all','opacity':'1'});
522
+ }
523
+
524
+
525
+ }
526
+ $('#htcc_fb_as_state').on('change', function (event) {
527
+ if(!$(this).prop('checked')){
528
+ $('.as').css({'pointer-events':'none','opacity':'0.6'});
529
+ if (!$('.connected-page').hasClass('pro')) {
530
+ $('.as').last().find('label,input').css({'pointer-events': 'none', 'opacity': '0.6'});
531
+ $('.as').last().css({'pointer-events':'all','opacity':'1'});
532
+ }
533
+ }else{
534
+ $('.as').css({'pointer-events':'all','opacity':'1'});
535
  }
536
  });
537
 
538
+ if ($('.bot_disabled').length>0){
539
+ $('#tab-2,#tab-3,#tab-1 form').css({'pointer-events':'none','opacity':'0.6'})
540
+ }
541
+ $('h3.acc-title').on('click', function (event) {
542
  if (!$(this).hasClass('open')) {
543
  $(this).addClass('open');
544
  $(this).next().slideDown();
548
  $(this).next().slideUp();
549
  }
550
  });
551
+
552
+ $('.connect-page a').on("click", function (event) {
553
+ event.preventDefault();
554
+ window.location.href = $(this).attr('href');
555
+ $('.connect-page a').each(function () {
556
+ $(this).removeAttr('href');
557
+ $(this).off('click');
558
+ });
559
+ });
560
+ $("#button_disconnect_page").on("click", function( ) {
561
+ $("#to_pro").show();
562
+ $('#modal-overlay').show();
563
+ $('body').css({'overflow': 'hidden'});
564
+
565
+ });
566
+ $('#disconnect').on('click', function () {
567
+ $('.modal_close').off('click');
568
+ $('.button-close-modal').off('click');
569
+ })
570
+
571
+ $(".modal .button-close-modal,.modal .modal_close").on("click", function(event) {
572
+ event.preventDefault();
573
+ $('#errors').hide();
574
+ $(".modal").hide();
575
+ $('body').css({'overflow': 'auto'});
576
+ $('.button-lazy-load').removeClass('opacity-button');
577
+ $('.lazyload').hide();
578
+ $('#modal-overlay').hide();
579
+ attr = $('.step-wrapper ul li.tab-link.current').attr("data-tab");
580
+ set_current_tab(attr);
581
+ });
582
+ var datas = new Object();
583
+ var tab ='';
584
+ var attr ='';
585
+ var error = false;
586
+ var save_from_form=false;
587
+ $('.tab-content:not(:last)').each(function () {
588
+ var id = $(this).attr('id');
589
+ datas[id] = new Object();
590
+ $(this).find('input,textarea, select').each(function () {
591
+ var name = $(this).attr('name');
592
+ if ($(this).attr('type') == 'checkbox'){
593
+ datas[id][$(this).attr('id')] = $(this).prop('checked')
594
+ }else if ($(this).attr('id') == "htcc-color-wp" ) {
595
+ datas[id][$(this).attr('id')]=$(this).val().toUpperCase();
596
+ } else {
597
+ if (name.indexOf("htcc") >= 0 && name.indexOf("htcc_options") < 0){
598
+ datas[id][$(this).attr('id')] = $(this).val();
599
+ }
600
+ }
601
+ });
602
+ });
603
+
604
+ $('#toplevel_page_wp-chatbot ul li:not(:first-child)').each( function () {
605
+ $(this).on('click',function (event) {
606
+ event.preventDefault();
607
+ var current_li = $(".step-wrapper ul li.tab-link.current").attr('data-tab');
608
+ attr = $(this).find('span').attr('data-tab');
609
+ if (attr!=current_li){
610
+ set_current_tab(attr);
611
+ }
612
+ tab = $("#"+attr)
613
+ var li_next = $(".step-wrapper ul li.tab-link[data-tab='" + attr +"']");
614
+ $('#toplevel_page_wp-chatbot ul li:not(:first-child)').removeClass('current');
615
+ $(this).addClass('current');
616
+ unsaved(current_li,li_next,attr);
617
+ });
618
+ });
619
+ var flag = new Object();
620
+ var second_flag = new Object();
621
+
622
+
623
+ $(".step-wrapper ul li.tab-link").on("click", function() {
624
+ attr = $(this).attr("data-tab");
625
+ $('#toplevel_page_wp-chatbot ul li:not(:first-child)').removeClass('current');
626
+ $("#toplevel_page_wp-chatbot ul li span[data-tab='" + attr +"']").parents('li').addClass('current');
627
+ if (!$(this).hasClass('current')){
628
+ set_current_tab(attr);
629
+ }
630
+ if(!$(this).is(':last-child')){
631
+ tab = $(this);
632
+ var current = $('.step-wrapper ul li.tab-link.current').attr("data-tab");
633
+ unsaved(current,tab,attr);
634
+ }else {
635
+ $(".step-wrapper ul li.tab-link").removeClass("current");
636
+ $(this).addClass('current');
637
+ $(".tab-content").removeClass("current");
638
+ $('#'+$(this).attr("data-tab")).addClass('current');
639
  }
640
  });
641
+
642
+ $.ajax({
643
+ type: 'GET',
644
+ url: ajaxurl,
645
+ data: {
646
+ action: 'get_done',
647
+ },
648
+ dataType: 'json',
649
+ success: function(data) {
650
+ second_flag = data.data;
651
+ }
652
  });
653
+ if($(".step-wrapper ul li.tab-link").length-1 == $(".step-wrapper ul li.tab-link.done").length) {
654
+ $('.setup_statement').css({'display':'none'})
655
  }
656
+
657
+ function set_current_tab(attr) {
658
+ $.ajax({
659
+ type: 'POST',
660
+ url: ajaxurl,
661
+ data: {
662
+ action: 'set_current_tab',
663
+ current: attr
664
+ },
665
+ dataType: 'json',
666
+ });
667
+ }
668
+
669
+ function unsaved(cur_link,link,attr){
670
+ var setup = false;
671
+ if (!link.hasClass('current')){
672
+ for (var key in datas[cur_link]) {
673
+ if (datas[cur_link].hasOwnProperty(key)){
674
+ var obj = $('#'+key);
675
+ if (obj.attr('type')== 'checkbox'){
676
+ if (datas[cur_link][obj.attr('id')]!=obj.prop('checked')){
677
+ error=true;
678
+ }
679
+ }else if (obj.attr('id') == "htcc-color-wp" ) {
680
+ if (datas[cur_link][obj.attr('id')]!=obj.val().toUpperCase()){
681
+ error=true;
682
+ }
683
+ }else {
684
+ if (datas[cur_link][obj.attr('id')]!=obj.val()){
685
+ error=true;
686
+ }
687
+ }
688
+ }
689
+ }
690
+ if(!error){
691
+ $(".step-wrapper ul li.tab-link").removeClass("current");
692
+ $(".step-wrapper ul li.tab-link.current").addClass('done');
693
+ $(".tab-content").removeClass("current");
694
+ link.addClass("current");
695
+ $("#"+attr).addClass("current");
696
+ }else {
697
+ $("#unsaved_option").show();
698
+ $('#modal-overlay').show();
699
+ $('body').css({'overflow':'hidden'});
700
+ $('.save_change').on('click',function () {
701
+ error = false;
702
+ $('div.modal_close').off('click');
703
+ $('#discard_button').off('click');
704
+ save_from_form = true;
705
+ $('#'+cur_link).find('#submit').click();
706
+ });
707
+ }
708
  }
709
+ link.addClass('done');
710
+ $(".step-wrapper ul li.tab-link").each(function () {
711
+ var index = $(this).attr("data-tab");
712
+ if ($(this).hasClass('done')) {
713
+ flag[index] = true;
714
+ }
715
+ });
716
+
717
+ if($(".step-wrapper ul li.tab-link").length-1 == $(".step-wrapper ul li.tab-link.done").length) {
718
+ $('.setup_statement').css({'display':'none'});
719
+ setup = true;
720
+ }
721
+ if (JSON.stringify(flag)!==JSON.stringify(second_flag)){
722
+ $.extend(second_flag,flag);
723
+ $.ajax({
724
+ type: 'GET',
725
+ url: ajaxurl,
726
+ data: {
727
+ action: 'send_done',
728
+ state: flag,
729
+ setup: setup
730
+ },
731
+ dataType: 'json',
732
+ });
733
+ }
734
+
735
+ }
736
+
737
+ function send_next(next,setup){
738
+ set_current_tab(next.attr('data-tab'));
739
+ next.addClass('done');
740
+ $(".step-wrapper ul li.tab-link").each(function () {
741
+ var index = $(this).attr("data-tab");
742
+ if ($(this).hasClass('done')) {
743
+ flag[index] = true;
744
+ }
745
+ });
746
+ if (JSON.stringify(flag)!==JSON.stringify(second_flag)){
747
+ $.extend(second_flag,flag);
748
+ $.ajax({
749
+ type: 'GET',
750
+ url: ajaxurl,
751
+ data: {
752
+ action: 'send_done',
753
+ state: flag,
754
+ setup: setup
755
+ },
756
+ dataType: 'json',
757
+ });
758
+ }
759
+ }
760
+
761
+ $(document).on("click", "#submit", function() {
762
+ if (!save_from_form){
763
+ var next = $(".step-wrapper ul li.tab-link.current").next();
764
+ if (next.attr('data-tab')!=='tab-3'){
765
+ var second_next = next.next();
766
+ }
767
+ var setup = false;
768
+ if($(".step-wrapper ul li.tab-link").length-1 == $(".step-wrapper ul li.tab-link.done").length) {
769
+ setup = true;
770
+ }
771
+ if (!next.hasClass('done')){
772
+ send_next(next,setup)
773
+ }else if (second_next && !second_next.hasClass('done')){
774
+ send_next(second_next,setup)
775
+ }else {
776
+ var cur = $(".step-wrapper ul li.tab-link.current");
777
+ send_next(cur,setup);
778
+ }
779
+
780
+ }
781
+ });
782
+
783
+ $("#discard_button").on("click", function(event) {
784
+ var current = $('.step-wrapper ul li.tab-link.current').attr("data-tab");
785
+ event.preventDefault();
786
+ for (var key in datas[current]) {
787
+ if (datas[current].hasOwnProperty(key)){
788
+ var obj = $('#'+key);
789
+ if (obj.attr('type') == 'checkbox'){
790
+ if (datas[current][key]!=obj.prop('checked')){
791
+ obj.click();
792
+ }
793
+ }else {
794
+ obj.val(datas[current][obj.attr('id')]);
795
+ }
796
+ }
797
+ }
798
+ $(".htcc-color-wp").spectrum("set", $("#htcc-color-wp").val());
799
+
800
+ $(".step-wrapper ul li.tab-link").removeClass("current");
801
+ $(".tab-content").removeClass("current");
802
+ $(".step-wrapper ul li.tab-link[data-tab='" + attr +"']").addClass('current');
803
+ $("#"+attr).addClass("current");
804
+ $('.lazyload').hide();
805
+ $('.button-lazy-load').removeClass('opacity-button');
806
+ $('body').css({'overflow':'auto'});
807
+ $(".modal").hide();
808
+ $('#modal-overlay').hide();
809
+ error = false;
810
+ });
811
+
812
+
813
+ $('.form-table tr').hover(
814
+ function (event) {
815
+ event.preventDefault();
816
+ let field = $(this).find('div.row');
817
+ let page = $('.connected-page');
818
+ if (!page.hasClass('pro')){
819
+ field.find('input,select').css({'pointer-event':'none'});
820
+ field.find('.pro_button__wrapper').stop( true, false ).fadeIn( "fast" );
821
+ }
822
+ },
823
+ function (event) {
824
+ event.preventDefault();
825
+ let field = $(this).find('div.row');
826
+ let page = $('.connected-page');
827
+ if (!page.hasClass('pro')){
828
+ field.find('input,select').css({'pointer-event':'none'});
829
+ field.find('.pro_button__wrapper').stop( true, false ).fadeOut('fast');
830
+ }
831
+ }
832
+
833
+ );
834
+ $('.button_cancel').on('click',function (e) {
835
+ e.preventDefault();
836
+ $('#cancel').show();
837
+ $('#modal-overlay').show();
838
+ $('body').css({'overflow':'hidden'});
839
+ $('#cancel_sub').on('click',function (e) {
840
+ e.preventDefault();
841
+ $('.modal_close').attr("disabled", true);
842
+ $('.button-close-modal').attr("disabled", true);
843
+ $.ajax({
844
+ type: 'POST',
845
+ url: ajaxurl,
846
+ data: {
847
+ action: 'cancel_subscribe',
848
+ },
849
+ dataType: 'json',
850
+ error: function (data,response) {
851
+ $('.modal_close').attr("disabled", false);
852
+ $('.button-close-modal').attr("disabled", false);
853
+ },
854
+ success: function (data,response) {
855
+ $('.cancel__wrapper').empty();
856
+ $('.cancel__wrapper').append("<p class='subscribe_succes_cancel'>Your subscription will expire at the end of the billing cycle.</p>");
857
+ var path = location.protocol + '//' + location.host + location.pathname + '?page=wp-chatbot';
858
+ window.location = path;
859
+ }
860
+ });
861
+ })
862
+ });
863
+ let current = $('.percentage-bar__card-used-number').data('value');
864
+ let max = $('.percentage-bar__card-max-number').data('value');
865
+ let wit = current/max*$('.percentage-bar__bar').width()+'px';
866
+ $('.percentage-bar__used-percentage').css({'width':wit})
867
+
868
+
869
+ $('.pro_button__link,#button_update').on('click',function (e) {
870
+ e.preventDefault();
871
+ $('#pro_option').show();
872
+ $('#modal-overlay').show();
873
+ $('body').css({'overflow':'hidden'});
874
+ });
875
+ $.fn.exists = function() { return this.length > 0; };
876
+
877
+ if ( $(".payment_info").exists() ) {
878
+ $('#pay_plan').on('click',function (e) {
879
+ e.preventDefault();
880
+ $('#pay_plan').addClass('opacity-button');
881
+ $('#pay_plan div.lazyload').css('display', 'block');
882
+ $('#pay_plan').css({'pointer-event':'none'});
883
+ $("#pay_plan").attr("disabled", true);
884
+ $.ajax({
885
+ type: 'POST',
886
+ url: ajaxurl,
887
+ data: {
888
+ action: 'create_subscribe',
889
+ },
890
+ dataType: 'json',
891
+ error: function (data,response) {
892
+ $('#errors').stop( true, false ).fadeIn( "fast" );
893
+ $('#pay_plan').removeClass('opacity-button');
894
+ $('#pay_plan div.lazyload').css('display', 'none');
895
+ $('#pay_plan').css({'pointer-event':'all'});
896
+ $('#errors').text("Unable to create a subscription. Retry the request later");
897
+ $("#pay_plan").attr("disabled", false);
898
+ },
899
+ success: function (data,response) {
900
+ var path = location.protocol + '//' + location.host + location.pathname + '?page=wp-chatbot';
901
+ window.location = path;
902
+ }
903
+ });
904
+ });
905
+ }else {
906
+ recurly.configure({
907
+ publicKey: 'ewr1-oZyeuL07BdPz9I7T4DxgDO', // Set this to your own public key
908
+ style: {
909
+ all: {
910
+ fontFamily: 'Open Sans',
911
+ fontSize: '1rem',
912
+ fontWeight: 'bold',
913
+ fontColor: '#2c0730',
914
+ required: 'true'
915
+ }
916
+ }
917
+ });
918
+ $('form#checkout-form').submit( function (event) {
919
+ event.preventDefault();
920
+ var form = this;
921
+ $('#pay_plan').addClass('opacity-button');
922
+ $('#pay_plan div.lazyload').css('display', 'block');
923
+ $('#pay_plan').css({'pointer-event':'none'});
924
+ $("#pay_plan").attr("disabled", true);
925
+ recurly.token(form, function (err, token) {
926
+ if (err) {
927
+ $('#errors').css({'display':'flex'});
928
+ $("#pay_plan").attr("disabled", false);
929
+ $('#pay_plan').removeClass('opacity-button');
930
+ $('#pay_plan div.lazyload').css('display', 'none');
931
+ $('#pay_plan').css({'pointer-event':'all'});
932
+ $('#errors').text("Invalid card number. Please try again.");
933
+ return;
934
+ }
935
+ $.ajax({
936
+ type: 'POST',
937
+ url: ajaxurl,
938
+ data: {
939
+ action: 'create_subscribe',
940
+ token:token.id
941
+ },
942
+ dataType: 'json',
943
+ error: function (data,response) {
944
+ $('#errors').stop( true, false ).fadeIn( "fast" )
945
+ $('#pay_plan').removeClass('opacity-button');
946
+ $("#pay_plan").attr("disabled", false);
947
+ $('#pay_plan div.lazyload').css('display', 'none');
948
+ $('#pay_plan').css({'pointer-event':'all'});
949
+ $('#errors').text("Unable to create a subscription. Retry the request later");
950
+ },
951
+ success: function (data,response) {
952
+ var path = location.protocol + '//' + location.host + location.pathname + '?page=wp-chatbot';
953
+ window.location = path;
954
+ }
955
+ });
956
+ });
957
+ });
958
+ function errorm (err) {
959
+ $('button').prop('disabled', false);
960
+ }
961
+ }
962
+
963
  });
964
 
admin/class-htcc-admin.php CHANGED
@@ -31,8 +31,8 @@ if (!class_exists('HTCC_Admin')) :
31
  $this->token = $this->api->connectMobileMonkey();
32
  $this->options = get_option('htcc_options');
33
  $this->fb_page_id = $this->options['fb_page_id'];
34
- $this->botid = $this->api->getActivePage()['bot_id'];
35
- $this->internal = get_option('mobilemonkey_active_page_id');
36
  $this->stepdis = "close";
37
  }
38
 
@@ -51,23 +51,84 @@ if (!class_exists('HTCC_Admin')) :
51
  */
52
  public function htcc_options_page()
53
  {
 
54
  add_menu_page(
55
  'WP-Chatbot Setting page',
56
- 'WP-Chatbot',
57
  'manage_options',
58
  'wp-chatbot',
59
  array($this, 'settings_page'),
60
  'dashicons-format-chat'
61
  );
62
- if ($this->getApi()->connectMobileMonkey()) {
63
- add_submenu_page('wp-chatbot', 'Contacts', 'Contacts', 8, 'wp-chatbot-contact', [
64
- $this, 'page_contact'
65
- ]);
66
- }
67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
69
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
 
 
 
 
 
 
71
  /**
72
  * Options page Content -
73
  * get settings form from a template settings_page.php
@@ -88,14 +149,50 @@ if (!class_exists('HTCC_Admin')) :
88
  require_once('settings_page.php');
89
  }
90
 
91
- function page_contact()
92
- {
93
- include('contact_page.php');
94
- $table = new MobileMonkey_Contacts_List_Table();
95
- $table->prepare_items();
96
- $table->display();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  }
98
 
 
 
 
 
 
 
99
  /**
100
  * Options page - Regsiter, add section and add setting fields
101
  *
@@ -106,240 +203,63 @@ if (!class_exists('HTCC_Admin')) :
106
  */
107
  public function htcc_custom_settings()
108
  {
109
- add_settings_section('htcc_settings_connect', '', array($this, 'htcc_section_connect_render'), 'wp-chatbot');
110
- add_settings_section('htcc_settings_as', '', array($this, 'htcc_section_as_render'), 'wp-chatbot');
111
-
112
- add_settings_field('htcc_fb_welcome_message', '', array($this, 'htcc_fb_welcome_message_cb'), 'wp-chatbot', 'htcc_settings_as');
113
- add_settings_field('htcc_fb_as_state', '', array($this, 'htcc_fb_as_state_cb'), 'wp-chatbot', 'htcc_settings_as');
114
- add_settings_field('htcc_fb_answer1','', array($this, 'htcc_fb_answer1_cb'), 'wp-chatbot', 'htcc_settings_as');
115
- add_settings_field('htcc_fb_answer2','', array($this, 'htcc_fb_answer2_cb'), 'wp-chatbot', 'htcc_settings_as');
116
- add_settings_field('htcc_fb_answer3','', array($this, 'htcc_fb_answer3_cb'), 'wp-chatbot', 'htcc_settings_as');
117
- add_settings_field('htcc_fb_thank_answer','', array($this, 'htcc_fb_thank_answer_cb'), 'wp-chatbot', 'htcc_settings_as');
118
- add_settings_field('htcc_fb_email_trans','', array($this, 'htcc_fb_email_trans_cb'), 'wp-chatbot', 'htcc_settings_as');
119
- register_setting('htcc_setting_group', 'htcc_as_options', array($this, 'htcc_as_options_sanitize'));
120
-
121
-
122
-
123
- add_settings_section('htcc_settings', '', array($this, 'print_additional_settings_section_info'), 'wp-chatbot');
124
- add_settings_field('htcc_fb_color', __('Color', 'wp-chatbot'), array($this, 'htcc_fb_color_cb'), 'wp-chatbot', 'htcc_settings');
125
- add_settings_field('htcc_fb_greeting_login', __('Logged in Greeting', 'wp-chatbot'), array($this, 'htcc_fb_greeting_login_cb'), 'wp-chatbot', 'htcc_settings');
126
- add_settings_field('htcc_fb_greeting_logout', __('Logged out Greeting', 'wp-chatbot'), array($this, 'htcc_fb_greeting_logout_cb'), 'wp-chatbot', 'htcc_settings');
127
- add_settings_field('htcc_fb_greeting_dialog_display', __('Greeting Dialog Display', 'wp-chatbot'), array($this, 'htcc_fb_greeting_dialog_display_cb'), 'wp-chatbot', 'htcc_settings');
128
- add_settings_field('htcc_fb_greeting_dialog_delay', __('Greeting Dialog Delay', 'wp-chatbot'), array($this, 'htcc_fb_greeting_dialog_delay_cb'), 'wp-chatbot', 'htcc_settings');
129
- add_settings_field('htcc_fb_sdk_lang', __('Messenger language', 'wp-chatbot'), array($this, 'htcc_fb_sdk_lang_cb'), 'wp-chatbot', 'htcc_settings');
130
- add_settings_field('htcc_show_hide', __('Hide Based on post type', 'wp-chatbot'), array($this, 'htcc_show_hide_post_types_cb'), 'wp-chatbot', 'htcc_settings');
131
- add_settings_field('htcc_list_id_tohide', __('Post, Page Id\'s to Hide', 'wp-chatbot'), array($this, 'htcc_list_id_tohide_cb'), 'wp-chatbot', 'htcc_settings');
132
- add_settings_field('htcc_list_cat_tohide', __('Categorys to Hide', 'wp-chatbot'), array($this, 'htcc_list_cat_tohide_cb'), 'wp-chatbot', 'htcc_settings');
133
- add_settings_field('htcc_devices_show_hide', __('Hide Based on Devices', 'wp-chatbot'), array($this, 'htcc_show_hide_devices_cb'), 'wp-chatbot', 'htcc_settings');
134
- add_settings_field('htcc_shortcode', __('Shortcode name', 'wp-chatbot'), array($this, 'htcc_custom_shortcode_cb'), 'wp-chatbot', 'htcc_settings');
 
 
135
  register_setting('htcc_setting_group', 'htcc_options', array($this, 'htcc_options_sanitize'));
136
  }
137
 
138
 
139
- function htcc_section_connect_render() {
140
- ?>
141
- <h3 class="acc-title <?php if ($this->botid && $this->token){ echo "colapse"; } else {echo "open";}?>"><div class="circle">1</div>Connect to your Facebook account<i class="fa fa-angle-down step_fa"></i></h3>
142
-
143
- <div class="acc-content" style="display:block">
144
- <div class="accordionItemHeading">
145
- <?php $this->htcc_fb_connection_button_cb(); ?>
146
- </div>
147
- </div>
148
- <?php
149
  }
150
  function htcc_section_as_render() {
151
  ?>
152
  <?php
153
- if ($this->fb_page_id && $this->token && $this->botid){
154
- $this->stepdis = "open";
155
- if ($this->api->mmOnlyCheck($this->fb_page_id)){
156
- $style = "disabled";
157
- $this->test = "none";
158
- }else{
159
- $style = "";
160
- $this->test = "block";
161
- }
162
- }
163
- ?>
164
- <h3 class="acc-title <?php echo $this->stepdis?>"><div class="circle">2</div>Set up your ChatBot<i class="fa fa-angle-down step_fa"></i></h3>
165
- <div class="acc-content answering-service <?php echo $style; ?>" style="display:block">
166
- <div class="accordionItemHeading">
167
-
168
- <div class="mm_only" style="display: none">
169
- <h6><?php _e('Looks like you\'ve already worked in MobileMonkey. Please use the MobileMonkey app to make additional edits to the \'Welcome message\' and \'Answering Service\'.', 'wp-chatbot') ?></h6>
170
- <a target="_blank" rel="noopener noreferrer" href='https://app.mobilemonkey.com/chatbot-editor/<?php echo"$this->internal"?>/home' class="button">Go to MobileMonkey</a>
171
- </div>
172
- <?php
173
- }
174
- function print_additional_settings_section_info() {
175
- ?>
176
- </div>
177
- </div>
178
- <h3 class="acc-title <?php echo $this->stepdis?>"><div class="circle">3</div>Customize<i class="fa fa-angle-down step_fa"></i></h3>
179
- <div class="acc-content" style="display:block">
180
- <div class="accordionItemHeading">
181
- <?php
182
-
183
- }
184
- public function htcc_fb_connection_button_cb()
185
- {
186
- $options = get_option('htcc_options');
187
- $options_as = get_option('htcc_as_options');
188
- $api = $this->getApi();
189
- $api->logoutMobilemonkey();
190
- $token = $api->connectMobileMonkey();
191
-
192
- if ($token) {
193
- $reset = FALSE;
194
- if ($api->connectPage() || $api->disconnectPage()) {
195
- $reset = TRUE;
196
- }
197
-
198
- $pages = $api->getPages();
199
-
200
- $activePage = $api->getActivePage($reset);
201
- if ($activePage) {
202
- if ($activePage['bot_id']){
203
- if ($_REQUEST['settings-updated']){
204
- if (!$this->api->mmOnlyCheck($this->fb_page_id)){
205
- $test = $api->getWidgets($activePage['remote_id']);
206
- if ((float)$test->enabled!== (float)$options_as['fb_as_state']){
207
-
208
- if ($options_as['fb_as_state']== null || $options_as['fb_as_state']==0){
209
- $valuse = false;
210
- } else {
211
- $valuse = true;
212
- }
213
- $api->AsStateSave($valuse,$activePage['remote_id']);
214
- }
215
- if ($test) {
216
- foreach ($test->widgets as $key=>$value){
217
- if ($value->type == "quick_question"){
218
- $key+=1;
219
- if ($options_as['fb_answer'.$key.'']!== $value->config->body){
220
- $dump_value = $value;
221
- $dump_value->config->body = $options_as['fb_answer'.$key.''];
222
- $api->updateWidgets($dump_value);
223
- }
224
- }
225
- if ($value->type == 'text'){
226
- if ($options_as['thank_message']!== $value->config->body) {
227
- $dump_value = $value;
228
- $dump_value->config->body = $options_as['thank_message'];
229
- $api->updateWidgets($dump_value);
230
-
231
- }
232
- }
233
- if ($value->type == 'email'){
234
- if ($options_as['email']!== $value->config->recipient) {
235
- $dump_value = $value;
236
- $dump_value->config->recipient = $options_as['email'];
237
- $api->updateWidgets($dump_value);
238
-
239
- }
240
- }
241
- }
242
- }
243
- $current_welcome_message = $api->getWelcomeMessage($activePage['remote_id']);
244
- if ($options['fb_welcome_message'] !== $current_welcome_message) {
245
- $api->updateWelcomeMessage($options['fb_welcome_message'], $activePage['remote_id']);
246
- }
247
- }
248
- }
249
- $custom_settings = $this->api->getCustomChatSettings($activePage['remote_id']);
250
- if ($_REQUEST['settings-updated']){
251
- if ($custom_settings) {
252
- foreach ($custom_settings as $key=>$value){
253
- if ($key != "js_src"){
254
- if ($key == 'hide_mobile' || $key == 'hide_desktop'){
255
- if (!$options['fb_'.$key]){
256
- $options['fb_'.$key] = false;
257
- }else{
258
- $options['fb_'.$key] = true;
259
- }
260
- }
261
- if ($options['fb_'.$key]!=$value){
262
- $new_value[$key] = $options['fb_'.$key];
263
-
264
- }
265
- }
266
- }
267
- if (!empty($new_value)){
268
- $api->updateCustomChatSettings($new_value,$activePage['remote_id']);
269
- }
270
- }
271
- $current_language = $api->getLanguage($activePage['remote_id']);
272
- if (!empty($options['fb_sdk_lang']) && $options['fb_sdk_lang'] !== $current_language) {
273
- $api->updateLanguage($options['fb_sdk_lang'], $activePage['remote_id']);
274
- }
275
- }else {
276
-
277
- foreach ($custom_settings as $key=>$value){
278
- $options['fb_'.$key]=$value;
279
- if (!$reset){
280
- update_option('htcc_options', $options);
281
- }
282
- }
283
-
284
- }
285
-
286
- }else {
287
- echo "<style>.settings-error{display: none}</style>";
288
- $this->api->renderNotice('Your chatbot has been disabled in MobileMonkey. Please reactivate it before making additional edits. Go <a target="_blank" rel="noopener noreferrer" href="https://app.mobilemonkey.com/chatbot-editor/">here</a> to reactivate your chatbot');
289
- }
290
-
291
-
292
- $fb_connected_area_active_page_settings = [
293
- 'connected_page' => $activePage,
294
- 'current_facebook_page_block' => '',
295
- 'logout_path' => add_query_arg([
296
- 'page' => HTCC_PLUGIN_MAIN_MENU,
297
- 'logout' => true,
298
- ], admin_url('admin.php')),
299
- ];
300
- HT_CC::view('ht-cc-admin-fb-button-connected', $fb_connected_area_active_page_settings);
301
-
302
- } else {
303
- if ($this->internal){
304
- echo "<style>.settings-error{display: none}</style>";
305
- $this->api->renderNotice('Your Facebook page has been disconnected in MobileMonkey. Please connect to a page to reactivate your chatbot.');
306
- }
307
- $fb_connected_area_pages_settings = [
308
- 'pages' => $pages,
309
- 'logout_path' => add_query_arg([
310
- 'page' => HTCC_PLUGIN_MAIN_MENU,
311
- 'logout' => true,
312
- ], admin_url('admin.php')),
313
- ];
314
- HT_CC::view('ht-cc-admin-fb-button-select-page', $fb_connected_area_pages_settings);
315
- }
316
-
317
- } else {
318
-
319
- HT_CC::view('ht-cc-admin-fb-button-not-connected', [
320
- 'options' => $options,
321
- 'path' => $this->getApi()->connectLink(),
322
- ]);
323
- }
324
-
325
  }
326
 
327
 
328
  // color - next new version added ..
329
  public function htcc_fb_color_cb_old()
330
  {
331
- $htcc_fb_color = get_option('htcc_options');
332
  ?>
333
 
334
  <div class="row">
335
  <div class="input-field col s12">
336
 
337
- <!-- <input name="htcc_options[fb_color]" data-default-color="#26a69a" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="text" class="htcc-color-wp" style="height: 1.375rem;" > -->
338
 
339
- <input id="htcc-color-wp" class="htcc-color-wp" name="htcc_options[fb_color]"
340
  value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="text"
341
  style="height: 1.375rem;">
342
- <p class="description"><?php _e('messenger theme color, leave empty for default color - ', 'wp-chatbot') ?>
343
  <a target="_blank"
344
  href="https://mobilemonkey.com/wp-chatbot/messenger-theme-color/"><?php _e('more info', 'wp-chatbot') ?></a>
345
  </p>
@@ -352,63 +272,66 @@ if (!class_exists('HTCC_Admin')) :
352
  public function htcc_fb_color_cb()
353
  {
354
 
355
- $htcc_fb_color = get_option('htcc_options');
356
  ?>
 
 
 
357
  <div class="row">
358
  <div class="input-field col s12">
359
- <!-- <input name="htcc_options[fb_color]" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="color" class="htcc-color-wp" style="width: 5rem; height: 1.5rem;" > -->
360
- <input name="htcc_options[fb_color]" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>"
361
  type="text" class="htcc-color-wp" style="height: 1.375rem;">
362
- <p class="description"><?php _e('messenger theme color, leave empty for default color - ', 'wp-chatbot') ?>
363
- <a target="_blank"
364
- href="https://mobilemonkey.com/wp-chatbot/messenger-theme-color/"><?php _e('more info', 'wp-chatbot') ?></a>
365
- </p>
366
  <!-- <p class="description"><?php _e('please open settings page in the browser that supports "type color", we are planning to make a better way to choose the color ', 'wp-chatbot') ?></p> -->
367
  </div>
368
  </div>
369
  <?php
370
  }
371
- public function htcc_fb_as_state_cb()
372
- {
373
- $htcc_fb_as_state = get_option('htcc_as_options');
374
- ?>
375
- <div class="row">
376
- <div class="input-field as_state col s12">
377
- <label class="switch">
378
- <input id="htcc_fb_as_state" name="htcc_as_options[fb_as_state]" type="checkbox" value="1" <?php checked($htcc_fb_as_state['fb_as_state'], 1); ?>/>
379
- <span class="slider round"></span>
380
- </label>
381
- <p><?php _e('Answering Service is on', 'wp-chatbot') ?></p>
382
- </div>
383
- </div>
384
- <?php
385
- }
386
 
387
  // Welcome message
388
  public function htcc_fb_welcome_message_cb()
389
  {
390
- $htcc_fb_welcome_message = get_option('htcc_options');
 
391
  $htcc_fb_app_id = get_option('mobilemonkey_environment');
392
  ?>
393
  <div class="row">
394
- <div class="test-bot-button" style="display: <?php echo $this->test; ?>">
395
- <div class="test-bot-button__button-wrapper">
396
- <div class="test-bot-button__messenger">
397
- <div class="fb-send-to-messenger"
398
- messenger_app_id="<?php echo $htcc_fb_app_id->fb_app_id; ?>"
399
- page_id="<?php echo $this->fb_page_id; ?>"
400
- color="blue"
401
- size="large">
 
 
 
 
402
  </div>
403
  </div>
 
404
  </div>
405
- </div>
406
-
407
- <a target="_blank" rel="noopener noreferrer" style="display: none" href="https://www.m.me/<?php echo $this->fb_page_id?>" id="messanger" class="button testchat">Open Messenger</a>
408
- <h6><?php _e('Welcome message', 'wp-chatbot') ?></h6>
409
  <div class="input-field col s12">
410
- <label for="fb_greeting_login"><?php _e('WP-Chatbot will greet your chat users with this message.', 'wp-chatbot') ?></label>
411
- <textarea rows="5" style="width:78%" name="htcc_options[fb_welcome_message]" id="fb_welcome_message"> <?php echo esc_attr($htcc_fb_welcome_message['fb_welcome_message']) ?></textarea>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  </div>
413
  </div>
414
  <?php
@@ -418,9 +341,9 @@ if (!class_exists('HTCC_Admin')) :
418
  $htcc_fb_answer1 = get_option('htcc_as_options');
419
  ?>
420
  <div class="row as">
421
- <div class="input-field col s9">
422
  <h6><?php _e('Quick Questions', 'wp-chatbot') ?></h6>
423
- <label for="fb_answer1"><?php _e('WP-Chatbot will ask your chat users a few questions.', 'wp-chatbot') ?></label>
424
  <input type="text" name="htcc_as_options[fb_answer1]" id="fb_answer1"
425
  value="<?php echo esc_attr($htcc_fb_answer1['fb_answer1']) ?>">
426
  </div>
@@ -432,7 +355,7 @@ if (!class_exists('HTCC_Admin')) :
432
  $htcc_fb_answer2 = get_option('htcc_as_options');
433
  ?>
434
  <div class="row as">
435
- <div class="input-field col s9">
436
  <input type="text" name="htcc_as_options[fb_answer2]" id="fb_answer2"
437
  value="<?php echo esc_attr($htcc_fb_answer2['fb_answer2']) ?>">
438
  </div>
@@ -444,7 +367,7 @@ if (!class_exists('HTCC_Admin')) :
444
  $htcc_fb_answer3 = get_option('htcc_as_options');
445
  ?>
446
  <div class="row as">
447
- <div class="input-field col s9">
448
  <input type="text" name="htcc_as_options[fb_answer3]" id="fb_answer3"
449
  value="<?php echo esc_attr($htcc_fb_answer3['fb_answer3']) ?>">
450
  </div>
@@ -456,9 +379,8 @@ if (!class_exists('HTCC_Admin')) :
456
  $htcc_fb_thank_answer = get_option('htcc_as_options');
457
  ?>
458
  <div class="row as">
459
- <div class="input-field col s9">
460
- <h6><?php _e('Thank you message', 'wp-chatbot') ?></h6>
461
- <label for="fb_answer1"><?php _e('Thank your users for answering your questions, and let them know you\'ll get back to them.', 'wp-chatbot') ?></label>
462
  <input type="text" name="htcc_as_options[thank_message]" id="thank_message"
463
  value="<?php echo esc_attr($htcc_fb_thank_answer['thank_message']) ?>">
464
  </div>
@@ -469,18 +391,26 @@ if (!class_exists('HTCC_Admin')) :
469
  {
470
  $htcc_fb_email_trans = get_option('htcc_as_options');
471
  ?>
472
- <div class="row as">
473
- <div class="input-field col s9">
474
- <h6><?php _e('Email to send transcripts to:', 'wp-chatbot') ?></h6>
475
- <label for="htcc_fb_email_trans"><?php _e('When people answer all of the questions below, we can send the answers to an email address of your choice!', 'wp-chatbot') ?></label>
476
- <input type="text" name="htcc_as_options[email]" id="email"
477
- value="<?php echo esc_attr($htcc_fb_email_trans['email']) ?>">
 
 
 
 
 
 
 
 
 
 
 
478
  </div>
479
  </div>
480
- <div class="row mobilego">
481
- <h6><?php _e('Add More Questions and Customization for free in MobileMonkey!', 'wp-chatbot') ?></h6>
482
- <a target="_blank" rel="noopener noreferrer" href='https://app.mobilemonkey.com/chatbot-editor/<?php echo $this->botid?>/bot-builder' class="button">Enter MobileMonkey Free Web Edition</a>
483
- </div>
484
  <?php
485
  }
486
 
@@ -488,17 +418,16 @@ if (!class_exists('HTCC_Admin')) :
488
  public function htcc_fb_greeting_login_cb()
489
  {
490
 
491
- $htcc_fb_greeting_login = get_option('htcc_options');
492
  ?>
493
  <div class="row">
494
  <div class="input-field col s12">
495
- <input type="text" name="htcc_options[fb_logged_in_greeting]" id="fb_greeting_login"
496
- value="<?php echo esc_attr($htcc_fb_greeting_login['fb_logged_in_greeting']) ?>">
497
- <label for="fb_greeting_login"><?php _e('Logged in Greetings', 'ht-click') ?></label>
498
- <p class="description"><?php _e('Greetings text - If Facebook logged in the current browser, leave empty for default message - ', 'wp-chatbot') ?>
499
  <a target="_blank"
500
  href="https://mobilemonkey.com/wp-chatbot/change-facebook-messenger-greetings-text/"><?php _e('more info', 'wp-chatbot') ?></a>
501
- </p>
 
 
502
  <!-- <p class="description"><?php _e('Grettings can add in any language, this can be different to the messenger language', 'wp-chatbot') ?></p> -->
503
  <!-- <p class="description"><?php _e('If this Greetings fields are blank, default Greetings will load based on Messenger Language', 'wp-chatbot') ?></p> -->
504
  </div>
@@ -510,17 +439,15 @@ if (!class_exists('HTCC_Admin')) :
510
  public function htcc_fb_greeting_logout_cb()
511
  {
512
 
513
- $htcc_fb_greeting_logout = get_option('htcc_options');
514
  ?>
515
  <div class="row">
516
  <div class="input-field col s12">
517
- <input type="text" name="htcc_options[fb_logged_out_greeting]" id="fb_greeting_logout"
518
- value="<?php echo esc_attr($htcc_fb_greeting_logout['fb_logged_out_greeting']) ?>">
519
- <label for="fb_greeting_logout"><?php _e('Logged out Greetings', 'ht-click') ?></label>
520
- <p class="description"><?php _e('Greetings text - If Facebook logged out in the current browser, leave empty for default message - ', 'wp-chatbot') ?>
521
  <a target="_blank"
522
- href="https://mobilemonkey.com/wp-chatbot/change-facebook-messenger-greetings-text/"><?php _e('more info', 'wp-chatbot') ?></a>
523
- </p>
 
524
  </div>
525
  </div>
526
  <?php
@@ -529,13 +456,18 @@ if (!class_exists('HTCC_Admin')) :
529
  // sdk lang. / messenger lang
530
  public function htcc_fb_sdk_lang_cb()
531
  {
532
- if ($this->fb_page_id && $this->token && $this->botid){
533
- $lang = $this->api->getLanguage($this->fb_page_id);
534
  }
535
  ?>
536
  <div class="row">
537
  <div class="input-field col s12">
538
- <select name="htcc_options[fb_sdk_lang]">
 
 
 
 
 
539
  <?php
540
  $fb_lang = HTCC_Lang::$fb_lang;
541
 
@@ -546,79 +478,87 @@ if (!class_exists('HTCC_Admin')) :
546
  }
547
  ?>
548
  </select>
549
- <label for=""><?php _e('Language', 'ht-click') ?></label>
550
- <p class="description"><?php _e('Language displays in chat window, not user input - ', 'wp-chatbot') ?>
551
- <a target="_blank"
552
- href="https://mobilemonkey.com/wp-chatbot/messenger-language/"><?php _e('more info', 'wp-chatbot') ?></a>
553
- </p>
554
- <p class="description"><?php _e('Facebook SDK is not supporting all languages.., please don\'t consider it, as an error ', 'wp-chatbot') ?> </p>
555
- <!-- <p class="description"><?php _e('If desired Language is not added - ', 'wp-chatbot') ?><a target="_blank" href="https://www.messenger.com/t/1541811499235090/"><?php _e('please message us', 'wp-chatbot') ?></a> </p> -->
556
  </div>
557
  </div>
558
  <?php
559
  }
560
 
561
-
562
  // greeting_dialog_display - since v2.2
563
  public function htcc_fb_greeting_dialog_display_cb()
564
  {
565
- $greeting_dialog_display = get_option('htcc_options');
566
  $min_value = esc_attr($greeting_dialog_display['fb_greeting_dialog_display']);
567
  ?>
568
- <div class="row">
569
  <div class="input-field col s12">
570
- <select name="htcc_options[fb_greeting_dialog_display]" class="select-1">
571
- <option value="" <?php echo $min_value == "" ? 'SELECTED' : ''; ?> >Default</option>
572
- <option value="show" <?php echo $min_value == "show" ? 'SELECTED' : ''; ?> >Show</option>
573
- <option value="fade" <?php echo $min_value == "fade" ? 'SELECTED' : ''; ?> >Fade</option>
574
- <option value="hide" <?php echo $min_value == "hide" ? 'SELECTED' : ''; ?> >Hide</option>
575
- </select>
576
- <label for=""><?php _e('Greeting Dialog Display', 'ht-click') ?></label>
577
- <p class="description"><?php _e('Greetings Dialog Display - ', 'wp-chatbot') ?><a target="_blank"
578
- href="https://mobilemonkey.com/wp-chatbot/greeting-dialog-display/"><?php _e('more info', 'wp-chatbot') ?></a>
579
- </p>
580
- <p class="description"><?php _e('Show - The greeting dialog will always be shown when the plugin loads.', 'wp-chatbot') ?></p>
581
- <p class="description"><?php _e('Fade - The greeting dialog of the plugin will be shown, then fade away and stay hidden afterwards.', 'wp-chatbot') ?></p>
582
- <p class="description"><?php _e('Hide - The greeting dialog of the plugin will always be hidden until a user clicks on the plugin.', 'wp-chatbot') ?></p>
 
 
 
 
 
 
 
 
 
583
  </div>
584
  </div>
585
  <?php
586
  }
587
-
588
  // greeting_dialog_delay - since v2.2
589
  public function htcc_fb_greeting_dialog_delay_cb()
590
  {
591
- $greeting_dialog_delay = get_option('htcc_options');
592
  $delay_time = esc_attr($greeting_dialog_delay['fb_greeting_dialog_delay']);
593
  ?>
594
- <div class="row">
595
  <div class="input-field col s12">
596
- <input type="number" min="0" name="htcc_options[fb_greeting_dialog_delay]" id="fb_greeting_dialog_delay"
597
- value="<?php echo $delay_time ?>">
598
- <label for="fb_greeting_dialog_delay"><?php _e('Greeting Dialog Delay', 'ht-click') ?></label>
599
- <p class="description"><?php _e('Sets the number of seconds of delay before the greeting dialog is shown after the plugin is loaded. Leave blank to disable delay - ', 'wp-chatbot') ?>
600
  <a target="_blank"
601
- href="https://mobilemonkey.com/wp-chatbot/greeting-dialog-delay/"><?php _e('more info', 'wp-chatbot') ?></a>
602
- </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
603
  </div>
604
  </div>
605
  <?php
606
  }
607
 
608
 
609
-
610
-
611
  // minimized - deprecated - since v2.2
612
  // removed since 3.2
613
  public function htcc_fb_is_minimized_cb()
614
  {
615
- $minimized = get_option('htcc_options');
616
  $min_value = esc_attr($minimized['minimized']);
617
  ?>
618
  <div class="row">
619
  <div class="input-field col s12">
620
  <div>
621
- <select name="htcc_options[minimized]" class="select-1">
622
  <option value="" <?php echo $min_value == "" ? 'SELECTED' : ''; ?> >Default</option>
623
  <option value="false" <?php echo $min_value == "false" ? 'SELECTED' : ''; ?> >False</option>
624
  <option value="true" <?php echo $min_value == "true" ? 'SELECTED' : ''; ?> >True</option>
@@ -635,14 +575,18 @@ if (!class_exists('HTCC_Admin')) :
635
  // checkboxes - Hide based on Type of posts ..
636
  public function htcc_show_hide_post_types_cb()
637
  {
638
- $htcc_checkbox = get_option('htcc_options');
639
-
 
 
 
 
640
  // Single Posts
641
  if (isset($htcc_checkbox['hideon_posts'])) {
642
  ?>
643
  <p>
644
  <label>
645
- <input name="htcc_options[hideon_posts]" type="checkbox"
646
  value="1" <?php checked($htcc_checkbox['hideon_posts'], 1); ?> id="filled-in-box1"/>
647
  <span><?php _e('Hide on - Posts', 'wp-chatbot') ?></span>
648
  </label>
@@ -652,7 +596,7 @@ if (!class_exists('HTCC_Admin')) :
652
  ?>
653
  <p>
654
  <label>
655
- <input name="htcc_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1"/>
656
  <span><?php _e('Hide on - Posts', 'wp-chatbot') ?></span>
657
  </label>
658
  </p>
@@ -665,7 +609,7 @@ if (!class_exists('HTCC_Admin')) :
665
  ?>
666
  <p>
667
  <label>
668
- <input name="htcc_options[hideon_page]" type="checkbox"
669
  value="1" <?php checked($htcc_checkbox['hideon_page'], 1); ?> id="filled-in-box2"/>
670
  <span><?php _e('Hide on - Pages', 'wp-chatbot') ?></span>
671
  </label>
@@ -675,7 +619,7 @@ if (!class_exists('HTCC_Admin')) :
675
  ?>
676
  <p>
677
  <label>
678
- <input name="htcc_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2"/>
679
  <span><?php _e('Hide on - Pages', 'wp-chatbot') ?></span>
680
  </label>
681
  </p>
@@ -688,7 +632,7 @@ if (!class_exists('HTCC_Admin')) :
688
  ?>
689
  <p>
690
  <label>
691
- <input name="htcc_options[hideon_homepage]" type="checkbox"
692
  value="1" <?php checked($htcc_checkbox['hideon_homepage'], 1); ?> id="filled-in-box3"/>
693
  <span><?php _e('Hide on - Home Page', 'wp-chatbot') ?></span>
694
  </label>
@@ -698,7 +642,7 @@ if (!class_exists('HTCC_Admin')) :
698
  ?>
699
  <p>
700
  <label>
701
- <input name="htcc_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3"/>
702
  <span><?php _e('Hide on - Home Page', 'wp-chatbot') ?></span>
703
  </label>
704
  </p>
@@ -714,7 +658,7 @@ if (!class_exists('HTCC_Admin')) :
714
  ?>
715
  <p>
716
  <label>
717
- <input name="htcc_options[hideon_frontpage]" type="checkbox"
718
  value="1" <?php checked($htcc_checkbox['hideon_frontpage'], 1); ?> id="filled-in-box4"/>
719
  <span><?php _e('Hide on - Front Page', 'wp-chatbot') ?></span>
720
  </label>
@@ -724,7 +668,7 @@ if (!class_exists('HTCC_Admin')) :
724
  ?>
725
  <p>
726
  <label>
727
- <input name="htcc_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4"/>
728
  <span><?php _e('Hide on - Front Page', 'wp-chatbot') ?></span>
729
  </label>
730
  </p>
@@ -737,7 +681,7 @@ if (!class_exists('HTCC_Admin')) :
737
  ?>
738
  <p>
739
  <label>
740
- <input name="htcc_options[hideon_category]" type="checkbox"
741
  value="1" <?php checked($htcc_checkbox['hideon_category'], 1); ?> id="filled-in-box5"/>
742
  <span><?php _e('Hide on - Category', 'wp-chatbot') ?></span>
743
  </label>
@@ -747,7 +691,7 @@ if (!class_exists('HTCC_Admin')) :
747
  ?>
748
  <p>
749
  <label>
750
- <input name="htcc_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5"/>
751
  <span><?php _e('Hide on - Category', 'wp-chatbot') ?></span>
752
  </label>
753
  </p>
@@ -760,7 +704,7 @@ if (!class_exists('HTCC_Admin')) :
760
  ?>
761
  <p>
762
  <label>
763
- <input name="htcc_options[hideon_archive]" type="checkbox"
764
  value="1" <?php checked($htcc_checkbox['hideon_archive'], 1); ?> id="filled-in-box6"/>
765
  <span><?php _e('Hide on - Archive', 'wp-chatbot') ?></span>
766
  </label>
@@ -770,7 +714,7 @@ if (!class_exists('HTCC_Admin')) :
770
  ?>
771
  <p>
772
  <label>
773
- <input name="htcc_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6"/>
774
  <span><?php _e('Hide on - Archive', 'wp-chatbot') ?></span>
775
  </label>
776
  </p>
@@ -783,7 +727,7 @@ if (!class_exists('HTCC_Admin')) :
783
  ?>
784
  <p>
785
  <label>
786
- <input name="htcc_options[hideon_404]" type="checkbox"
787
  value="1" <?php checked($htcc_checkbox['hideon_404'], 1); ?> id="filled-in-box7"/>
788
  <span><?php _e('Hide on - 404 Page', 'wp-chatbot') ?></span>
789
  </label>
@@ -793,17 +737,14 @@ if (!class_exists('HTCC_Admin')) :
793
  ?>
794
  <p>
795
  <label>
796
- <input name="htcc_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7"/>
797
  <span><?php _e('Hide on - 404 Page', 'wp-chatbot') ?></span>
798
  </label>
799
  </p>
800
  <?php
801
  }
802
  ?>
803
- <p class="description"> <?php _e('check for not to load Messenger - based on type of the page - ', 'wp-chatbot') ?>
804
- <a target="_blank"
805
- href="https://mobilemonkey.com/wp-chatbot/show-hide-messenger-based-on-type-of-the-page/"><?php _e('more info', 'wp-chatbot') ?></a>
806
- </p>
807
 
808
 
809
  <?php
@@ -813,16 +754,16 @@ if (!class_exists('HTCC_Admin')) :
813
  // ID 's list to hide styles
814
  function htcc_list_id_tohide_cb()
815
  {
816
- $htcc_list_id_tohide = get_option('htcc_options');
817
  ?>
818
  <div class="row">
819
  <div class="input-field col s12">
820
- <input name="htcc_options[list_hideon_pages]"
821
  value="<?php echo esc_attr($htcc_list_id_tohide['list_hideon_pages']) ?>"
822
- id="list_hideon_pages htcc_list_id_tohide" type="text">
823
- <label for="list_hideon_pages"><?php _e('Post, Page Ids to Hide', 'ht-click') ?></label>
824
- <p class="description"> <?php _e('Add Post, Page, Media - ID\'s to hide,', 'wp-chatbot') ?>
825
- <br> <?php _e('can add multiple IDs separate with comma ( , )', 'wp-chatbot') ?> - <a
826
  target="_blank"
827
  href="https://mobilemonkey.com/wp-chatbot/hide-messenger-based-on-post-id/"><?php _e('more info', 'wp-chatbot') ?></a>
828
  </p>
@@ -834,16 +775,16 @@ if (!class_exists('HTCC_Admin')) :
834
  // Categorys list - to hide
835
  function htcc_list_cat_tohide_cb()
836
  {
837
- $htcc_list_cat_tohide = get_option('htcc_options');
838
  ?>
839
  <div class="row">
840
  <div class="input-field col s12">
841
- <input name="htcc_options[list_hideon_cat]"
842
  value="<?php echo esc_attr($htcc_list_cat_tohide['list_hideon_cat']) ?>"
843
- id="list_hideon_cat htcc_list_cat_tohide" type="text">
844
- <label for="list_hideon_cat"><?php _e('Categorys to Hide', 'ht-click') ?></label>
845
- <p class="description"> <?php _e('Category name\'s to hide,', 'wp-chatbot') ?>
846
- <br> <?php _e('can add multiple Categories separate with comma ( , )', 'wp-chatbot') ?> - <a
847
  target="_blank"
848
  href="https://mobilemonkey.com/wp-chatbot/hide-messenger-based-on-category/"><?php _e('more info', 'wp-chatbot') ?></a>
849
  </p>
@@ -856,14 +797,14 @@ if (!class_exists('HTCC_Admin')) :
856
  // checkboxes - based on Type of device ..
857
  public function htcc_show_hide_devices_cb()
858
  {
859
- $htcc_devices = get_option('htcc_options');
860
 
861
  // Hide on Mobile Devices
862
  if (isset($htcc_devices['fb_hide_mobile'])) {
863
  ?>
864
  <p>
865
  <label>
866
- <input name="htcc_options[fb_hide_mobile]" type="checkbox"
867
  value="1" <?php checked($htcc_devices['fb_hide_mobile'], 1); ?> id="fb_hide_mobile"/>
868
  <span><?php _e('Hide on - Mobile Devices', 'wp-chatbot') ?></span>
869
  </label>
@@ -873,7 +814,7 @@ if (!class_exists('HTCC_Admin')) :
873
  ?>
874
  <p>
875
  <label>
876
- <input name="htcc_options[fb_hide_mobile]" type="checkbox" value="1" id="fb_hide_mobile"/>
877
  <span><?php _e('Hide on - Mobile Devices', 'wp-chatbot') ?></span>
878
  </label>
879
  </p>
@@ -886,7 +827,7 @@ if (!class_exists('HTCC_Admin')) :
886
  ?>
887
  <p>
888
  <label>
889
- <input name="htcc_options[fb_hide_desktop]" type="checkbox"
890
  value="1" <?php checked($htcc_devices['fb_hide_desktop'], 1); ?> id="fb_hide_desktop"/>
891
  <span><?php _e('Hide on - Desktops', 'wp-chatbot') ?></span>
892
  </label>
@@ -896,7 +837,7 @@ if (!class_exists('HTCC_Admin')) :
896
  ?>
897
  <p>
898
  <label>
899
- <input name="htcc_options[fb_hide_desktop]" type="checkbox" value="1" id="fb_hide_desktop"/>
900
  <span><?php _e('Hide on - Desktops', 'wp-chatbot') ?></span>
901
  </label>
902
  </p>
@@ -908,13 +849,13 @@ if (!class_exists('HTCC_Admin')) :
908
  // Custom shortcode
909
  function htcc_custom_shortcode_cb()
910
  {
911
- $htcc_shortcode = get_option('htcc_options');
912
  ?>
913
  <div class="row">
914
  <div class="input-field col s12">
915
- <input name="htcc_options[shortcode]" value="<?php echo esc_attr($htcc_shortcode['shortcode']) ?>"
916
  id="shortcode" type="text" class="validate input-margin">
917
- <label for="shortcode"><?php _e('Shortcode name', 'ht-click') ?></label>
918
  <?php
919
  // $shorcode_list = '';
920
  // foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
@@ -925,7 +866,7 @@ if (!class_exists('HTCC_Admin')) :
925
  - <a target="_blank"
926
  href="https://mobilemonkey.com/wp-chatbot/change-shortcode-name/"><?php _e('more info', 'wp-chatbot') ?></a>
927
  </p>
928
- <p class="description"> <?php _e('please don\'t add an already existing shortcode name', 'wp-chatbot') ?>
929
  <!-- <p class="description"> <?php _e('please dont add this already existing shorcode names', 'wp-chatbot') ?> - </p> -->
930
  </div>
931
  </div>
@@ -936,85 +877,112 @@ if (!class_exists('HTCC_Admin')) :
936
 
937
  public function htcc_options_sanitize($input)
938
  {
939
- $option = get_option('htcc_options');
940
- $error=false;
941
- $error_delay_lenght =false;
942
- $error_delay_value =false;
 
 
 
 
 
 
 
 
 
 
 
 
 
943
  if (!current_user_can('manage_options')) {
944
  wp_die('not allowed to modify - please contact admin ');
945
  }
946
 
947
  $new_input = array();
948
-
 
 
949
  foreach ($input as $key => $value) {
950
- if ($key == 'fb_welcome_message' && $_REQUEST['action']== 'update' && !$this->api->mmOnlyCheck($this->fb_page_id)){
951
- if ($value == '' || ctype_space($value)){
952
- $new_input[$key] = $option[$key];
953
- $error = true;
954
- }else {
955
- $new_input[$key] = sanitize_text_field($input[$key]);
956
- }
957
- }elseif($key == 'fb_greeting_dialog_delay' && $_REQUEST['action']== 'update'){
958
- if (strlen($value) > 9){
959
- $new_input[$key] = $option[$key];
960
- $error_delay_lenght = true;
961
- }else {
962
- if ($value == '0'){
963
- $error_delay_value = true;
964
- $new_input[$key] = $option[$key];
965
- }else {
966
- $new_input[$key] = sanitize_text_field($input[$key]);
967
- }
968
- }
969
- }elseif(isset($input[$key])) {
970
  $new_input[$key] = sanitize_text_field($input[$key]);
971
  }
972
  }
973
- if ($error){
974
- $this->api->settingSaveError("welcome_message");
975
- }
976
  if ($error_delay_lenght){
977
- $this->api->settingSaveError("delay_length");
978
- }
979
  if ($error_delay_value){
980
- $this->api->settingSaveError("delay_0");
981
- }
982
  return $new_input;
983
  }
984
  public function htcc_as_options_sanitize($input)
985
  {
986
- $error=false;
987
- $error_email=false;
988
- $option = get_option('htcc_as_options');
 
 
989
 
990
  if (!current_user_can('manage_options')) {
991
  wp_die('not allowed to modify - please contact admin ');
992
  }
993
- if ($input){
994
- $new_input = array();
995
-
996
- foreach ($input as $key => $value) {
997
- if ($value == '' || ctype_space($value)){
998
- if ($_REQUEST['action'] == 'update'){
999
- $new_input[$key] = $option[$key];
1000
- $error = true;
1001
- }
1002
- }elseif (isset($input[$key])) {
1003
- if ($key == 'email' && !is_email($value)){
 
 
 
 
 
 
 
 
 
1004
  $new_input[$key] = $option[$key];
1005
- $error_email = true;
1006
- }else {
1007
- $new_input[$key] = sanitize_text_field($input[$key]);
1008
  }
1009
- }
1010
- }
1011
- }
1012
- if ($error){
1013
- $this->api->settingSaveError("AS");
1014
- }
1015
- if ($error_email){
1016
- $this->api->settingSaveError("email");
1017
- }
 
 
 
 
 
 
 
 
 
 
 
1018
  return $new_input;
1019
  }
1020
 
31
  $this->token = $this->api->connectMobileMonkey();
32
  $this->options = get_option('htcc_options');
33
  $this->fb_page_id = $this->options['fb_page_id'];
34
+ $this->botid = $this->api->getActiveBotId();
35
+ $this->internal = $this->api->getActivePage();
36
  $this->stepdis = "close";
37
  }
38
 
51
  */
52
  public function htcc_options_page()
53
  {
54
+ $notification = '!';
55
  add_menu_page(
56
  'WP-Chatbot Setting page',
57
+ !$this->fb_page_id || !$this->token || !$this->internal ? sprintf('WP-Chatbot <span class="awaiting-mod">%s</span>', $notification) : '<span data-tab="tab-1">WP-Chatbot</span>',
58
  'manage_options',
59
  'wp-chatbot',
60
  array($this, 'settings_page'),
61
  'dashicons-format-chat'
62
  );
 
 
 
 
 
63
 
64
+ if ($this->fb_page_id && $this->token && $this->internal){
65
+ add_submenu_page(
66
+ 'wp-chatbot',
67
+ 'wp-chatbot',
68
+ '<span data-tab="tab-1">Setup</span>',
69
+ 'manage_options',
70
+ 'wp-chatbot',
71
+ array($this, 'settings_page')
72
+ );
73
+ add_submenu_page(
74
+ 'wp-chatbot',
75
+ 'Customize',
76
+ '<span data-tab="tab-2">Customize</span>',
77
+ 8,
78
+ '',
79
+ ''
80
+ );
81
+ add_submenu_page(
82
+ 'wp-chatbot',
83
+ 'Contacts',
84
+ '<span data-tab="tab-3">Contacts</span>',
85
+ 8,
86
+ '',
87
+ ''
88
+ );
89
+ add_submenu_page(
90
+ 'wp-chatbot',
91
+ 'Your Subscription',
92
+ '<span data-tab="tab-4">Your Subscription</span>',
93
+ 8,
94
+ '',
95
+ ''
96
+ );
97
+ }
98
 
99
  }
100
+ /**
101
+ * Incomplete Setup Notification
102
+ *
103
+ * @uses action hook - admin_init
104
+ *
105
+ * @since 1.0.0
106
+ * @return void
107
+ */
108
+ public function htcc_incomplete_setup(){
109
+ if (!$this->fb_page_id || !$this->token || !$this->internal){
110
+ add_action( 'admin_bar_menu', function( \WP_Admin_Bar $bar )
111
+ {
112
+ $bar->add_menu( array(
113
+ 'id' => 'wp-chatbot',
114
+ 'title' => '<span class="ab-icon chat-bot"></span>',
115
+ 'parent' => 'top-secondary',
116
+ 'href' => admin_url( 'admin.php?page=wp-chatbot' ),
117
+ 'meta' => array(
118
+ 'target' => '_self',
119
+ 'title' => __( 'Wp-Chatbot', 'htcc_plugin' ),
120
+ 'html' => '',
121
+ ),
122
+ ) );
123
+ }, 210);
124
+ }
125
 
126
+ }
127
+ public function example_admin_notice() {
128
+ if (!$this->fb_page_id || !$this->token || !$this->internal){
129
+ HT_CC::view('ht-cc-admin-notice-not-connected');
130
+ }
131
+ }
132
  /**
133
  * Options page Content -
134
  * get settings form from a template settings_page.php
149
  require_once('settings_page.php');
150
  }
151
 
152
+ public function get_tab_done(){
153
+ $response= array('done'=>true);
154
+ if (isset($_SESSION['tab'])){
155
+ $response = array(
156
+ 'tab-1' => isset($_SESSION['tab']['tab1'])?$_SESSION['tab']['tab1']:true,
157
+ 'tab-2' => isset($_SESSION['tab']['tab2'])?$_SESSION['tab']['tab2']:false,
158
+ 'tab-3' => isset($_SESSION['tab']['tab3'])?$_SESSION['tab']['tab3']:false,
159
+ );
160
+ }
161
+ wp_send_json_success ($response);
162
+ }
163
+
164
+ public function set_tab_done(){
165
+ $data = $_GET;
166
+ $response= array('done'=>true);
167
+ if (isset($data['state'])){
168
+ $renameMap = [
169
+ 'tab-1' => 'tab1',
170
+ 'tab-2' => 'tab2',
171
+ 'tab-3' => 'tab3'
172
+ ];
173
+ $data['state'] = array_combine(array_map(function($el) use ($renameMap) {
174
+ return $renameMap[$el];
175
+ }, array_keys($data['state'])), array_values($data['state']));
176
+ $_SESSION['tab'] = array_merge($_SESSION['tab'],$data['state']);
177
+ $response = array(
178
+ 'success' => true,
179
+ 'tab-1' => isset($_SESSION['tab']['tab1'])?$_SESSION['tab']['tab1']:true,
180
+ 'tab-2' => isset($_SESSION['tab']['tab2'])?$_SESSION['tab']['tab2']:false,
181
+ 'tab-3' => isset($_SESSION['tab']['tab3'])?$_SESSION['tab']['tab3']:false,
182
+ );
183
+ }
184
+ if (isset($data['setup'])){
185
+ $_SESSION['setup'] = $data['setup'];
186
+ }
187
+ wp_send_json_success ( $response,$_SESSION['setup']);
188
  }
189
 
190
+ public function set_current_tab(){
191
+ $data = $_POST;
192
+ $_SESSION['current'] = $data['current'];
193
+ wp_send_json_success ();
194
+ }
195
+
196
  /**
197
  * Options page - Regsiter, add section and add setting fields
198
  *
203
  */
204
  public function htcc_custom_settings()
205
  {
206
+
207
+ add_settings_section('htcc_settings_as', '', array($this, 'htcc_section_as_render'), 'htcc-as-setting-section');
208
+
209
+ add_settings_field('htcc_fb_welcome_message', __('Welcome Message', 'wp-chatbot'), array($this, 'htcc_fb_welcome_message_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
210
+ add_settings_field('htcc_fb_as_state', '', array($this, 'htcc_fb_as_state_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
211
+ add_settings_field('htcc_fb_answer1','', array($this, 'htcc_fb_answer1_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
212
+ add_settings_field('htcc_fb_answer2','', array($this, 'htcc_fb_answer2_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
213
+ add_settings_field('htcc_fb_answer3','', array($this, 'htcc_fb_answer3_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
214
+ add_settings_field('htcc_fb_thank_answer', __('Thank you Message', 'wp-chatbot'), array($this, 'htcc_fb_thank_answer_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
215
+ add_settings_field('htcc_fb_email_trans', __('Email to send transcripts to<span class="pro">PRO</span>', 'wp-chatbot'), array($this, 'htcc_fb_email_trans_cb'), 'htcc-as-setting-section', 'htcc_settings_as');
216
+ register_setting('htcc_as_setting_group', 'htcc_as_options', array($this, 'htcc_as_options_sanitize'));
217
+
218
+
219
+
220
+ add_settings_section('htcc_custom_settings', '', array($this, 'print_additional_settings_section_info'), 'wp-custom-settings-section');
221
+ add_settings_field('htcc_fb_color', __('Color', 'wp-chatbot'), array($this, 'htcc_fb_color_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
222
+ add_settings_field('htcc_fb_greeting_login', __('Logged in Greeting', 'wp-chatbot'), array($this, 'htcc_fb_greeting_login_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
223
+ add_settings_field('htcc_fb_greeting_logout', __('Logged out Greeting', 'wp-chatbot'), array($this, 'htcc_fb_greeting_logout_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
224
+ add_settings_field('htcc_fb_greeting_dialog_display', __('Greeting Dialog Display<span class="pro">PRO</span>', 'wp-chatbot'), array($this, 'htcc_fb_greeting_dialog_display_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
225
+ add_settings_field('htcc_fb_greeting_dialog_delay', __('Greeting Dialog Delay<span class="pro">PRO</span>', 'wp-chatbot'), array($this, 'htcc_fb_greeting_dialog_delay_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
226
+ add_settings_field('htcc_fb_sdk_lang', __('Messenger language', 'wp-chatbot'), array($this, 'htcc_fb_sdk_lang_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
227
+ add_settings_field('htcc_show_hide', __('Hide Based on post type', 'wp-chatbot'), array($this, 'htcc_show_hide_post_types_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
228
+ add_settings_field('htcc_list_id_tohide', __('Post, Page IDs to Hide', 'wp-chatbot'), array($this, 'htcc_list_id_tohide_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
229
+ add_settings_field('htcc_list_cat_tohide', __('Categories to Hide', 'wp-chatbot'), array($this, 'htcc_list_cat_tohide_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
230
+ add_settings_field('htcc_devices_show_hide', __('Hide Based on Devices', 'wp-chatbot'), array($this, 'htcc_show_hide_devices_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
231
+ add_settings_field('htcc_shortcode', __('Shortcode name', 'wp-chatbot'), array($this, 'htcc_custom_shortcode_cb'), 'wp-custom-settings-section', 'htcc_custom_settings');
232
+ register_setting('htcc_custom_setting_group', 'htcc_custom_options', array($this, 'htcc_custom_options_sanitize'));
233
+
234
  register_setting('htcc_setting_group', 'htcc_options', array($this, 'htcc_options_sanitize'));
235
  }
236
 
237
 
238
+ function print_additional_settings_section_info() {
239
+ ?>
240
+ <?php
 
 
 
 
 
 
 
241
  }
242
  function htcc_section_as_render() {
243
  ?>
244
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  }
246
 
247
 
248
  // color - next new version added ..
249
  public function htcc_fb_color_cb_old()
250
  {
251
+ $htcc_fb_color = get_option('htcc_custom_options');
252
  ?>
253
 
254
  <div class="row">
255
  <div class="input-field col s12">
256
 
257
+ <!-- <input name="htcc_custom_options[fb_color]" data-default-color="#26a69a" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="text" class="htcc-color-wp" style="height: 1.375rem;" > -->
258
 
259
+ <input id="htcc-color-wp" class="htcc-color-wp" name="htcc_custom_options[fb_color]"
260
  value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="text"
261
  style="height: 1.375rem;">
262
+ <p class="description"><?php _e('Messenger theme color; leave empty for default color', 'wp-chatbot') ?>
263
  <a target="_blank"
264
  href="https://mobilemonkey.com/wp-chatbot/messenger-theme-color/"><?php _e('more info', 'wp-chatbot') ?></a>
265
  </p>
272
  public function htcc_fb_color_cb()
273
  {
274
 
275
+ $htcc_fb_color = get_option('htcc_custom_options');
276
  ?>
277
+ <label for="htcc-color-wp" class="gray"> <?php _e('Messenger theme color; leave empty for default color', 'wp-chatbot') ?>
278
+ <a target="_blank"
279
+ href="https://mobilemonkey.com/wp-chatbot/messenger-theme-color/"><?php _e(' - more info', 'wp-chatbot') ?></a> </label>
280
  <div class="row">
281
  <div class="input-field col s12">
282
+ <!-- <input name="htcc_custom_options[fb_color]" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>" type="color" class="htcc-color-wp" style="width: 5rem; height: 1.5rem;" > -->
283
+ <input name="htcc_custom_options[fb_color]" id="htcc-color-wp" value="<?php echo esc_attr($htcc_fb_color['fb_color']) ?>"
284
  type="text" class="htcc-color-wp" style="height: 1.375rem;">
285
+
 
 
 
286
  <!-- <p class="description"><?php _e('please open settings page in the browser that supports "type color", we are planning to make a better way to choose the color ', 'wp-chatbot') ?></p> -->
287
  </div>
288
  </div>
289
  <?php
290
  }
291
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
292
 
293
  // Welcome message
294
  public function htcc_fb_welcome_message_cb()
295
  {
296
+ $htcc_fb_welcome_message = get_option('htcc_as_options');
297
+ $ref = get_option('htcc_fb_ref');
298
  $htcc_fb_app_id = get_option('mobilemonkey_environment');
299
  ?>
300
  <div class="row">
301
+ <div class="test_button__wrap">
302
+ <div class="test-bot-button" style="display: <?php echo $this->test; ?>">
303
+ <div class="test-bot-button__button-wrapper">
304
+ <div class="test-bot-button__messenger">
305
+ <div class="fb-send-to-messenger"
306
+ messenger_app_id="<?php echo $htcc_fb_app_id->fb_app_id; ?>"
307
+ page_id="<?php echo $this->fb_page_id; ?>"
308
+ data-ref="<?php echo $ref;?>"
309
+ color="blue"
310
+ size="large">
311
+ </div>
312
+ </div>
313
  </div>
314
  </div>
315
+ <a target="_blank" rel="noopener noreferrer" style="display: none" href="https://www.m.me/<?php echo $this->fb_page_id?>" id="messanger" class="button testchat">Open Messenger</a>
316
  </div>
 
 
 
 
317
  <div class="input-field col s12">
318
+ <label for="fb_welcome_message"><?php _e('Welcome message - WP-Chatbot will greet your chat users with this message.', 'wp-chatbot') ?></label>
319
+ <textarea rows="2" style="width:100%" name="htcc_as_options[fb_welcome_message]" id="fb_welcome_message"> <?php echo esc_attr($htcc_fb_welcome_message['fb_welcome_message'])?></textarea>
320
+ </div>
321
+ </div>
322
+ <?php
323
+ }
324
+ public function htcc_fb_as_state_cb()
325
+ {
326
+ $htcc_fb_as_state = get_option('htcc_as_options');
327
+ ?>
328
+ <div class="row">
329
+ <div class="input-field as_state col s12">
330
+ <label class="switch">
331
+ <input id="htcc_fb_as_state" name="htcc_as_options[fb_as_state]" type="checkbox" value="1" <?php isset($htcc_fb_as_state['fb_as_state']) ? checked($htcc_fb_as_state['fb_as_state'], 1) : checked(0); ?>/>
332
+ <span class="slider round"></span>
333
+ </label>
334
+ <p class="as_text"><?php _e('Answering Service', 'wp-chatbot') ?></p>
335
  </div>
336
  </div>
337
  <?php
341
  $htcc_fb_answer1 = get_option('htcc_as_options');
342
  ?>
343
  <div class="row as">
344
+ <div class="input-field col l12 m12">
345
  <h6><?php _e('Quick Questions', 'wp-chatbot') ?></h6>
346
+ <label class="gray" for="fb_answer1"><?php _e('WP-Chatbot will ask your chat users a few questions.', 'wp-chatbot') ?></label>
347
  <input type="text" name="htcc_as_options[fb_answer1]" id="fb_answer1"
348
  value="<?php echo esc_attr($htcc_fb_answer1['fb_answer1']) ?>">
349
  </div>
355
  $htcc_fb_answer2 = get_option('htcc_as_options');
356
  ?>
357
  <div class="row as">
358
+ <div class="input-field col l12 m12">
359
  <input type="text" name="htcc_as_options[fb_answer2]" id="fb_answer2"
360
  value="<?php echo esc_attr($htcc_fb_answer2['fb_answer2']) ?>">
361
  </div>
367
  $htcc_fb_answer3 = get_option('htcc_as_options');
368
  ?>
369
  <div class="row as">
370
+ <div class="input-field col l12 m12">
371
  <input type="text" name="htcc_as_options[fb_answer3]" id="fb_answer3"
372
  value="<?php echo esc_attr($htcc_fb_answer3['fb_answer3']) ?>">
373
  </div>
379
  $htcc_fb_thank_answer = get_option('htcc_as_options');
380
  ?>
381
  <div class="row as">
382
+ <div class="input-field col l12 m12">
383
+ <label class="gray" for="fb_answer1"><?php _e('Thank your users for answering your questions, and let them know you\'ll get back to them.', 'wp-chatbot') ?></label>
 
384
  <input type="text" name="htcc_as_options[thank_message]" id="thank_message"
385
  value="<?php echo esc_attr($htcc_fb_thank_answer['thank_message']) ?>">
386
  </div>
391
  {
392
  $htcc_fb_email_trans = get_option('htcc_as_options');
393
  ?>
394
+ <div class="row as pro">
395
+ <div class="input-field col l12 m12">
396
+ <label class="gray" for="htcc_fb_email_trans"><?php _e('When people answer all of the questions below, we can send the answers to an email address of your choice!', 'wp-chatbot') ?></label>
397
+ <div class="wrap__pro">
398
+ <input type="text" name="htcc_as_options[email]" id="email"
399
+ value="<?php echo esc_attr($htcc_fb_email_trans['email']) ?>">
400
+ <div class="pro_button__wrapper" style="display: none">
401
+ <a href="#" class="pro_button__link">
402
+ <div class="pro_button">
403
+ <div class="pro_button__content"><?php _e('Upgrade to unlock this feature') ?></div>
404
+ <div class="pro_button__action">
405
+ <span class="pro_button_action__text"><?php _e('Upgrade') ?></span>
406
+ </div>
407
+ </div>
408
+ </a>
409
+ </div>
410
+ </div>
411
  </div>
412
  </div>
413
+
 
 
 
414
  <?php
415
  }
416
 
418
  public function htcc_fb_greeting_login_cb()
419
  {
420
 
421
+ $htcc_fb_greeting_login = get_option('htcc_custom_options');
422
  ?>
423
  <div class="row">
424
  <div class="input-field col s12">
425
+ <label class="gray" for="fb_greeting_login"><?php _e('Greeting text - If logged into Facebook in the current browser; leave empty for default message - ', 'wp-chatbot') ?>
 
 
 
426
  <a target="_blank"
427
  href="https://mobilemonkey.com/wp-chatbot/change-facebook-messenger-greetings-text/"><?php _e('more info', 'wp-chatbot') ?></a>
428
+ </label>
429
+ <input type="text" name="htcc_custom_options[fb_logged_in_greeting]" id="fb_greeting_login"
430
+ value="<?php echo esc_attr($htcc_fb_greeting_login['fb_logged_in_greeting']) ?>">
431
  <!-- <p class="description"><?php _e('Grettings can add in any language, this can be different to the messenger language', 'wp-chatbot') ?></p> -->
432
  <!-- <p class="description"><?php _e('If this Greetings fields are blank, default Greetings will load based on Messenger Language', 'wp-chatbot') ?></p> -->
433
  </div>
439
  public function htcc_fb_greeting_logout_cb()
440
  {
441
 
442
+ $htcc_fb_greeting_logout = get_option('htcc_custom_options');
443
  ?>
444
  <div class="row">
445
  <div class="input-field col s12">
446
+ <label class="gray" for="fb_greeting_logout"><?php _e('Greeting text - If logged out of Facebook in the current browser; leave empty for default message - ', 'wp-chatbot') ?>
 
 
 
447
  <a target="_blank"
448
+ href="https://mobilemonkey.com/wp-chatbot/change-facebook-messenger-greetings-text/"><?php _e('more info', 'wp-chatbot') ?></a></label>
449
+ <input type="text" name="htcc_custom_options[fb_logged_out_greeting]" id="fb_greeting_logout"
450
+ value="<?php echo esc_attr($htcc_fb_greeting_logout['fb_logged_out_greeting']) ?>">
451
  </div>
452
  </div>
453
  <?php
456
  // sdk lang. / messenger lang
457
  public function htcc_fb_sdk_lang_cb()
458
  {
459
+ if ($this->fb_page_id && $this->token && $this->botid){
460
+ $lang = $this->getApi()->getLanguage($this->fb_page_id);
461
  }
462
  ?>
463
  <div class="row">
464
  <div class="input-field col s12">
465
+ <label class="gray"><?php _e('Language displays in chat window, not user input - ', 'wp-chatbot') ?>
466
+ <a target="_blank"
467
+ href="https://mobilemonkey.com/wp-chatbot/messenger-language/"><?php _e('more info', 'wp-chatbot') ?></a>
468
+ <p>Facebook SDK does not support all languages</p>
469
+ </label>
470
+ <select name="htcc_custom_options[fb_sdk_lang]" id="htcc_sdk_lang">
471
  <?php
472
  $fb_lang = HTCC_Lang::$fb_lang;
473
 
478
  }
479
  ?>
480
  </select>
 
 
 
 
 
 
 
481
  </div>
482
  </div>
483
  <?php
484
  }
485
 
 
486
  // greeting_dialog_display - since v2.2
487
  public function htcc_fb_greeting_dialog_display_cb()
488
  {
489
+ $greeting_dialog_display = get_option('htcc_custom_options');
490
  $min_value = esc_attr($greeting_dialog_display['fb_greeting_dialog_display']);
491
  ?>
492
+ <div class="row pro">
493
  <div class="input-field col s12">
494
+ <label class="gray"><?php _e('Greetings Dialog Display - ', 'wp-chatbot') ?><a target="_blank" href="https://mobilemonkey.com/wp-chatbot/greeting-dialog-display/"><?php _e('more info', 'wp-chatbot') ?></a></label>
495
+ <div class="wrap__pro">
496
+ <select name="htcc_custom_options[fb_greeting_dialog_display]" class="select-1" id="htcc_greeting_dialog_display">
497
+ <option value="" <?php echo $min_value == "" ? 'SELECTED' : ''; ?> >Default</option>
498
+ <option value="show" <?php echo $min_value == "show" ? 'SELECTED' : ''; ?> >Show</option>
499
+ <option value="fade" <?php echo $min_value == "fade" ? 'SELECTED' : ''; ?> >Fade</option>
500
+ <option value="hide" <?php echo $min_value == "hide" ? 'SELECTED' : ''; ?> >Hide</option>
501
+ </select>
502
+ <div class="pro_button__wrapper" style="display: none">
503
+ <a href="#" class="pro_button__link">
504
+ <div class="pro_button">
505
+ <div class="pro_button__content"><?php _e('Upgrade to unlock this feature') ?></div>
506
+ <div class="pro_button__action">
507
+ <span class="pro_button_action__text"><?php _e('Upgrade') ?></span>
508
+ </div>
509
+ </div>
510
+ </a>
511
+ </div>
512
+ </div>
513
+ <p>Show - The greeting dialog will always be shown when the plugin loads.</p>
514
+ <p>Fade - The greeting dialog of the plugin will be shown, then fade away and stay minimized afterwards.</p>
515
+ <p>Hide - The greeting dialog of the plugin will always be minimized until a user clicks on the plugin.</p>
516
  </div>
517
  </div>
518
  <?php
519
  }
 
520
  // greeting_dialog_delay - since v2.2
521
  public function htcc_fb_greeting_dialog_delay_cb()
522
  {
523
+ $greeting_dialog_delay = get_option('htcc_custom_options');
524
  $delay_time = esc_attr($greeting_dialog_delay['fb_greeting_dialog_delay']);
525
  ?>
526
+ <div class="row pro">
527
  <div class="input-field col s12">
528
+ <label class="gray" for="fb_greeting_dialog_delay"><?php _e('Sets the number of seconds of delay before the greeting dialog is shown after the plugin is loaded - ', 'wp-chatbot') ?>
 
 
 
529
  <a target="_blank"
530
+ href="https://mobilemonkey.com/wp-chatbot/greeting-dialog-delay/"><?php _e('more info', 'wp-chatbot') ?></a></label>
531
+ <div class="wrap__pro">
532
+ <input type="number" min="0" name="htcc_custom_options[fb_greeting_dialog_delay]" id="fb_greeting_dialog_delay"
533
+ value="<?php echo $delay_time ?>">
534
+ <div class="pro_button__wrapper" style="display: none">
535
+ <a href="#" class="pro_button__link">
536
+ <div class="pro_button">
537
+ <div class="pro_button__content"><?php _e('Upgrade to unlock this feature') ?></div>
538
+ <div class="pro_button__action">
539
+ <span class="pro_button_action__text"><?php _e('Upgrade') ?></span>
540
+ </div>
541
+ </div>
542
+ </a>
543
+ </div>
544
+ </div>
545
  </div>
546
  </div>
547
  <?php
548
  }
549
 
550
 
 
 
551
  // minimized - deprecated - since v2.2
552
  // removed since 3.2
553
  public function htcc_fb_is_minimized_cb()
554
  {
555
+ $minimized = get_option('htcc_custom_options');
556
  $min_value = esc_attr($minimized['minimized']);
557
  ?>
558
  <div class="row">
559
  <div class="input-field col s12">
560
  <div>
561
+ <select name="htcc_custom_options[minimized]" class="select-1">
562
  <option value="" <?php echo $min_value == "" ? 'SELECTED' : ''; ?> >Default</option>
563
  <option value="false" <?php echo $min_value == "false" ? 'SELECTED' : ''; ?> >False</option>
564
  <option value="true" <?php echo $min_value == "true" ? 'SELECTED' : ''; ?> >True</option>
575
  // checkboxes - Hide based on Type of posts ..
576
  public function htcc_show_hide_post_types_cb()
577
  {
578
+ $htcc_checkbox = get_option('htcc_custom_options');
579
+ ?>
580
+ <label class="gray"><?php _e('Check the box to suppress Messenger chat; based on page type - ', 'wp-chatbot') ?>
581
+ <a target="_blank"
582
+ href="https://mobilemonkey.com/wp-chatbot/show-hide-messenger-based-on-type-of-the-page/"><?php _e('more info', 'wp-chatbot') ?></a></label>
583
+ <?php
584
  // Single Posts
585
  if (isset($htcc_checkbox['hideon_posts'])) {
586
  ?>
587
  <p>
588
  <label>
589
+ <input name="htcc_custom_options[hideon_posts]" type="checkbox"
590
  value="1" <?php checked($htcc_checkbox['hideon_posts'], 1); ?> id="filled-in-box1"/>
591
  <span><?php _e('Hide on - Posts', 'wp-chatbot') ?></span>
592
  </label>
596
  ?>
597
  <p>
598
  <label>
599
+ <input name="htcc_custom_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1"/>
600
  <span><?php _e('Hide on - Posts', 'wp-chatbot') ?></span>
601
  </label>
602
  </p>
609
  ?>
610
  <p>
611
  <label>
612
+ <input name="htcc_custom_options[hideon_page]" type="checkbox"
613
  value="1" <?php checked($htcc_checkbox['hideon_page'], 1); ?> id="filled-in-box2"/>
614
  <span><?php _e('Hide on - Pages', 'wp-chatbot') ?></span>
615
  </label>
619
  ?>
620
  <p>
621
  <label>
622
+ <input name="htcc_custom_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2"/>
623
  <span><?php _e('Hide on - Pages', 'wp-chatbot') ?></span>
624
  </label>
625
  </p>
632
  ?>
633
  <p>
634
  <label>
635
+ <input name="htcc_custom_options[hideon_homepage]" type="checkbox"
636
  value="1" <?php checked($htcc_checkbox['hideon_homepage'], 1); ?> id="filled-in-box3"/>
637
  <span><?php _e('Hide on - Home Page', 'wp-chatbot') ?></span>
638
  </label>
642
  ?>
643
  <p>
644
  <label>
645
+ <input name="htcc_custom_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3"/>
646
  <span><?php _e('Hide on - Home Page', 'wp-chatbot') ?></span>
647
  </label>
648
  </p>
658
  ?>
659
  <p>
660
  <label>
661
+ <input name="htcc_custom_options[hideon_frontpage]" type="checkbox"
662
  value="1" <?php checked($htcc_checkbox['hideon_frontpage'], 1); ?> id="filled-in-box4"/>
663
  <span><?php _e('Hide on - Front Page', 'wp-chatbot') ?></span>
664
  </label>
668
  ?>
669
  <p>
670
  <label>
671
+ <input name="htcc_custom_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4"/>
672
  <span><?php _e('Hide on - Front Page', 'wp-chatbot') ?></span>
673
  </label>
674
  </p>
681
  ?>
682
  <p>
683
  <label>
684
+ <input name="htcc_custom_options[hideon_category]" type="checkbox"
685
  value="1" <?php checked($htcc_checkbox['hideon_category'], 1); ?> id="filled-in-box5"/>
686
  <span><?php _e('Hide on - Category', 'wp-chatbot') ?></span>
687
  </label>
691
  ?>
692
  <p>
693
  <label>
694
+ <input name="htcc_custom_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5"/>
695
  <span><?php _e('Hide on - Category', 'wp-chatbot') ?></span>
696
  </label>
697
  </p>
704
  ?>
705
  <p>
706
  <label>
707
+ <input name="htcc_custom_options[hideon_archive]" type="checkbox"
708
  value="1" <?php checked($htcc_checkbox['hideon_archive'], 1); ?> id="filled-in-box6"/>
709
  <span><?php _e('Hide on - Archive', 'wp-chatbot') ?></span>
710
  </label>
714
  ?>
715
  <p>
716
  <label>
717
+ <input name="htcc_custom_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6"/>
718
  <span><?php _e('Hide on - Archive', 'wp-chatbot') ?></span>
719
  </label>
720
  </p>
727
  ?>
728
  <p>
729
  <label>
730
+ <input name="htcc_custom_options[hideon_404]" type="checkbox"
731
  value="1" <?php checked($htcc_checkbox['hideon_404'], 1); ?> id="filled-in-box7"/>
732
  <span><?php _e('Hide on - 404 Page', 'wp-chatbot') ?></span>
733
  </label>
737
  ?>
738
  <p>
739
  <label>
740
+ <input name="htcc_custom_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7"/>
741
  <span><?php _e('Hide on - 404 Page', 'wp-chatbot') ?></span>
742
  </label>
743
  </p>
744
  <?php
745
  }
746
  ?>
747
+
 
 
 
748
 
749
 
750
  <?php
754
  // ID 's list to hide styles
755
  function htcc_list_id_tohide_cb()
756
  {
757
+ $htcc_list_id_tohide = get_option('htcc_custom_options');
758
  ?>
759
  <div class="row">
760
  <div class="input-field col s12">
761
+ <input name="htcc_custom_options[list_hideon_pages]"
762
  value="<?php echo esc_attr($htcc_list_id_tohide['list_hideon_pages']) ?>"
763
+ id="list_hideon_pages" type="text">
764
+ <label for="list_hideon_pages" class="gray"><?php _e('Post, Page IDs to Hide', 'ht-click') ?></label>
765
+ <p class="description"> <?php _e('Add Post, Page, Media - IDs to hide', 'wp-chatbot') ?>
766
+ <br> <?php _e('Can add multiple IDs separate with comma ( , )', 'wp-chatbot') ?> - <a
767
  target="_blank"
768
  href="https://mobilemonkey.com/wp-chatbot/hide-messenger-based-on-post-id/"><?php _e('more info', 'wp-chatbot') ?></a>
769
  </p>
775
  // Categorys list - to hide
776
  function htcc_list_cat_tohide_cb()
777
  {
778
+ $htcc_list_cat_tohide = get_option('htcc_custom_options');
779
  ?>
780
  <div class="row">
781
  <div class="input-field col s12">
782
+ <input name="htcc_custom_options[list_hideon_cat]"
783
  value="<?php echo esc_attr($htcc_list_cat_tohide['list_hideon_cat']) ?>"
784
+ id="list_hideon_cat" type="text">
785
+ <label for="list_hideon_cat" class="gray"><?php _e('Categories to Hide', 'ht-click') ?></label>
786
+ <p class="description"> <?php _e('Category names to hide', 'wp-chatbot') ?>
787
+ <br> <?php _e('Сan add multiple Categories separate by comma ( , )', 'wp-chatbot') ?> - <a
788
  target="_blank"
789
  href="https://mobilemonkey.com/wp-chatbot/hide-messenger-based-on-category/"><?php _e('more info', 'wp-chatbot') ?></a>
790
  </p>
797
  // checkboxes - based on Type of device ..
798
  public function htcc_show_hide_devices_cb()
799
  {
800
+ $htcc_devices = get_option('htcc_custom_options');
801
 
802
  // Hide on Mobile Devices
803
  if (isset($htcc_devices['fb_hide_mobile'])) {
804
  ?>
805
  <p>
806
  <label>
807
+ <input name="htcc_custom_options[fb_hide_mobile]" type="checkbox"
808
  value="1" <?php checked($htcc_devices['fb_hide_mobile'], 1); ?> id="fb_hide_mobile"/>
809
  <span><?php _e('Hide on - Mobile Devices', 'wp-chatbot') ?></span>
810
  </label>
814
  ?>
815
  <p>
816
  <label>
817
+ <input name="htcc_custom_options[fb_hide_mobile]" type="checkbox" value="1" id="fb_hide_mobile"/>
818
  <span><?php _e('Hide on - Mobile Devices', 'wp-chatbot') ?></span>
819
  </label>
820
  </p>
827
  ?>
828
  <p>
829
  <label>
830
+ <input name="htcc_custom_options[fb_hide_desktop]" type="checkbox"
831
  value="1" <?php checked($htcc_devices['fb_hide_desktop'], 1); ?> id="fb_hide_desktop"/>
832
  <span><?php _e('Hide on - Desktops', 'wp-chatbot') ?></span>
833
  </label>
837
  ?>
838
  <p>
839
  <label>
840
+ <input name="htcc_custom_options[fb_hide_desktop]" type="checkbox" value="1" id="fb_hide_desktop"/>
841
  <span><?php _e('Hide on - Desktops', 'wp-chatbot') ?></span>
842
  </label>
843
  </p>
849
  // Custom shortcode
850
  function htcc_custom_shortcode_cb()
851
  {
852
+ $htcc_shortcode = get_option('htcc_custom_options');
853
  ?>
854
  <div class="row">
855
  <div class="input-field col s12">
856
+ <input name="htcc_custom_options[shortcode]" value="<?php echo esc_attr($htcc_shortcode['shortcode']) ?>"
857
  id="shortcode" type="text" class="validate input-margin">
858
+ <label for="shortcode" class="gray"><?php _e('Shortcode name', 'ht-click') ?></label>
859
  <?php
860
  // $shorcode_list = '';
861
  // foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
866
  - <a target="_blank"
867
  href="https://mobilemonkey.com/wp-chatbot/change-shortcode-name/"><?php _e('more info', 'wp-chatbot') ?></a>
868
  </p>
869
+ <p class="description"> <?php _e('Please don\'t add an already existing shortcode name', 'wp-chatbot') ?>
870
  <!-- <p class="description"> <?php _e('please dont add this already existing shorcode names', 'wp-chatbot') ?> - </p> -->
871
  </div>
872
  </div>
877
 
878
  public function htcc_options_sanitize($input)
879
  {
880
+ if ( ! current_user_can( 'manage_options' ) ) {
881
+ wp_die( 'not allowed to modify - please contact admin ' );
882
+ }
883
+ $new_input = array();
884
+ foreach ($input as $key => $value) {
885
+ if( isset( $input[$key] ) ) {
886
+ $new_input[$key] = sanitize_text_field( $input[$key] );
887
+ }
888
+ }
889
+ return $new_input;
890
+ }
891
+ public function htcc_custom_options_sanitize($input)
892
+ {
893
+ $option = get_option('htcc_custom_options');
894
+ $error=false;
895
+ $error_delay_lenght =false;
896
+ $error_delay_value =false;
897
  if (!current_user_can('manage_options')) {
898
  wp_die('not allowed to modify - please contact admin ');
899
  }
900
 
901
  $new_input = array();
902
+ if(isset($_REQUEST['action']) && $_REQUEST['action']== 'update') {
903
+ $_SESSION['tab-2'] = true;
904
+ }
905
  foreach ($input as $key => $value) {
906
+
907
+ if($key == 'fb_greeting_dialog_delay'&& isset($_REQUEST['action']) && $_REQUEST['action']== 'update'){
908
+ if (strlen($value) > 9){
909
+ $new_input[$key] = $option[$key];
910
+ $error_delay_lenght = true;
911
+ }else {
912
+ if ($value == '0'){
913
+ $error_delay_value = true;
914
+ $new_input[$key] = $option[$key];
915
+ }else {
916
+ $new_input[$key] = sanitize_text_field($input[$key]);
917
+ }
918
+ }
919
+ }elseif(isset($input[$key])) {
 
 
 
 
 
 
920
  $new_input[$key] = sanitize_text_field($input[$key]);
921
  }
922
  }
923
+
 
 
924
  if ($error_delay_lenght){
925
+ $this->getApi()->settingSaveError("delay_length");
926
+ }
927
  if ($error_delay_value){
928
+ $this->getApi()->settingSaveError("delay_0");
929
+ }
930
  return $new_input;
931
  }
932
  public function htcc_as_options_sanitize($input)
933
  {
934
+ $error=false;
935
+ $error_welcome=false;
936
+ $error_email=false;
937
+ $option = get_option('htcc_as_options');
938
+
939
 
940
  if (!current_user_can('manage_options')) {
941
  wp_die('not allowed to modify - please contact admin ');
942
  }
943
+ if ($input){
944
+ $new_input = array();
945
+ if(isset($_REQUEST['action']) && $_REQUEST['action']== 'update') {
946
+ $_SESSION['tab1'] = true;
947
+ }
948
+ foreach ($input as $key => $value) {
949
+ if ($key == 'fb_welcome_message' && isset($_REQUEST['action']) && $_REQUEST['action']== 'update') {
950
+ if ($value == '' || ctype_space($value)) {
951
+ $new_input[$key] = $option[$key];
952
+ $error_welcome = true;
953
+ } else {
954
+ $_SESSION['tab1'] = true;
955
+ $new_input[$key] = sanitize_text_field($input[$key]);
956
+ }
957
+ }
958
+ if ($value == '' || ctype_space($value)){
959
+ if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'update' && !$this->getApi()->mmOnlyCheck($this->fb_page_id)){
960
+ if($key == 'email'&&!$this->api->getCurrentSubscription()){
961
+ $new_input[$key] = '';
962
+ }else{
963
  $new_input[$key] = $option[$key];
964
+ $error = true;
 
 
965
  }
966
+ }
967
+ }elseif (isset($input[$key])) {
968
+ if ($key == 'email' && !is_email($value)){
969
+ $new_input[$key] = $option[$key];
970
+ $error_email = true;
971
+ }else {
972
+ $new_input[$key] = sanitize_text_field($input[$key]);
973
+ }
974
+ }
975
+ }
976
+ }
977
+ if ($error_welcome){
978
+ $this->getApi()->settingSaveError("welcome_message");
979
+ }
980
+ if ($error){
981
+ $this->getApi()->settingSaveError("AS");
982
+ }
983
+ if ($error_email){
984
+ $this->getApi()->settingSaveError("email");
985
+ }
986
  return $new_input;
987
  }
988
 
admin/class-htcc-enqueue.php CHANGED
@@ -24,6 +24,7 @@ class HTCC_Enqueue {
24
  // spectrum
25
  wp_enqueue_style( 'htcc_admin_color_picker_styles', 'https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css', '', HTCC_VERSION );
26
  wp_enqueue_style( 'font_awesome', 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', '', HTCC_VERSION );
 
27
  wp_enqueue_style( 'Fredoka One', 'https://fonts.googleapis.com/css?family=Fredoka+One', '', HTCC_VERSION );
28
  wp_enqueue_script( 'htcc_admin_color_picker_js', 'https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js', array( 'jquery' ), HTCC_VERSION, true );
29
 
@@ -37,6 +38,7 @@ class HTCC_Enqueue {
37
 
38
 
39
  wp_enqueue_script( 'htcc_admin_js', plugins_url( 'admin/assets/js/admin.js', HTCC_PLUGIN_FILE ), array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
 
40
  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 );
41
 
42
 
@@ -51,4 +53,4 @@ $htcc_enqueue = new HTCC_Enqueue();
51
  add_action('admin_enqueue_scripts', array( $htcc_enqueue, 'enqueue' ) );
52
 
53
 
54
- endif; // END class_exists check
24
  // spectrum
25
  wp_enqueue_style( 'htcc_admin_color_picker_styles', 'https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.css', '', HTCC_VERSION );
26
  wp_enqueue_style( 'font_awesome', 'https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', '', HTCC_VERSION );
27
+ wp_enqueue_style( 'recurly_css', 'https://js.recurly.com/v4/recurly.css', '', HTCC_VERSION );
28
  wp_enqueue_style( 'Fredoka One', 'https://fonts.googleapis.com/css?family=Fredoka+One', '', HTCC_VERSION );
29
  wp_enqueue_script( 'htcc_admin_color_picker_js', 'https://cdnjs.cloudflare.com/ajax/libs/spectrum/1.8.0/spectrum.min.js', array( 'jquery' ), HTCC_VERSION, true );
30
 
38
 
39
 
40
  wp_enqueue_script( 'htcc_admin_js', plugins_url( 'admin/assets/js/admin.js', HTCC_PLUGIN_FILE ), array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
41
+ wp_enqueue_script( 'htcc_admin_recurly_js', 'https://js.recurly.com/v4/recurly.js', array( 'wp-color-picker', 'jquery' ), HTCC_VERSION, true );
42
  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 );
43
 
44
 
53
  add_action('admin_enqueue_scripts', array( $htcc_enqueue, 'enqueue' ) );
54
 
55
 
56
+ endif; // END class_exists check
admin/commons/ht-cc-admin-fb-button-connected.php CHANGED
@@ -7,29 +7,16 @@
7
  */
8
 
9
  if (!defined('ABSPATH')) exit;
10
-
11
  ?>
 
12
 
13
- <?php
14
-
15
- $logout_button = [
16
- 'logout_path' => $logout_path
17
- ];
18
-
19
- HT_CC::view('ht-cc-admin-logout-button', $logout_button);
20
- ?>
21
-
22
- <h5>Connected Facebook page</h5>
23
- <div class="connected-page">
24
  <div class="active-page-info">
25
- <div class="connected-page-title">
26
- <?php echo $connected_page['name']; ?> <span>(Connected)</span>
27
- </div>
28
- <div class="connected-page-settings">
29
- <a class="button-lazy-load" href="<?php echo $connected_page['path']; ?>">Disconnect</a>
30
- <div class="lazyload"></div>
31
  </div>
32
- <input type="hidden" name="htcc_options[fb_page_id]" value="<?php echo $connected_page['remote_id'] ?>">
33
  </div>
34
  </div>
35
 
7
  */
8
 
9
  if (!defined('ABSPATH')) exit;
 
10
  ?>
11
+ <h2><?php settings_errors(); ?> </h2>
12
 
13
+ <div class="connected-page <?php _e($is_pro ? 'pro' : '') ?>">
 
 
 
 
 
 
 
 
 
 
14
  <div class="active-page-info">
15
+ <div class="page_name__wrap">
16
+ <p class="page_name"><?php echo $connected_page['name']; ?></p>
17
+ <?php _e($is_pro ? '<span class="pro">PRO</span>' : '') ?>
 
 
 
18
  </div>
19
+ <p class="connect_check"> <i class="fa fa-check"></i><?php _e('Connected')?></p>
20
  </div>
21
  </div>
22
 
admin/commons/ht-cc-admin-fb-button-not-connected.php CHANGED
@@ -30,7 +30,9 @@ if (!defined('ABSPATH')) exit;
30
  }(document, 'script', 'facebook-jssdk'));
31
  </script>
32
  <div class="mobilemonkey-settings">
33
- <div class="get-mm-free-button">
 
 
34
  <div id="get-mm-free-button__iframe-container" class="fb-send-to-messenger" messenger_app_id="2015199145383303" page_id="1754274684887439" data-color="blue" data-size="xlarge" data-ref="2799f93cb1488fae43ae0b5aac5f898e993cffecf2f4f7d3d7"></div>
35
 
36
  <a id="get-mm-free-button__link" class="connect-button margin-top button-lazy-load get-mm-free-button__fallback" href='<?php echo $path; ?>'>
30
  }(document, 'script', 'facebook-jssdk'));
31
  </script>
32
  <div class="mobilemonkey-settings">
33
+ <h5>Welcome to WP-Chatbot!</h5>
34
+ <p class="get_start">To get started, connect your Facebook page</p>
35
+ <div class="get-mm-free-button">
36
  <div id="get-mm-free-button__iframe-container" class="fb-send-to-messenger" messenger_app_id="2015199145383303" page_id="1754274684887439" data-color="blue" data-size="xlarge" data-ref="2799f93cb1488fae43ae0b5aac5f898e993cffecf2f4f7d3d7"></div>
37
 
38
  <a id="get-mm-free-button__link" class="connect-button margin-top button-lazy-load get-mm-free-button__fallback" href='<?php echo $path; ?>'>
admin/commons/ht-cc-admin-fb-button-select-page.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @uses at class-htcc-admin.php
7
  * @param $logout_path
8
- * @param $pages Array
9
  */
10
 
11
  if (!defined('ABSPATH')) exit;
@@ -22,8 +22,8 @@ HT_CC::view('ht-cc-admin-logout-button', $logout_button);
22
 
23
  ?>
24
 
25
- <h5>Connect to your Facebook page</h5>
26
- <p class="description">This is the page that will receive messages from your website visitors.</p>
27
  <div class="choose-page">
28
  <?php
29
  foreach ($pages as $page) { ?>
@@ -31,8 +31,10 @@ HT_CC::view('ht-cc-admin-logout-button', $logout_button);
31
  <?php echo $page['name'] ?>
32
  <?php if (!empty($page["remote_id"])) : ?>
33
  <div class="connect-page">
34
- <a class="button-lazy-load" href="<?php echo $page['path']; ?>">Select</a>
35
- <div class="lazyload"></div>
 
 
36
  </div>
37
  <?php endif; ?>
38
  </div>
5
  *
6
  * @uses at class-htcc-admin.php
7
  * @param $logout_path
8
+ * @param $pages array
9
  */
10
 
11
  if (!defined('ABSPATH')) exit;
22
 
23
  ?>
24
 
25
+ <h5><?php _e('Connect to your Facebook page') ?></h5>
26
+ <p class="description"><?php _e('This is the page that will receive messages from your website visitors.') ?></p>
27
  <div class="choose-page">
28
  <?php
29
  foreach ($pages as $page) { ?>
31
  <?php echo $page['name'] ?>
32
  <?php if (!empty($page["remote_id"])) : ?>
33
  <div class="connect-page">
34
+ <a class="button-lazy-load" href="<?php echo $page['path']; ?>"><?php _e('Select') ?>
35
+ <div class="lazyload"></div>
36
+ </a>
37
+
38
  </div>
39
  <?php endif; ?>
40
  </div>
admin/commons/ht-cc-admin-fb-subscription.php ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * View information about the type of subscription page.
4
+ *
5
+ * @uses at ht-cc-admin-settings-form.php
6
+ * @param $type string
7
+ * @param $page array
8
+ * @param $billing_info object
9
+ */
10
+
11
+ if (!defined('ABSPATH')) exit;
12
+ $plan->outgoing_messages_limit >= 1000?$limit = number_format(($plan->outgoing_messages_limit / 1000), 0) . 'K':$limit =$plan->outgoing_messages_limit;
13
+ if ($message_statistic->count){
14
+ if ($message_statistic->count >= 1000){
15
+ $message = number_format(($message_statistic->count / 1000), 0) . 'K';
16
+ }else{
17
+ $message = $message_statistic->count;
18
+ }
19
+ }else{
20
+ $message_statistic->count=0;
21
+ $message = 0;
22
+ }
23
+
24
+ if ($subscribe_info) {
25
+ ?>
26
+ <h1><?php _e($plan->short_name . ' - $' . number_format(($plan->unit_amount_in_cents /100), 0, '.', ' ').'/'. $plan->billing_period) ?></h1>
27
+ <div class="subscribe__wrap">
28
+ <div class="subscribe_info__wrap">
29
+ <div class="main_info__wrap">
30
+ <div class="allotment_wrap">
31
+ <p><?php _e("Send Allotment: "); ?><?php _e($limit?$limit." sends":"unlimited"); ?></p>
32
+ </div>
33
+ <div class="billing_date_wrap">
34
+ <p><?php $subscribe_info->canceled_at ? _e("Expires on: "):_e("Next Billing Date: "); _e(date('m/d/Y', strtotime($subscribe_info->ends_at))); ?></p>
35
+ </div>
36
+ <div class="billed_wrap">
37
+ <p><?php _e("Billed with: "); ?><?php _e("****-****-****-".$account->last_card_numbers); ?></p>
38
+ </div>
39
+ <div class="invoice_info_wrap">
40
+ <a target="_blank" rel="noopener noreferrer"
41
+ href="<?php _e($account->view_invoices_link);?>"><?php _e('View Invoices') ?></a>
42
+ <a target="_blank" rel="noopener noreferrer"
43
+ href="<?php _e($account->edit_billing_link);?>"><?php _e('Edit Billing Information') ?></a>
44
+ </div>
45
+ </div>
46
+ <?php if(!$account->canceled_at){ ?>
47
+ <?php
48
+ if (!$subscribe_info->canceled_at){
49
+ if ($page['is_wp']){?>
50
+ <div class="button__wrap">
51
+ <a href="#" class="button_cancel"><?php _e('Deactivate') ?></a>
52
+ </div>
53
+ <?php }else{ ?>
54
+ <div class="button__wrap">
55
+ <a target="_blank" rel="noopener noreferrer" href="<?php _e($account->view_invoices_link);?>" class="button_edit"><?php _e('Edit in MobileMonkey') ?></a>
56
+ </div>
57
+ <?php }
58
+ ?>
59
+ <?php }} ?>
60
+
61
+
62
+ </div>
63
+ <div class="page_info__wrap">
64
+ <div class="page_main_info_wrap">
65
+ <div class="page_name__wrap">
66
+ <h2 class="subscribe_page_name"><?php _e($page['page_name']); ?></h2>
67
+ </div>
68
+ <div class="subscribe_connect">
69
+ <p><?php _e('Connected since ' .date('m/d/Y', strtotime($page['since']))) ?></p>
70
+ </div>
71
+ <?php if($plan->outgoing_messages_limit){ ?>
72
+ <div class="message_sent__wrap">
73
+ <label for="message_sent"><?php _e('Messages Sent: ') ?></label>
74
+ <div class="percentage-bar__body-wrapper">
75
+ <div class="percentage-bar__bar">
76
+ <div class="percentage-bar__used-percentage"></div>
77
+ </div>
78
+ <div class="number__wrap">
79
+ <div class="percentage-bar__card-used-number" data-value="<?php _e($message_statistic->count)?>"><?php _e($message)?></div>
80
+ <div class="percentage-bar__card-max-number" data-value="<?php _e($plan->outgoing_messages_limit)?>"><?php _e($limit)?></div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ <?php }?>
85
+ </div>
86
+ </div>
87
+ </div>
88
+
89
+ <?php
90
+ } else {
91
+ ?>
92
+ <h1><?php _e('WP-Chatbot Free Plan') ?></h1>
93
+ <div class="subscribe__wrap">
94
+ <div class="subscribe_info__wrap">
95
+ <div class="main_info__wrap">
96
+ <div class="allotment_wrap">
97
+ <p><?php _e("Send Allotment: "); ?><?php _e("1K sends"); ?></p>
98
+ </div>
99
+ </div>
100
+ </div>
101
+ <div class="page_info__wrap">
102
+ <div class="page_main_info_wrap">
103
+ <div class="page_name__wrap">
104
+ <h2 class="subscribe_page_name"><?php _e($page['page_name']); ?></h2>
105
+ </div>
106
+ <div class="subscribe_connect">
107
+ <p><?php _e('Connected since ' . date('m/d/Y', strtotime($page['since']))) ?></p>
108
+ </div>
109
+ <div class="message_sent__wrap">
110
+ <label for="message_sent"><?php _e('Messages Sent: ') ?></label>
111
+ <div class="percentage-bar__body-wrapper">
112
+ <div class="percentage-bar__bar">
113
+ <div class="percentage-bar__used-percentage" style="width: 31%;"></div>
114
+ </div>
115
+ <div class="number__wrap">
116
+ <div class="percentage-bar__card-used-number" data-value="<?php _e($message_statistic->count)?>"><?php _e($message)?></div>
117
+ <div class="percentage-bar__card-max-number" data-value="1000"><?php _e('1K')?></div>
118
+ </div>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ <div class="button__wrap">
123
+ <a href="#" id="button_update" class="button_update"><?php _e('Upgrade') ?></a>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ <?php
128
+ }
129
+ ?>
admin/commons/ht-cc-admin-form-bottom-connect.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * View of Facebook button area when connected.
5
+ *
6
+ * @uses at class-htcc-admin.php
7
+ */
8
+
9
+ if (!defined('ABSPATH')) exit;
10
+ ?>
11
+
12
+ <div class="connected-page-bottom">
13
+ <div class="active-page-info">
14
+ <h3 class="acc-title colapse">Page Connection <i class="fa fa-angle-down step_fa"></i></h3>
15
+
16
+ <div class="acc-content" style="display: none">
17
+ <div class="accordionItemHeading">
18
+ <div class="log_out__wrapper">
19
+ <h5>Connected Facebook Page</h5>
20
+ </div>
21
+ <div class="disconnect_page__wrapper">
22
+ <p><?php echo $connected_page['name']; ?><b> (Connected)</b></p>
23
+ <div class="connected-page-settings">
24
+ <div id="button_disconnect_page" class="button-lazy-load">Disconnect
25
+ <div class="lazyload"></div>
26
+ </div>
27
+
28
+
29
+ </div>
30
+ </div>
31
+ <input type="hidden" name="htcc_options[fb_page_id]" value="<?php echo $connected_page['remote_id'] ?>">
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
admin/commons/ht-cc-admin-notice-not-connected.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ .main {
14
+ width: 1200px;
15
+ margin: 0 auto;
16
+ }
17
+ .mobile-button {
18
+ width: 98%;
19
+ margin-top: 54px;
20
+ display: flex;
21
+ background: linear-gradient(to right, rgba(191,0,146,1) 0%, rgba(224,0,75,1) 100%);
22
+ border-radius: 30px;
23
+ box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
24
+ text-decoration: none;
25
+ }
26
+ h3, p {
27
+ margin-bottom: 10px;
28
+ margin-top: 0;
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: 15px 24px;
40
+ border: 2px solid #fff;
41
+ border-radius: 10px;
42
+ text-transform: uppercase;
43
+ font-weight: 900;
44
+ font-size: 18px;
45
+ margin-right: 2em;
46
+ text-align: center;
47
+ }
48
+ .notification__info {
49
+ padding: 1rem;
50
+ }
51
+ .info-heading {
52
+ font-size: 26px;
53
+ }
54
+ .info__text--bottom {
55
+ display: flex;
56
+ }
57
+ .info__heading{
58
+ color: #FFFFFF;
59
+ font-family: "Nunito Sans";
60
+ font-size: 28px;
61
+ font-weight: 800;
62
+ line-height: 38px;
63
+ }
64
+ .info__text{
65
+ color: #FFFFFF;
66
+ font-family: "Nunito Sans";
67
+ font-size: 18px;
68
+ font-weight: bold;
69
+ line-height: 24px;
70
+ }
71
+ .button__wrapper{
72
+ display: flex;
73
+ }
74
+ .button__wrapper_text{
75
+ color: #F1F1F1;
76
+ font-family: "Nunito Sans";
77
+ font-size: 24px;
78
+ font-weight: 900;
79
+ line-height: 32px;
80
+ display: flex;
81
+ }
82
+ .image-monkey{
83
+ margin: -10px 0 0 0;
84
+ z-index: 10;
85
+ position: relative;
86
+ height: 110%;
87
+ }
88
+ .notification__images{
89
+ height: 100%;
90
+ width: 300px;
91
+ position: relative;
92
+ }
93
+ .button__wrapper_arrow{
94
+ display: flex;
95
+ align-self: center;
96
+ margin-left: 10px;
97
+ width: auto;
98
+ height: auto;
99
+ font-size: 35px;
100
+ }
101
+ .button__wrapper_text{
102
+ align-self: center;
103
+ display: flex;
104
+ }
105
+ @media (max-width: 720px) {
106
+ .notification__wrapper{
107
+ flex-direction: column;
108
+ }
109
+ .notification__button{
110
+ margin-left: 0;
111
+ margin-bottom: 20px;
112
+ margin-right: 0;
113
+ }
114
+ .notification__images{
115
+ width: auto;
116
+ }
117
+ .mobile-button{
118
+ margin: 20px;
119
+ width: 87%;
120
+ }
121
+ }
122
+
123
+ @media (max-width: 992px) {
124
+ .button__wrapper_text{
125
+ font-size: 16px;
126
+ line-height: 16px;
127
+ }
128
+ .notification__images{
129
+ height: auto;
130
+ }
131
+ }
132
+
133
+ @media (max-width: 1200px) {
134
+ .info__heading{
135
+ font-size: 24px;
136
+ }
137
+ .info__text{
138
+ font-size: 16px;
139
+ }
140
+ .button__wrapper_text{
141
+ font-size: 17px;
142
+ line-height: 17px;
143
+ }
144
+ .button__wrapper_arrow{
145
+ font-size: 22px;
146
+ }
147
+ .notification__button{
148
+ padding: 15px 15px;
149
+ }
150
+ }
151
+ #wpadminbar .chat-bot{
152
+ background-image: url(<?php echo plugins_url('admin/assets/img/notice_icon_new.png',HTCC_PLUGIN_FILE)?>)!important;
153
+ height: 100%;
154
+ background-size: contain;
155
+ background-repeat: no-repeat;
156
+ width: 52px;
157
+ padding: 0px;
158
+ margin: 0px;
159
+ }
160
+ #wpadminbar .quicklinks>ul>li#wp-admin-bar-wp-chatbot a{
161
+ padding: 0;
162
+ }
163
+ @media (max-width: 782px) {
164
+ #wp-toolbar #wp-admin-bar-wp-chatbot{
165
+ display: block;
166
+ }
167
+ #wpadminbar li#wp-admin-bar-wp-chatbot .chat-bot{
168
+ width: 75px;
169
+ }
170
+ }
171
+ </style>
172
+ <a class="mobile-button" href="<?php echo admin_url( 'admin.php?page=wp-chatbot' )?>">
173
+ <div class="notification__wrapper">
174
+ <div class="notification__images">
175
+ <img src="<?php echo plugins_url('admin/assets/img/monkey.png',HTCC_PLUGIN_FILE)?>" class="images__item image-monkey">
176
+ </div>
177
+ <div class="notification__info">
178
+ <h3 class="info__heading">Uh oh. Your WP-Chatbot setup is incomplete!</h3>
179
+ <p class="info__text">Click to resolve as soon as possible</p>
180
+ <div class="info__text--bottom">
181
+ <img src="<?php echo plugins_url('admin/assets/img/logo.png',HTCC_PLUGIN_FILE)?>" alt="test" class="info__image">
182
+ </div>
183
+ </div>
184
+ <div class="notification__button">
185
+ <div class="button__wrapper">
186
+ <span class="button__wrapper_text">Complete setup</span>
187
+ <span class="dashicons button__wrapper_arrow dashicons-arrow-right-alt"></span>
188
+ </div>
189
+ </div>
190
+ </div>
191
+ </a>
admin/commons/ht-cc-admin-settings-form.php ADDED
@@ -0,0 +1,295 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * sidebar in admin area - plugin settings page.
4
+ *
5
+ * @uses at settings_page.php
6
+ *
7
+ */
8
+
9
+ if (!defined('ABSPATH')) exit;
10
+ include(HTCC_PLUGIN_DIR . 'admin/contact_page.php');
11
+ $table = new MobileMonkey_Contacts_List_Table();
12
+ $table->prepare_items();
13
+ !isset($_SESSION['current']) ? $_SESSION['current'] = 'tab-1' : $_SESSION['current'];
14
+ $_SESSION['tab']['tab1'] = true;
15
+ $mm_only?$setup='true':$setup = $_SESSION['setup'];
16
+ $current = str_replace('-', "", $_SESSION['current']);
17
+ foreach ($_SESSION['tab'] as $key => $value) {
18
+ if ($value) {
19
+ $$key = 'done';
20
+ } else {
21
+ $$key = '';
22
+ }
23
+ }
24
+ $$current .= ' current';
25
+ ?>
26
+ <div class="step-wrapper">
27
+ <div class="tab_header">
28
+ <ul class="tabs_wrapper">
29
+ <li class="tab-link <?php echo $tab1 ?>" data-tab="tab-1">
30
+ <span class="tab_number">1</span>
31
+ <span class="tab_header">Setup</span>
32
+ </li>
33
+ <li class="tab-link <?php echo $tab2 ?>" data-tab="tab-2">
34
+ <span class="tab_number">2</span>
35
+ <span class="tab_header">Customize</span>
36
+ </li>
37
+ <li class="tab-link <?php echo $tab3 ?>" data-tab="tab-3">
38
+ <span class="tab_number">3</span>
39
+ <span class="tab_header">Contacts</span>
40
+ <span class="tab_contacts__count"><?php echo $table->totalItems ?></span>
41
+ </li>
42
+ <li class="tab-link <?php echo $tab4 ?>" data-tab="tab-4">
43
+ <span class="tab_header">Your Subscription</span>
44
+ </li>
45
+
46
+ </ul>
47
+ <div class="list_tabs__button">
48
+ <ul class="list_tabs"></ul>
49
+ </div>
50
+ <div class="setup_statement" style="<?php echo($setup=='true' ? "display:none" : "display:block") ?>">
51
+ Setup Incomplete
52
+ </div>
53
+ </div>
54
+ <?php
55
+ $mm_only ? $state = 'none' : $state = 'block';
56
+ !$mm_only ? $mm = 'none' : $mm = 'block'; ?>
57
+ <div id="tab-1" class="tab-content <?php echo $tab1 ?> setup_section">
58
+ <div class="tab-content__wrapper">
59
+ <div class="mm_only_block" style="display: <?php echo $mm?>">
60
+ <h6><?php _e('Looks like you\'ve already worked in MobileMonkey. Please use the MobileMonkey app to make additional edits to the \'Welcome message\' and \'Answering Service\'.', 'wp-chatbot') ?></h6>
61
+ <a target="_blank" rel="noopener noreferrer" href='https://app.mobilemonkey.com/chatbot-editor/<?php echo$connected_page['id']?>/home' class="button_go">Go to MobileMonkey</a>
62
+ </div>
63
+ <form method="post" action="options.php" style="display: <?php echo $state ?>">
64
+ <?php
65
+ settings_fields('htcc_as_setting_group');
66
+ do_settings_sections('htcc-as-setting-section');
67
+ ?>
68
+
69
+ <?php submit_button('Save Changes'); ?>
70
+ </form>
71
+ <?php
72
+ $fb_connected_area_active_page_settings = [
73
+ 'connected_page' => $connected_page
74
+ ];
75
+ HT_CC::view('ht-cc-admin-form-bottom-connect', $fb_connected_area_active_page_settings); ?>
76
+ </div>
77
+ </div>
78
+ <div id="tab-2" class="tab-content customize_section <?php echo $tab2 ?>">
79
+ <div class="tab-content__wrapper">
80
+ <h1><?php _e('Customize') ?></h1>
81
+ <form method="post" action="options.php">
82
+ <?php
83
+ settings_fields('htcc_custom_setting_group');
84
+ do_settings_sections('wp-custom-settings-section');
85
+ ?>
86
+ <?php submit_button('Save Changes'); ?>
87
+ </form>
88
+
89
+ </div>
90
+ </div>
91
+ <div id="tab-3" class="tab-content contact_tab <?php echo $tab3 ?>">
92
+ <h1><?php _e('Contacts') ?></h1>
93
+
94
+ <div class="contact_head__wrap">
95
+ <h4><?php
96
+ $text = $table->totalItems > 1 ? 'contacts' : 'contact';
97
+ if ($table->totalItems == 0) {
98
+ $table->totalItems = '';
99
+ $text = "No contacts ";
100
+ }
101
+ echo $table->totalItems
102
+ ?> <p><?php _e($text) ?><?php _e(' generated') ?></p></h4>
103
+ <div class="download__wrap">
104
+ <div class="pro_button__wrapper" style="display: none">
105
+ <a href="#" class="pro_button__link">
106
+ <div class="pro_button">
107
+ <div class="pro_button__content"><?php _e('Upgrade to unlock this feature') ?></div>
108
+ <div class="pro_button__action">
109
+ <span class="pro_button_action__text"><?php _e('Upgrade') ?></span>
110
+ </div>
111
+ </div>
112
+ </a>
113
+ </div>
114
+ </div>
115
+ </div>
116
+ <div class="table__wrap">
117
+ <?php
118
+ $table->display();
119
+ ?>
120
+ <a target="_blank" rel="noopener noreferrer"
121
+ href="https://app.mobilemonkey.com/chatbot-editor/<?php echo $connected_page['bot_id'] ?>/contacts"
122
+ id="contacts_modal">
123
+ <div class="contact_modal__wrapper">
124
+ <div class="contact_modal__content">
125
+ <p><?php _e('View your contacts in') ?> </p><span class="customization_button__image"></span>
126
+ <span class="logo_name"><?php _e('MobileMonkey') ?></span>
127
+ </div>
128
+ <div class="contact_modal__button">
129
+ <div><?php _e('Let\'s go!') ?></div>
130
+ </div>
131
+ </div>
132
+ </a>
133
+ </div>
134
+ </div>
135
+ <div id="tab-4" class="tab-content subscribe_section <?php echo $tab4 ?>">
136
+ <div class="tab-content__wrapper">
137
+ <?php
138
+ $plan = json_decode(json_encode($wp_plan_info), True);
139
+ $fb_subscribe_info = [
140
+ 'type' => 'pro',
141
+ 'account' => $account_info,
142
+ 'subscribe_info' => $subscribe_info,
143
+ 'message_statistic' => $message_statistic,
144
+ 'page' => [
145
+ 'page_name'=>$page_info['pageName'],
146
+ 'since'=>$page_info['connected_at'],
147
+ 'is_wp' =>$page_info['is_wp_subscribe'],
148
+ 'messages_sent'=>'822',
149
+ 'max_messages' =>'1'
150
+ ],
151
+ 'plan' => $wp_plan_info
152
+ ];
153
+ HT_CC::view('ht-cc-admin-fb-subscription', $fb_subscribe_info); ?>
154
+ </div>
155
+ </div>
156
+ <div id="to_pro" class="modal">
157
+ <div class="modal_close">X</div>
158
+ <div class="upgrade__wrapper">
159
+ <div class="upgrade__content">
160
+ <h4><?php _e('Are you sure that you want to disconnect this page?') ?></h4>
161
+ <p><?php _e('Disconnecting will disable all chatbots on your Facebook page and remove the chat widget from your website.') ?></p>
162
+ </div>
163
+ <div class="upgrade__button">
164
+ <a class="button-close-modal blues" href="#"><?php _e('Cancel') ?></a>
165
+ <a href="<?php echo $connected_page['path']; ?>" id="disconnect"
166
+ class="button-lazy-load reds"><?php _e('Disconnect') ?>
167
+ <div class="lazyload"></div>
168
+ </a>
169
+
170
+
171
+ </div>
172
+ </div>
173
+ </div>
174
+ <div id="cancel" class="modal">
175
+ <div class="modal_close">X</div>
176
+ <div class="cancel__wrapper">
177
+ <div class="cancel__content">
178
+ <h4><?php _e('Are you sure you want to deactivate this subscription?') ?></h4>
179
+ <p><?php _e('You will lose access to all Pro features once this subscription expires.') ?></p>
180
+ </div>
181
+ <div class="cancel__button">
182
+ <a class="button-close-modal blues" href="#"><?php _e('Cancel') ?></a>
183
+ <a href="#" id="cancel_sub"
184
+ class="button-lazy-load reds"><?php _e('Deactivate anyway') ?>
185
+ <div class="lazyload"></div>
186
+ </a>
187
+
188
+
189
+ </div>
190
+ </div>
191
+ </div>
192
+ <div id="unsaved_option" class="modal">
193
+ <div class="modal_close">X</div>
194
+ <div class="unsaved__wrapper">
195
+ <div class="unsaved__content">
196
+ <h4><?php _e('Do you want to save your changes?') ?></h4>
197
+ </div>
198
+ <div class="unsaved__button">
199
+ <a class="blues save_change button-lazy-load" href="#"><?php _e('Save') ?>
200
+ <div class="lazyload"></div>
201
+ </a>
202
+ <a href="#" id="discard_button" class="reds button-lazy-load"><?php _e('Discard') ?></a>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ <div id="pro_option" class="modal">
207
+ <div class="modal_close"><i class="fa fa-times" aria-hidden="true"></i></div>
208
+ <div class="mm__wrapper">
209
+ <form class="checkout-form" id="checkout-form">
210
+ <input type="hidden" data-recurly="token" name="recurly-token">
211
+ <div class="billing-modal-header">
212
+ <div class="billing-modal-header__logo">
213
+ <div class="logo"></div>
214
+ <span><?php _e('MobileMonkey') ?></span></div>
215
+ <div class="billing-modal-header__plan-name">WP-CHATBOT PRO</div>
216
+ <div class="billing-modal-header__plan-price">$<?php _e(number_format(($plan['unit_amount_in_cents'] /100), 2, '.', ' '))?>/<?php _e($plan['billing_period'])?></div>
217
+
218
+ <div class="billing-page-details">
219
+ <div class="billing-page-details__left-section">
220
+ <div class="billing-page-details__middle">
221
+ <div class="billing-page-details__name">
222
+ <?php _e($connected_page['name']) ?>
223
+ </div>
224
+ <div class="billing-page-details__sends-text">
225
+ </div>
226
+ </div>
227
+ </div>
228
+ <div class="billing-page-details__check-circle">
229
+ <i class="fa fa-check" aria-hidden="true"></i>
230
+ </div>
231
+ </div>
232
+ </div>
233
+ <div class="billing-modal-body">
234
+ <?php
235
+ if ($account_info){
236
+ ?>
237
+ <div class="billing_info_wrap">
238
+ <div class="payment_info">
239
+ <div class="payment_info_text"><?php _e('Payment Information')?></div>
240
+ <div class="billed_with"><?php _e('Billed with')?>: XXXX-XXXX-XXXX-<?php _e($account_info->last_card_numbers)?></div>
241
+ </div>
242
+ </div>
243
+ <?php
244
+ }else{?>
245
+ <label for="email"><?php _e('EMAIL') ?></label>
246
+ <input type="email" id="email" required>
247
+ <div class="name__wrap">
248
+ <div class="firstname__wrap">
249
+ <label for="firstname"><?php _e('FIRST NAME') ?></label>
250
+ <input type="text" id="firstname" data-recurly="first_name" required>
251
+ </div>
252
+ <div class="lastname__wrap">
253
+ <label for="lastname"><?php _e('LAST NAME') ?></label>
254
+ <input type="text" id="lastname" data-recurly="last_name" required>
255
+ </div>
256
+ </div>
257
+ <label for="country"><?php _e('COUNTRY')?></label>
258
+ <select name="country" id="country" data-recurly="country" required>
259
+ <option value="US">US</option>
260
+ <option value="AD">AD</option>
261
+ <option value="AE">AE</option>
262
+ </select>
263
+ <label for="card_number"><?php _e('CARD INFO') ?></label>
264
+ <div class="card__wrap">
265
+ <div id="card_number" data-recurly="card" name="card"></div>
266
+ </div>
267
+ <?php
268
+ }
269
+ ?>
270
+
271
+ </div>
272
+ <div class="billing-modal-footer">
273
+ <?php
274
+ if (!$account_info){
275
+ ?>
276
+ <div class="term__wrap">
277
+ <input type="checkbox" required>
278
+ <span class="terms-label"><?php _e('I have read and accept the ') ?> <b><a href="https://mobilemonkey.com/privacy-policy"><?php _e('Privacy Policy ') ?></a></b><?php _e('and ') ?> <b><a href="https://mobilemonkey.com/master-service-agreement"><?php _e('Terms of Service') ?></a></b></span>
279
+ </div>
280
+ <?php
281
+ }
282
+ ?>
283
+ <div id="errors"></div>
284
+ <button id="pay_plan" class="oranges">Confirm
285
+ <div class="lazyload"></div>
286
+ </button>
287
+ </div>
288
+
289
+ </form>
290
+ </div>
291
+ </div>
292
+ <div class="modal-overlays" id="modal-overlay">
293
+ </div>
294
+
295
+ </div>
admin/commons/ht-cc-admin-sidebar.php CHANGED
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
14
 
15
 
16
  <!-- Premium plugin Content -->
17
- <div class="service-content" style="display: none;" >
18
  <div class="row">
19
  <div class="col s12 m6">
20
  <!-- docs -->
14
 
15
 
16
  <!-- Premium plugin Content -->
17
+ <div class="service-content" style="display: block;" >
18
  <div class="row">
19
  <div class="col s12 m6">
20
  <!-- docs -->
admin/commons/th-cc-admin-notice-not-connected.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ .main {
14
+ width: 1200px;
15
+ margin: 0 auto;
16
+ }
17
+ .mobile-button {
18
+ width: 98%;
19
+ margin-top: 54px;
20
+ display: flex;
21
+ background: linear-gradient(to right, rgba(191,0,146,1) 0%, rgba(224,0,75,1) 100%);
22
+ border-radius: 30px;
23
+ box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
24
+ text-decoration: none;
25
+ }
26
+ h3, p {
27
+ margin-bottom: 10px;
28
+ margin-top: 0;
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: 15px 24px;
40
+ border: 2px solid #fff;
41
+ border-radius: 10px;
42
+ text-transform: uppercase;
43
+ font-weight: 900;
44
+ font-size: 18px;
45
+ margin-right: 2em;
46
+ text-align: center;
47
+ }
48
+ .notification__info {
49
+ padding: 1rem;
50
+ }
51
+ .info-heading {
52
+ font-size: 26px;
53
+ }
54
+ .info__text--bottom {
55
+ display: flex;
56
+ }
57
+ .info__heading{
58
+ color: #FFFFFF;
59
+ font-family: "Nunito Sans";
60
+ font-size: 28px;
61
+ font-weight: 800;
62
+ line-height: 38px;
63
+ }
64
+ .info__text{
65
+ color: #FFFFFF;
66
+ font-family: "Nunito Sans";
67
+ font-size: 18px;
68
+ font-weight: bold;
69
+ line-height: 24px;
70
+ }
71
+ .button__wrapper{
72
+ display: flex;
73
+ }
74
+ .button__wrapper_text{
75
+ color: #F1F1F1;
76
+ font-family: "Nunito Sans";
77
+ font-size: 24px;
78
+ font-weight: 900;
79
+ line-height: 32px;
80
+ display: flex;
81
+ }
82
+ .image-monkey{
83
+ margin: -10px 0 0 0;
84
+ z-index: 10;
85
+ position: relative;
86
+ height: 110%;
87
+ }
88
+ .notification__images{
89
+ height: 100%;
90
+ width: 300px;
91
+ position: relative;
92
+ }
93
+ .button__wrapper_arrow{
94
+ display: flex;
95
+ align-self: center;
96
+ margin-left: 10px;
97
+ width: auto;
98
+ height: auto;
99
+ font-size: 35px;
100
+ }
101
+ .button__wrapper_text{
102
+ align-self: center;
103
+ display: flex;
104
+ }
105
+ @media (max-width: 720px) {
106
+ .notification__wrapper{
107
+ flex-direction: column;
108
+ }
109
+ .notification__button{
110
+ margin-left: 0;
111
+ margin-bottom: 20px;
112
+ margin-right: 0;
113
+ }
114
+ .notification__images{
115
+ width: auto;
116
+ }
117
+ .mobile-button{
118
+ margin: 20px;
119
+ width: 87%;
120
+ }
121
+ }
122
+
123
+ @media (max-width: 992px) {
124
+ .button__wrapper_text{
125
+ font-size: 16px;
126
+ line-height: 16px;
127
+ }
128
+ .notification__images{
129
+ height: auto;
130
+ }
131
+ }
132
+
133
+ @media (max-width: 1200px) {
134
+ .info__heading{
135
+ font-size: 24px;
136
+ }
137
+ .info__text{
138
+ font-size: 16px;
139
+ }
140
+ .button__wrapper_text{
141
+ font-size: 17px;
142
+ line-height: 17px;
143
+ }
144
+ .button__wrapper_arrow{
145
+ font-size: 22px;
146
+ }
147
+ .notification__button{
148
+ padding: 15px 15px;
149
+ }
150
+ }
151
+ #wpadminbar .chat-bot{
152
+ background-image: url(<?php echo plugins_url('admin/assets/img/notice_icon_new.png',HTCC_PLUGIN_FILE)?>)!important;
153
+ height: 100%;
154
+ background-size: contain;
155
+ background-repeat: no-repeat;
156
+ width: 52px;
157
+ padding: 0px;
158
+ margin: 0px;
159
+ }
160
+ #wpadminbar .quicklinks>ul>li#wp-admin-bar-wp-chatbot a{
161
+ padding: 0;
162
+ }
163
+ @media (max-width: 782px) {
164
+ #wp-toolbar #wp-admin-bar-wp-chatbot{
165
+ display: block;
166
+ }
167
+ #wpadminbar li#wp-admin-bar-wp-chatbot .chat-bot{
168
+ width: 75px;
169
+ }
170
+ }
171
+ </style>
172
+ <a class="mobile-button" href="<?php echo admin_url( 'admin.php?page=wp-chatbot' )?>">
173
+ <div class="notification__wrapper">
174
+ <div class="notification__images">
175
+ <img src="<?php echo plugins_url('admin/assets/img/monkey.png',HTCC_PLUGIN_FILE)?>" class="images__item image-monkey">
176
+ </div>
177
+ <div class="notification__info">
178
+ <h3 class="info__heading">Uh oh. Your WP-Chatbot setup is incomplete!</h3>
179
+ <p class="info__text">Click to resolve as soon as possible</p>
180
+ <div class="info__text--bottom">
181
+ <img src="<?php echo plugins_url('admin/assets/img/logo.png',HTCC_PLUGIN_FILE)?>" alt="test" class="info__image">
182
+ </div>
183
+ </div>
184
+ <div class="notification__button">
185
+ <div class="button__wrapper">
186
+ <span class="button__wrapper_text">Complete setup</span>
187
+ <span class="dashicons button__wrapper_arrow dashicons-arrow-right-alt"></span>
188
+ </div>
189
+ </div>
190
+ </div>
191
+ </a>
admin/contact_page.php CHANGED
@@ -7,7 +7,7 @@
7
  class MobileMonkey_Contacts_List_Table extends WP_List_Table
8
  {
9
  private $api;
10
- private $totalItems;
11
  private $count = 10;
12
 
13
  public function __construct() {
@@ -153,7 +153,6 @@ class MobileMonkey_Contacts_List_Table extends WP_List_Table
153
  public function display() {
154
  $singular = $this->_args['singular'];
155
 
156
- $this->display_tablenav( 'top' );
157
 
158
  $this->screen->render_screen_reader_content( 'heading_list' );
159
  ?>
7
  class MobileMonkey_Contacts_List_Table extends WP_List_Table
8
  {
9
  private $api;
10
+ public $totalItems;
11
  private $count = 10;
12
 
13
  public function __construct() {
153
  public function display() {
154
  $singular = $this->_args['singular'];
155
 
 
156
 
157
  $this->screen->render_screen_reader_content( 'heading_list' );
158
  ?>
admin/settings_page.php CHANGED
@@ -6,7 +6,7 @@
6
  */
7
 
8
  if (!defined('ABSPATH')) exit;
9
-
10
  ?>
11
 
12
  <!-- style="display: flex; flex-wrap: wrap;" -->
@@ -15,26 +15,95 @@ if (!defined('ABSPATH')) exit;
15
  <div class="row mobile_wrap">
16
  <div class="col s12 m9 x9 options">
17
  <div class="mobilemonkey-logo"></div>
18
- <h6 class="options-subtitle">WP-Chatbot is <a href="https://mobilemonkey.com/" target="_blank">powered by
19
- MobileMonkey</a>: an Official Facebook Messenger Solutions Provider Partner</h6>
20
- <h2><?php settings_errors(); ?> </h2>
21
-
22
- <form action="options.php" method="post">
23
- <div class="toc-tab-box">
24
- <?php
25
- settings_fields('htcc_setting_group');
26
- do_settings_sections('wp-chatbot');
27
- ?>
28
- </div>
29
- </div>
30
- <?php
31
- if ($this->stepdis == "open"){
32
- submit_button('Save Changes');
33
- }
34
- ?>
35
-
36
- </div>
37
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  </div>
39
 
40
  <div class="col s12 m3 x3 ht-cc-admin-sidebar">
6
  */
7
 
8
  if (!defined('ABSPATH')) exit;
9
+ $options = get_option('htcc_options');
10
  ?>
11
 
12
  <!-- style="display: flex; flex-wrap: wrap;" -->
15
  <div class="row mobile_wrap">
16
  <div class="col s12 m9 x9 options">
17
  <div class="mobilemonkey-logo"></div>
18
+ <h6 class="options-subtitle"><?php _e('WP-Chatbot is ') ?><a href="https://mobilemonkey.com/" target="_blank"><?php _e('powered by MobileMonkey') ?></a><?php _e(': an Official Facebook Messenger Solutions Provider Partner') ?></h6>
19
+ <?php
20
+ $options = get_option('htcc_options');
21
+ $options_as = get_option('htcc_as_options');
22
+ $options_custom = get_option('htcc_custom_options');
23
+ $api = $this->getApi();
24
+ $this->api->logoutMobilemonkey();
25
+ $token = $this->api->connectMobileMonkey();
26
+ $internal = get_option('mobilemonkey_active_page_id');
27
+ $update = false;
28
+ if ($token) {
29
+ $reset = FALSE;
30
+ if ($this->api->connectPage() || $this->api->disconnectPage()) {
31
+ $reset = TRUE;
32
+ }
33
+ $pages = $this->api->getPages();
34
+ $activePage = $this->api->getActivePage($reset);
35
+ if ($activePage) {
36
+ if ($activePage['bot_id']){
37
+ $mm_state = $this->api->mmOnlyCheck($this->fb_page_id);
38
+ if ( isset($_REQUEST['settings-updated']) && $_REQUEST['settings-updated']){
39
+ $update = true;
40
+ $current_language = $this->api->getLanguage($activePage['remote_id']);
41
+ if (!empty($options_custom['fb_sdk_lang']) && $options_custom['fb_sdk_lang'] !== $current_language) {
42
+ $this->api->updateLanguage($options_custom['fb_sdk_lang'], $activePage['remote_id']);
43
+ }
44
+ if ($mm_state){
45
+ echo "<style>.settings-error{display: none}</style>";
46
+ }
47
+ }
48
+ if (!$mm_state){
49
+ $widget = $this->api->getWidgets($activePage['remote_id']);
50
+ $current_welcome_message = $this->api->getWelcomeMessage($activePage['remote_id']);
51
+ if ($options_as['fb_welcome_message'] !== $current_welcome_message && isset($options_as['fb_welcome_message'])) {
52
+ $this->api->updateWelcomeMessage($options_as['fb_welcome_message'], $activePage['remote_id']);
53
+ }
54
+ }else {
55
+ delete_option('htcc_as_options');
56
+ }
57
+ $this->api->setWidgets($options_as,$widget,$activePage['remote_id'],$update);
58
+ $this->api->setCustomChatSettings($activePage['remote_id'],$options_custom,$update);
59
+ }else {
60
+ echo "<style>.settings-error{display: none}</style>";
61
+ $this->api->renderNotice('<p class="bot_disabled">Your chatbot has been disabled in MobileMonkey. Please reactivate it before making additional edits. Go <a target="_blank" rel="noopener noreferrer" href="https://app.mobilemonkey.com/chatbot-editor/">here</a> to reactivate your chatbot</p>');
62
+
63
+ }
64
+ $this->api->getSubscribeInfo();
65
+ $is_pro = $this->api->GetCurrentSubscription()? true : false;
66
+ $fb_connected_area_active_page_settings = [
67
+ 'connected_page' => $activePage,
68
+ 'is_pro' => $is_pro
69
+ ];
70
+ $page_subscribe_info = [
71
+ 'page_info'=> $this->api->getPageInfo(),
72
+ 'account_info'=> $this->api->getAccountInfo(),
73
+ 'subscribe_info'=> $this->api->getCurrentSubscription(),
74
+ 'wp_plan_info'=> $this->api->getWpPlan(),
75
+ 'message_statistic'=> $this->api->getMessageStatistic(),
76
+ 'connected_page' => $activePage,
77
+ 'mm_only' => $mm_state
78
+ ];
79
+ HT_CC::view('ht-cc-admin-fb-button-connected', $fb_connected_area_active_page_settings);
80
+ HT_CC::view('ht-cc-admin-settings-form',$page_subscribe_info);
81
+
82
+ } else {
83
+ if ($internal){
84
+ echo "<style>.settings-error{display: none}</style>";
85
+ $this->api->renderNotice('Your Facebook page has been disconnected in MobileMonkey. Please connect to a page to reactivate your chatbot.');
86
+ }
87
+ $fb_connected_area_pages_settings = [
88
+ 'pages' => $pages,
89
+ 'logout_path' => add_query_arg([
90
+ 'page' => HTCC_PLUGIN_MAIN_MENU,
91
+ 'logout' => true,
92
+ ], admin_url('admin.php')),
93
+ ];
94
+ HT_CC::view('ht-cc-admin-fb-button-select-page', $fb_connected_area_pages_settings);
95
+ }
96
+
97
+ } else {
98
+
99
+ HT_CC::view('ht-cc-admin-fb-button-not-connected', [
100
+ 'options' => $options,
101
+ 'path' => $this->getApi()->connectLink(),
102
+ ]);
103
+ }
104
+
105
+ ?>
106
+
107
  </div>
108
 
109
  <div class="col s12 m3 x3 ht-cc-admin-sidebar">
inc/MobileMonkeyApi.php CHANGED
@@ -14,6 +14,7 @@ class MobileMonkeyApi
14
  private $pagination;
15
  private $contacts;
16
  private $plugin_name = 'wp-chatbot';
 
17
 
18
  private function getApiDomain()
19
  {
@@ -69,6 +70,85 @@ class MobileMonkeyApi
69
  return get_option($this->option_prefix . 'company_id');
70
  }
71
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
  private function getInternalPageId($connection_page_id)
74
  {
@@ -84,13 +164,82 @@ class MobileMonkeyApi
84
  return get_option($this->option_prefix . 'fb_internal_page_id');
85
  }
86
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  private function setActiveBotId($bot_id)
89
  {
90
  update_option($this->option_prefix . 'active_bot', $bot_id);
91
  }
92
 
93
- private function getActiveBotId()
94
  {
95
  return get_option($this->option_prefix . 'active_bot');
96
  }
@@ -153,6 +302,8 @@ class MobileMonkeyApi
153
  {
154
  $logout = filter_input(INPUT_GET, "logout", FILTER_SANITIZE_STRING);
155
  if ($logout || $reset) {
 
 
156
  delete_option($this->option_prefix . 'token');
157
  delete_option($this->option_prefix . 'company_id');
158
  delete_option($this->option_prefix . 'active_page_id');
@@ -211,13 +362,23 @@ class MobileMonkeyApi
211
  if ($connect_response->facebook_page->remote_id) {
212
  $options = get_option('htcc_options', array());
213
  $options['fb_page_id'] = $connect_response->facebook_page->remote_id;
 
214
  $options['fb_internal_page_id'] = $connect_response->facebook_page->id;
215
  update_option('htcc_options', $options);
216
  if ($connect_response->facebook_page->active_bot_id) {
217
  $custom_settings = $this->getCustomChatSettings($options['fb_page_id']);
 
218
  foreach ($custom_settings as $key=>$value){
219
- $options['fb_'.$key]=$value;
 
 
 
 
220
  }
 
 
 
 
221
  update_option('htcc_fb_js_src', $custom_settings->js_src);
222
  if (!$this->mmOnlyCheck($options['fb_page_id'])){
223
  $test = $this->getWidgets($connect_response->facebook_page->remote_id);
@@ -230,21 +391,28 @@ class MobileMonkeyApi
230
  if ($value->type == 'text') {
231
  $value_new['thank_message'] = $value->config->body;
232
  }
233
- if ($value->type == 'email') {
234
  $value_new['email'] = $value->config->recipient;
235
  }
236
  }
237
  }
238
  $value_new['fb_as_state'] = 0;
239
- update_option('htcc_as_options', $value_new);
240
  }
241
- if ($connect_response->welcome_message) {
242
- $options['fb_welcome_message'] = $connect_response->welcome_message->body;
243
  } else {
244
- $options['fb_welcome_message'] = '';
245
  }
 
 
246
  $options['fb_sdk_lang'] = $this->getLanguage($connect_response->facebook_page->remote_id);
247
  update_option('htcc_options', $options);
 
 
 
 
 
248
  $this->refreshSettingsPage();
249
  return true;
250
  }
@@ -289,10 +457,11 @@ class MobileMonkeyApi
289
  $this->ErrorHandler($response,'AS State Save','');
290
  }
291
 
292
- public function disconnectPage()
293
  {
294
- $pageId = filter_input(INPUT_GET, "disconnect", FILTER_SANITIZE_STRING);
295
-
 
296
  if ($pageId) {
297
  $args = [
298
  'timeout' => 10,
@@ -316,11 +485,16 @@ class MobileMonkeyApi
316
  $options['fb_page_id'] = '';
317
  $options['fb_welcome_message'] = '';
318
  update_option('htcc_options', $options);
319
-
 
 
 
 
320
  delete_option($this->option_prefix . 'active_page_id');
321
  delete_option($this->option_prefix . 'active_page_remote_id');
322
  delete_option($this->option_prefix . 'active_bot');
323
-
 
324
  $this->refreshSettingsPage();
325
 
326
  return true;
@@ -364,23 +538,24 @@ class MobileMonkeyApi
364
  $pagesObj = json_decode($content);
365
 
366
  if (empty($pagesObj->errors)) {
367
-
368
- foreach ($pagesObj->data as $page) {
369
- $p = [
370
- 'name' => $page->name,
371
- 'remote_id' => $page->remote_id,
372
- 'id' => $page->facebook_page_id,
373
- 'bot_id' => $page->bot_id,
374
- 'bot_kind' => $page->bot_kind,
375
- 'company_id' => $page->company_id,
376
- 'path' => add_query_arg([
377
- 'page' => $this->plugin_name,
378
- 'connect' => $page->remote_id,
379
- 'page_name' => $page->name
380
- ], admin_url('admin.php')),
381
- ];
382
-
383
- $pages[] = $p;
 
384
  }
385
  }
386
  }
@@ -565,6 +740,96 @@ class MobileMonkeyApi
565
  return false;
566
  }
567
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
568
 
569
  public function updateWidgets($object)
570
  {
@@ -786,6 +1051,49 @@ class MobileMonkeyApi
786
  }
787
  }
788
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
789
 
790
  private function ErrorHandler($response,$point,$type){
791
  $content = wp_remote_retrieve_body($response);
@@ -801,6 +1109,7 @@ class MobileMonkeyApi
801
  foreach ($connect_response->errors as $error) {
802
  $this->renderError('Error: ' . $error);
803
  }
 
804
  }
805
  } elseif (!empty($connect_response->errors)) {
806
  foreach ($connect_response->errors as $error) {
14
  private $pagination;
15
  private $contacts;
16
  private $plugin_name = 'wp-chatbot';
17
+ private $page_info;
18
 
19
  private function getApiDomain()
20
  {
70
  return get_option($this->option_prefix . 'company_id');
71
  }
72
  }
73
+ private function getActiveRemotePageId(){
74
+ return get_option($this->option_prefix . 'active_page_remote_id');
75
+ }
76
+
77
+ public function getSubscribeInfo()
78
+ {
79
+ $args = [
80
+ 'timeout' => 10,
81
+ 'headers' => [
82
+ 'Authorization' => $this->getToken(),
83
+ 'Content-Type' => 'application/json; charset=utf-8',
84
+ ],
85
+ 'method' => 'GET',
86
+ ];
87
+ $response = wp_remote_post($this->getApiDomain() . 'api/wordpress/subscriptions/for_page?facebook_page_id=' . $this->getActiveRemotePageId().'&v=' . HTCC_VERSION.'.2', $args);
88
+ $error = $this->ErrorHandler($response,'Page Subscribe Info','get');
89
+ if ($error) {
90
+ $connect_response = json_decode($error);
91
+ $this->setAccountInfo($connect_response->account);
92
+ $this->setCurrentSubscription($connect_response->subscription);
93
+ $this->setWpPlan($connect_response->plan);
94
+ $this->setPageInfo($connect_response);
95
+ $this->setMessageStatistic($connect_response->current_outgoing_messages_statistic);
96
+ }
97
+ }
98
+
99
+ public function setPageInfo($info){
100
+ $data = [
101
+ 'pageName'=> $info->name,
102
+ 'connected_at'=> $info->connected_at,
103
+ 'is_wp_subscribe'=> $info->is_wp_subscription,
104
+ ];
105
+ $this->page_info = $data;
106
+ update_option($this->option_prefix . 'page_info', $data);
107
+ }
108
+
109
+ public function getPageInfo(){
110
+ return get_option($this->option_prefix . 'page_info');
111
+ }
112
+
113
+ public function setAccountInfo($account){
114
+ update_option($this->option_prefix . 'account_info', $account);
115
+ }
116
+ /**
117
+ * @return object
118
+ */
119
+ public function getAccountInfo(){
120
+ return get_option($this->option_prefix . 'account_info');
121
+ }
122
+
123
+ public function setMessageStatistic($account){
124
+ update_option($this->option_prefix . 'message_statistic', $account);
125
+ }
126
+ /**
127
+ * @return object
128
+ */
129
+ public function getMessageStatistic(){
130
+ return get_option($this->option_prefix . 'message_statistic');
131
+ }
132
+
133
+ public function setCurrentSubscription($subscribe){
134
+ update_option($this->option_prefix . 'current_subscribe', $subscribe);
135
+ }
136
+ /**
137
+ * @return object
138
+ */
139
+ public function getCurrentSubscription(){
140
+ return get_option($this->option_prefix . 'current_subscribe');
141
+ }
142
+
143
+ public function setWpPlan($plan){
144
+ update_option($this->option_prefix . 'wp_plan', $plan);
145
+ }
146
+ /**
147
+ * @return object
148
+ */
149
+ public function getWpPlan(){
150
+ return get_option($this->option_prefix . 'wp_plan');
151
+ }
152
 
153
  private function getInternalPageId($connection_page_id)
154
  {
164
  return get_option($this->option_prefix . 'fb_internal_page_id');
165
  }
166
  }
167
+ private function default_custom_setting(){
168
+ $data = array();
169
+ $data['fb_logged_in_greeting'] = 'Hi! How can we help you?';
170
+ $data['fb_logged_out_greeting'] = 'Hi! We\'re here to answer any questions you may have';
171
+ $data['fb_color'] = '#0084FF';
172
+ $data['fb_greeting_dialog_display'] = 'show';
173
+ $data['fb_greeting_dialog_delay'] = 1;
174
+ return($data);
175
+ }
176
+
177
+ public function create_subscribe(){
178
+ $data = $_POST;
179
+ $args = [
180
+ 'timeout' => 10,
181
+ 'headers' => [
182
+ 'Authorization' => $this->getToken(),
183
+ 'Content-Type' => 'application/json; charset=utf-8',
184
+ ],
185
+ 'body' => json_encode([
186
+ 'facebook_page_id'=> $this->getActiveRemotePageId(),
187
+ 'src' => $this->getSrc(),
188
+ ]),
189
+ 'method' => 'POST',
190
+ ];
191
+ if(isset($data['token'])){
192
+ $args['body'] = json_encode([
193
+ 'facebook_page_id'=> $this->getActiveRemotePageId(),
194
+ 'src' => $this->getSrc(),
195
+ 'token' => $data['token']
196
+ ]);
197
+ }
198
+ $response = wp_remote_post($this->getApiDomain() . 'api/wordpress/subscriptions?v=' . HTCC_VERSION.'.2', $args);
199
+ $error = $this->ErrorHandler($response,'Subscribe','create');
200
+ if ($error) {
201
+ $connect_response = json_decode($error);
202
+ $this->setAccountInfo($connect_response->account);
203
+ $this->setCurrentSubscription($connect_response->subscription);
204
+ $this->setWpPlan($connect_response->plan);
205
+ $this->setPageInfo($connect_response);
206
+ $this->setMessageStatistic($connect_response->current_outgoing_messages_statistic);
207
+ wp_send_json_success ($error);
208
+ }
209
+ }
210
+
211
+ public function cancel_subscribe(){
212
+ $args = [
213
+ 'timeout' => 10,
214
+ 'headers' => [
215
+ 'Authorization' => $this->getToken(),
216
+ 'Content-Type' => 'application/json; charset=utf-8',
217
+ ],
218
+ 'body' => json_encode([
219
+ 'facebook_page_id'=> $this->getActiveRemotePageId(),
220
+ 'src' => $this->getSrc(),
221
+ ]),
222
+ 'method' => 'POST',
223
+ ];
224
+ $response = wp_remote_post($this->getApiDomain() . 'api/wordpress/subscriptions/cancel?v=' . HTCC_VERSION.'.2', $args);
225
+ $error = $this->ErrorHandler($response,'Subscribe','Cancel');
226
+ if ($error) {
227
+ $connect_response = json_decode($error);
228
+ $this->setAccountInfo($connect_response->account);
229
+ $this->setCurrentSubscription($connect_response->subscription);
230
+ $this->setWpPlan($connect_response->plan);
231
+ $this->setPageInfo($connect_response);
232
+ $this->setMessageStatistic($connect_response->current_outgoing_messages_statistic);
233
+ wp_send_json_success ($error);
234
+ }
235
+ }
236
 
237
  private function setActiveBotId($bot_id)
238
  {
239
  update_option($this->option_prefix . 'active_bot', $bot_id);
240
  }
241
 
242
+ public function getActiveBotId()
243
  {
244
  return get_option($this->option_prefix . 'active_bot');
245
  }
302
  {
303
  $logout = filter_input(INPUT_GET, "logout", FILTER_SANITIZE_STRING);
304
  if ($logout || $reset) {
305
+ $this->disconnectPage(get_option($this->option_prefix . 'active_page_id'));
306
+ delete_option('htcc_fb_js_src');
307
  delete_option($this->option_prefix . 'token');
308
  delete_option($this->option_prefix . 'company_id');
309
  delete_option($this->option_prefix . 'active_page_id');
362
  if ($connect_response->facebook_page->remote_id) {
363
  $options = get_option('htcc_options', array());
364
  $options['fb_page_id'] = $connect_response->facebook_page->remote_id;
365
+ $this->setActivePageId($connect_response->facebook_page->remote_id);
366
  $options['fb_internal_page_id'] = $connect_response->facebook_page->id;
367
  update_option('htcc_options', $options);
368
  if ($connect_response->facebook_page->active_bot_id) {
369
  $custom_settings = $this->getCustomChatSettings($options['fb_page_id']);
370
+ $default_setting = $this->default_custom_setting();
371
  foreach ($custom_settings as $key=>$value){
372
+ if ($value == '' || !isset($value)){
373
+ $custom_options['fb_'.$key] = $default_setting['fb_'.$key];
374
+ }else {
375
+ $custom_options['fb_'.$key]=$value;
376
+ }
377
  }
378
+ $ref_cont = $this->getBotRef($connect_response->facebook_page->active_bot_id);
379
+ $ref = stristr($ref_cont->test_link, '=');
380
+ $ref_value = str_replace("=", "", $ref);
381
+ update_option('htcc_fb_ref', $ref_value);
382
  update_option('htcc_fb_js_src', $custom_settings->js_src);
383
  if (!$this->mmOnlyCheck($options['fb_page_id'])){
384
  $test = $this->getWidgets($connect_response->facebook_page->remote_id);
391
  if ($value->type == 'text') {
392
  $value_new['thank_message'] = $value->config->body;
393
  }
394
+ if ($value->type == 'email'&&$this->getCurrentSubscription()) {
395
  $value_new['email'] = $value->config->recipient;
396
  }
397
  }
398
  }
399
  $value_new['fb_as_state'] = 0;
400
+
401
  }
402
+ if ($connect_response->welcome_message||$connect_response->welcome_message=='0') {
403
+ $value_new['fb_welcome_message'] = $connect_response->welcome_message;
404
  } else {
405
+ $value_new['fb_welcome_message'] = '';
406
  }
407
+ update_option('htcc_custom_options', $custom_options);
408
+ update_option('htcc_as_options', $value_new);
409
  $options['fb_sdk_lang'] = $this->getLanguage($connect_response->facebook_page->remote_id);
410
  update_option('htcc_options', $options);
411
+ $_SESSION['tab']['tab1'] = true;
412
+ $_SESSION['tab']['tab2'] = false;
413
+ $_SESSION['tab']['tab3'] = false;
414
+ $_SESSION['current'] = 'tab-1';
415
+ $_SESSION['setup'] = false;
416
  $this->refreshSettingsPage();
417
  return true;
418
  }
457
  $this->ErrorHandler($response,'AS State Save','');
458
  }
459
 
460
+ public function disconnectPage($pageId='')
461
  {
462
+ if (!$pageId){
463
+ $pageId = filter_input(INPUT_GET, "disconnect", FILTER_SANITIZE_STRING);
464
+ }
465
  if ($pageId) {
466
  $args = [
467
  'timeout' => 10,
485
  $options['fb_page_id'] = '';
486
  $options['fb_welcome_message'] = '';
487
  update_option('htcc_options', $options);
488
+ delete_option($this->option_prefix . 'page_info');
489
+ delete_option($this->option_prefix . 'account_info');
490
+ delete_option($this->option_prefix . 'current_subscribe');
491
+ delete_option($this->option_prefix . 'message_statistic');
492
+ delete_option($this->option_prefix . 'wp_plan');
493
  delete_option($this->option_prefix . 'active_page_id');
494
  delete_option($this->option_prefix . 'active_page_remote_id');
495
  delete_option($this->option_prefix . 'active_bot');
496
+ delete_option('htcc_fb_js_src');
497
+ unset($_SESSION['tab'],$_SESSION['current'],$_SESSION['setup']);
498
  $this->refreshSettingsPage();
499
 
500
  return true;
538
  $pagesObj = json_decode($content);
539
 
540
  if (empty($pagesObj->errors)) {
541
+ if(is_array($pagesObj->data)) {
542
+ foreach ($pagesObj->data as $page) {
543
+ $p = [
544
+ 'name' => $page->name,
545
+ 'remote_id' => $page->remote_id,
546
+ 'id' => $page->facebook_page_id,
547
+ 'bot_id' => $page->bot_id,
548
+ 'bot_kind' => $page->bot_kind,
549
+ 'company_id' => $page->company_id,
550
+ 'path' => add_query_arg([
551
+ 'page' => $this->plugin_name,
552
+ 'connect' => $page->remote_id,
553
+ 'page_name' => $page->name
554
+ ], admin_url('admin.php')),
555
+ ];
556
+
557
+ $pages[] = $p;
558
+ }
559
  }
560
  }
561
  }
740
  return false;
741
  }
742
  }
743
+ public function setWidgets($options,$widgets,$page_id,$update)
744
+ {
745
+ if (!$update){
746
+ if (!$options['email']&&$this->getCurrentSubscription()){
747
+ foreach ($widgets->widgets as $key=>$value){
748
+ $value->type == 'email'?$options['email'] = $value->config->recipient:'';
749
+ }
750
+ update_option('htcc_as_options', $options);
751
+ }
752
+ if (!$options){
753
+ $data_widget = $this->getWidgets($page_id);
754
+ if (!$data_widget) {
755
+ return false;
756
+ }
757
+ foreach ($data_widget->widgets as $key => $value) {
758
+ switch ($value->type){
759
+ case 'quick_question':
760
+ $key += 1;
761
+ $value_new['fb_answer' . $key . ''] = $value->config->body;
762
+ break;
763
+ case 'text':
764
+ $value_new['thank_message'] = $value->config->body;
765
+ break;
766
+ case 'email':
767
+ $value_new['email'] = $value->config->recipient;
768
+ break;
769
+ }
770
+ }
771
+ $value_new['fb_welcome_message'] = $this->getWelcomeMessage($page_id);
772
+ $value_new['fb_as_state'] = 0;
773
+ update_option('htcc_as_options', $value_new);
774
+ }
775
+ }else{
776
+ if (!$widgets){
777
+ return false;
778
+ }
779
+
780
+ if ((float)$widgets->enabled!== (float)$options['fb_as_state']){
781
+
782
+ if ($options['fb_as_state']== null || $options['fb_as_state']==0){
783
+ $state = false;
784
+ } else {
785
+ $state = true;
786
+ }
787
+ $this->AsStateSave($state,$page_id);
788
+ }
789
+
790
+ foreach ($widgets->widgets as $key=>$value){
791
+ switch ($value->type) {
792
+ case 'quick_question':
793
+ $key+=1;
794
+ if ($options['fb_answer'.$key.'']!== $value->config->body){
795
+ if (!isset($options['fb_answer'.$key.''])|| $options['fb_answer'.$key.''] == ''){
796
+ $value_new['fb_answer' . $key . ''] = $value->config->body;
797
+ }
798
+ $dump_value = $value;
799
+ $dump_value->config->body = $options['fb_answer'.$key.''];
800
+ $this->updateWidgets($dump_value);
801
+ }
802
+ break;
803
+ case 'text':
804
+ if ($options['thank_message']!== $value->config->body) {
805
+ if (!isset($options['thank_message'])|| $options['thank_message'] == ''){
806
+ $value_new['thank_message'] = $value->config->body;
807
+ }
808
+ $dump_value = $value;
809
+ $dump_value->config->body = $options['thank_message'];
810
+ $this->updateWidgets($dump_value);
811
+
812
+ }
813
+ break;
814
+ case 'email':
815
+ if ($options['email']!== $value->config->recipient&&$this->getCurrentSubscription()) {
816
+ if (!isset($options['email'])|| $options['email'] == '') {
817
+ $value_new['email'] = $value->config->recipient;
818
+ }
819
+ $dump_value = $value;
820
+ $dump_value->config->recipient = $options['email'];
821
+ $this->updateWidgets($dump_value);
822
+
823
+ }
824
+ break;
825
+ default:
826
+ return false;
827
+ }
828
+ }
829
+ }
830
+ return true;
831
+
832
+ }
833
 
834
  public function updateWidgets($object)
835
  {
1051
  }
1052
  }
1053
 
1054
+ public function setCustomChatSettings($page_id,$options,$update){
1055
+ $custom_settings = $this->getCustomChatSettings($page_id);
1056
+ if (!$update){
1057
+ if (!$options){
1058
+ $custom_settings = $this->getCustomChatSettings($page_id);
1059
+ if (!$custom_settings) {
1060
+ return false;
1061
+ }
1062
+ $default_setting = $this->default_custom_setting();
1063
+ foreach ($custom_settings as $key=>$value){
1064
+ if ($value == '' || !isset($value)){
1065
+ $custom_options['fb_'.$key] = $default_setting['fb_'.$key];
1066
+ }else {
1067
+ $custom_options['fb_'.$key]=$value;
1068
+ }
1069
+ }
1070
+ update_option('htcc_fb_js_src', $custom_settings->js_src);
1071
+ update_option('htcc_custom_options', $custom_options);
1072
+ }
1073
+ }
1074
+ if (!$custom_settings) {
1075
+ return false;
1076
+ }
1077
+ foreach ($custom_settings as $key=>$value){
1078
+ switch ($key){
1079
+ case 'js_src':
1080
+ break;
1081
+ case 'hide_mobile':
1082
+ $options['fb_'.$key] = false;
1083
+ break;
1084
+ case 'hide_desktop':
1085
+ $options['fb_'.$key] = false;
1086
+ break;
1087
+ default:
1088
+ $new_value[$key] = !isset($options['fb_'.$key])?'':$options['fb_'.$key];
1089
+ break;
1090
+ }
1091
+ }
1092
+ if (!empty($new_value)){
1093
+ $this->updateCustomChatSettings($new_value,$page_id);
1094
+ }
1095
+ return true;
1096
+ }
1097
 
1098
  private function ErrorHandler($response,$point,$type){
1099
  $content = wp_remote_retrieve_body($response);
1109
  foreach ($connect_response->errors as $error) {
1110
  $this->renderError('Error: ' . $error);
1111
  }
1112
+ return $error;
1113
  }
1114
  } elseif (!empty($connect_response->errors)) {
1115
  foreach ($connect_response->errors as $error) {
inc/class-ht-cc.php CHANGED
@@ -204,11 +204,16 @@ class HT_CC {
204
 
205
  private function hooks() {
206
 
207
- register_activation_hook( __FILE__, array( 'HTCC_Register', 'activate' ) );
208
- register_deactivation_hook( __FILE__, array( 'HTCC_Register', 'deactivate' ) );
209
- register_uninstall_hook(__FILE__, array( 'HTCC_Register', 'uninstall' ) );
210
  add_action( 'activated_plugin', array( 'HTCC_Register', 'activate_plugin' ) );
211
-
 
 
 
 
 
212
  // initilaze classes
213
  if ( ! is_admin() ) {
214
  add_action( 'init', array( $this, 'init' ), 0 );
204
 
205
  private function hooks() {
206
 
207
+ register_activation_hook( HTCC_PLUGIN_FILE, array( 'HTCC_Register', 'activate' ) );
208
+ register_deactivation_hook( HTCC_PLUGIN_FILE, array( 'HTCC_Register', 'deactivate' ) );
209
+ register_uninstall_hook(HTCC_PLUGIN_FILE, array( 'HTCC_Register', 'uninstall' ) );
210
  add_action( 'activated_plugin', array( 'HTCC_Register', 'activate_plugin' ) );
211
+ add_action('init', 'start_session', 1);
212
+ function start_session() {
213
+ if(!session_id()) {
214
+ session_start();
215
+ }
216
+ }
217
  // initilaze classes
218
  if ( ! is_admin() ) {
219
  add_action( 'init', array( $this, 'init' ), 0 );
inc/class-htcc-chatbot.php CHANGED
@@ -31,8 +31,7 @@ class HTCC_Chatbot {
31
  */
32
  public function chatbot() {
33
 
34
- $htcc_options = ht_cc()->variables->get_option;;
35
- $log_events_value = esc_attr( $htcc_options['log_events'] );
36
  $shortcode_name = esc_attr( $htcc_options['shortcode'] );
37
 
38
  $is_mobile = ht_cc()->device_type->is_mobile;
@@ -131,6 +130,11 @@ class HTCC_Chatbot {
131
  // Hide styles on this catergorys - list
132
  $list_hideon_cat = $htcc_options['list_hideon_cat'];
133
 
 
 
 
 
 
134
  if( $list_hideon_cat ) {
135
  // Get current post Categorys list and create an array for that..
136
  $current_categorys_array = array();
@@ -196,7 +200,11 @@ class HTCC_Chatbot {
196
  if ( 'no' == $this->sdk_added ) {
197
  return;
198
  }
199
-
 
 
 
 
200
 
201
  if ( 'true' == HTCC_PRO ) {
202
  ?>
31
  */
32
  public function chatbot() {
33
 
34
+ $htcc_options = ht_cc()->variables->get_option;
 
35
  $shortcode_name = esc_attr( $htcc_options['shortcode'] );
36
 
37
  $is_mobile = ht_cc()->device_type->is_mobile;
130
  // Hide styles on this catergorys - list
131
  $list_hideon_cat = $htcc_options['list_hideon_cat'];
132
 
133
+ $activePage = $this->api->getActivePage();
134
+ if (!$activePage) {
135
+ delete_option('htcc_fb_js_src');
136
+ $this->htcc_js_options = '';
137
+ }
138
  if( $list_hideon_cat ) {
139
  // Get current post Categorys list and create an array for that..
140
  $current_categorys_array = array();
200
  if ( 'no' == $this->sdk_added ) {
201
  return;
202
  }
203
+ $activePage = $this->api->getActivePage();
204
+ if (!$activePage) {
205
+ delete_option('htcc_fb_js_src');
206
+ $this->htcc_js_options = '';
207
+ }
208
 
209
  if ( 'true' == HTCC_PRO ) {
210
  ?>
inc/class-htcc-db.php CHANGED
@@ -79,10 +79,9 @@ class HTCC_db {
79
  'list_hideon_pages' => '',
80
  'list_hideon_cat' => '',
81
  'shortcode' => 'chatbot',
82
-
83
- 'greeting_dialog_display' => '',
84
- 'greeting_dialog_delay' => '',
85
-
86
  );
87
 
88
  $db_values = get_option( 'htcc_options', array() );
79
  'list_hideon_pages' => '',
80
  'list_hideon_cat' => '',
81
  'shortcode' => 'chatbot',
82
+ 'greeting_dialog_display' => '',
83
+ 'greeting_dialog_delay' => '',
84
+ 'ref' => '',
 
85
  );
86
 
87
  $db_values = get_option( 'htcc_options', array() );
inc/class-htcc-register.php CHANGED
@@ -67,7 +67,14 @@ class HTCC_Register {
67
  * @return void
68
  */
69
  public static function deactivate() {
70
-
 
 
 
 
 
 
 
71
  }
72
 
73
  /**
@@ -77,7 +84,14 @@ class HTCC_Register {
77
  * @return void
78
  */
79
  public static function uninstall() {
80
-
 
 
 
 
 
 
 
81
  }
82
 
83
 
67
  * @return void
68
  */
69
  public static function deactivate() {
70
+ $pageid = get_option('mobilemonkey_active_page_id');
71
+ $test = new MobileMonkeyApi();
72
+ $test->disconnectPage($pageid);
73
+ delete_option('mobilemonkey_token');
74
+ delete_option('mobilemonkey_company_id');
75
+ delete_option('mobilemonkey_active_page_id');
76
+ delete_option('mobilemonkey_active_page_remote_id');
77
+ delete_option('mobilemonkey_active_bot');
78
  }
79
 
80
  /**
84
  * @return void
85
  */
86
  public static function uninstall() {
87
+ $pageid = get_option('mobilemonkey_active_page_id');
88
+ $test = new MobileMonkeyApi();
89
+ $test->disconnectPage($pageid);
90
+ delete_option('mobilemonkey_token');
91
+ delete_option('mobilemonkey_company_id');
92
+ delete_option('mobilemonkey_active_page_id');
93
+ delete_option('mobilemonkey_active_page_remote_id');
94
+ delete_option('mobilemonkey_active_bot');
95
  }
96
 
97
 
inc/class-htcc-test-chatbot.php CHANGED
@@ -25,7 +25,7 @@ if (!class_exists('HTCC_Test_Chatbot')) :
25
 
26
  $htcc_options = ht_cc()->variables->get_option;
27
  $htcc_js_options = get_option('htcc_fb_js_src');
28
- if ($_GET['page']== HTCC_PLUGIN_MAIN_MENU){
29
  ?>
30
  <script src='<?php echo $htcc_js_options?>'></script>
31
  <script>
@@ -51,11 +51,11 @@ if (!class_exists('HTCC_Test_Chatbot')) :
51
  if (e.event === 'opt_in') {
52
  jQuery('#fb-root').show();
53
  jQuery('.test-bot-button').hide();
54
- FB.XFBML.parse();
55
  jQuery('.testchat').show();
56
  jQuery('.testchat').on('click',function () {
57
  setTimeout(function(){
58
- FB.XFBML.parse();
59
  jQuery('.test-bot-button').show();
60
  jQuery('.testchat').hide();
61
  }, 5000);
25
 
26
  $htcc_options = ht_cc()->variables->get_option;
27
  $htcc_js_options = get_option('htcc_fb_js_src');
28
+ if (isset($_GET['page']) && $_GET['page']== HTCC_PLUGIN_MAIN_MENU){
29
  ?>
30
  <script src='<?php echo $htcc_js_options?>'></script>
31
  <script>
51
  if (e.event === 'opt_in') {
52
  jQuery('#fb-root').show();
53
  jQuery('.test-bot-button').hide();
54
+ FB.XFBML.parse(jQuery("#htcc-messenger").ref);
55
  jQuery('.testchat').show();
56
  jQuery('.testchat').on('click',function () {
57
  setTimeout(function(){
58
+ /*FB.XFBML.parse(e.ref);*/
59
  jQuery('.test-bot-button').show();
60
  jQuery('.testchat').hide();
61
  }, 5000);
inc/commons/class-ht-cc-variables.php CHANGED
@@ -38,7 +38,7 @@ class HT_CC_Variables {
38
  }
39
 
40
  public function get_option() {
41
- $this->get_option = get_option('htcc_options');
42
  }
43
 
44
  // public function ccw_enable() {
38
  }
39
 
40
  public function get_option() {
41
+ $this->get_option = get_option('htcc_custom_options');
42
  }
43
 
44
  // public function ccw_enable() {
readme.txt CHANGED
@@ -3,13 +3,16 @@ Requires at least: 4.6
3
  Tested up to: 5.2
4
  Requires PHP: 5.6
5
  Contributors: larrykim, yankovski
6
- Stable tag: 4.0.9
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
10
 
11
 
12
  == Description ==
 
 
 
13
  WP-Chatbot adds a Facebook Messenger chat widget to your website. The Messenger widget is the fastest and simplest way to add live chat to your website, convert more leads and engage your customers, even after they’ve left your website.
14
 
15
  - One-click installation for WordPress
3
  Tested up to: 5.2
4
  Requires PHP: 5.6
5
  Contributors: larrykim, yankovski
6
+ Stable tag: 4.1.2
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
10
 
11
 
12
  == Description ==
13
+
14
+ https://vimeo.com/339614063
15
+
16
  WP-Chatbot adds a Facebook Messenger chat widget to your website. The Messenger widget is the fastest and simplest way to add live chat to your website, convert more leads and engage your customers, even after they’ve left your website.
17
 
18
  - One-click installation for WordPress
wp-chatbot.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Chatbot
4
  Plugin URI: https://mobilemonkey.com/wp-chatbot/
5
  Description: Add Messenger to your website, Chatbot or live Chat using Facebook Messenger
6
- Version: 4.0.9
7
  Author: MobileMonkey
8
  Author URI: https://mobilemonkey.com/wp-chatbot/
9
  License: GPL2
@@ -17,7 +17,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
17
 
18
  // Version - define HTCC_VERSION
19
  if ( ! defined( 'HTCC_VERSION' ) ) {
20
- define( 'HTCC_VERSION', '4.0.9' );
21
  }
22
 
23
 
3
  Plugin Name: WP Chatbot
4
  Plugin URI: https://mobilemonkey.com/wp-chatbot/
5
  Description: Add Messenger to your website, Chatbot or live Chat using Facebook Messenger
6
+ Version: 4.1.2
7
  Author: MobileMonkey
8
  Author URI: https://mobilemonkey.com/wp-chatbot/
9
  License: GPL2
17
 
18
  // Version - define HTCC_VERSION
19
  if ( ! defined( 'HTCC_VERSION' ) ) {
20
+ define( 'HTCC_VERSION', '4.1.2' );
21
  }
22
 
23