WhatsApp me - Version 4.0.5

Version Description

Join.chat rebrand!! Analytics events change from WhatsAppMe to JoinChat and classes, actions and filters change from wame or whatsappme to joinchat.

Download this release

Release Info

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

Code changes from version 4.0.4 to 4.0.5

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.4
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -181,6 +181,11 @@ Join.chat general text settings can be translated with the strings translation o
181
 
182
  == Changelog ==
183
 
 
 
 
 
 
184
  = 4.0.4 =
185
  * Better public settings JSON output
186
  * Re-fix WAme deactivate
@@ -209,7 +214,7 @@ See [changelog.txt](https://plugins.svn.wordpress.org/creame-whatsapp-me/trunk/c
209
 
210
  == Upgrade Notice ==
211
 
212
- = 4.0.4 =
213
  **Join.chat rebrand!!** Analytics events change from `WhatsAppMe` to `JoinChat` and classes, actions and filters change from `wame` or `whatsappme` to `joinchat`.
214
 
215
  = 2.3.0 =
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 4.0.5
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
181
 
182
  == Changelog ==
183
 
184
+ = 4.0.5 =
185
+ * **NEW:** Clear third party cache plugins on settings save.
186
+ * FIX php error on image resize.
187
+ * UPDATED International Telephone Input library to v.17.
188
+
189
  = 4.0.4 =
190
  * Better public settings JSON output
191
  * Re-fix WAme deactivate
214
 
215
  == Upgrade Notice ==
216
 
217
+ = 4.0.5 =
218
  **Join.chat rebrand!!** Analytics events change from `WhatsAppMe` to `JoinChat` and classes, actions and filters change from `wame` or `whatsappme` to `joinchat`.
219
 
220
  = 2.3.0 =
admin/class-joinchat-admin.php CHANGED
@@ -71,7 +71,7 @@ class JoinChatAdmin {
71
  $this->version = $version;
72
 
73
  // Updated in get_settings() at 'admin_init' hook
74
- $this->enhanced_phone = '16.0.11'; // intl-tel-input version
75
  $this->tabs = array();
76
  $this->settings = array();
77
 
@@ -1003,4 +1003,49 @@ class JoinChatAdmin {
1003
 
1004
  }
1005
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1006
  }
71
  $this->version = $version;
72
 
73
  // Updated in get_settings() at 'admin_init' hook
74
+ $this->enhanced_phone = '17.0.3'; // intl-tel-input version
75
  $this->tabs = array();
76
  $this->settings = array();
77
 
1003
 
1004
  }
1005
 
1006
+ /**
1007
+ * Clear third party cache plugins if joinchat option changed
1008
+ *
1009
+ * @since 4.0.5
1010
+ * @access public
1011
+ * @param mixed $old_value joinchat previous settings.
1012
+ * @param mixed $value joinchat new settings.
1013
+ * @return void
1014
+ */
1015
+ public static function clear_cache() {
1016
+
1017
+ // TODO: Prevent Autoptimize clear many times
1018
+
1019
+ /**
1020
+ * List of callable functions or actions by third party plugins.
1021
+ * format: string callable or array( string callable or hook, [, mixed $parameter [, mixed $... ]] )
1022
+ */
1023
+ $cache_plugins = apply_filters(
1024
+ 'joinchat_cache_plugins',
1025
+ array(
1026
+ 'autoptimizeCache::clearall_actionless', // Autoptimize https://wordpress.org/plugins/autoptimize/
1027
+ 'ce_clear_cache', // Cache Enabler https://wordpress.org/plugins/cache-enabler/
1028
+ 'cachify_flush_cache', // Cachify https://wordpress.org/plugins/cachify/
1029
+ 'LiteSpeed_Cache_API::purge_all', // LiteSpeed Cache https://wordpress.org/plugins/litespeed-cache/
1030
+ 'sg_cachepress_purge_cache', // SG Optimizer https://es.wordpress.org/plugins/sg-cachepress/
1031
+ array( 'wpfc_clear_all_cache', true ), // WP Fastest Cache https://es.wordpress.org/plugins/wp-fastest-cache/
1032
+ 'rocket_clean_minify', // WP Rocket https://wp-rocket.me
1033
+ 'rocket_clean_domain',
1034
+ 'wp_cache_clean_cache', // WP Super Cache https://wordpress.org/plugins/wp-super-cache/
1035
+ 'w3tc_flush_all', // W3 Total Cache https://wordpress.org/plugins/w3-total-cache/
1036
+ )
1037
+ );
1038
+
1039
+ foreach ( $cache_plugins as $callable ) {
1040
+ $callable = (array) $callable;
1041
+
1042
+ if ( is_callable( $callable[0] ) ) {
1043
+ call_user_func_array( array_shift( $callable ), $callable );
1044
+ } elseif ( has_action( $callable[0] ) ) {
1045
+ call_user_func_array( 'do_action', $callable );
1046
+ }
1047
+ }
1048
+
1049
+ }
1050
+
1051
  }
includes/class-joinchat-util.php CHANGED
@@ -96,14 +96,26 @@ class JoinChatUtil {
96
 
97
  if ( ! file_exists( $new_img_path ) ) {
98
  $new_img = wp_get_image_editor( $img_path );
99
- $new_img->resize( $width, $height, $crop );
100
- $new_img = $new_img->save( $new_img_path );
101
 
102
- $thumb = array(
103
- 'url' => str_replace( $uploads['basedir'], $uploads['baseurl'], $new_img_path ),
104
- 'width' => $new_img['width'],
105
- 'height' => $new_img['height'],
106
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  } else {
108
  @list($w, $h) = getimagesize( $new_img_path );
109
 
96
 
97
  if ( ! file_exists( $new_img_path ) ) {
98
  $new_img = wp_get_image_editor( $img_path );
 
 
99
 
100
+ if ( ! is_wp_error( $new_img ) ) {
101
+ $new_img->resize( $width, $height, $crop );
102
+ $new_img = $new_img->save( $new_img_path );
103
+
104
+ $thumb = array(
105
+ 'url' => str_replace( $uploads['basedir'], $uploads['baseurl'], $new_img_path ),
106
+ 'width' => $new_img['width'],
107
+ 'height' => $new_img['height'],
108
+ );
109
+ } else {
110
+ // Fallback to original image
111
+ @list($w, $h) = getimagesize( $img_path );
112
+
113
+ $thumb = array(
114
+ 'url' => str_replace( $uploads['basedir'], $uploads['baseurl'], $img_path ),
115
+ 'width' => $w,
116
+ 'height' => $h,
117
+ );
118
+ }
119
  } else {
120
  @list($w, $h) = getimagesize( $new_img_path );
121
 
includes/class-joinchat.php CHANGED
@@ -172,6 +172,7 @@ class JoinChat {
172
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
173
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_post' );
174
  $this->loader->add_action( 'load-settings_page_joinchat', $plugin_admin, 'help_tab' );
 
175
 
176
  $this->loader->add_filter( "plugin_action_links_creame-whatsapp-me/{$this->plugin_name}.php", $plugin_admin, 'settings_link' );
177
  $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
172
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
173
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_post' );
174
  $this->loader->add_action( 'load-settings_page_joinchat', $plugin_admin, 'help_tab' );
175
+ $this->loader->add_action( 'update_option_joinchat', $plugin_admin, 'clear_cache', 100 );
176
 
177
  $this->loader->add_filter( "plugin_action_links_creame-whatsapp-me/{$this->plugin_name}.php", $plugin_admin, 'settings_link' );
178
  $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
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.4
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.4' );
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.5
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.5' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,