Version Description
- Added instruction links in plugin install page. Tested up to WordPress 5.5.1
Download this release
Release Info
Developer | |
Plugin | Messenger Customer Chat |
Version | 1.8 |
Comparing to | |
See all releases |
Code changes from version 1.7 to 1.8
- facebook-messenger-customer-chat.php +37 -3
- options.php +23 -18
- readme.txt +14 -7
- script.js +1 -1
facebook-messenger-customer-chat.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: The Official Facebook Chat Plugin
|
4 |
-
Description: With
|
5 |
Author: Facebook
|
6 |
Author URI: https://developers.facebook.com
|
7 |
-
Version: 1.
|
8 |
|
9 |
* Copyright (C) 2017-present, Facebook, Inc.
|
10 |
*
|
@@ -22,6 +22,40 @@ class Facebook_Messenger_Customer_Chat {
|
|
22 |
function __construct() {
|
23 |
include( plugin_dir_path( __FILE__ ) . 'options.php' );
|
24 |
add_action( 'wp_footer', array( $this, 'fbmcc_inject_messenger' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
}
|
26 |
|
27 |
function fbmcc_inject_messenger() {
|
@@ -37,7 +71,7 @@ class Facebook_Messenger_Customer_Chat {
|
|
37 |
}(document, 'script', 'facebook-jssdk'));</script>
|
38 |
<div class='fb-customerchat'
|
39 |
attribution='wordpress'
|
40 |
-
attribution_version='1.
|
41 |
page_id=".fbmcc_sanitize_page_id(get_option( 'fbmcc_pageID' ))."
|
42 |
>
|
43 |
</div>
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: The Official Facebook Chat Plugin
|
4 |
+
Description: With a few clicks, 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.8
|
8 |
|
9 |
* Copyright (C) 2017-present, Facebook, Inc.
|
10 |
*
|
22 |
function __construct() {
|
23 |
include( plugin_dir_path( __FILE__ ) . 'options.php' );
|
24 |
add_action( 'wp_footer', array( $this, 'fbmcc_inject_messenger' ) );
|
25 |
+
add_filter( 'plugin_action_links',
|
26 |
+
array( $this, 'fbmcc_plugin_action_links'), 10, 2 );
|
27 |
+
add_filter( 'plugin_row_meta',
|
28 |
+
array( $this, 'fbmcc_register_plugin_links'), 10, 2 );
|
29 |
+
}
|
30 |
+
|
31 |
+
function fbmcc_plugin_action_links( $links, $file ) {
|
32 |
+
if ( current_user_can( 'manage_options' ) ) {
|
33 |
+
$base = plugin_basename(__FILE__);
|
34 |
+
if ( $file == $base ) {
|
35 |
+
$settings_link = '<a href="admin.php?
|
36 |
+
page=messenger-customer-chat-plugin">Settings</a>';
|
37 |
+
array_unshift( $links, $settings_link );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
return $links;
|
41 |
+
}
|
42 |
+
|
43 |
+
function fbmcc_register_plugin_links( $links, $file ) {
|
44 |
+
$base = plugin_basename(__FILE__);
|
45 |
+
if ( $file == $base ) {
|
46 |
+
if ( current_user_can( 'manage_options' ) ) {
|
47 |
+
$links[] = '<a href="admin.php?page=messenger-customer-chat-plugin">
|
48 |
+
Settings</a>';
|
49 |
+
}
|
50 |
+
$links[] =
|
51 |
+
'<a href=
|
52 |
+
"https://wordpress.org/plugins/facebook-messenger-customer-chat/#faq"
|
53 |
+
target="_blank">FAQ</a>';
|
54 |
+
$links[] =
|
55 |
+
'<a href="https://wordpress.org/support/plugin/facebook-messenger-customer-chat/"
|
56 |
+
target="_blank">Support</a>';
|
57 |
+
}
|
58 |
+
return $links;
|
59 |
}
|
60 |
|
61 |
function fbmcc_inject_messenger() {
|
71 |
}(document, 'script', 'facebook-jssdk'));</script>
|
72 |
<div class='fb-customerchat'
|
73 |
attribution='wordpress'
|
74 |
+
attribution_version='1.8'
|
75 |
page_id=".fbmcc_sanitize_page_id(get_option( 'fbmcc_pageID' ))."
|
76 |
>
|
77 |
</div>
|
options.php
CHANGED
@@ -48,7 +48,7 @@ add_action( 'admin_menu', function() {
|
|
48 |
add_action( 'admin_enqueue_scripts', 'fbmcc_add_styles' );
|
49 |
add_action( 'admin_enqueue_scripts', 'fmcc_localize_ajax' );
|
50 |
|
51 |
-
add_action( '
|
52 |
|
53 |
function fbmcc_update_options() {
|
54 |
|
@@ -78,7 +78,7 @@ function fbmcc_sanitize_locale($input) {
|
|
78 |
|
79 |
function fbmcc_add_styles() {
|
80 |
wp_enqueue_style(
|
81 |
-
'admin-styles',
|
82 |
plugins_url( '/settings.css', __FILE__ ),
|
83 |
false,
|
84 |
'1.0',
|
@@ -93,7 +93,8 @@ function fmcc_localize_ajax() {
|
|
93 |
'nonce' => wp_create_nonce( 'update_fmcc_code' )
|
94 |
);
|
95 |
|
96 |
-
wp_register_script( 'code_script',
|
|
|
97 |
wp_localize_script( 'code_script', 'ajax_object', $ajax_object );
|
98 |
wp_enqueue_script( 'code_script' );
|
99 |
}
|
@@ -108,7 +109,12 @@ function fbmcc_integration_settings() {
|
|
108 |
<div class="intro">
|
109 |
<div>
|
110 |
<h2>Getting Started?</h2>
|
111 |
-
<p class="fbmcc-instructions">Let people start a conversation on
|
|
|
|
|
|
|
|
|
|
|
112 |
</p>
|
113 |
</div>
|
114 |
<div class="fbmcc-buttonContainer">
|
@@ -135,25 +141,24 @@ function fbmcc_integration_settings() {
|
|
135 |
_e( 'style="display:none;"' );
|
136 |
} ?>>
|
137 |
<div>
|
138 |
-
<p class="fbmcc-instructions">The plugin code has already been added
|
139 |
-
website. You can always go back through the setup process
|
|
|
140 |
</p>
|
141 |
</div>
|
142 |
</div>
|
143 |
<div class="fbmcc-card card">
|
144 |
<div class="intro">
|
145 |
-
<p class="fbmcc-instructions">
|
146 |
-
Use of this plugin is subject to
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
Facebook Platform Bug Reports</a> page.
|
152 |
-
you can ask for help in the
|
153 |
-
<a
|
154 |
-
|
155 |
-
target='_blank'>
|
156 |
-
Messenger Platform Developer Community</a>.
|
157 |
</p>
|
158 |
</div>
|
159 |
</div>
|
48 |
add_action( 'admin_enqueue_scripts', 'fbmcc_add_styles' );
|
49 |
add_action( 'admin_enqueue_scripts', 'fmcc_localize_ajax' );
|
50 |
|
51 |
+
add_action( 'wp_ajax_fbmcc_update_options', 'fbmcc_update_options');
|
52 |
|
53 |
function fbmcc_update_options() {
|
54 |
|
78 |
|
79 |
function fbmcc_add_styles() {
|
80 |
wp_enqueue_style(
|
81 |
+
'fbmcc-admin-styles',
|
82 |
plugins_url( '/settings.css', __FILE__ ),
|
83 |
false,
|
84 |
'1.0',
|
93 |
'nonce' => wp_create_nonce( 'update_fmcc_code' )
|
94 |
);
|
95 |
|
96 |
+
wp_register_script( 'code_script',
|
97 |
+
plugin_dir_url( __FILE__ ) . 'script.js' );
|
98 |
wp_localize_script( 'code_script', 'ajax_object', $ajax_object );
|
99 |
wp_enqueue_script( 'code_script' );
|
100 |
}
|
109 |
<div class="intro">
|
110 |
<div>
|
111 |
<h2>Getting Started?</h2>
|
112 |
+
<p class="fbmcc-instructions">Let people start a conversation on
|
113 |
+
your website and continue in Messenger. It's easy to set up. Chats
|
114 |
+
started on your website can be continued in the customers'
|
115 |
+
Messenger app, so you never lose connections with your customers.
|
116 |
+
Even those without a Facebook Messenger account can chat with you
|
117 |
+
in guest mode, so you can reach more customers than ever.
|
118 |
</p>
|
119 |
</div>
|
120 |
<div class="fbmcc-buttonContainer">
|
141 |
_e( 'style="display:none;"' );
|
142 |
} ?>>
|
143 |
<div>
|
144 |
+
<p class="fbmcc-instructions">The plugin code has already been added
|
145 |
+
into your website. You can always go back through the setup process
|
146 |
+
to customize the plugin.
|
147 |
</p>
|
148 |
</div>
|
149 |
</div>
|
150 |
<div class="fbmcc-card card">
|
151 |
<div class="intro">
|
152 |
+
<p class="fbmcc-instructions">
|
153 |
+
Use of this plugin is subject to
|
154 |
+
<a href='https://developers.facebook.com/policy/'>
|
155 |
+
Facebook's Platform Policies</a><br><br>
|
156 |
+
Having a problem with the Chat Plugin? Report the issue on the
|
157 |
+
<a href='https://developers.facebook.com/support/bugs/'
|
158 |
+
target='_blank'>Facebook Platform Bug Reports</a> page.
|
159 |
+
If you get stuck or have questions, you can ask for help in the
|
160 |
+
<a href='https://www.facebook.com/groups/messengerplatform'
|
161 |
+
target='_blank'>Messenger Platform Developer Community</a>.
|
|
|
|
|
162 |
</p>
|
163 |
</div>
|
164 |
</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.
|
6 |
-
Stable tag: 1.
|
7 |
Requires PHP: 5.2.4
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -11,17 +11,17 @@ 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
|
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
|
17 |
|
18 |
Key features of the Chat Plugin:
|
19 |
|
20 |
- No disconnection: Using the plugin creates a long-lived thread between you and your customers in Messenger. Customers can start a chat on your website and carry on in their mobile device with the Messenger app.
|
21 |
-
- Chat transcripts are automatically created in the customer
|
22 |
- The familiar, modern interface of Messenger builds trust and encourages your customers to engage with you
|
23 |
- You can use the same Inboxes on desktop and mobile that you use to manage your Facebook page messaging
|
24 |
-
- You can set up hours of availability, auto replies and FAQ to serve customers when you
|
25 |
|
26 |
|
27 |
== Installation ==
|
@@ -50,7 +50,7 @@ After navigating to the Chat Plugin settings page, click on 'Setup Customer Chat
|
|
50 |
1. You will be asked to select the language and you can customize the greeting message. The default greeting is "Hi! How can we help you?"
|
51 |
2. The next screen allows you to select your response time and chat color. By setting the response time, you can set expectations with your customers on when they will receive a response
|
52 |
3. Next, click on 'Finish' to save these settings and click 'Done' to close this window. The Messenger customer chat plugin should now be installed.
|
53 |
-
4. You can rerun the setup by clicking 'Edit Customer Chat'. To remove the plugin, you can
|
54 |
|
55 |
<br />
|
56 |
That's it! You're all set. Now all visitors to your WordPress website will see the Messenger customer chat plugin and can message you.
|
@@ -88,6 +88,10 @@ If you get stuck, or have any questions, you can ask for help in the [Messenger
|
|
88 |
|
89 |
== Changelog ==
|
90 |
|
|
|
|
|
|
|
|
|
91 |
= 1.7 - Aug 5, 2020 =
|
92 |
* Tested up to WordPress 5.4.2
|
93 |
* Added Plugin versioning
|
@@ -120,6 +124,9 @@ If you get stuck, or have any questions, you can ask for help in the [Messenger
|
|
120 |
|
121 |
== Upgrade Notice ==
|
122 |
|
|
|
|
|
|
|
123 |
= 1.7 =
|
124 |
* Added Plugin versioning. Tested up to WordPress 5.4.2
|
125 |
|
2 |
Contributors: facebook
|
3 |
Tags: Facebook, Messenger, Customer Care, Chat, Messaging, Chat Plugin
|
4 |
Requires at least: 3.9
|
5 |
+
Tested up to: 5.5.1
|
6 |
+
Stable tag: 1.8
|
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 a few clicks, 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 |
|
20 |
- No disconnection: Using the plugin creates a long-lived thread between you and your customers in Messenger. Customers can start a chat on your website and carry on in their mobile device with the Messenger app.
|
21 |
+
- Chat transcripts are automatically created in the customer's Messenger account
|
22 |
- The familiar, modern interface of Messenger builds trust and encourages your customers to engage with you
|
23 |
- You can use the same Inboxes on desktop and mobile that you use to manage your Facebook page messaging
|
24 |
+
- You can set up hours of availability, auto replies and FAQ to serve customers when you're not available
|
25 |
|
26 |
|
27 |
== Installation ==
|
50 |
1. You will be asked to select the language and you can customize the greeting message. The default greeting is "Hi! How can we help you?"
|
51 |
2. The next screen allows you to select your response time and chat color. By setting the response time, you can set expectations with your customers on when they will receive a response
|
52 |
3. Next, click on 'Finish' to save these settings and click 'Done' to close this window. The Messenger customer chat plugin should now be installed.
|
53 |
+
4. You can rerun the setup by clicking 'Edit Customer Chat'. To remove the plugin, you can deactivate the plugin/uninstall it.
|
54 |
|
55 |
<br />
|
56 |
That's it! You're all set. Now all visitors to your WordPress website will see the Messenger customer chat plugin and can message you.
|
88 |
|
89 |
== Changelog ==
|
90 |
|
91 |
+
= 1.8 - Sept 28, 2020 =
|
92 |
+
* Tested up to WordPress 5.5.1
|
93 |
+
* Added instruction links in plugin install page
|
94 |
+
|
95 |
= 1.7 - Aug 5, 2020 =
|
96 |
* Tested up to WordPress 5.4.2
|
97 |
* Added Plugin versioning
|
124 |
|
125 |
== Upgrade Notice ==
|
126 |
|
127 |
+
= 1.8 =
|
128 |
+
* Added instruction links in plugin install page. Tested up to WordPress 5.5.1
|
129 |
+
|
130 |
= 1.7 =
|
131 |
* Added Plugin versioning. Tested up to WordPress 5.4.2
|
132 |
|
script.js
CHANGED
@@ -30,7 +30,7 @@ function fbmcc_setupCustomerChat() {
|
|
30 |
if (e.originalEvent.origin === FACEBOOK_URL) {
|
31 |
$data_json = JSON.parse(e.originalEvent.data);
|
32 |
var data = {
|
33 |
-
'action' : '
|
34 |
'pageID' : fbmcc_sanitizeNumbersOnly($data_json["pageID"]),
|
35 |
'locale' : fbmcc_sanitizeLocale($data_json["locale"]),
|
36 |
'_wpnonce' : ajax_object.nonce,
|
30 |
if (e.originalEvent.origin === FACEBOOK_URL) {
|
31 |
$data_json = JSON.parse(e.originalEvent.data);
|
32 |
var data = {
|
33 |
+
'action' : 'fbmcc_update_options',
|
34 |
'pageID' : fbmcc_sanitizeNumbersOnly($data_json["pageID"]),
|
35 |
'locale' : fbmcc_sanitizeLocale($data_json["locale"]),
|
36 |
'_wpnonce' : ajax_object.nonce,
|