Messenger Customer Chat - Version 1.7

Version Description

  • Added Plugin versioning. Tested up to WordPress 5.4.2
Download this release

Release Info

Developer Facebook
Plugin Icon 128x128 Messenger Customer Chat
Version 1.7
Comparing to
See all releases

Code changes from version 1.6 to 1.7

Files changed (3) hide show
  1. facebook-messenger-customer-chat.php +4 -7
  2. options.php +22 -8
  3. readme.txt +20 -11
facebook-messenger-customer-chat.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: The Official Facebook Chat Plugin
4
  Description: With one click, you can add the Facebook Chat Plugin to your website, enabling customers to message you while browsing your website. To see and reply to those messages, simply use the same messaging tools you use for your Facebook messaging, on desktop at facebook.com, Facebook Page Manager App (available on iOS and Android), or by adding your page account to Messenger. It’s free, easy to install and comes with a user interface your customers are already familiar with.
5
  Author: Facebook
6
  Author URI: https://developers.facebook.com
7
- Version: 1.6
8
 
9
  * Copyright (C) 2017-present, Facebook, Inc.
10
  *
@@ -32,20 +32,17 @@ class Facebook_Messenger_Customer_Chat {
32
  <script>(function(d, s, id) {
33
  var js, fjs = d.getElementsByTagName(s)[0];
34
  js = d.createElement(s); js.id = id;
35
- js.src = 'https://connect.facebook.net/".get_option( 'fbmcc_locale' )."/sdk/xfbml.customerchat.js#xfbml=1&version=v6.0&autoLogAppEvents=1';
36
  fjs.parentNode.insertBefore(js, fjs);
37
  }(document, 'script', 'facebook-jssdk'));</script>
38
  <div class='fb-customerchat'
39
  attribution='wordpress'
40
- page_id=".get_option( 'fbmcc_pageID' )."
 
41
  >
42
  </div>
43
  ";
44
  _e($genCode);
45
- }else if( get_option( 'fbmcc_enabled' ) == '1'
46
- && get_option( 'fbmcc_generatedCode' ) != ''
47
- ) {
48
- _e( stripslashes( get_option( 'fbmcc_generatedCode' ) ) );
49
  }
50
  }
51
  }
4
  Description: With one click, you can add the Facebook Chat Plugin to your website, enabling customers to message you while browsing your website. To see and reply to those messages, simply use the same messaging tools you use for your Facebook messaging, on desktop at facebook.com, Facebook Page Manager App (available on iOS and Android), or by adding your page account to Messenger. It’s free, easy to install and comes with a user interface your customers are already familiar with.
5
  Author: Facebook
6
  Author URI: https://developers.facebook.com
7
+ Version: 1.7
8
 
9
  * Copyright (C) 2017-present, Facebook, Inc.
10
  *
32
  <script>(function(d, s, id) {
33
  var js, fjs = d.getElementsByTagName(s)[0];
34
  js = d.createElement(s); js.id = id;
35
+ js.src = 'https://connect.facebook.net/".fbmcc_sanitize_locale(get_option( 'fbmcc_locale' ))."/sdk/xfbml.customerchat.js#xfbml=1&version=v6.0&autoLogAppEvents=1';
36
  fjs.parentNode.insertBefore(js, fjs);
37
  }(document, 'script', 'facebook-jssdk'));</script>
38
  <div class='fb-customerchat'
39
  attribution='wordpress'
40
+ attribution_version='1.7'
41
+ page_id=".fbmcc_sanitize_page_id(get_option( 'fbmcc_pageID' ))."
42
  >
43
  </div>
44
  ";
45
  _e($genCode);
 
 
 
 
46
  }
47
  }
48
  }
options.php CHANGED
@@ -54,12 +54,28 @@ function fbmcc_update_options() {
54
 
55
  if ( current_user_can( 'manage_options' ) ) {
56
  check_ajax_referer( 'update_fmcc_code' );
57
- update_option( 'fbmcc_pageID', sanitize_text_field($_POST['pageID']));
58
- update_option( 'fbmcc_locale', sanitize_text_field($_POST['locale']));
59
  }
60
  wp_die();
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  function fbmcc_add_styles() {
64
  wp_enqueue_style(
65
  'admin-styles',
@@ -87,14 +103,12 @@ function fmcc_localize_ajax() {
87
  function fbmcc_integration_settings() {
88
  ?>
89
  <div class="wrap">
90
- <h2>Messenger Customer Chat Settings</h2>
91
  <div class="fbmcc-card card">
92
  <div class="intro">
93
  <div>
94
  <h2>Getting Started?</h2>
95
- <p class="fbmcc-instructions">Let people start a conversation on your
96
- website and continue in Messenger. It's easy to set up. We'll
97
- give you the code to add to your website.
98
  </p>
99
  </div>
100
  <div class="fbmcc-buttonContainer">
@@ -137,9 +151,9 @@ function fbmcc_integration_settings() {
137
  Facebook Platform Bug Reports</a> page. If you get stuck or have questions,
138
  you can ask for help in the
139
  <a
140
- href='https://wordpress.org/support/plugin/facebook-messenger-customer-chat'
141
  target='_blank'>
142
- Facebook Chat Plugin forum</a>.
143
  </p>
144
  </div>
145
  </div>
54
 
55
  if ( current_user_can( 'manage_options' ) ) {
56
  check_ajax_referer( 'update_fmcc_code' );
57
+ update_option( 'fbmcc_pageID', fbmcc_sanitize_page_id($_POST['pageID']));
58
+ update_option( 'fbmcc_locale', fbmcc_sanitize_locale($_POST['locale']));
59
  }
60
  wp_die();
61
  }
62
 
63
+ function fbmcc_sanitize_page_id($input) {
64
+ if ( preg_match('/^\d+$/', $input) ) {
65
+ return $input;
66
+ } else {
67
+ return '';
68
+ }
69
+ }
70
+
71
+ function fbmcc_sanitize_locale($input) {
72
+ if ( preg_match('/^[A-Za-z_]{4,5}$/', $input) ){
73
+ return $input;
74
+ } else {
75
+ return '';
76
+ }
77
+ }
78
+
79
  function fbmcc_add_styles() {
80
  wp_enqueue_style(
81
  'admin-styles',
103
  function fbmcc_integration_settings() {
104
  ?>
105
  <div class="wrap">
106
+ <h2>Facebook Chat Plugin Settings</h2>
107
  <div class="fbmcc-card card">
108
  <div class="intro">
109
  <div>
110
  <h2>Getting Started?</h2>
111
+ <p class="fbmcc-instructions">Let people start a conversation on your website and continue in Messenger. It's easy to set up. Chats started on your website can be continued in the customers’ Messenger app, so you never lose connections with your customers. Even those without a Facebook Messenger account can chat with you in guest mode, so you can reach more customers than ever.
 
 
112
  </p>
113
  </div>
114
  <div class="fbmcc-buttonContainer">
151
  Facebook Platform Bug Reports</a> page. If you get stuck or have questions,
152
  you can ask for help in the
153
  <a
154
+ href='https://www.facebook.com/groups/messengerplatform'
155
  target='_blank'>
156
+ Messenger Platform Developer Community</a>.
157
  </p>
158
  </div>
159
  </div>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: facebook
3
  Tags: Facebook, Messenger, Customer Care, Chat, Messaging, Chat Plugin
4
  Requires at least: 3.9
5
- Tested up to: 5.4.1
6
- Stable tag: 1.6
7
  Requires PHP: 5.2.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -11,7 +11,9 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  The Official Facebook Chat Plugin
12
 
13
  == Description ==
14
- With one click, you can add the Facebook Chat Plugin to your website, enabling customers to message you while browsing your website. To see and reply to those messages, simply use the same messaging tools you use for your Facebook messaging, on desktop at facebook.com, Facebook Page Manager App (available on iOS and Android), or by adding your page account to Messenger. It’s free, easy to install and comes with a user interface your customers are already familiar with.
 
 
15
 
16
  Key features of the Chat Plugin:
17
 
@@ -57,12 +59,12 @@ That's it! You're all set. Now all visitors to your WordPress website will see t
57
  If you get stuck, or have any questions, you can ask for help in the [Messenger Platform Developer Community](https://www.facebook.com/groups/messengerplatform).
58
 
59
  == Screenshots ==
60
- 1. Messenger customer chat on your website
61
- 2. Messenger customer chat settings page on first installation
62
- 3. Select Facebook Page in setup
63
- 4. Set your desired language and customize the greeting text
64
- 5. Set your response time and customize your chat color
65
- 6. Messenger customer chat settings page after successful setup
66
 
67
  == Frequently Asked Questions ==
68
 
@@ -86,8 +88,12 @@ If you get stuck, or have any questions, you can ask for help in the [Messenger
86
 
87
  == Changelog ==
88
 
 
 
 
 
89
  = 1.6 - July 27, 2020 =
90
- * Bug fixes
91
 
92
  = 1.5 - April 29, 2020 =
93
  * Fix undefined variable error message
@@ -114,8 +120,11 @@ If you get stuck, or have any questions, you can ask for help in the [Messenger
114
 
115
  == Upgrade Notice ==
116
 
 
 
 
117
  = 1.6 =
118
- * Bug fixes
119
 
120
  = 1.5 =
121
  * Fix undefined variable error message
2
  Contributors: facebook
3
  Tags: Facebook, Messenger, Customer Care, Chat, Messaging, Chat Plugin
4
  Requires at least: 3.9
5
+ Tested up to: 5.4.2
6
+ Stable tag: 1.7
7
  Requires PHP: 5.2.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  The Official Facebook Chat Plugin
12
 
13
  == Description ==
14
+ The Facebook Chat Plugin is a free and easy to use tool to connect with customers on your website. With one click, you can add the plugin to your website, enabling customers to message you while browsing your website. Chats started on your website can be continued in the customers' Messenger app, so you never lose connections with your customers. Even those without a Facebook Messenger account can chat with you in guest mode, so you can reach more customers than ever.
15
+
16
+ "Having an open line of communication with our customers gives them a sense of confidence from the browsing stage to final checkout," said Ryan Pamplin, CEO of BlendJet. "We noticed that customers who engage with us are three to four times more likely to checkout. With the Chat Plugin allowing us to reach more customers, we’ve tripled our sales since offering it as a customer engagement channel."
17
 
18
  Key features of the Chat Plugin:
19
 
59
  If you get stuck, or have any questions, you can ask for help in the [Messenger Platform Developer Community](https://www.facebook.com/groups/messengerplatform).
60
 
61
  == Screenshots ==
62
+ 1. Facebook Chat Plugin on your website
63
+ 2. Facebook Chat Plugin on mobile view
64
+ 3. Starting a conversation via the Chat Plugin
65
+ 4. Facebook Chat Plugin settings page on first installation
66
+ 5. Set your desired language, guest mode and customize the greeting text
67
+ 6. Facebook Chat Plugin settings page after successful setup
68
 
69
  == Frequently Asked Questions ==
70
 
88
 
89
  == Changelog ==
90
 
91
+ = 1.7 - Aug 5, 2020 =
92
+ * Tested up to WordPress 5.4.2
93
+ * Added Plugin versioning
94
+
95
  = 1.6 - July 27, 2020 =
96
+ * Fix security issue
97
 
98
  = 1.5 - April 29, 2020 =
99
  * Fix undefined variable error message
120
 
121
  == Upgrade Notice ==
122
 
123
+ = 1.7 =
124
+ * Added Plugin versioning. Tested up to WordPress 5.4.2
125
+
126
  = 1.6 =
127
+ * Fix security issue
128
 
129
  = 1.5 =
130
  * Fix undefined variable error message