PluginProbe ʕ •ᴥ•ʔ
Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line Messenger, WeChat, Email, SMS, Call Button – Chaty / 3.1.6
Floating Chat Widget: Contact Chat Icons, Telegram Chat, Line Messenger, WeChat, Email, SMS, Call Button – Chaty v3.1.6
3.5.7 3.5.6 3.5.5 3.5.4 trunk 1.1 1.1.1 1.1.2 1.1.3 1.2 1.2.1 1.2.2 1.2.3 1.3 1.3.1 1.3.2 1.3.3 1.3.4 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.9 2.9.1 2.9.2 2.9.3 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3
chaty / cht-icons.php
chaty Last commit date
admin 2 years ago css 2 years ago images 2 years ago includes 2 years ago js 2 years ago languages 2 years ago src 3 years ago views 2 years ago cht-icons.php 2 years ago mix-manifest.json 3 years ago package-lock.json 3 years ago package.json 3 years ago postcss.config.js 3 years ago readme.txt 2 years ago tailwind.config.js 3 years ago webpack.mix.js 3 years ago
cht-icons.php
233 lines
1 <?php
2 /*
3 Plugin Name: Chaty
4 Contributors: galdub, tomeraharon
5 Description: Chat with your website visitors via their favorite channels. Show a chat icon on the bottom of your site and communicate with your website visitors.
6 Author: Premio
7 Author URI: https://premio.io/downloads/chaty/
8 Text Domain: chaty
9 Domain Path: /languages
10 Version: 3.1.6
11 License: GPL2
12 */
13
14 if (!defined('ABSPATH')) {
15 exit;
16 }
17
18
19 define('CHT_FILE', __FILE__); // this file
20 if(!defined('CHT_OPT')) {
21 define('CHT_OPT', 'chaty');
22 }
23 define('CHT_DIR', dirname(CHT_FILE)); // our directory
24 define('CHT_ADMIN_INC', CHT_DIR . '/admin');
25 define('CHT_FRONT_INC', CHT_DIR . '/frontend');
26 define('CHT_INC', CHT_DIR . '/includes');
27 define('CHT_PRO_URL', admin_url("admin.php?page=chaty-app-upgrade"));
28 define('CHT_PLUGIN_URL', plugin_dir_url(__FILE__));
29 define('CHT_PLUGIN_BASE', plugin_basename(CHT_FILE));
30 define('CHT_VERSION', "3.1.6");
31
32 if (!function_exists('wp_doing_ajax')) {
33 function wp_doing_ajax()
34 {
35 /**
36 * Filters whether the current request is a WordPress Ajax request.
37 *
38 * @since 4.7.0
39 *
40 * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
41 */
42 return apply_filters('wp_doing_ajax', defined('DOING_AJAX') && DOING_AJAX);
43 }
44 }
45
46 if(!function_exists("cht_clear_all_caches")) {
47 function cht_clear_all_caches()
48 {
49 /* Clear cookies from browser */
50 if (isset($_COOKIE['chaty_settings'])) {
51 setcookie("chaty_settings", '', time() - 3600, "/");
52 setcookie("cta_exit_intent_shown", '', time() - 3600, "/");
53 }
54 if(isset($_COOKIE['chatyWidget_0'])) {
55 setcookie("chatyWidget_0", '', time() - 3600, "/");
56 }
57 for($i=1; $i<=20; $i++) {
58 if(isset($_COOKIE['chatyWidget__'.$i])) {
59 setcookie('chatyWidget__'.$i, '', time() - 3600, "/");
60 }
61 }
62 try {
63 global $wp_fastest_cache;
64 // if W3 Total Cache is being used, clear the cache
65 if (function_exists('w3tc_flush_all')) {
66 w3tc_flush_all();
67
68 }
69 /* if WP Super Cache is being used, clear the cache */
70 if (function_exists('wp_cache_clean_cache')) {
71 global $file_prefix, $supercachedir;
72 if (empty($supercachedir) && function_exists('get_supercache_dir')) {
73 $supercachedir = get_supercache_dir();
74 }
75 wp_cache_clean_cache($file_prefix);
76 }
77 if (class_exists('WpeCommon')) {
78 //be extra careful, just in case 3rd party changes things on us
79 if (method_exists('WpeCommon', 'purge_memcached')) {
80 //WpeCommon::purge_memcached();
81 }
82 if (method_exists('WpeCommon', 'clear_maxcdn_cache')) {
83 //WpeCommon::clear_maxcdn_cache();
84 }
85 if (method_exists('WpeCommon', 'purge_varnish_cache')) {
86 //WpeCommon::purge_varnish_cache();
87 }
88 }
89 /* WP Fastest Cache Plugin */
90 if (method_exists('WpFastestCache', 'deleteCache') && !empty($wp_fastest_cache)) {
91 $wp_fastest_cache->deleteCache();
92 }
93 /* WP Rocket Plugin */
94 if (function_exists('rocket_clean_domain')) {
95 rocket_clean_domain();
96 // Preload cache.
97 if (function_exists('run_rocket_sitemap_preload')) {
98 run_rocket_sitemap_preload();
99 }
100 }
101 /* Autoptimize Cache Plugin */
102 if (class_exists("autoptimizeCache") && method_exists("autoptimizeCache", "clearall")) {
103 autoptimizeCache::clearall();
104 }
105 /* LiteSpeed Plugin */
106 if (class_exists("LiteSpeed_Cache_API") && method_exists("autoptimizeCache", "purge_all")) {
107 LiteSpeed_Cache_API::purge_all();
108 }
109 /* Breeze Plugin */
110 if (class_exists("Breeze_PurgeCache") && method_exists("Breeze_PurgeCache", "breeze_cache_flush")) {
111 Breeze_PurgeCache::breeze_cache_flush();
112 }
113 /* Hummingbird */
114 if (class_exists( '\Hummingbird\Core\Utils' ) ) {
115 $modules = \Hummingbird\Core\Utils::get_active_cache_modules();
116 foreach ( $modules as $module => $name ) {
117 $mod = \Hummingbird\Core\Utils::get_module( $module );
118 if ( $mod->is_active() ) {
119 if ( 'minify' === $module ) {
120 $mod->clear_files();
121 } else {
122 $mod->clear_cache();
123 }
124 }
125 }
126 }
127 /* WP Total Cache */
128 if ( function_exists( 'wp_cache_clean_cache' ) ) {
129 global $file_prefix;
130 wp_cache_clean_cache( $file_prefix, true );
131 }
132 } catch (Exception $e) {
133 return 1;
134 }
135 }
136 }
137
138 if(is_admin()) {
139 require_once CHT_ADMIN_INC . '/chaty-timezone.php';
140 require_once CHT_INC . '/class-review-box.php';
141 require_once CHT_INC . '/class-affiliate.php';
142 require_once CHT_INC . '/class-upgrade-box.php';
143 }
144
145 require_once CHT_INC . '/class-cht-icons.php';
146 require_once CHT_INC . '/class-frontend.php';
147
148 add_action('activated_plugin', 'cht_activation_redirect');
149
150 register_activation_hook(CHT_FILE, 'cht_install', 10);
151
152 function cht_install()
153 {
154 $widgetSize = get_option('cht_numb_slug');
155 $cht_devices = get_option('cht_devices');
156
157 if (empty($widgetSize) && empty($cht_devices)) {
158 $options = array(
159 'mobile' => '1',
160 'desktop' => '1',
161 );
162
163 update_option('cht_created_on', date("Y-m-d"));
164 update_option('cht_devices', $options);
165 update_option('cht_position', 'right');
166 update_option('cht_cta', 'Contact us');
167 update_option('cht_numb_slug', ',Phone,Whatsapp');
168 update_option('cht_social_whatsapp', '');
169 update_option('cht_social_phone', '');
170 update_option('cht_widget_size', '54');
171 update_option('widget_icon', 'chat-base');
172 update_option('cht_widget_img', '');
173 update_option('cht_color', '#A886CD');
174 }
175
176 $popup_status = get_option("chaty_intro_popup");
177 if($popup_status === false || empty($popup_status)) {
178 add_option("chaty_intro_popup", "show");
179 }
180
181 $option = get_option("Chaty_show_affiliate_box_after");
182 if($option === false || empty($option)) {
183 $date = date("Y-m-d", strtotime("+5 days"));
184 add_option("Chaty_show_affiliate_box_after", $date);
185 }
186 }
187
188 function cht_activation_redirect($plugin)
189 {
190 if ($plugin == plugin_basename(__FILE__)) {
191 $cht_active = get_option('cht_active');
192 if($cht_active === false) {
193 $admin_url = admin_url('admin.php?page=chaty-app&widget=0');
194 } else {
195 $admin_url = admin_url('admin.php?page=chaty-app');
196 }
197 wp_redirect($admin_url);
198 exit;
199 }
200 }
201
202 function chaty_plugin_check_db_table() {
203 global $wpdb, $pagenow;
204 $page = filter_input(INPUT_GET, 'page');
205 if ($pagenow == 'plugins.php' || ($page == 'chaty-app' || $page == 'chaty-upgrade' || $page == 'widget-analytics' || $page == 'chaty-contact-form-feed')) {
206 require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
207 $charset_collate = $wpdb->get_charset_collate();
208 $chaty_table = $wpdb->prefix . 'chaty_contact_form_leads';
209 if ($wpdb->get_var("show tables like '{$chaty_table}'") != $chaty_table) {
210 $chaty_table_settings = "CREATE TABLE {$chaty_table} (
211 id bigint(11) NOT NULL AUTO_INCREMENT,
212 widget_id int(11) NULL,
213 name varchar(100) NULL,
214 email varchar(100) NULL,
215 phone_number varchar(100) NULL,
216 message text NULL,
217 ref_page text NULL,
218 ip_address tinytext NULL,
219 created_on datetime,
220 PRIMARY KEY (id)
221 ) $charset_collate;";
222 dbDelta($chaty_table_settings);
223 }
224
225 /* version 2.7.3 change added new column */
226 $field_check = $wpdb->get_var("SHOW COLUMNS FROM {$chaty_table} LIKE 'phone_number'");
227 if ('phone_number' != $field_check) {
228 $wpdb->query("ALTER TABLE {$chaty_table} ADD phone_number VARCHAR(100) NULL DEFAULT NULL AFTER email");
229 }
230 }
231 }
232 add_action( 'admin_init' , 'chaty_plugin_check_db_table' );
233