WhatsApp me - Version 4.0.2

Version Description

  • Encode emojis if DB not support utf8mb4.
  • Better update from WAme (no manual activation required).
Download this release

Release Info

Developer creapuntome
Plugin Icon 128x128 WhatsApp me
Version 4.0.2
Comparing to
See all releases

Code changes from version 4.0.0 to 4.0.2

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat,
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
- Stable tag: 4.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -13,14 +13,14 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
13
 
14
  == Description ==
15
 
16
- [join.chat](https://join.chat?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Add-ons](https://join.chat/en/addons/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Support](https://join.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0)
17
 
18
  ### The best WhatsApp plugin for WordPress.
19
  > We help more than 200,000 businesses worldwide to attract users and convert them into clients.
20
 
21
- ### New in Join.chat 4.0 📍
22
 
23
- 🌈 **Say hello to the colors.** We've redesigned the entire interface of the chat window, now you choose a color, and we customize all the visual theme of the Widget.
24
 
25
  🍾 **Triggers.** Your pages can interact with Join.chat and show the chat window or launch WhatsApp when user clicks or an item appears when scrolling. You just need to add a few css classes.
26
 
@@ -32,8 +32,8 @@ Define in which pages or zones it should appear, the delay time, if you want it
32
  #### 🔮 Magic WhatsApp button.
33
  Add your logo, profile picture or even an animated gif. You can define a tooltip to capture the user's attention, the limit is set by your creativity.
34
 
35
- #### 📱 Add multiple phone numbers.
36
- You can serve users in different terminals, you can insert a different one in each page, product or section.
37
 
38
  #### 🔴 Show a notification.
39
  Use a balloon on the button to get the user's attention. In this way, you ensure that you do not miss any important message you want to give them, surprise them in a less intrusive way.
@@ -53,10 +53,11 @@ Remember, you do not have to do anything, the plugin already creates and compute
53
  #### 💱 Customize different languages.
54
  To be able to support all your users, wherever they are. Our plugin is compatible with WPML and Polylang.
55
 
56
- ### 🌚 Dark Mode.
57
  Display the chat window with dark colors and white text. From settings you can activate it or leave it automatic so that it detects the configuration of devices in dark mode.
58
 
59
- https://www.youtube.com/watch?v=1Gma1Wvt6gU
 
60
 
61
  ### ⌁ What you can´t do with Join.chat ⛔️
62
 
@@ -98,6 +99,18 @@ You can change the position of the button so that nothing covers it by adding th
98
 
99
  `.joinchat { z-index:9999; }`
100
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  Greater values of z-index are left over, the default value is 400.
102
 
103
  = What about GDPR? =
@@ -105,6 +118,7 @@ Greater values of z-index are left over, the default value is 400.
105
  Join.chat don't use cookies.
106
 
107
  Join.chat save two localStorage variables for proper operation:
 
108
  * `joinchat_visited` to know if is the first time on site or is a returning user.
109
  * `joinchat_hashes` if you set a Call To Action (CTA), when user launch WhatsApp or close Chat Window the CTA hashed is saved to prevent show automatically that CTA again.
110
 
@@ -143,22 +157,26 @@ Join.chat send a custom event if Facebook Pixel is detected when user click to l
143
 
144
  There is a Javascript event that Join.chat triggers automatically before launch WhatsApp, which can be used to add your custom tracking code (or other needs).
145
 
146
- `jQuery(document).ready(function($){
 
147
  $(document).on('joinchat:open', function (event, args, settings) {
148
  // Your staff
149
  // Note: args.link is the link to open, you can change it
150
  // but only wa.me, whastapp.com or current domain are allowed.
151
  });
152
- });`
 
153
 
154
  = WPML/Polylang change Telephone by language =
155
 
156
  Join.chat general text settings can be translated with the strings translation of WPML/Polylang. You only need to save Join.chat settings to register strings and make them ready for translation. But "Telephone" is not translateable by default. If you need different phone numbers for every language add the following php code in your theme functions.php and save Join.chat settings.
157
 
158
- `add_filter( 'joinchat_settings_i18n', function( $settings ) {
 
159
  $settings['telephone'] = 'Telephone';
160
  return $settings;
161
- } );`
 
162
 
163
  = Settings are not saved when using emojis =
164
 
@@ -169,213 +187,36 @@ If settings are not saved when using emojis, add this code in your theme functio
169
 
170
  == Screenshots ==
171
 
172
- 1. Button on desktop.
173
- 2. Button with tooltip and custom image.
174
- 3. Call to action on desktop.
175
- 4. Button and call to action on mobile.
176
- 5. Join.chat general settings.
177
- 6. Join.chat advanced visibility settings.
178
- 7. Join.chat WooCommerce settings.
179
- 8. Join.chat on post/page edition.
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
183
  = 4.0.0 =
184
  * **NEW:** Join.chat brand.
185
  * **NEW:** Widget theme color.
186
  * **NEW:** CSS class triggers to open chat window.
187
- * **CHANGED for SEO:** All analytics events change from `WhatsAppMe` to `JoinChat`
188
- * **CHANGED for devs:** All css styles change from `wame` or `whatsappme`to `joinchat` and all actions and filters change from `wame_` or `whatsappme_`to `joinchat_`.
189
  * Lighter, reduced assets size and deleted images.
190
 
191
- = 3.2.3 =
192
- * FIX svg in safari < 13.
193
-
194
- = 3.2.2 =
195
- * **NEW:** Metabox can override global settings and leave it blank with `{}`.
196
- * **NEW:** Can use `wame_open` class on any element to open WAme or launch WhatsApp.
197
- * **NEW:** Added 'whatsappme_delete_all' filter, set true to clear all WAme data on plugin uninstall.
198
- * CHANGED Tested up to WordPress 5.4.
199
- * CHANGED updated FAQs GDPR info to include localStorage vars.
200
-
201
- = 3.2.1 =
202
- * FIX svg animations on firefox.
203
- * FIX empty messages on WP < 4.6.
204
- * FIX Google Analytics 'ga' event not sent if gtag for GAds or GTM is present.
205
-
206
- = 3.2.0 =
207
- * **NEW:** Dark mode.
208
- * **NEW:** Hide on mobile when keyboard is open.
209
- * **NEW:** Post metabox show main WAme settings as placeholders.
210
- * CHANGED webp support is now on server side.
211
- * CHANGED rewrite of chatbox output, SVGs separated, full chatbox scroll and new filters.
212
- * FIX 'apply_filters_deprecated' fatal error on WP < 4.6
213
-
214
- = 3.1.4 =
215
- * FIX php warning with new var {DISCOUNT} when price is zero.
216
-
217
- = 3.1.3 =
218
- * Minor improvements and link to Wame CTA Extras.
219
-
220
- = 3.1.2 =
221
- * **NEW:** WooCommerce Call to Action for Products on Sale, also added dynamic vars {DISCOUNT} {REGULAR}.
222
- * FIX Fatal error when selected button image is deleted from media library.
223
- * FIX WooCommerce settings not registered for translation.
224
- * For devs: format replacements now also accepts callbacks.
225
- * For devs: new javascript events for chat window 'whatsappme:show' 'whatsappme:hide'.
226
-
227
- = 3.1.1 =
228
- * CHANGED Tested up to WordPress 5.3
229
- * FIX Save on the first time can store some settings incorrectly.
230
- * FIX rtl styles for new button text.
231
-
232
- = 3.1.0 =
233
- * **NEW:** WhatsApp button image.
234
- * **NEW:** WhatsApp button tooltip.
235
- * **NEW:** Start WhatsApp button text on Chat Window.
236
- * **NEW:** Option to disable automatic open of Chat Window.
237
- * For devs: static functions moved to a WhatsAppMe_Util class.
238
-
239
- = 3.0.3 =
240
- * FIX in landscape or with long CTAs the chat window could be higher than view and can't be closed.
241
- * For developers:
242
- * New metabox filters 'whatsappme_metabox_output' and 'whatsappme_metabox_save'.
243
- * Change filter 'whatsappme_message_replacements' to 'whatsappme_format_replacements'.
244
- * Change filter 'whatsappme_message_send_replacements' to 'whatsappme_variable_replacements'.
245
-
246
- = 3.0.2 =
247
- * **NEW:** Send Facebook Pixel custom event when user launch WhatsApp.
248
- * FIX empty tabs on settings page due to conflicts with other themes or plugins.
249
-
250
- = 3.0.1 =
251
- * FIX sometimes the phone number is lost in WAme settings on save.
252
- * CHANGED Wame button z-index to 1000.
253
-
254
- = 3.0.0 =
255
- * **NEW:** Better Integration with WooCommerce: CTA and Custom Message for product pages and new dynamic variables {SKU}, {PRICE} {PRODUCT}.
256
- * **NEW:** Admin help tab with styles and dynamic varibles info.
257
- * **NEW:** For developers: a lot of new hooks to change or extend WAme functions.
258
- * **NEW:** Custom javascript document event 'whatsappme:open' that allow trigger other actions and/or change the link url.
259
- * CHANGED Rebrand "WhatsApp me" to "WAme chat".
260
- * CHANGED Code linted following WordPress standar.
261
- * FIX when post visibility was set as "hidden", it used default global visibility.
262
- * FIX javascript error when "ga" global object is defined but isn't Google Analytics.
263
- * FIX rtl styles for chat.
264
-
265
- = 2.3.3 =
266
- * FIX javascript error when "ga" global object is defined but isn't Google Analytics.
267
-
268
- = 2.3.2 =
269
- * FIX PHP notice on some archive pages.
270
-
271
- = 2.3.1 =
272
- * Readme texts and description.
273
-
274
- = 2.3.0 =
275
- * **NEW:** WPML/Polylang integration.
276
- * **NEW:** Added setting to launch WhatsApp Web on desktop.
277
- * **NEW:** Separated button delay and chat delay settings.
278
- * **NEW:** dynamic variables {SITE}, {URL} and {TITLE} now also works on Call To Action.
279
- * CHANGED Better ordered settings panel.
280
- * FIX incorrect post id on loops can return post config instead main config.
281
- * FIX typo error on filter "whatsappme_whastapp_web"
282
-
283
- = 2.2.3 =
284
- * **NEW:** Hide in front if editing with Elementor.
285
- * CHANGED improvements in public styles.
286
-
287
- = 2.2.2 =
288
- * **NEW:** styles/scripts minified.
289
- * FIX UX issues.
290
-
291
- = 2.2.0 =
292
- * **NEW:** Now can change telephone number on every post/page.
293
- * **NEW:** Send Google Tag Manager event on click.
294
- * **NEW:** New filter 'whatsappme_whastapp_web'. Set true if you prefer to open WhatsApp Web on desktop.
295
- * **NEW:** "Send button" change when dialog is opened.
296
- * UPDATED Tested up to Wordpress v.5.1.
297
- * UPDATED International Telephone Input library to v.15.
298
-
299
- = 2.1.3 =
300
- * FIX PHP warning on some rare cases.
301
-
302
- = 2.1.2 =
303
- * FIX javascript error on iOS Safari private browsing.
304
-
305
- = 2.1.1 =
306
- * FIX javascript error on IE11.
307
-
308
- = 2.1.0 =
309
- * **NEW:** Button bagde option for a less intrusive mode.
310
- * CHANGED now each different Call to Action is marked as read separately.
311
- * CHANGED now first show Call to Action (if defined) before launch WhatsApp link.
312
 
313
- = 2.0.1 =
314
- * FIX removed array_filter function that requires PHP 5.6 min version.
315
 
316
- = 2.0.0 =
317
- * **NEW: Advanced visibility settings to define where to show WAme button.**
318
- * **NEW:** WooCommerce integration.
319
- * UPDATED International Telephone Input library to v.13.
320
- * Minor fixes on fields cleanup and other improvements.
321
-
322
- = 1.4.3 =
323
- * NEW support for Google Analytics Global Site Tag (gtag.js).
324
- * CHANGE events label now is the destination URL to match general behavior.
325
- * UPDATED International Telephone Input library
326
-
327
- = 1.4.2 =
328
- * FIX JavaScript error introduced on v1.4.1.
329
-
330
- = 1.4.1 =
331
- * Fix JS frontend sometimes can't load WAme settings.
332
- * Fix better Google Analytics event tracking when leave page.
333
-
334
- = 1.4.0 =
335
- * **NEW:** Added the option to define the first message to send. You can include variables such as {SITE}, {URL} or {TITLE}.
336
- * Fix PHP notice when global $post is null (e.g. search results or login page).
337
-
338
- = 1.3.2 =
339
- * Only set admin/public hooks when it corresponds to improve performance and fix a notice on admin.
340
-
341
- = 1.3.1 =
342
- * Fix fatal error when the PHP mbstring extension is not active
343
-
344
- = 1.3.0 =
345
- * Added option to change position of button to left
346
- * Added formatting styles for Call to action text like in WhatsApp: *italic* **bold** strikethrough
347
-
348
- = 1.2.0 =
349
- * Added International Telephone Input for enhanced phone input
350
- * Phone number is cleared to generate correct WhatsApp links
351
-
352
- = 1.1.0 =
353
- * Added posts/pages option to override CTA or hide button
354
- * Don't enqueue assets if not show button
355
- * Added filters for developers
356
-
357
- = 1.0.3 =
358
- * Readme texts
359
-
360
- = 1.0.2 =
361
- * Fix plugin version
362
-
363
- = 1.0.1 =
364
- * Fix text domain
365
-
366
- = 1.0.0 =
367
- * First version
368
 
369
  == Upgrade Notice ==
370
 
371
- = 4.0.0 =
372
- **Join.chat rebrand.**
373
- To avoid using several prefixes from old and new versions we have decided to rename all them to the new `joinchat`.
374
-
375
- **WARNING**
376
- * **For SEO:** All analytics events change from `WhatsAppMe` to `JoinChat`
377
- * **For Devs:** All css styles change from `wame` or `whatsappme`to `joinchat`.
378
- * **For Devs:** All actions and filters change from `wame_` or `whatsappme_`to `joinchat_`.
379
 
380
  = 2.3.0 =
381
  WPML and Polylang integration.
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 4.0.2
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
13
 
14
  == Description ==
15
 
16
+ [Join.chat](https://join.chat?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Add-ons](https://join.chat/en/addons/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Support](https://join.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0)
17
 
18
  ### The best WhatsApp plugin for WordPress.
19
  > We help more than 200,000 businesses worldwide to attract users and convert them into clients.
20
 
21
+ ### New in Join.chat 4.0 (formerly WAme) 📍
22
 
23
+ 🌈 **Say hello to colors.** We've redesigned the entire interface of the chat window, now you choose a color, and we customize all the visual theme of the Widget.
24
 
25
  🍾 **Triggers.** Your pages can interact with Join.chat and show the chat window or launch WhatsApp when user clicks or an item appears when scrolling. You just need to add a few css classes.
26
 
32
  #### 🔮 Magic WhatsApp button.
33
  Add your logo, profile picture or even an animated gif. You can define a tooltip to capture the user's attention, the limit is set by your creativity.
34
 
35
+ #### 📝 Edit at publication level.
36
+ You can change general settings on every Post, Page, Product or CPT. In the right side you will find Join.chat metabox where you can modify Phone, CTA, Message and display options.
37
 
38
  #### 🔴 Show a notification.
39
  Use a balloon on the button to get the user's attention. In this way, you ensure that you do not miss any important message you want to give them, surprise them in a less intrusive way.
53
  #### 💱 Customize different languages.
54
  To be able to support all your users, wherever they are. Our plugin is compatible with WPML and Polylang.
55
 
56
+ #### 🌚 Dark Mode.
57
  Display the chat window with dark colors and white text. From settings you can activate it or leave it automatic so that it detects the configuration of devices in dark mode.
58
 
59
+ #### 👨‍💻 Developer friendly.
60
+ Fully extensible, with lots of filters and actions to extend its functionality or change behavior.
61
 
62
  ### ⌁ What you can´t do with Join.chat ⛔️
63
 
99
 
100
  `.joinchat { z-index:9999; }`
101
 
102
+ If you need to move up:
103
+
104
+ ```
105
+ /* always */
106
+ .joinchat { --bottom: 60px; }
107
+
108
+ /* mobile only */
109
+ @media (max-width: 480px), (max-width: 767px) and (orientation: landscape) {
110
+ .joinchat { --bottom: 60px; }
111
+ }
112
+ ```
113
+
114
  Greater values of z-index are left over, the default value is 400.
115
 
116
  = What about GDPR? =
118
  Join.chat don't use cookies.
119
 
120
  Join.chat save two localStorage variables for proper operation:
121
+
122
  * `joinchat_visited` to know if is the first time on site or is a returning user.
123
  * `joinchat_hashes` if you set a Call To Action (CTA), when user launch WhatsApp or close Chat Window the CTA hashed is saved to prevent show automatically that CTA again.
124
 
157
 
158
  There is a Javascript event that Join.chat triggers automatically before launch WhatsApp, which can be used to add your custom tracking code (or other needs).
159
 
160
+ ```
161
+ jQuery(document).ready(function($){
162
  $(document).on('joinchat:open', function (event, args, settings) {
163
  // Your staff
164
  // Note: args.link is the link to open, you can change it
165
  // but only wa.me, whastapp.com or current domain are allowed.
166
  });
167
+ });
168
+ ```
169
 
170
  = WPML/Polylang change Telephone by language =
171
 
172
  Join.chat general text settings can be translated with the strings translation of WPML/Polylang. You only need to save Join.chat settings to register strings and make them ready for translation. But "Telephone" is not translateable by default. If you need different phone numbers for every language add the following php code in your theme functions.php and save Join.chat settings.
173
 
174
+ ```
175
+ add_filter( 'joinchat_settings_i18n', function( $settings ) {
176
  $settings['telephone'] = 'Telephone';
177
  return $settings;
178
+ } );
179
+ ```
180
 
181
  = Settings are not saved when using emojis =
182
 
187
 
188
  == Screenshots ==
189
 
190
+ 1. Set phone, button text and call to action.
191
+ 2. Chat window.
192
+ 3. Set button image and tooltip.
193
+ 4. Set chat window color theme.
 
 
 
 
194
 
195
  == Changelog ==
196
 
197
+ = 4.0.2 =
198
+ * Encode emojis if DB not support utf8mb4.
199
+ * Better update from WAme (no manual activation required).
200
+
201
+ = 4.0.1 =
202
+ * minor fixes.
203
+
204
  = 4.0.0 =
205
  * **NEW:** Join.chat brand.
206
  * **NEW:** Widget theme color.
207
  * **NEW:** CSS class triggers to open chat window.
 
 
208
  * Lighter, reduced assets size and deleted images.
209
 
210
+ **CHANGED for SEO:** All analytics events change from `WhatsAppMe` to `JoinChat`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
 
212
+ **CHANGED for Devs:** All css classes, actions and filters change from `wame` or `whatsappme` to `joinchat`.
 
213
 
214
+ See [changelog.txt](https://plugins.svn.wordpress.org/creame-whatsapp-me/trunk/changelog.txt) for older changelog
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
215
 
216
  == Upgrade Notice ==
217
 
218
+ = 4.0.2 =
219
+ **Join.chat rebrand!!** Analytics events change from `WhatsAppMe` to `JoinChat` and classes, actions and filters change from `wame` or `whatsappme` to `joinchat`.
 
 
 
 
 
 
220
 
221
  = 2.3.0 =
222
  WPML and Polylang integration.
admin/class-joinchat-admin.php CHANGED
@@ -334,12 +334,19 @@ class JoinChatAdmin {
334
  */
335
  public function settings_validate( $input ) {
336
 
 
 
337
  // Prevent bad behavior when validate twice on first save
338
  // bug https://core.trac.wordpress.org/ticket/21989
339
  if ( count( get_settings_errors( 'joinchat' ) ) ) {
340
  return $input;
341
  }
342
 
 
 
 
 
 
343
  $util = new JoinChatUtil(); // Shortcut
344
 
345
  $input['telephone'] = $util::clean_input( $input['telephone'] );
@@ -496,7 +503,7 @@ class JoinChatAdmin {
496
 
497
  $value = isset( $this->settings[ $field_id ] ) ? $this->settings[ $field_id ] : '';
498
  $utm = '?utm_source=settings&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
499
- $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
500
 
501
  switch ( $field_id ) {
502
  case 'telephone':
@@ -671,7 +678,7 @@ class JoinChatAdmin {
671
  function help_tab() {
672
  $screen = get_current_screen();
673
  $utm = '?utm_source=helptab&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
674
- $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
675
 
676
  $help_tabs = array(
677
  array(
@@ -767,7 +774,7 @@ class JoinChatAdmin {
767
 
768
  if ( 'creame-whatsapp-me/joinchat.php' == $plugin_file ) {
769
  $utm = '?utm_source=plugins&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
770
- $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
771
 
772
  $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/docs/' . $utm . '">' . __( 'Documentation', 'creame-whatsapp-me' ) . '</a>';
773
  $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/addons/' . $utm . '">' . __( 'Add-ons', 'creame-whatsapp-me' ) . '</a>';
@@ -943,12 +950,20 @@ class JoinChatAdmin {
943
  * @return void
944
  */
945
  public function save_post( $post_id ) {
 
 
 
946
  if ( wp_is_post_autosave( $post_id ) ||
947
  ! isset( $_POST['joinchat_nonce'] ) ||
948
  ! wp_verify_nonce( $_POST['joinchat_nonce'], 'joinchat_data' ) ) {
949
  return;
950
  }
951
 
 
 
 
 
 
952
  // Clean and delete empty/false fields
953
  $metadata = array_filter(
954
  JoinChatUtil::clean_input(
334
  */
335
  public function settings_validate( $input ) {
336
 
337
+ global $wpdb;
338
+
339
  // Prevent bad behavior when validate twice on first save
340
  // bug https://core.trac.wordpress.org/ticket/21989
341
  if ( count( get_settings_errors( 'joinchat' ) ) ) {
342
  return $input;
343
  }
344
 
345
+ // Encode emojis if utf8mb4 not supported by DB
346
+ if ( 'utf8mb4' !== $wpdb->charset && function_exists( 'wp_encode_emoji' ) && ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
347
+ add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
348
+ }
349
+
350
  $util = new JoinChatUtil(); // Shortcut
351
 
352
  $input['telephone'] = $util::clean_input( $input['telephone'] );
503
 
504
  $value = isset( $this->settings[ $field_id ] ) ? $this->settings[ $field_id ] : '';
505
  $utm = '?utm_source=settings&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
506
+ $lang = _x( 'en', 'url lang slug (only available for spanish "es")', 'creame-whatsapp-me' );
507
 
508
  switch ( $field_id ) {
509
  case 'telephone':
678
  function help_tab() {
679
  $screen = get_current_screen();
680
  $utm = '?utm_source=helptab&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
681
+ $lang = _x( 'en', 'url lang slug (only available for spanish "es")', 'creame-whatsapp-me' );
682
 
683
  $help_tabs = array(
684
  array(
774
 
775
  if ( 'creame-whatsapp-me/joinchat.php' == $plugin_file ) {
776
  $utm = '?utm_source=plugins&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
777
+ $lang = _x( 'en', 'url lang slug (only available for spanish "es")', 'creame-whatsapp-me' );
778
 
779
  $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/docs/' . $utm . '">' . __( 'Documentation', 'creame-whatsapp-me' ) . '</a>';
780
  $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/addons/' . $utm . '">' . __( 'Add-ons', 'creame-whatsapp-me' ) . '</a>';
950
  * @return void
951
  */
952
  public function save_post( $post_id ) {
953
+
954
+ global $wpdb;
955
+
956
  if ( wp_is_post_autosave( $post_id ) ||
957
  ! isset( $_POST['joinchat_nonce'] ) ||
958
  ! wp_verify_nonce( $_POST['joinchat_nonce'], 'joinchat_data' ) ) {
959
  return;
960
  }
961
 
962
+ // Encode emojis if utf8mb4 not supported by DB
963
+ if ( 'utf8mb4' !== $wpdb->charset && function_exists( 'wp_encode_emoji' ) && ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
964
+ add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
965
+ }
966
+
967
  // Clean and delete empty/false fields
968
  $metadata = array_filter(
969
  JoinChatUtil::clean_input(
changelog.txt ADDED
@@ -0,0 +1,182 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ == Changelog ==
3
+
4
+ This file contains only old changelog. See README.txt for newer versions.
5
+
6
+ = 3.2.3 =
7
+ * FIX svg in safari < 13.
8
+
9
+ = 3.2.2 =
10
+ * **NEW:** Metabox can override global settings and leave it blank with `{}`.
11
+ * **NEW:** Can use `wame_open` class on any element to open WAme or launch WhatsApp.
12
+ * **NEW:** Added 'whatsappme_delete_all' filter, set true to clear all WAme data on plugin uninstall.
13
+ * CHANGED Tested up to WordPress 5.4.
14
+ * CHANGED updated FAQs GDPR info to include localStorage vars.
15
+
16
+ = 3.2.1 =
17
+ * FIX svg animations on firefox.
18
+ * FIX empty messages on WP < 4.6.
19
+ * FIX Google Analytics 'ga' event not sent if gtag for GAds or GTM is present.
20
+
21
+ = 3.2.0 =
22
+ * **NEW:** Dark mode.
23
+ * **NEW:** Hide on mobile when keyboard is open.
24
+ * **NEW:** Post metabox show main WAme settings as placeholders.
25
+ * CHANGED webp support is now on server side.
26
+ * CHANGED rewrite of chatbox output, SVGs separated, full chatbox scroll and new filters.
27
+ * FIX 'apply_filters_deprecated' fatal error on WP < 4.6
28
+
29
+ = 3.1.4 =
30
+ * FIX php warning with new var {DISCOUNT} when price is zero.
31
+
32
+ = 3.1.3 =
33
+ * Minor improvements and link to Wame CTA Extras.
34
+
35
+ = 3.1.2 =
36
+ * **NEW:** WooCommerce Call to Action for Products on Sale, also added dynamic vars {DISCOUNT} {REGULAR}.
37
+ * FIX Fatal error when selected button image is deleted from media library.
38
+ * FIX WooCommerce settings not registered for translation.
39
+ * For devs: format replacements now also accepts callbacks.
40
+ * For devs: new javascript events for chat window 'whatsappme:show' 'whatsappme:hide'.
41
+
42
+ = 3.1.1 =
43
+ * CHANGED Tested up to WordPress 5.3
44
+ * FIX Save on the first time can store some settings incorrectly.
45
+ * FIX rtl styles for new button text.
46
+
47
+ = 3.1.0 =
48
+ * **NEW:** WhatsApp button image.
49
+ * **NEW:** WhatsApp button tooltip.
50
+ * **NEW:** Start WhatsApp button text on Chat Window.
51
+ * **NEW:** Option to disable automatic open of Chat Window.
52
+ * For devs: static functions moved to a WhatsAppMe_Util class.
53
+
54
+ = 3.0.3 =
55
+ * FIX in landscape or with long CTAs the chat window could be higher than view and can't be closed.
56
+ * For developers:
57
+ * New metabox filters 'whatsappme_metabox_output' and 'whatsappme_metabox_save'.
58
+ * Change filter 'whatsappme_message_replacements' to 'whatsappme_format_replacements'.
59
+ * Change filter 'whatsappme_message_send_replacements' to 'whatsappme_variable_replacements'.
60
+
61
+ = 3.0.2 =
62
+ * **NEW:** Send Facebook Pixel custom event when user launch WhatsApp.
63
+ * FIX empty tabs on settings page due to conflicts with other themes or plugins.
64
+
65
+ = 3.0.1 =
66
+ * FIX sometimes the phone number is lost in WAme settings on save.
67
+ * CHANGED Wame button z-index to 1000.
68
+
69
+ = 3.0.0 =
70
+ * **NEW:** Better Integration with WooCommerce: CTA and Custom Message for product pages and new dynamic variables {SKU}, {PRICE} {PRODUCT}.
71
+ * **NEW:** Admin help tab with styles and dynamic varibles info.
72
+ * **NEW:** For developers: a lot of new hooks to change or extend WAme functions.
73
+ * **NEW:** Custom javascript document event 'whatsappme:open' that allow trigger other actions and/or change the link url.
74
+ * CHANGED Rebrand "WhatsApp me" to "WAme chat".
75
+ * CHANGED Code linted following WordPress standar.
76
+ * FIX when post visibility was set as "hidden", it used default global visibility.
77
+ * FIX javascript error when "ga" global object is defined but isn't Google Analytics.
78
+ * FIX rtl styles for chat.
79
+
80
+ = 2.3.3 =
81
+ * FIX javascript error when "ga" global object is defined but isn't Google Analytics.
82
+
83
+ = 2.3.2 =
84
+ * FIX PHP notice on some archive pages.
85
+
86
+ = 2.3.1 =
87
+ * Readme texts and description.
88
+
89
+ = 2.3.0 =
90
+ * **NEW:** WPML/Polylang integration.
91
+ * **NEW:** Added setting to launch WhatsApp Web on desktop.
92
+ * **NEW:** Separated button delay and chat delay settings.
93
+ * **NEW:** dynamic variables {SITE}, {URL} and {TITLE} now also works on Call To Action.
94
+ * CHANGED Better ordered settings panel.
95
+ * FIX incorrect post id on loops can return post config instead main config.
96
+ * FIX typo error on filter "whatsappme_whastapp_web"
97
+
98
+ = 2.2.3 =
99
+ * **NEW:** Hide in front if editing with Elementor.
100
+ * CHANGED improvements in public styles.
101
+
102
+ = 2.2.2 =
103
+ * **NEW:** styles/scripts minified.
104
+ * FIX UX issues.
105
+
106
+ = 2.2.0 =
107
+ * **NEW:** Now can change telephone number on every post/page.
108
+ * **NEW:** Send Google Tag Manager event on click.
109
+ * **NEW:** New filter 'whatsappme_whastapp_web'. Set true if you prefer to open WhatsApp Web on desktop.
110
+ * **NEW:** "Send button" change when dialog is opened.
111
+ * UPDATED Tested up to Wordpress v.5.1.
112
+ * UPDATED International Telephone Input library to v.15.
113
+
114
+ = 2.1.3 =
115
+ * FIX PHP warning on some rare cases.
116
+
117
+ = 2.1.2 =
118
+ * FIX javascript error on iOS Safari private browsing.
119
+
120
+ = 2.1.1 =
121
+ * FIX javascript error on IE11.
122
+
123
+ = 2.1.0 =
124
+ * **NEW:** Button bagde option for a less intrusive mode.
125
+ * CHANGED now each different Call to Action is marked as read separately.
126
+ * CHANGED now first show Call to Action (if defined) before launch WhatsApp link.
127
+
128
+ = 2.0.1 =
129
+ * FIX removed array_filter function that requires PHP 5.6 min version.
130
+
131
+ = 2.0.0 =
132
+ * **NEW: Advanced visibility settings to define where to show WAme button.**
133
+ * **NEW:** WooCommerce integration.
134
+ * UPDATED International Telephone Input library to v.13.
135
+ * Minor fixes on fields cleanup and other improvements.
136
+
137
+ = 1.4.3 =
138
+ * NEW support for Google Analytics Global Site Tag (gtag.js).
139
+ * CHANGE events label now is the destination URL to match general behavior.
140
+ * UPDATED International Telephone Input library
141
+
142
+ = 1.4.2 =
143
+ * FIX JavaScript error introduced on v1.4.1.
144
+
145
+ = 1.4.1 =
146
+ * Fix JS frontend sometimes can't load WAme settings.
147
+ * Fix better Google Analytics event tracking when leave page.
148
+
149
+ = 1.4.0 =
150
+ * **NEW:** Added the option to define the first message to send. You can include variables such as {SITE}, {URL} or {TITLE}.
151
+ * Fix PHP notice when global $post is null (e.g. search results or login page).
152
+
153
+ = 1.3.2 =
154
+ * Only set admin/public hooks when it corresponds to improve performance and fix a notice on admin.
155
+
156
+ = 1.3.1 =
157
+ * Fix fatal error when the PHP mbstring extension is not active
158
+
159
+ = 1.3.0 =
160
+ * Added option to change position of button to left
161
+ * Added formatting styles for Call to action text like in WhatsApp: *italic* **bold** strikethrough
162
+
163
+ = 1.2.0 =
164
+ * Added International Telephone Input for enhanced phone input
165
+ * Phone number is cleared to generate correct WhatsApp links
166
+
167
+ = 1.1.0 =
168
+ * Added posts/pages option to override CTA or hide button
169
+ * Don't enqueue assets if not show button
170
+ * Added filters for developers
171
+
172
+ = 1.0.3 =
173
+ * Readme texts
174
+
175
+ = 1.0.2 =
176
+ * Fix plugin version
177
+
178
+ = 1.0.1 =
179
+ * Fix text domain
180
+
181
+ = 1.0.0 =
182
+ * First version
joinchat.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: Join.chat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
- * Version: 4.0.0
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
@@ -27,7 +27,7 @@ if ( ! defined( 'WPINC' ) ) {
27
  * Currently plugin version.
28
  * Start at version 1.0.0 and use SemVer - https://semver.org
29
  */
30
- define( 'JOINCHAT_VERSION', '4.0.0' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
9
  * Plugin Name: Join.chat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
+ * Version: 4.0.2
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
27
  * Currently plugin version.
28
  * Start at version 1.0.0 and use SemVer - https://semver.org
29
  */
30
+ define( 'JOINCHAT_VERSION', '4.0.2' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
languages/creame-whatsapp-me.pot CHANGED
@@ -347,7 +347,7 @@ msgid "Included with all our %1$sadd-ons%2$s"
347
  msgstr ""
348
 
349
  #: admin/class-joinchat-admin.php:673 admin/class-joinchat-admin.php:766
350
- msgctxt "url lang slug (only avaible for spanish \"es\")"
351
  msgid "en"
352
  msgstr ""
353
 
347
  msgstr ""
348
 
349
  #: admin/class-joinchat-admin.php:673 admin/class-joinchat-admin.php:766
350
+ msgctxt "url lang slug (only available for spanish \"es\")"
351
  msgid "en"
352
  msgstr ""
353
 
public/class-joinchat-public.php CHANGED
@@ -251,7 +251,8 @@ class JoinChatPublic {
251
 
252
  $powered_url = urlencode( home_url( $wp->request ) );
253
  $powered_site = urlencode( get_bloginfo( 'name' ) );
254
- $powered_link = "https://join.chat/powered/?site={$powered_site}&url={$powered_url}";
 
255
 
256
  // Set custom img tag and bypass default image logic
257
  $image = apply_filters( 'joinchat_image', null );
251
 
252
  $powered_url = urlencode( home_url( $wp->request ) );
253
  $powered_site = urlencode( get_bloginfo( 'name' ) );
254
+ $powered_lang = _x( 'en', 'url lang slug (only available for spanish "es")', 'creame-whatsapp-me' );
255
+ $powered_link = "https://join.chat/{$powered_lang}/powered/?site={$powered_site}&url={$powered_url}";
256
 
257
  // Set custom img tag and bypass default image logic
258
  $image = apply_filters( 'joinchat_image', null );
public/js/joinchat.js CHANGED
@@ -74,6 +74,10 @@
74
  if (this.chatbox) {
75
  this.chatbox = false;
76
  this.$div.removeClass('joinchat--chatbox joinchat--tooltip');
 
 
 
 
77
  // Trigger custom event
78
  $(document).trigger('joinchat:hide');
79
  }
74
  if (this.chatbox) {
75
  this.chatbox = false;
76
  this.$div.removeClass('joinchat--chatbox joinchat--tooltip');
77
+
78
+ if (this.settings.message_badge) {
79
+ this.$('.joinchat__badge').removeClass('joinchat__badge--out');
80
+ }
81
  // Trigger custom event
82
  $(document).trigger('joinchat:hide');
83
  }
public/js/joinchat.min.js CHANGED
@@ -1 +1 @@
1
- !function(t,o){"use strict";o.joinchat_obj=o.joinchat_obj||{},joinchat_obj=t.extend({$div:null,settings:null,store:null,chatbox:!1,is_mobile:!1},joinchat_obj),joinchat_obj.$=function(o){return t(o||this.$div,this.$div)},joinchat_obj.send_event=function(t){var e=o[this.settings.ga_tracker||"ga"];"function"==typeof e&&"function"==typeof e.getAll?(e("set","transport","beacon"),e.getAll().forEach(function(o){o.send("event","JoinChat","click",t)})):"function"==typeof gtag&&gtag("event","click",{event_category:"JoinChat",event_label:t,transport_type:"beacon"});"object"==typeof dataLayer&&dataLayer.push({event:"JoinChat",eventAction:"click",eventLabel:t}),"function"==typeof fbq&&fbq("trackCustom","JoinChat",{eventAction:"click",eventLabel:t})},joinchat_obj.whatsapp_link=function(t,o,e){return((e=void 0!==e?e:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(o||"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),t(document).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),t(document).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",o=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===o.indexOf(t)&&(o.push(t),this.store.setItem("joinchat_hashes",o.join(",")))},joinchat_obj.open_whatsapp=function(e,n){var i={link:this.whatsapp_link(e||this.settings.telephone,n||this.settings.message_send)},a=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");t(document).trigger("joinchat:open",[i,this.settings]),a.test(i.link)?(this.send_event(i.link),o.open(i.link,"joinchat")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com")},t(function(){joinchat_obj.$div=t(".joinchat"),joinchat_obj.settings=joinchat_obj.$div.data("settings"),joinchat_obj.is_mobile=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,o){this._data[t]=String(o)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if(void 0===joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0}joinchat_obj.$div.length&&joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?function(){var e,n,i=1e3*joinchat_obj.settings.button_delay,a=1e3*joinchat_obj.settings.message_delay,s=!!joinchat_obj.settings.message_hash,c=!!joinchat_obj.$(".joinchat__box").length,h=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,j=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function _(){clearTimeout(n),joinchat_obj.chatbox_show()}function r(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}function b(){c&&!joinchat_obj.chatbox?_():(r(),joinchat_obj.open_whatsapp())}var l="joinchat--show";j||s&&a&&!joinchat_obj.settings.message_badge&&h||(l+=" joinchat--tooltip");setTimeout(function(){joinchat_obj.$div.addClass(l)},i),s&&!j&&a&&(joinchat_obj.settings.message_badge?n=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},i+a):h&&(n=setTimeout(_,i+a)));c&&!joinchat_obj.is_mobile&&t(".joinchat__button",joinchat_obj.$div).mouseenter(function(){e=setTimeout(_,1500)}).mouseleave(function(){clearTimeout(e)});if(t(".joinchat__button",joinchat_obj.$div).click(b),t(".joinchat__close",joinchat_obj.$div).click(r),t(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();var o=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(o<0?1:-1)}),joinchat_obj.is_mobile){var g,u=o.innerHeight;t(document).on("focus blur","input, textarea",function(e){t(e.target).closest(joinchat_obj.$div)||(clearTimeout(g),g=setTimeout(function(){joinchat_obj.$div.toggleClass("joinchat--show",o.innerHeight>.7*u)},800))})}if(t(document).on("click",".joinchat_open",function(t){t.preventDefault(),joinchat_obj.chatbox||b()}),t(document).on("click",".joinchat_close",function(t){t.preventDefault(),r()}),c&&"IntersectionObserver"in o){var d=t(".joinchat_show,.joinchat_force_show");if(d.length>0){var p=new IntersectionObserver(function(o){t.each(o,function(){if(this.intersectionRatio>0&&(!j||t(this.target).hasClass("joinchat_force_show")))return _(),p.disconnect(),!1})});d.each(function(){p.observe(this)})}}t(document).trigger("joinchat:start")}():t(document).on("click",".joinchat_open",function(t){t.preventDefault(),joinchat_obj.open_whatsapp()})),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)})}(jQuery,window);
1
+ !function(t,o){"use strict";o.joinchat_obj=o.joinchat_obj||{},joinchat_obj=t.extend({$div:null,settings:null,store:null,chatbox:!1,is_mobile:!1},joinchat_obj),joinchat_obj.$=function(o){return t(o||this.$div,this.$div)},joinchat_obj.send_event=function(t){var e=o[this.settings.ga_tracker||"ga"];"function"==typeof e&&"function"==typeof e.getAll?(e("set","transport","beacon"),e.getAll().forEach(function(o){o.send("event","JoinChat","click",t)})):"function"==typeof gtag&&gtag("event","click",{event_category:"JoinChat",event_label:t,transport_type:"beacon"});"object"==typeof dataLayer&&dataLayer.push({event:"JoinChat",eventAction:"click",eventLabel:t}),"function"==typeof fbq&&fbq("trackCustom","JoinChat",{eventAction:"click",eventLabel:t})},joinchat_obj.whatsapp_link=function(t,o,e){return((e=void 0!==e?e:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(o||"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),t(document).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),this.settings.message_badge&&this.$(".joinchat__badge").removeClass("joinchat__badge--out"),t(document).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",o=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===o.indexOf(t)&&(o.push(t),this.store.setItem("joinchat_hashes",o.join(",")))},joinchat_obj.open_whatsapp=function(e,n){var i={link:this.whatsapp_link(e||this.settings.telephone,n||this.settings.message_send)},a=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");t(document).trigger("joinchat:open",[i,this.settings]),a.test(i.link)?(this.send_event(i.link),o.open(i.link,"joinchat")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com")},t(function(){joinchat_obj.$div=t(".joinchat"),joinchat_obj.settings=joinchat_obj.$div.data("settings"),joinchat_obj.is_mobile=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,o){this._data[t]=String(o)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if(void 0===joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0}joinchat_obj.$div.length&&joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?function(){var e,n,i=1e3*joinchat_obj.settings.button_delay,a=1e3*joinchat_obj.settings.message_delay,s=!!joinchat_obj.settings.message_hash,c=!!joinchat_obj.$(".joinchat__box").length,h=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,j=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function _(){clearTimeout(n),joinchat_obj.chatbox_show()}function b(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}function r(){c&&!joinchat_obj.chatbox?_():(b(),joinchat_obj.open_whatsapp())}var l="joinchat--show";j||s&&a&&!joinchat_obj.settings.message_badge&&h||(l+=" joinchat--tooltip");setTimeout(function(){joinchat_obj.$div.addClass(l)},i),s&&!j&&a&&(joinchat_obj.settings.message_badge?n=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},i+a):h&&(n=setTimeout(_,i+a)));c&&!joinchat_obj.is_mobile&&t(".joinchat__button",joinchat_obj.$div).mouseenter(function(){e=setTimeout(_,1500)}).mouseleave(function(){clearTimeout(e)});if(t(".joinchat__button",joinchat_obj.$div).click(r),t(".joinchat__close",joinchat_obj.$div).click(b),t(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();var o=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(o<0?1:-1)}),joinchat_obj.is_mobile){var g,u=o.innerHeight;t(document).on("focus blur","input, textarea",function(e){t(e.target).closest(joinchat_obj.$div)||(clearTimeout(g),g=setTimeout(function(){joinchat_obj.$div.toggleClass("joinchat--show",o.innerHeight>.7*u)},800))})}if(t(document).on("click",".joinchat_open",function(t){t.preventDefault(),joinchat_obj.chatbox||r()}),t(document).on("click",".joinchat_close",function(t){t.preventDefault(),b()}),c&&"IntersectionObserver"in o){var d=t(".joinchat_show,.joinchat_force_show");if(d.length>0){var p=new IntersectionObserver(function(o){t.each(o,function(){if(this.intersectionRatio>0&&(!j||t(this.target).hasClass("joinchat_force_show")))return _(),p.disconnect(),!1})});d.each(function(){p.observe(this)})}}t(document).trigger("joinchat:start")}():t(document).on("click",".joinchat_open",function(t){t.preventDefault(),joinchat_obj.open_whatsapp()})),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)})}(jQuery,window);
whatsappme.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * WhatsApp me to Join.chat migration helper
5
+ */
6
+
7
+ // If this file is called directly, abort.
8
+ if ( ! defined( 'WPINC' ) ) {
9
+ die;
10
+ }
11
+
12
+ // Deactivate old 'creame-whatsapp-me/whatsappme.php'
13
+ deactivate_plugins( plugin_basename( __FILE__ ) );
14
+
15
+ // Activate new 'creame-whatsapp-me/joinchat.php'
16
+ activate_plugins( plugin_dir_path( __FILE__ ) . 'joinchat.php' );