Version Description
- Fixed checking of $customer_details variable.
- Fixed undefined index issues on validating visibility options.
Download this release
Release Info
Developer | alvinsotawk |
Plugin | Tawk.To Live Chat |
Version | 0.5.2 |
Comparing to | |
See all releases |
Code changes from version 0.5.1 to 0.5.2
- readme.txt +86 -82
- tawkto.php +44 -15
- templates/widget.php +3 -3
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: tawkto
|
|
3 |
Tags: tawk,tawk.to,tawkto,chat,free chat,livechat,chat widget,plugin,chat for web,chat online,chat software,free live chat,IM Chat,,live chat,live support,live web chat,online chat,online support,snapengage,wordpress chat,wordpress live chat
|
4 |
Requires at least: 2.7
|
5 |
Tested up to: 5.7
|
6 |
-
Stable tag: 0.5.
|
7 |
|
8 |
(OFFICIAL tawk.to plugin) Instantly chat with visitors on your website with the free tawk.to chat widget.
|
9 |
Website: [http://tawk.to](http://tawk.to)
|
@@ -55,125 +55,129 @@ Note: You will need a free tawk.to account : [Create one for free here!](https:/
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
-
= 0.
|
59 |
-
*
|
|
|
60 |
|
61 |
-
= 0.
|
62 |
-
*
|
|
|
|
|
63 |
|
64 |
-
= 0.
|
65 |
-
*
|
|
|
66 |
|
67 |
-
= 0.
|
68 |
-
*
|
69 |
|
70 |
-
= 0.
|
71 |
-
*
|
72 |
|
73 |
-
= 0.
|
74 |
-
*
|
75 |
|
76 |
-
= 0.1
|
77 |
-
*
|
78 |
|
79 |
-
= 0.
|
80 |
-
*
|
81 |
|
82 |
-
= 0.
|
83 |
-
*
|
84 |
|
85 |
-
= 0.
|
86 |
-
*
|
87 |
|
88 |
-
= 0.
|
89 |
-
*
|
90 |
|
91 |
-
= 0.
|
92 |
-
*
|
93 |
|
94 |
-
= 0.
|
95 |
-
*
|
96 |
|
97 |
-
= 0.
|
98 |
-
*
|
|
|
|
|
99 |
|
100 |
-
= 0.2
|
101 |
-
*
|
102 |
-
* Added the ability to include a specific url slug
|
103 |
-
* modified plugin settings page interface
|
104 |
|
105 |
-
= 0.
|
106 |
-
*
|
|
|
|
|
107 |
|
108 |
-
= 0.
|
109 |
-
*
|
110 |
|
111 |
-
= 0.
|
112 |
-
*
|
|
|
|
|
|
|
113 |
|
114 |
= 0.2.8 =
|
115 |
* added updated plugin admin interface
|
116 |
|
117 |
-
= 0.2.
|
118 |
-
*
|
119 |
|
120 |
-
= 0.
|
121 |
-
*
|
122 |
|
123 |
-
= 0.
|
124 |
-
*
|
125 |
|
126 |
-
= 0.
|
127 |
-
*
|
128 |
-
*
|
129 |
-
|
130 |
|
131 |
-
= 0.3
|
132 |
-
*
|
133 |
|
134 |
-
= 0.
|
135 |
-
*
|
136 |
-
* updated admin page texts
|
137 |
-
* moved wp_footer hook to last item
|
138 |
|
139 |
-
= 0.
|
140 |
-
*
|
141 |
|
142 |
-
= 0.
|
143 |
-
*
|
144 |
|
145 |
-
= 0.
|
146 |
-
*
|
147 |
|
148 |
-
= 0.
|
149 |
-
*
|
150 |
|
151 |
-
= 0.
|
152 |
-
*
|
153 |
|
154 |
-
= 0.
|
155 |
-
*
|
156 |
|
157 |
-
= 0.
|
158 |
-
*
|
159 |
|
160 |
-
= 0.
|
161 |
-
*
|
162 |
|
163 |
-
= 0.4
|
164 |
-
*
|
165 |
|
166 |
-
= 0.
|
167 |
-
*
|
168 |
|
169 |
-
= 0.
|
170 |
-
*
|
171 |
-
* Escaped widget embed URL to prevent possible XSS issues
|
172 |
|
173 |
-
= 0.
|
174 |
-
*
|
175 |
-
* Fixed undefined index issue of the enable/disable visitor recognition feature.
|
176 |
-
* Fixed default value for enable/disable visitor recognition feature after updating plugin.
|
177 |
|
178 |
## Frequently Asked Questions
|
179 |
|
3 |
Tags: tawk,tawk.to,tawkto,chat,free chat,livechat,chat widget,plugin,chat for web,chat online,chat software,free live chat,IM Chat,,live chat,live support,live web chat,online chat,online support,snapengage,wordpress chat,wordpress live chat
|
4 |
Requires at least: 2.7
|
5 |
Tested up to: 5.7
|
6 |
+
Stable tag: 0.5.2
|
7 |
|
8 |
(OFFICIAL tawk.to plugin) Instantly chat with visitors on your website with the free tawk.to chat widget.
|
9 |
Website: [http://tawk.to](http://tawk.to)
|
55 |
|
56 |
== Changelog ==
|
57 |
|
58 |
+
= 0.5.2 =
|
59 |
+
* Fixed checking of $customer_details variable.
|
60 |
+
* Fixed undefined index issues on validating visibility options.
|
61 |
|
62 |
+
= 0.5.1 =
|
63 |
+
* Supported version bump 5.7.
|
64 |
+
* Fixed undefined index issue of the enable/disable visitor recognition feature.
|
65 |
+
* Fixed default value for enable/disable visitor recognition feature after updating plugin.
|
66 |
|
67 |
+
= 0.5.0 =
|
68 |
+
* Added option to enable/disable visitor recognition
|
69 |
+
* Escaped widget embed URL to prevent possible XSS issues
|
70 |
|
71 |
+
= 0.4.4 =
|
72 |
+
* supported version bump 5.6.2
|
73 |
|
74 |
+
= 0.4.3 =
|
75 |
+
* supported version bumbp 5.5.1
|
76 |
|
77 |
+
= 0.4.2 =
|
78 |
+
* supported version bump 5.4
|
79 |
|
80 |
+
= 0.4.1 =
|
81 |
+
* Fixed plugin version mismatch in readme and plugin file
|
82 |
|
83 |
+
= 0.4.0 =
|
84 |
+
* Added support for wildcard url match for include URL and exclude URL
|
85 |
|
86 |
+
= 0.3.8 =
|
87 |
+
* supported version bump 5.2.2
|
88 |
|
89 |
+
= 0.3.7 =
|
90 |
+
* supported version bump 5.2.1
|
91 |
|
92 |
+
= 0.3.6 =
|
93 |
+
* supported version bump 5.1
|
94 |
|
95 |
+
= 0.3.5 =
|
96 |
+
* supported version bump
|
97 |
|
98 |
+
= 0.3.4 =
|
99 |
+
* supported version bump
|
100 |
|
101 |
+
= 0.3.3 =
|
102 |
+
* fixed user recognition vulnerability
|
103 |
+
* updated admin page texts
|
104 |
+
* moved wp_footer hook to last item
|
105 |
|
106 |
+
= 0.3.2 =
|
107 |
+
* fixed issues on widget settings on fresh install
|
|
|
|
|
108 |
|
109 |
+
= 0.3.1 =
|
110 |
+
* plugin notifications update
|
111 |
+
* logged in user recognition
|
112 |
+
If user is logged in, the widget will fill the pre-chat form automatically
|
113 |
|
114 |
+
= 0.3.0 =
|
115 |
+
* fixed issues with visibility filters
|
116 |
|
117 |
+
= 0.3.0 =
|
118 |
+
* fixed issues with visibility filters
|
119 |
+
|
120 |
+
= 0.2.9 =
|
121 |
+
* fixed issue with assets folder
|
122 |
|
123 |
= 0.2.8 =
|
124 |
* added updated plugin admin interface
|
125 |
|
126 |
+
= 0.2.7 =
|
127 |
+
* added woocommerce support
|
128 |
|
129 |
+
= 0.2.6 =
|
130 |
+
* wrapped all hard-coded text in plugin settings with gettext functions
|
131 |
|
132 |
+
= 0.2.5 =
|
133 |
+
* Fixed include url warning message thrown
|
134 |
|
135 |
+
= 0.2.4 =
|
136 |
+
* updated session handling
|
137 |
+
* Added the ability to include a specific url slug
|
138 |
+
* modified plugin settings page interface
|
139 |
|
140 |
+
= 0.2.3 =
|
141 |
+
* Updating widget code due to known conflict
|
142 |
|
143 |
+
= 0.2.2 =
|
144 |
+
* Supported version bump to 4.7
|
|
|
|
|
145 |
|
146 |
+
= 0.2.1 =
|
147 |
+
* Supported version bump
|
148 |
|
149 |
+
= 0.2.0 =
|
150 |
+
* Added multisite support *
|
151 |
|
152 |
+
= 0.1.9 =
|
153 |
+
* Added the ability to exclude a specific url slug
|
154 |
|
155 |
+
= 0.1.8 =
|
156 |
+
* Fixed bug causing conflict with another plugin, and tested on 4.5
|
157 |
|
158 |
+
= 0.1.7 =
|
159 |
+
* Fixed naming convention causing a conflict with another plugin
|
160 |
|
161 |
+
= 0.1.6 =
|
162 |
+
* Modified visibility options to fix a bug, and implemented a better shortcode.
|
163 |
|
164 |
+
= 0.1.0 =
|
165 |
+
* Add the tawk.to live chat widget to your site!
|
166 |
|
167 |
+
= 0.1.5 =
|
168 |
+
* Implemented visibility options, you can now choose to Always show the script, show it only on the front page, only on category pages or only on pages tagged with a shortcode.
|
169 |
|
170 |
+
= 0.1.4 =
|
171 |
+
* Supported version bump
|
172 |
|
173 |
+
= 0.1.3 =
|
174 |
+
* Supported version bump
|
175 |
|
176 |
+
= 0.1.2 =
|
177 |
+
* Supported version bump
|
|
|
178 |
|
179 |
+
= 0.1.1 =
|
180 |
+
* No more manual embed code copying, choose desired widget and it will be inserted in your site
|
|
|
|
|
181 |
|
182 |
## Frequently Asked Questions
|
183 |
|
tawkto.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Tawk.to Live Chat
|
4 |
Plugin URI: https://www.tawk.to
|
5 |
Description: Embeds Tawk.to live chat widget to your site
|
6 |
-
Version: 0.5.
|
7 |
Author: Tawkto
|
8 |
Text Domain: tawk-to-live-chat
|
9 |
*/
|
@@ -107,21 +107,24 @@ if(!class_exists('TawkTo_Settings')){
|
|
107 |
}
|
108 |
|
109 |
public function validate_options($input){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
-
$input
|
112 |
-
$input
|
113 |
-
$input['show_oncategory'] = ($input['show_oncategory'] != '1')? 0 : 1;
|
114 |
-
$input['show_ontagpage'] = ($input['show_ontagpage'] != '1')? 0 : 1;
|
115 |
-
$input['show_onarticlepages'] = ($input['show_onarticlepages'] != '1')? 0 : 1;
|
116 |
-
$input['exclude_url'] = ($input['exclude_url'] != '1')? 0 : 1;
|
117 |
-
$input['excluded_url_list'] = sanitize_text_field($input['excluded_url_list']);
|
118 |
-
$input['include_url'] = ($input['include_url'] != '1')? 0 : 1;
|
119 |
-
$input['included_url_list'] = sanitize_text_field($input['included_url_list']);
|
120 |
-
$input['display_on_shop'] = ($input['display_on_shop'] != '1')? 0 : 1;
|
121 |
-
$input['display_on_productcategory'] = ($input['display_on_productcategory'] != '1')? 0 : 1;
|
122 |
-
$input['display_on_productpage'] = ($input['display_on_productpage'] != '1')? 0 : 1;
|
123 |
-
$input['display_on_producttag'] = ($input['display_on_producttag'] != '1')? 0 : 1;
|
124 |
-
$input['enable_visitor_recognition'] = ($input['enable_visitor_recognition'] != '1')? 0 : 1;
|
125 |
|
126 |
return $input;
|
127 |
}
|
@@ -171,6 +174,32 @@ if(!class_exists('TawkTo_Settings')){
|
|
171 |
public static function ids_are_correct($page_id, $widget_id) {
|
172 |
return preg_match('/^[0-9A-Fa-f]{24}$/', $page_id) === 1 && preg_match('/^[a-z0-9]{1,50}$/i', $widget_id) === 1;
|
173 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
}
|
175 |
}
|
176 |
|
3 |
Plugin Name: Tawk.to Live Chat
|
4 |
Plugin URI: https://www.tawk.to
|
5 |
Description: Embeds Tawk.to live chat widget to your site
|
6 |
+
Version: 0.5.2
|
7 |
Author: Tawkto
|
8 |
Text Domain: tawk-to-live-chat
|
9 |
*/
|
107 |
}
|
108 |
|
109 |
public function validate_options($input){
|
110 |
+
$visibility_toggle_fields = array(
|
111 |
+
'always_display',
|
112 |
+
'show_onfrontpage',
|
113 |
+
'show_oncategory',
|
114 |
+
'show_ontagpage',
|
115 |
+
'show_onarticlepages',
|
116 |
+
'exclude_url',
|
117 |
+
'include_url',
|
118 |
+
'display_on_shop',
|
119 |
+
'display_on_productcategory',
|
120 |
+
'display_on_productpage',
|
121 |
+
'display_on_producttag',
|
122 |
+
'enable_visitor_recognition'
|
123 |
+
);
|
124 |
+
$visibility_text_fields = array('excluded_url_list', 'included_url_list');
|
125 |
|
126 |
+
self::validate_visibility_toggle_fields($input, $visibility_toggle_fields);
|
127 |
+
self::validate_text_fields($input, $visibility_text_fields);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
return $input;
|
130 |
}
|
174 |
public static function ids_are_correct($page_id, $widget_id) {
|
175 |
return preg_match('/^[0-9A-Fa-f]{24}$/', $page_id) === 1 && preg_match('/^[a-z0-9]{1,50}$/i', $widget_id) === 1;
|
176 |
}
|
177 |
+
|
178 |
+
private static function validate_text_fields(&$fields, $field_names) {
|
179 |
+
foreach ($field_names as $field_name) {
|
180 |
+
if (isset($fields[$field_name])) {
|
181 |
+
$fields[$field_name] = sanitize_text_field($fields[$field_name]);
|
182 |
+
continue;
|
183 |
+
}
|
184 |
+
|
185 |
+
$fields[$field_name] = '';
|
186 |
+
}
|
187 |
+
|
188 |
+
return;
|
189 |
+
}
|
190 |
+
|
191 |
+
private static function validate_visibility_toggle_fields(&$fields, $field_names) {
|
192 |
+
foreach ($field_names as $field_name) {
|
193 |
+
if (isset($fields[$field_name]) && $fields[$field_name] == '1') {
|
194 |
+
$fields[$field_name] = 1;
|
195 |
+
continue;
|
196 |
+
}
|
197 |
+
|
198 |
+
$fields[$field_name] = 0;
|
199 |
+
}
|
200 |
+
|
201 |
+
return;
|
202 |
+
}
|
203 |
}
|
204 |
}
|
205 |
|
templates/widget.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<!--Start of Tawk.to Script (0.5.
|
2 |
<script type="text/javascript">
|
3 |
var Tawk_API=Tawk_API||{};
|
4 |
<?php
|
5 |
-
if(
|
6 |
echo 'Tawk_API.visitor = '. $customer_details.';';
|
7 |
}
|
8 |
?>
|
@@ -16,4 +16,4 @@ s1.setAttribute('crossorigin','*');
|
|
16 |
s0.parentNode.insertBefore(s1,s0);
|
17 |
})();
|
18 |
</script>
|
19 |
-
<!--End of Tawk.to Script (0.5.
|
1 |
+
<!--Start of Tawk.to Script (0.5.2)-->
|
2 |
<script type="text/javascript">
|
3 |
var Tawk_API=Tawk_API||{};
|
4 |
<?php
|
5 |
+
if(isset($customer_details) && $enable_visitor_recognition) {
|
6 |
echo 'Tawk_API.visitor = '. $customer_details.';';
|
7 |
}
|
8 |
?>
|
16 |
s0.parentNode.insertBefore(s1,s0);
|
17 |
})();
|
18 |
</script>
|
19 |
+
<!--End of Tawk.to Script (0.5.2)-->
|