Messenger Customer Chat - Version 1.3

Version Description

  • Fix security issue
Download this release

Release Info

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

Code changes from version 1.2 to 1.3

Files changed (4) hide show
  1. facebook-messenger-customer-chat.php +1 -1
  2. options.php +12 -0
  3. readme.txt +10 -3
  4. script.js +1 -0
facebook-messenger-customer-chat.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Messenger Customer Chat
4
  Description: Messenger Customer Chat is the official free Messenger customer chat plugin for WordPress by Facebook. This plugin allows you to interact with your customers using Messenger by integrating it on your WordPress website in three simple steps. To get started, go to your Wordpress Dashboard -> Customer Chat -> click on "Setup Customer Chat."
5
  Author: Facebook
6
  Author URI: https://developers.facebook.com
7
- Version: 1.2
8
 
9
  * Copyright (C) 2017-present, Facebook, Inc.
10
  *
4
  Description: Messenger Customer Chat is the official free Messenger customer chat plugin for WordPress by Facebook. This plugin allows you to interact with your customers using Messenger by integrating it on your WordPress website in three simple steps. To get started, go to your Wordpress Dashboard -> Customer Chat -> click on "Setup Customer Chat."
5
  Author: Facebook
6
  Author URI: https://developers.facebook.com
7
+ Version: 1.3
8
 
9
  * Copyright (C) 2017-present, Facebook, Inc.
10
  *
options.php CHANGED
@@ -46,6 +46,7 @@ add_action( 'admin_menu', function() {
46
  });
47
 
48
  add_action( 'admin_enqueue_scripts', 'fbmcc_add_styles' );
 
49
 
50
  add_action( 'admin_init', function() {
51
  register_setting( 'messenger-integration-plugin-settings', 'fbmcc_enabled' );
@@ -55,6 +56,7 @@ add_action( 'admin_init', function() {
55
  add_action( 'wp_ajax_update_options', 'fbmcc_update_options');
56
 
57
  function fbmcc_update_options() {
 
58
  update_option( 'fbmcc_enabled', "1" );
59
  update_option( 'fbmcc_generatedCode', sanitize_textarea_field( $_POST['fbmcc_generatedCode'] ) );
60
  wp_die();
@@ -70,6 +72,16 @@ function fbmcc_add_styles() {
70
  );
71
  }
72
 
 
 
 
 
 
 
 
 
 
 
73
  function fbmcc_integration_settings() {
74
  ?>
75
  <div class="wrap">
46
  });
47
 
48
  add_action( 'admin_enqueue_scripts', 'fbmcc_add_styles' );
49
+ add_action( 'admin_enqueue_scripts', 'fmcc_localize_ajax' );
50
 
51
  add_action( 'admin_init', function() {
52
  register_setting( 'messenger-integration-plugin-settings', 'fbmcc_enabled' );
56
  add_action( 'wp_ajax_update_options', 'fbmcc_update_options');
57
 
58
  function fbmcc_update_options() {
59
+ check_ajax_referer( 'update_fmcc_code' );
60
  update_option( 'fbmcc_enabled', "1" );
61
  update_option( 'fbmcc_generatedCode', sanitize_textarea_field( $_POST['fbmcc_generatedCode'] ) );
62
  wp_die();
72
  );
73
  }
74
 
75
+ function fmcc_localize_ajax() {
76
+ $ajax_object = array(
77
+ 'nonce' => wp_create_nonce( 'update_fmcc_code' )
78
+ );
79
+
80
+ wp_register_script( 'code_script', plugin_dir_url( __FILE__ ) . 'script.js' );
81
+ wp_localize_script( 'code_script', 'ajax_object', $ajax_object );
82
+ wp_enqueue_script( 'code_script' );
83
+ }
84
+
85
  function fbmcc_integration_settings() {
86
  ?>
87
  <div class="wrap">
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: facebook
3
  Tags: Facebook, Messenger, Customer Care, Chat, Messaging
4
  Requires at least: 3.9
5
- Tested up to: 5.1
6
- Stable tag: 1.2
7
  Requires PHP: 5.2.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -86,7 +86,11 @@ Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can
86
 
87
  == Changelog ==
88
 
89
- = 1.2 - February 28, 2018 =
 
 
 
 
90
  * Tested up to WordPress 5.1
91
  * Fixed issues with Safari
92
  * Fix: Edge case where multiple SDK loaded on the page resulting with plugin not loading
@@ -100,6 +104,9 @@ Of course! This plugin is open sourced on the Facebook Incubator GitHub. You can
100
 
101
  == Upgrade Notice ==
102
 
 
 
 
103
  = 1.2 =
104
  * Handle edge case which resulted in plugin being broken for some users.
105
 
2
  Contributors: facebook
3
  Tags: Facebook, Messenger, Customer Care, Chat, Messaging
4
  Requires at least: 3.9
5
+ Tested up to: 5.2.1
6
+ Stable tag: 1.3
7
  Requires PHP: 5.2.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
86
 
87
  == Changelog ==
88
 
89
+ = 1.3 - June 17, 2019 =
90
+ * Tested up to WordPress 5.2.1
91
+ * Fixed security issue
92
+
93
+ = 1.2 - February 28, 2019 =
94
  * Tested up to WordPress 5.1
95
  * Fixed issues with Safari
96
  * Fix: Edge case where multiple SDK loaded on the page resulting with plugin not loading
104
 
105
  == Upgrade Notice ==
106
 
107
+ = 1.3 =
108
+ * Fix security issue
109
+
110
  = 1.2 =
111
  * Handle edge case which resulted in plugin being broken for some users.
112
 
script.js CHANGED
@@ -35,6 +35,7 @@ function fbmcc_setupCustomerChat() {
35
  'locale' : fbmcc_sanitizeLocale($data_json["locale"]),
36
  'themeColor' : fbmcc_sanitizeHexColor($data_json["themeColorCode"]),
37
  'greetingText' : $data_json["greetingTextCode"],
 
38
  };
39
  data.generatedCode = fbmcc_genScript(
40
  data.pageID,
35
  'locale' : fbmcc_sanitizeLocale($data_json["locale"]),
36
  'themeColor' : fbmcc_sanitizeHexColor($data_json["themeColorCode"]),
37
  'greetingText' : $data_json["greetingTextCode"],
38
+ '_wpnonce' : ajax_object.nonce,
39
  };
40
  data.generatedCode = fbmcc_genScript(
41
  data.pageID,