WP-Chatbot for Facebook Messenger Customer Chat - Version 1.3.0

Version Description

  • can change Language for Messenger
Download this release

Release Info

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

Code changes from version 1.2.0 to 1.3.0

admin/admin.php CHANGED
@@ -12,6 +12,7 @@
12
13
if ( ! defined( 'ABSPATH' ) ) exit;
14
15
16
require_once('class-htcc-admin.php');
17
12
13
if ( ! defined( 'ABSPATH' ) ) exit;
14
15
+ require_once('class-htcc-lang.php');
16
17
require_once('class-htcc-admin.php');
18
admin/class-htcc-admin.php CHANGED
@@ -70,15 +70,19 @@ class HTCC_Admin {
70
register_setting( 'htcc_settings_group', 'htcc_options' , array( $this, 'htcc_options_sanitize' ) );
71
72
add_settings_section( 'htcc_settings', '', array( $this, 'htcc_settings_section_cb' ), 'htcc_options_settings' );
73
- add_settings_field( 'enable', 'Enable', array( $this, 'htcc_enable_cb' ), 'htcc_options_settings', 'htcc_settings' );
74
- add_settings_field( 'htcc_fb_app_id', 'Facebook App ID', array( $this, 'htcc_fb_app_id_cb' ), 'htcc_options_settings', 'htcc_settings' );
75
- add_settings_field( 'htcc_fb_page_id', 'Facebook Page ID', array( $this, 'htcc_fb_page_id_cb' ), 'htcc_options_settings', 'htcc_settings' );
76
- add_settings_field( 'htcc_show_hide', 'Hide Based on post type', array( $this, 'htcc_show_hide_post_types_cb' ), 'htcc_options_settings', 'htcc_settings' );
77
- add_settings_field( 'htcc_list_id_tohide', 'Post, Page Id\'s to Hide', array( $this, 'htcc_list_id_tohide_cb' ), 'htcc_options_settings', 'htcc_settings' );
78
- add_settings_field( 'htcc_list_cat_tohide', 'Categorys to Hide', array( $this, 'htcc_list_cat_tohide_cb' ), 'htcc_options_settings', 'htcc_settings' );
79
- add_settings_field( 'htcc_devices_show_hide', 'Hide Based on Devices', array( $this, 'htcc_show_hide_devices_cb' ), 'htcc_options_settings', 'htcc_settings' );
80
-
81
- add_settings_field( 'htcc_shortcode', 'Shortcode name', array( $this, 'htcc_custom_shortcode_cb' ), 'htcc_options_settings', 'htcc_settings' );
82
83
}
84
@@ -93,23 +97,25 @@ class HTCC_Admin {
93
<div>
94
<select name="htcc_options[enable]" class="select-1">
95
<option value="no">No</option>
96
- <option value="1" <?php echo esc_attr( $enable['enable'] ) == '1' ? 'SELECTED' : ''; ?> >Yes</option>
97
</select>
98
</div>
99
<?php
100
}
101
102
public function htcc_fb_app_id_cb() {
103
104
$htcc_fb_app_id = get_option('htcc_options');
105
?>
106
<input type="text" name="htcc_options[fb_app_id]" id="" value="<?php echo esc_attr( $htcc_fb_app_id['fb_app_id'] ) ?>">
107
108
- <p class="description">Facebook App ID - <a target="_blank" href="https://holithemes.com/wp-chatbot/facebook-app-id/">moreinfo</a> </p>
109
<?php
110
}
111
112
113
public function htcc_fb_page_id_cb() {
114
115
$htcc_fb_page_id = get_option('htcc_options');
@@ -117,7 +123,32 @@ class HTCC_Admin {
117
<input type="text" name="htcc_options[fb_page_id]" id="" value="<?php echo esc_attr( $htcc_fb_page_id['fb_page_id'] ) ?>">
118
119
120
- <p class="description">Facebook Page ID - <a target="_blank" href="https://holithemes.com/wp-chatbot/find-facebook-page-id/">moreinfo</a> </p>
121
<?php
122
}
123
@@ -131,14 +162,14 @@ class HTCC_Admin {
131
?>
132
<p>
133
<input name="htcc_options[hideon_posts]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_posts'], 1 ); ?> id="filled-in-box1" />
134
- <label for="filled-in-box1">Hide on - Posts</label>
135
</p>
136
<?php
137
} else {
138
?>
139
<p>
140
<input name="htcc_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
141
- <label for="filled-in-box1">Hide on - Posts</label>
142
</p>
143
<?php
144
}
@@ -149,14 +180,14 @@ class HTCC_Admin {
149
?>
150
<p>
151
<input name="htcc_options[hideon_page]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_page'], 1 ); ?> id="filled-in-box2" />
152
- <label for="filled-in-box2">Hide on - Pages</label>
153
</p>
154
<?php
155
} else {
156
?>
157
<p>
158
<input name="htcc_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
159
- <label for="filled-in-box2">Hide on - Pages</label>
160
</p>
161
<?php
162
}
@@ -167,14 +198,14 @@ class HTCC_Admin {
167
?>
168
<p>
169
<input name="htcc_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
170
- <label for="filled-in-box3">Hide on - Home Page</label>
171
</p>
172
<?php
173
} else {
174
?>
175
<p>
176
<input name="htcc_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
177
- <label for="filled-in-box3">Hide on - Home Page</label>
178
</p>
179
<?php
180
}
@@ -188,14 +219,14 @@ class HTCC_Admin {
188
?>
189
<p>
190
<input name="htcc_options[hideon_frontpage]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_frontpage'], 1 ); ?> id="filled-in-box4" />
191
- <label for="filled-in-box4">Hide on - Front Page</label>
192
</p>
193
<?php
194
} else {
195
?>
196
<p>
197
<input name="htcc_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
198
- <label for="filled-in-box4">Hide on - Front Page</label>
199
</p>
200
<?php
201
}
@@ -207,14 +238,14 @@ class HTCC_Admin {
207
?>
208
<p>
209
<input name="htcc_options[hideon_category]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_category'], 1 ); ?> id="filled-in-box5" />
210
- <label for="filled-in-box5">Hide on - Category</label>
211
</p>
212
<?php
213
} else {
214
?>
215
<p>
216
<input name="htcc_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
217
- <label for="filled-in-box5">Hide on - Category</label>
218
</p>
219
<?php
220
}
@@ -226,14 +257,14 @@ class HTCC_Admin {
226
?>
227
<p>
228
<input name="htcc_options[hideon_archive]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_archive'], 1 ); ?> id="filled-in-box6" />
229
- <label for="filled-in-box6">Hide on - Archive</label>
230
</p>
231
<?php
232
} else {
233
?>
234
<p>
235
<input name="htcc_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
236
- <label for="filled-in-box6">Hide on - Archive</label>
237
</p>
238
<?php
239
}
@@ -245,19 +276,19 @@ class HTCC_Admin {
245
?>
246
<p>
247
<input name="htcc_options[hideon_404]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_404'], 1 ); ?> id="filled-in-box7" />
248
- <label for="filled-in-box7">Hide on - 404 Page</label>
249
</p>
250
<?php
251
} else {
252
?>
253
<p>
254
<input name="htcc_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
255
- <label for="filled-in-box7">Hide on - 404 Page</label>
256
</p>
257
<?php
258
}
259
?>
260
- <p class="description"> check to Hide <br> Hide Messenger - based on type of the page <a target="_blank" href="https://holithemes.com/wp-chatbot/show-hide-messenger-based-on-type-of-the-page/">more info</a> </p>
261
262
263
<?php
@@ -269,7 +300,7 @@ class HTCC_Admin {
269
$htcc_list_id_tohide = get_option('htcc_options');
270
?>
271
<input name="htcc_options[list_hideon_pages]" value="<?php echo esc_attr( $htcc_list_id_tohide['list_hideon_pages'] ) ?>" id="htcc_list_id_tohide" type="text">
272
- <p class="description"> Add Post, Page, Media - ID's to hide, <br> can add multiple id's separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/wp-chatbot/hide-messenger-based-on-post-id/">more info</a> </p>
273
<?php
274
}
275
@@ -278,7 +309,7 @@ class HTCC_Admin {
278
$htcc_list_cat_tohide = get_option('htcc_options');
279
?>
280
<input name="htcc_options[list_hideon_cat]" value="<?php echo esc_attr( $htcc_list_cat_tohide['list_hideon_cat'] ) ?>" id="htcc_list_cat_tohide" type="text" >
281
- <p class="description"> Category name's to hide, <br> can add multiple Categories separate with comma ( , ) - <a target="_blank" href="https://holithemes.com/wp-chatbot/hide-messenger-based-on-category/">more info</a> </p>
282
<?php
283
}
284
@@ -294,14 +325,14 @@ class HTCC_Admin {
294
?>
295
<p>
296
<input name="htcc_options[hideon_mobile]" type="checkbox" value="1" <?php checked( $htcc_devices['hideon_mobile'], 1 ); ?> id="hideon_mobile" />
297
- <label for="hideon_mobile">Hide on - Mobile Devices</label>
298
</p>
299
<?php
300
} else {
301
?>
302
<p>
303
<input name="htcc_options[hideon_mobile]" type="checkbox" value="1" id="hideon_mobile" />
304
- <label for="hideon_mobile">Hide on - Mobile Devices</label>
305
</p>
306
<?php
307
}
@@ -312,14 +343,14 @@ class HTCC_Admin {
312
?>
313
<p>
314
<input name="htcc_options[hideon_desktop]" type="checkbox" value="1" <?php checked( $htcc_devices['hideon_desktop'], 1 ); ?> id="hideon_desktop" />
315
- <label for="hideon_desktop">Hide on - Desktops</label>
316
</p>
317
<?php
318
} else {
319
?>
320
<p>
321
<input name="htcc_options[hideon_desktop]" type="checkbox" value="1" id="hideon_desktop" />
322
- <label for="hideon_desktop">Hide on - Desktops</label>
323
</p>
324
<?php
325
}
@@ -333,15 +364,14 @@ class HTCC_Admin {
333
<div class="row">
334
<div class="input-field col s12">
335
<input name="htcc_options[shortcode]" value="<?php echo esc_attr( $htcc_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="validate input-margin">
336
- <label for="shortcode">shortcode name</label>
337
<?php
338
$shorcode_list = '';
339
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
340
$shorcode_list .= $key . ', ';
341
}
342
?>
343
- <p class="description"> Default values is 'chatbot', can customize shortcode name - <a target="_blank" href="https://holithemes.com/wp-chatbot/change-shortcode-name/">more info</a> </p>
344
- <p class="description"> please dont add this already existing shorcode names - <?php echo $shorcode_list ?> </p>
345
</div>
346
</div>
347
<?php
@@ -372,6 +402,9 @@ class HTCC_Admin {
372
if( isset( $input['fb_page_id'] ) )
373
$new_input['fb_page_id'] = sanitize_text_field( $input['fb_page_id'] );
374
375
if( isset( $input['hideon_posts'] ) )
376
$new_input['hideon_posts'] = sanitize_text_field( $input['hideon_posts'] );
377
70
register_setting( 'htcc_settings_group', 'htcc_options' , array( $this, 'htcc_options_sanitize' ) );
71
72
add_settings_section( 'htcc_settings', '', array( $this, 'htcc_settings_section_cb' ), 'htcc_options_settings' );
73
+
74
+ add_settings_field( 'enable', __( 'Enable' , 'wp-chatbot' ), array( $this, 'htcc_enable_cb' ), 'htcc_options_settings', 'htcc_settings' );
75
+ add_settings_field( 'htcc_fb_app_id', __( 'Facebook App ID' , 'wp-chatbot' ), array( $this, 'htcc_fb_app_id_cb' ), 'htcc_options_settings', 'htcc_settings' );
76
+ add_settings_field( 'htcc_fb_page_id', __( 'Facebook Page ID' , 'wp-chatbot' ), array( $this, 'htcc_fb_page_id_cb' ), 'htcc_options_settings', 'htcc_settings' );
77
+
78
+
79
+ add_settings_field( 'htcc_show_hide', __( 'Hide Based on post type' , 'wp-chatbot' ), array( $this, 'htcc_show_hide_post_types_cb' ), 'htcc_options_settings', 'htcc_settings' );
80
+ add_settings_field( 'htcc_list_id_tohide', __( 'Post, Page Id\'s to Hide' , 'wp-chatbot' ), array( $this, 'htcc_list_id_tohide_cb' ), 'htcc_options_settings', 'htcc_settings' );
81
+ add_settings_field( 'htcc_list_cat_tohide', __( 'Categorys to Hide' , 'wp-chatbot' ), array( $this, 'htcc_list_cat_tohide_cb' ), 'htcc_options_settings', 'htcc_settings' );
82
+ add_settings_field( 'htcc_devices_show_hide', __( 'Hide Based on Devices' , 'wp-chatbot' ), array( $this, 'htcc_show_hide_devices_cb' ), 'htcc_options_settings', 'htcc_settings' );
83
+ add_settings_field( 'htcc_shortcode', __( 'Shortcode name' , 'wp-chatbot' ), array( $this, 'htcc_custom_shortcode_cb' ), 'htcc_options_settings', 'htcc_settings' );
84
+
85
+ add_settings_field( 'htcc_fb_sdk_lang', __( 'Messenger language' , 'wp-chatbot' ), array( $this, 'htcc_fb_sdk_lang_cb' ), 'htcc_options_settings', 'htcc_settings' );
86
87
}
88
97
<div>
98
<select name="htcc_options[enable]" class="select-1">
99
<option value="no">No</option>
100
+ <option value="1" <?php echo esc_attr( $enable['enable'] ) == '1' ? 'SELECTED' : ''; ?> ><?php _e( 'Yes' , 'wp-chatbot' ) ?></option>
101
</select>
102
</div>
103
<?php
104
}
105
106
+ // App id
107
public function htcc_fb_app_id_cb() {
108
109
$htcc_fb_app_id = get_option('htcc_options');
110
?>
111
<input type="text" name="htcc_options[fb_app_id]" id="" value="<?php echo esc_attr( $htcc_fb_app_id['fb_app_id'] ) ?>">
112
113
+ <p class="description"><?php _e( 'Facebook App ID - ' , 'wp-chatbot' ) ?> <a target="_blank" href="https://holithemes.com/wp-chatbot/facebook-app-id/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
114
<?php
115
}
116
117
118
+ // page id
119
public function htcc_fb_page_id_cb() {
120
121
$htcc_fb_page_id = get_option('htcc_options');
123
<input type="text" name="htcc_options[fb_page_id]" id="" value="<?php echo esc_attr( $htcc_fb_page_id['fb_page_id'] ) ?>">
124
125
126
+ <p class="description"><?php _e( 'Facebook Page ID - ' , 'wp-chatbot' ) ?><a target="_blank" href="https://holithemes.com/wp-chatbot/find-facebook-page-id/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
127
+ <?php
128
+ }
129
+
130
+
131
+ // sdk lang.
132
+ public function htcc_fb_sdk_lang_cb() {
133
+
134
+ $sdk_lang = get_option('htcc_options');
135
+ $lang = esc_attr( $sdk_lang['fb_sdk_lang'] );
136
+ ?>
137
+ <div>
138
+ <select name="htcc_options[fb_sdk_lang]">
139
+ <?php
140
+ $fb_lang = HTCC_Lang::$fb_lang;
141
+
142
+ foreach ( $fb_lang as $key => $value ) {
143
+ ?>
144
+ <option value="<?php echo $key ?>" <?php echo $lang == $key ? 'SELECTED' : ''; ?> ><?php echo $value ?></option>
145
+ <?php
146
+ }
147
+
148
+ ?>
149
+ </select>
150
+ </div>
151
+ <p class="description"><?php _e( 'If desired Language is not added, please message us - ' , 'wp-chatbot' ) ?><a target="_blank" href="https://holithemes.com/wp-chatbot/messenger-language/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
152
<?php
153
}
154
162
?>
163
<p>
164
<input name="htcc_options[hideon_posts]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_posts'], 1 ); ?> id="filled-in-box1" />
165
+ <label for="filled-in-box1"><?php _e( 'Hide on - Posts' , 'wp-chatbot' ) ?></label>
166
</p>
167
<?php
168
} else {
169
?>
170
<p>
171
<input name="htcc_options[hideon_posts]" type="checkbox" value="1" id="filled-in-box1" />
172
+ <label for="filled-in-box1"><?php _e( 'Hide on - Posts' , 'wp-chatbot' ) ?></label>
173
</p>
174
<?php
175
}
180
?>
181
<p>
182
<input name="htcc_options[hideon_page]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_page'], 1 ); ?> id="filled-in-box2" />
183
+ <label for="filled-in-box2"><?php _e( 'Hide on - Pages' , 'wp-chatbot' ) ?></label>
184
</p>
185
<?php
186
} else {
187
?>
188
<p>
189
<input name="htcc_options[hideon_page]" type="checkbox" value="1" id="filled-in-box2" />
190
+ <label for="filled-in-box2"><?php _e( 'Hide on - Pages' , 'wp-chatbot' ) ?></label>
191
</p>
192
<?php
193
}
198
?>
199
<p>
200
<input name="htcc_options[hideon_homepage]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_homepage'], 1 ); ?> id="filled-in-box3" />
201
+ <label for="filled-in-box3"><?php _e( 'Hide on - Home Page' , 'wp-chatbot' ) ?></label>
202
</p>
203
<?php
204
} else {
205
?>
206
<p>
207
<input name="htcc_options[hideon_homepage]" type="checkbox" value="1" id="filled-in-box3" />
208
+ <label for="filled-in-box3"><?php _e( 'Hide on - Home Page' , 'wp-chatbot' ) ?></label>
209
</p>
210
<?php
211
}
219
?>
220
<p>
221
<input name="htcc_options[hideon_frontpage]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_frontpage'], 1 ); ?> id="filled-in-box4" />
222
+ <label for="filled-in-box4"><?php _e( 'Hide on - Front Page' , 'wp-chatbot' ) ?></label>
223
</p>
224
<?php
225
} else {
226
?>
227
<p>
228
<input name="htcc_options[hideon_frontpage]" type="checkbox" value="1" id="filled-in-box4" />
229
+ <label for="filled-in-box4"><?php _e( 'Hide on - Front Page' , 'wp-chatbot' ) ?></label>
230
</p>
231
<?php
232
}
238
?>
239
<p>
240
<input name="htcc_options[hideon_category]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_category'], 1 ); ?> id="filled-in-box5" />
241
+ <label for="filled-in-box5"><?php _e( 'Hide on - Category' , 'wp-chatbot' ) ?></label>
242
</p>
243
<?php
244
} else {
245
?>
246
<p>
247
<input name="htcc_options[hideon_category]" type="checkbox" value="1" id="filled-in-box5" />
248
+ <label for="filled-in-box5"><?php _e( 'Hide on - Category' , 'wp-chatbot' ) ?></label>
249
</p>
250
<?php
251
}
257
?>
258
<p>
259
<input name="htcc_options[hideon_archive]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_archive'], 1 ); ?> id="filled-in-box6" />
260
+ <label for="filled-in-box6"><?php _e( 'Hide on - Archive' , 'wp-chatbot' ) ?></label>
261
</p>
262
<?php
263
} else {
264
?>
265
<p>
266
<input name="htcc_options[hideon_archive]" type="checkbox" value="1" id="filled-in-box6" />
267
+ <label for="filled-in-box6"><?php _e( 'Hide on - Archive' , 'wp-chatbot' ) ?></label>
268
</p>
269
<?php
270
}
276
?>
277
<p>
278
<input name="htcc_options[hideon_404]" type="checkbox" value="1" <?php checked( $htcc_checkbox['hideon_404'], 1 ); ?> id="filled-in-box7" />
279
+ <label for="filled-in-box7"><?php _e( 'Hide on - 404 Page' , 'wp-chatbot' ) ?></label>
280
</p>
281
<?php
282
} else {
283
?>
284
<p>
285
<input name="htcc_options[hideon_404]" type="checkbox" value="1" id="filled-in-box7" />
286
+ <label for="filled-in-box7"><?php _e( 'Hide on - 404 Page' , 'wp-chatbot' ) ?></label>
287
</p>
288
<?php
289
}
290
?>
291
+ <p class="description"> <?php _e( 'check to Hide' , 'wp-chatbot' ) ?> <br> <?php _e( 'Hide Messenger - based on type of the page' , 'wp-chatbot' ) ?> <a target="_blank" href="https://holithemes.com/wp-chatbot/show-hide-messenger-based-on-type-of-the-page/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
292
293
294
<?php
300
$htcc_list_id_tohide = get_option('htcc_options');
301
?>
302
<input name="htcc_options[list_hideon_pages]" value="<?php echo esc_attr( $htcc_list_id_tohide['list_hideon_pages'] ) ?>" id="htcc_list_id_tohide" type="text">
303
+ <p class="description"> <?php _e( 'Add Post, Page, Media - ID\'s to hide,' , 'wp-chatbot' ) ?> <br> <?php _e( 'can add multiple id\'s separate with comma ( , )' , 'wp-chatbot' ) ?> - <a target="_blank" href="https://holithemes.com/wp-chatbot/hide-messenger-based-on-post-id/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
304
<?php
305
}
306
309
$htcc_list_cat_tohide = get_option('htcc_options');
310
?>
311
<input name="htcc_options[list_hideon_cat]" value="<?php echo esc_attr( $htcc_list_cat_tohide['list_hideon_cat'] ) ?>" id="htcc_list_cat_tohide" type="text" >
312
+ <p class="description"> <?php _e( 'Category name\'s to hide,' , 'wp-chatbot' ) ?> <br> <?php _e( 'can add multiple Categories separate with comma ( , )' , 'wp-chatbot' ) ?> - <a target="_blank" href="https://holithemes.com/wp-chatbot/hide-messenger-based-on-category/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
313
<?php
314
}
315
325
?>
326
<p>
327
<input name="htcc_options[hideon_mobile]" type="checkbox" value="1" <?php checked( $htcc_devices['hideon_mobile'], 1 ); ?> id="hideon_mobile" />
328
+ <label for="hideon_mobile"><?php _e( 'Hide on - Mobile Devices' , 'wp-chatbot' ) ?></label>
329
</p>
330
<?php
331
} else {
332
?>
333
<p>
334
<input name="htcc_options[hideon_mobile]" type="checkbox" value="1" id="hideon_mobile" />
335
+ <label for="hideon_mobile"><?php _e( 'Hide on - Mobile Devices' , 'wp-chatbot' ) ?></label>
336
</p>
337
<?php
338
}
343
?>
344
<p>
345
<input name="htcc_options[hideon_desktop]" type="checkbox" value="1" <?php checked( $htcc_devices['hideon_desktop'], 1 ); ?> id="hideon_desktop" />
346
+ <label for="hideon_desktop"><?php _e( 'Hide on - Desktops' , 'wp-chatbot' ) ?></label>
347
</p>
348
<?php
349
} else {
350
?>
351
<p>
352
<input name="htcc_options[hideon_desktop]" type="checkbox" value="1" id="hideon_desktop" />
353
+ <label for="hideon_desktop"><?php _e( 'Hide on - Desktops' , 'wp-chatbot' ) ?></label>
354
</p>
355
<?php
356
}
364
<div class="row">
365
<div class="input-field col s12">
366
<input name="htcc_options[shortcode]" value="<?php echo esc_attr( $htcc_shortcode['shortcode'] ) ?>" id="shortcode" type="text" class="validate input-margin">
367
<?php
368
$shorcode_list = '';
369
foreach ($GLOBALS['shortcode_tags'] AS $key => $value) {
370
$shorcode_list .= $key . ', ';
371
}
372
?>
373
+ <p class="description"> <?php printf( __( 'Default values is \'%1$s\', can customize shortcode name' , 'wp-chatbot' ), 'chatbot' ) ?> - <a target="_blank" href="https://holithemes.com/wp-chatbot/change-shortcode-name/"><?php _e( 'more info' , 'wp-chatbot' ) ?></a> </p>
374
+ <p class="description"> <?php _e( 'please dont add this already existing shorcode names' , 'wp-chatbot' ) ?> - <?php echo $shorcode_list ?> </p>
375
</div>
376
</div>
377
<?php
402
if( isset( $input['fb_page_id'] ) )
403
$new_input['fb_page_id'] = sanitize_text_field( $input['fb_page_id'] );
404
405
+ if( isset( $input['fb_sdk_lang'] ) )
406
+ $new_input['fb_sdk_lang'] = sanitize_text_field( $input['fb_sdk_lang'] );
407
+
408
if( isset( $input['hideon_posts'] ) )
409
$new_input['hideon_posts'] = sanitize_text_field( $input['hideon_posts'] );
410
admin/class-htcc-lang.php ADDED
@@ -0,0 +1,45 @@
1
+ <?php
2
+ /**
3
+ * Added Languages - Messenger ..
4
+ *
5
+ */
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit;
8
+
9
+ if ( ! class_exists( 'HTCC_Lang' ) ) :
10
+
11
+ class HTCC_Lang {
12
+
13
+ static $fb_lang = array(
14
+ 'bn_IN' => 'Bengali',
15
+ 'cs_CZ' => 'Czech',
16
+ 'zh_CN' => 'Chinese',
17
+ 'nl_NL' => 'Dutch',
18
+ 'de_DE' => 'German',
19
+ 'en_US' => 'English',
20
+ 'fr_FR' => 'French',
21
+ 'hi_IN' => 'Hindi',
22
+ 'he_IL' => 'Hebrew',
23
+ 'id_ID' => 'Indonesian',
24
+ 'it_IT' => 'Italian',
25
+ 'ja_JP' => 'Japanese',
26
+ 'ko_KR' => 'Korean',
27
+ 'mr_IN' => 'Marathi',
28
+ 'pa_IN' => 'Punjabi',
29
+ 'pt_PT' => 'Portuguese',
30
+ 'pt_BR' => 'Brazil Portuguese',
31
+ 'ru_RU' => 'Russian',
32
+ 'es_LA' => 'Spanish',
33
+ 'ta_IN' => 'Tamil',
34
+ 'te_IN' => 'Telugu',
35
+ 'th_TH' => 'Thai',
36
+ 'tr_TR' => 'Turkish',
37
+ );
38
+
39
+
40
+ // http://www.loc.gov/standards/iso639-2/php/code_list.php
41
+ // https://developers.facebook.com/docs/internationalization/
42
+
43
+ }
44
+
45
+ endif; // END class_exists check
inc/class-htcc-chatbot.php CHANGED
@@ -18,7 +18,8 @@ class HTCC_Chatbot {
18
19
$htcc_fb_app_id = esc_attr( $htcc_options['fb_app_id'] );
20
$htcc_fb_page_id = esc_attr( $htcc_options['fb_page_id'] );
21
-
22
$shortcode_name = esc_attr( $htcc_options['shortcode'] );
23
$enable = esc_attr( $htcc_options['enable'] );
24
@@ -114,6 +115,8 @@ class HTCC_Chatbot {
114
}
115
116
117
?>
118
119
@@ -132,7 +135,7 @@ class HTCC_Chatbot {
132
var js, fjs = d.getElementsByTagName(s)[0];
133
if (d.getElementById(id)) {return;}
134
js = d.createElement(s); js.id = id;
135
- js.src = "https://connect.facebook.net/en_US/sdk.js";
136
fjs.parentNode.insertBefore(js, fjs);
137
}(document, 'script', 'facebook-jssdk'));
138
</script>
18
19
$htcc_fb_app_id = esc_attr( $htcc_options['fb_app_id'] );
20
$htcc_fb_page_id = esc_attr( $htcc_options['fb_page_id'] );
21
+ $htcc_fb_sdk_lang = esc_attr( $htcc_options['fb_sdk_lang'] );
22
+
23
$shortcode_name = esc_attr( $htcc_options['shortcode'] );
24
$enable = esc_attr( $htcc_options['enable'] );
25
115
}
116
117
118
+ $fb_sdk_src = "https://connect.facebook.net/$htcc_fb_sdk_lang/sdk.js"
119
+
120
?>
121
122
135
var js, fjs = d.getElementsByTagName(s)[0];
136
if (d.getElementById(id)) {return;}
137
js = d.createElement(s); js.id = id;
138
+ js.src = '<?php echo $fb_sdk_src ?>';
139
fjs.parentNode.insertBefore(js, fjs);
140
}(document, 'script', 'facebook-jssdk'));
141
</script>
inc/class-htcc-db.php CHANGED
@@ -50,6 +50,7 @@ class HTCC_db {
50
'enable' => '1',
51
'fb_app_id' => '510187842699385',
52
'fb_page_id' => '135269407170658',
53
54
'list_hideon_pages' => '',
55
'list_hideon_cat' => '',
50
'enable' => '1',
51
'fb_app_id' => '510187842699385',
52
'fb_page_id' => '135269407170658',
53
+ 'fb_sdk_lang' => 'en_US',
54
55
'list_hideon_pages' => '',
56
'list_hideon_cat' => '',
inc/class-htcc-shortcode.php CHANGED
@@ -18,6 +18,7 @@ class HTCC_Shortcode {
18
19
$global_app_id = $GLOBALS["htcc_app_id"];
20
$global_page_id = $GLOBALS["htcc_page_id"];
21
22
$htcc_options = get_option('htcc_options');
23
@@ -49,7 +50,7 @@ class HTCC_Shortcode {
49
var js, fjs = d.getElementsByTagName(s)[0];
50
if (d.getElementById(id)) {return;}
51
js = d.createElement(s); js.id = id;
52
- js.src = 'https://connect.facebook.net/en_US/sdk.js';
53
fjs.parentNode.insertBefore(js, fjs);
54
}(document, 'script', 'facebook-jssdk'));
55
</script>";
18
19
$global_app_id = $GLOBALS["htcc_app_id"];
20
$global_page_id = $GLOBALS["htcc_page_id"];
21
+ $global_fb_sdk_lang = $GLOBALS["htcc_fb_sdk_lang"];
22
23
$htcc_options = get_option('htcc_options');
24
50
var js, fjs = d.getElementsByTagName(s)[0];
51
if (d.getElementById(id)) {return;}
52
js = d.createElement(s); js.id = id;
53
+ js.src = 'https://connect.facebook.net/$global_fb_sdk_lang/sdk.js';
54
fjs.parentNode.insertBefore(js, fjs);
55
}(document, 'script', 'facebook-jssdk'));
56
</script>";
inc/commons/variables.php CHANGED
@@ -14,6 +14,7 @@ $GLOBALS["htcc_app_id"] = esc_attr( $htcc_options['fb_app_id'] );
14
$GLOBALS["htcc_page_id"] = esc_attr( $htcc_options['fb_page_id'] );
15
16
$GLOBALS["htcc_shortcode"] = esc_attr( $htcc_options['shortcode'] );
17
18
19
14
$GLOBALS["htcc_page_id"] = esc_attr( $htcc_options['fb_page_id'] );
15
16
$GLOBALS["htcc_shortcode"] = esc_attr( $htcc_options['shortcode'] );
17
+ $GLOBALS["htcc_fb_sdk_lang"] = esc_attr( $htcc_options['fb_sdk_lang'] );
18
19
20
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
=== WP Chatbot for facebook Messenger ===
2
- Requires at least: 4.0.0
3
Tested up to: 4.9.1
4
Requires PHP: 5.6
5
Contributors: bhvreddy, holithemes
6
Donate link: https://www.paypal.me/ugadi
7
Stable tag: trunk
8
- 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, holithemes
9
License: GPLv2 or later
10
License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
@@ -73,6 +73,9 @@ And for creating automatic messages - use tools like Chatfuel or so..
73
74
== Changelog ==
75
76
= 1.2.0 =
77
* Shortcode - beta
78
* Hide Messenger based on Devices
1
=== WP Chatbot for facebook Messenger ===
2
+ Requires at least: 4.6
3
Tested up to: 4.9.1
4
Requires PHP: 5.6
5
Contributors: bhvreddy, holithemes
6
Donate link: https://www.paypal.me/ugadi
7
Stable tag: trunk
8
+ 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, holithemes
9
License: GPLv2 or later
10
License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
73
74
== Changelog ==
75
76
+ = 1.3.0 =
77
+ * can change Language for Messenger
78
+
79
= 1.2.0 =
80
* Shortcode - beta
81
* Hide Messenger based on Devices
wp-chatbot.php CHANGED
@@ -2,18 +2,18 @@
2
/*
3
Plugin Name: WP Chatbot for facebook Messenger
4
Description: Add Messenger to your website, Chatbot or live Chat using Facebook Messenger
5
- Version: 1.2.0
6
Author: bhvreddy
7
License: GPL2
8
License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
- Text Domain: htcc_text
10
*/
11
12
13
if ( ! defined( 'ABSPATH' ) ) exit;
14
15
- define( 'HTCC_VERSION', '1.2.0' );
16
- define( 'HTCC_WP_MIN_VERSION', '3.1.0' );
17
define( 'HTCC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
18
define( 'HTCC_PLUGIN_FILE', __FILE__ );
19
2
/*
3
Plugin Name: WP Chatbot for facebook Messenger
4
Description: Add Messenger to your website, Chatbot or live Chat using Facebook Messenger
5
+ Version: 1.3.0
6
Author: bhvreddy
7
License: GPL2
8
License URI: https://www.gnu.org/licenses/gpl-2.0.html
9
+ Text Domain: wp-chatbot
10
*/
11
12
13
if ( ! defined( 'ABSPATH' ) ) exit;
14
15
+ define( 'HTCC_VERSION', '1.3.0' );
16
+ define( 'HTCC_WP_MIN_VERSION', '4.6' );
17
define( 'HTCC_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
18
define( 'HTCC_PLUGIN_FILE', __FILE__ );
19