Changeset 3060394
- Timestamp:
- 03/28/2024 09:19:56 AM (2 years ago)
- Location:
- subiz-live-chat/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (8 diffs)
-
subiz.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
subiz-live-chat/trunk/readme.txt
r2023145 r3060394 1 === Subiz - Live chat plugin on Wordpress===2 Contributors: mrsubiz1 === Subiz - Live chat === 2 Contributors: Subiz 3 3 Donate link: 4 4 Tags: chat, live chat, livechat, contact form, bot 5 5 Requires at least: 2.8 6 6 Tested up to: 5.0.2 7 Stable tag: 4. 07 Stable tag: 4.1 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl.html … … 13 13 == Description == 14 14 15 [Subiz](https://subiz.com /en) plugin for Wordpress is the easiest way to add free live chat to your website. It is the effect way to interact with on-site visitors in real time, a perfect way to capture lead, support and convert more customers from your sites.15 [Subiz](https://subiz.com.vn) plugin for Wordpress is the easiest way to add free live chat to your website. It is the effect way to interact with on-site visitors in real time, a perfect way to capture lead, support and convert more customers from your sites. 16 16 17 Beside Subiz App Mobile that help you to communicate to customer at any time, any where. Which you can also integrate your Fanpages, Emails…to Subiz that you can interact with customers across multi - channels from [Website](https://subiz.com /live-chat.html), [Fanpage](https://subiz.com/facebook-messenger.html), [Email](https://subiz.com/email.html)... in one platform. All interaction data will be gathered on Subiz that will help you understand the customer personalization and implement interactive marketing strategies for customer care and retention effectively.17 Beside Subiz App Mobile that help you to communicate to customer at any time, any where. Which you can also integrate your Fanpages, Emails…to Subiz that you can interact with customers across multi - channels from [Website](https://subiz.com.vn), [Fanpage](https://subiz.com.vn/facebook-messenger.html), [Email](https://subiz.com.vn/email.html)... in one platform. All interaction data will be gathered on Subiz that will help you understand the customer personalization and implement interactive marketing strategies for customer care and retention effectively. 18 18 19 19 **Advantages of Subiz Plugin** … … 27 27 Subiz plugin has been innovated and simplified with **customizing and Notification on browser right in plugin** to offer the best customer communication platform for WordPress users. 28 28 29 **[Sign up here](https://app.subiz.com /register) for free!** It will takes a few clicks to install Subiz plugin and you can start to communicate with customer cross multi channels in one platform29 **[Sign up here](https://app.subiz.com.vn/register) for free!** It will takes a few clicks to install Subiz plugin and you can start to communicate with customer cross multi channels in one platform 30 30 31 31 Once you install the plugin, you will be ready to take full advantage of the benefits and values of Subiz, and also our service … … 42 42 * **Evaluation of business activities**: Statistics of customer interaction and common customer issues, building customer specific portraits, evaluating the effectiveness of marketing campaigns through Subiz data available. 43 43 44 **[Key features](https://subiz.com /feature.html) of Subiz:**44 **[Key features](https://subiz.com.vn/feature.html) of Subiz:** 45 45 46 46 * Cross multi - channels communication … … 61 61 62 62 **Don't forget to follow and love Subiz:** 63 [Support Center](https://subiz.com /contact.html)64 [Document](https:// help-en.subiz.com/)65 [Blog](http ://subiz.com/blog/?utm_source=plugin_wp&utm_medium=plugin&utm_campaign=plugin_wp1.1)63 [Support Center](https://subiz.com.vn/contact.html) 64 [Document](https://subiz.com.vn/docs/220677403-lam-quen-voi-subiz) 65 [Blog](https://subiz.com.vn/blog/vi/) 66 66 [Facebook](https://www.facebook.com/subizdotcom) 67 67 [Twitter](https://twitter.com/subizdotcom) … … 69 69 == Installation == 70 70 71 * Register account at [Subiz.com](https://app.subiz.com /register?utm_source=Wordpress&utm_campaign=WP_Plug-in&utm_medium=Marketplace&utm_content=v4&utm_term=2019)72 * Login to [app.subiz.com and find your license ID](https://app.subiz.com /settings/)71 * Register account at [Subiz.com](https://app.subiz.com.vn/register?utm_source=Wordpress&utm_campaign=WP_Plug-in&utm_medium=Marketplace&utm_content=v4&utm_term=2019) 72 * Login to [app.subiz.com and find your license ID](https://app.subiz.com.vn/settings/) 73 73 * Find or download Subiz plugin from WordPress plugin directory 74 74 * Install Subiz in Plugin section of your WordPress Dashboard … … 83 83 84 84 Installing Subiz on your WordPress site takes a few clicks and just a few minutes. 85 If you do not have a Subiz’s account, you can [sign up here](https://app.subiz.com /register?utm_source=Wordpress&utm_campaign=WP_Plug-in&utm_medium=Marketplace&utm_content=v4&utm_term=2019) to get your ID account and installing Subiz using the WordPress plugin.85 If you do not have a Subiz’s account, you can [sign up here](https://app.subiz.com.vn/register?utm_source=Wordpress&utm_campaign=WP_Plug-in&utm_medium=Marketplace&utm_content=v4&utm_term=2019) to get your ID account and installing Subiz using the WordPress plugin. 86 86 If you’re already an Subiz customer, you can find instructions in the in-app [setup guide here](https://help-en.subiz.com/getting-started-with-subiz/setting-up-interaction-environments/installing-subiz-on-websites/integrate-subiz-on-some-website-platforms#using-plugin-on-wordpress). 87 87 … … 116 116 == Changelog == 117 117 118 = 4. 0=118 = 4.1 = 119 119 120 * Rewrite widget as Subiz upgraded 4. 0120 * Rewrite widget as Subiz upgraded 4.1 121 121 * Update Widget Customize, Notification Button Option pages -
subiz-live-chat/trunk/subiz.php
r2018073 r3060394 1 1 <?php 2 /* 3 Plugin Name: subiz 4 Plugin URI: http://support.subiz.com/support/solutions/articles/76904-subiz-plugins 5 Description: Subiz live chat plugin offers an excellent customer interaction platform where sales and customer service team can communicate directly with visitors, fulfil any enquiry in real-time, and actively receive feedback 6 Version: 4.0 7 Author: mrsubiz 8 Author URI: http://subiz.com 9 License: GPL3 2 3 /** 4 * @link https://subiz.com.vn 5 * @package subiz 6 * 7 * @wordpress-plugin 8 * Plugin Name: Subiz 9 * Plugin URI: http://subiz.com.vn/wordpress-plugin 10 * Description: Subiz live chat plugin offers an excellent customer interaction platform where sales and customer service team can communicate directly with visitors, fulfil any enquiry in real-time, and actively receive feedback 11 * Version: 4.1 12 * Author: Subiz 13 * Author URI: https://subiz.com.vn 14 * License: GPL-2.0+ 15 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 16 */ 11 if(!class_exists('Subiz_Settings')){12 17 13 class Subiz_Settings{ 14 const SUBIZ_LICENCE_ID_VARIABLE = 'subiz_licence_id'; 15 const SUBIZ_VISIBILITY_OPTIONS = 'subiz-visibility-options'; 18 // If this file is called directly, abort. 19 if (! defined('WPINC')) { 20 die; 21 } 16 22 17 public function __construct(){ 18 19 if(!get_option('subiz-visibility-options',false)) 20 { 21 $visibility = array ( 22 'subiz_widget_color'=>'', 23 'subiz_widget_button' => '', 24 'image_attachment_id' => '', 25 'image_attachment_id_2' => '', 26 'image_attachment_id_3' => '', 27 'subiz_notify_setting' => '', 28 'subiz_notify_text' => '', 29 'subiz_widget_button_width' => '', 30 'subiz_noti_button_default_l' => '', 31 'subiz_noti_button_default_r' => '', 32 'revert_default_l' => '', 33 'revert_default_r' => '', 34 ); 35 update_option( 'subiz-visibility-options', $visibility); 36 } 37 add_action('admin_init', array(&$this, 'admin_init')); 38 add_action('admin_menu', array(&$this, 'add_menu')); 39 add_action('admin_enqueue_scripts', array($this,'subiz_settings_assets') ); 40 } 41 42 public function subiz_settings_assets($hook) 43 { 44 if($hook != 'settings_page_subiz_plugin') 45 return; 46 47 wp_register_style( 'subiz_admin_style', plugins_url( 'assets/admin.css' , __FILE__ ) ); 48 wp_enqueue_style( 'subiz_admin_style' ); 49 wp_register_style( 'subiz_ui_style', plugins_url( 'assets/vendor/jquery-ui/jquery-ui.min.css' , __FILE__ ) ); 50 wp_enqueue_style( 'subiz_ui_style' ); 51 wp_register_style( 'subiz_colorpicker_style', plugins_url( 'assets/vendor/colorpicker-master/css/evol-colorpicker.min.css' , __FILE__ ) ); 52 wp_enqueue_style( 'subiz_colorpicker_style' ); 53 wp_enqueue_script( 'subiz_ui_script', plugins_url( 'assets/vendor/jquery-ui/jquery-ui.min.js' , __FILE__ ) ); 54 wp_enqueue_script( 'subiz_colorpicker_script', plugins_url( 'assets/vendor/colorpicker-master/js/evol-colorpicker.min.js' , __FILE__ ) ); 55 wp_enqueue_script( 'subiz_admin_script', plugins_url( 'assets/admin.js' , __FILE__ ) ); 56 57 } 58 59 public function admin_init(){ 60 register_setting( 'subiz_options', 'subiz_licence_id'); 61 register_setting( 'subiz_options', 'subiz-visibility-options', array(&$this,'validate_options') ); 62 } 23 define('PLUGIN_NAME_VERSION', '4.1'); 63 24 64 25 26 class SubizPlugin 27 { 28 public function __construct() 29 { 30 add_action('admin_menu', array( $this, 'admin_menu' )); 31 add_action('admin_init', array( $this, 'admin_setting_form_init' )); 32 } 65 33 66 public function validate_options($input){ 67 $input['subiz_widget_color'] = sanitize_hex_color($input['subiz_widget_color']); 68 $input['subiz_widget_button'] = sanitize_text_field($input['subiz_widget_button']); 69 $input['image_attachment_id'] = absint($input['image_attachment_id']); 70 $input['image_attachment_id_2'] = absint($input['image_attachment_id_2']); 71 $input['image_attachment_id_3'] = absint($input['image_attachment_id_3']); 72 $input['subiz_notify_setting'] = sanitize_text_field($input['subiz_notify_setting']); 73 $input['subiz_notify_text'] = sanitize_textarea_field($input['subiz_notify_text']); 74 $input['subiz_widget_button_width'] = absint($input['subiz_widget_button_width']); 75 $input['subiz_noti_button_default_l'] = sanitize_text_field($input['subiz_noti_button_default_l']); 76 $input['subiz_noti_button_default_r'] = sanitize_text_field($input['subiz_noti_button_default_r']); 77 $input['revert_default_l'] = sanitize_text_field($input['revert_default_l']); 78 $input['revert_default_r'] = sanitize_text_field($input['revert_default_r']); 79 return $input; 80 } 34 public static function activate() 35 { 36 $settings = array( 37 'subiz_account_id' => '', 38 'subiz_account_name' => '', 39 ); 40 add_option('subiz_settings', $settings, '', 'yes'); 41 } 81 42 82 public function add_menu(){ 83 add_options_page( 84 __('Subiz Settings','subiz'), 85 __('Subiz','subiz'), 86 'manage_options', 87 'subiz_plugin', 88 array(&$this, 'create_plugin_settings_page') 89 ); 90 } 43 public static function deactivate() 44 { 45 delete_option('subiz_settings'); 46 } 91 47 48 /** 49 * Registers a new settings page under Settings. 50 */ 51 public function admin_menu() 52 { 53 add_menu_page( 54 __('Subiz Settings', 'textdomain'), 55 __('Subiz', 'textdomain'), 56 'administrator', 57 'subiz-plugin', 58 array( 59 $this, 60 'settings_page' 61 ), 62 plugin_dir_url(dirname(__FILE__)) . 'subiz/images/subiz_channel.svg', 63 ); 64 } 92 65 93 public function create_plugin_settings_page(){ 66 public function admin_setting_form_init() 67 { 68 register_setting('subiz_options', 'subiz_settings'); 69 } 94 70 95 global $wpdb; 71 /** 72 * Settings page display callback. 73 */ 74 public function settings_page() 75 { 76 include sprintf('%s/page.php', dirname(__FILE__)); 77 } 96 78 97 if(!current_user_can('manage_options')) { 98 wp_die(__('You do not have sufficient permissions to access this page.')); 99 } 100 101 102 include(sprintf("%s/templates/settings.php", dirname(__FILE__))); 103 } 104 105 } 79 public function print_embed_code() 80 { 81 include sprintf('%s/widget.php', dirname(__FILE__)); 82 } 106 83 } 107 84 108 if(!class_exists('Subiz')){ 109 class Subiz{ 110 public function __construct(){ 111 $subiz_settings = new Subiz_Settings(); 112 } 85 if (class_exists('SubizPlugin')) { 86 register_activation_hook(__FILE__, array('SubizPlugin', 'activate')); 87 register_deactivation_hook(__FILE__, array('SubizPlugin', 'deactivate')); 113 88 114 public static function activate(){ 115 116 $visibility = array ( 117 'subiz_widget_color' => '', 118 'subiz_widget_color'=>'', 119 'subiz_widget_button' => '', 120 'image_attachment_id' => '', 121 'image_attachment_id_2' => '', 122 'image_attachment_id_3' => '', 123 'subiz_notify_setting' => '', 124 'subiz_notify_text' => '', 125 'subiz_widget_button_width' => '', 126 'subiz_noti_button_default_l' => '', 127 'subiz_noti_button_default_r' => '', 128 'revert_default_l' => '', 129 'revert_default_r' => '', 130 ); 131 132 add_option(Subiz_Settings::SUBIZ_LICENCE_ID_VARIABLE, '', '', 'yes'); 133 add_option(Subiz_Settings::SUBIZ_VISIBILITY_OPTIONS, $visibility, '', 'yes'); 134 } 135 136 public static function deactivate(){ 137 delete_option(Subiz_Settings::SUBIZ_LICENCE_ID_VARIABLE, '', '', 'yes'); 138 delete_option(Subiz_Settings::SUBIZ_VISIBILITY_OPTIONS); 139 } 140 141 142 143 public function sfw_insert_code(){ 144 $visibility = get_option( 'subiz-visibility-options' ); 145 $subiz_licence_id = get_option('subiz_licence_id'); 146 echo "<!-- Subiz --> <script> (function(s, u, b, i, z){ u[i]=u[i]||function(){ u[i].t=+new Date(); (u[i].q=u[i].q||[]).push(arguments); }; z=s.createElement('script'); var zz=s.getElementsByTagName('script')[0]; z.async=1; z.src=b; z.id='subiz-script'; zz.parentNode.insertBefore(z,zz); })(document, window, 'https://widgetv4.subiz.com/static/js/app.js', 'subiz'); subiz('setAccount', '" . $subiz_licence_id . "'); </script> <!-- End Subiz -->"; 147 $subiz_widget_color = $visibility['subiz_widget_color']; 148 $subiz_notify_setting = $visibility['subiz_notify_setting']; 149 $subiz_notify_text = $visibility['subiz_notify_text']; 150 if( $subiz_notify_text == ""){ 151 if(get_locale() == "vi"){ 152 $subiz_notify_text = "Click vào ĐỒNG Ý để nhận các thông tin hữu ích từ Subiz"; 153 }else{ 154 $subiz_notify_text = "Click AGREE to get useful information from SUBIZ"; 155 } 156 } 157 if($subiz_widget_color){ 158 echo "<script type=\"text/javascript\"> 159 window.subiz('changeCss', '.color-theme-default{background-color:".$subiz_widget_color." !important;}') 160 </script>"; 161 }; 162 if ($subiz_notify_setting == 's1') { 163 $image = ($visibility['media_selector_attachment_id' ] != '') ? wp_get_attachment_url($visibility['media_selector_attachment_id']) : plugins_url( 'subiz_logo.png' , __FILE__ ); 164 echo ("<style type=\"text/css\"> 165 @import url('https://fonts.googleapis.com/css?family=Muli:300,400,700&subset=latin-ext,vietnamese'); 166 body{margin:0px; padding: 0px;font-family: 'Muli', sans-serif; font-weight: 400; font-size: 16px; color: #4a4a4a; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;} 167 *{box-sizing: border-box;} 168 .popup-subscribire{position: fixed; top: 30px; width:500px; left: 50%; margin-left:-250px; padding: 18px; border-radius: 3px; background: #FFF; box-shadow: 0px 0px 20px rgba(5,25,62, .15);z-index:100;display: block;} 169 .popup-logo{ display: inline-block; vertical-align: top; width:120px; margin-right:20px;} 170 .popup-logo img{max-width:100%;} 171 .popup-summary{display: inline-block; width:calc(100% - 120px - 25px); line-height: 21px;} 172 .popup-bottom{position: relative; width:100%; padding: 5px 0 0 0; text-align: right;} 173 .popup-bottom a{ display: inline-block;vertical-align: middle; margin:0 3px; height: 40px; line-height: 38px; padding: 0 25px; color: #1890ff; font-size: 16px; font-weight:500; text-transform: uppercase; text-decoration: none; border-radius: 3px;} 174 .popup-bottom a.ok{ color: #FFF; background-color: #1890ff;} 175 </style> 176 177 <div class=\"popup-subscribire\"> 178 <div class=\"popup-logo\"><img src=\"". $image."\"></div> 179 <div class=\"popup-summary\">".$subiz_notify_text."</div> 180 <div class=\"popup-bottom\"> 181 <a href=\"#\" onclick=\"closePopUp();\">".__('No, thanks', 'subiz')."</a> 182 <a href=\"#\" class=\"ok\" onclick=\"subiz('subscribePushNotification');closePopUp()\">".__('Agree', 'subiz')."</a> 183 </div> 184 </div> 185 186 <script type=\"text/javascript\"> 187 function closePopUp(e) { 188 document.querySelector('.popup-subscribire').style.display = 'none' 189 if ( typeof(Storage) !== 'undefined') { 190 sessionStorage.setItem('closePopUp', 1); 191 } 192 }; 193 194 </script>"); 195 } elseif ($subiz_notify_setting == 's2') { 196 if($visibility['revert_default_r'] == "set"){ 197 if($visibility['subiz_noti_button_default_r']){ 198 $image2 = $visibility['subiz_noti_button_default_r']; 199 }else{ 200 $image2 = plugins_url("../assets/buttons/right/default_1_".get_locale().".png" , __FILE__ ); 201 } 202 }else{ 203 if($visibility['image_attachment_id_2'] != ''){ 204 $image2 = wp_get_attachment_url($visibility['image_attachment_id_2']); 205 } 206 } 207 echo "<style type=\"text/css\"> 208 .popup-subscribire{position: fixed; top: 50%; right: 0px; z-index:100;display: block;} 209 210 </style> 211 212 <div class=\"popup-subscribire\"> 213 <a href=\"#\" class=\"ok\" onclick=\"subiz('subscribePushNotification');closePopUp()\"> 214 215 <img src=\"". $image2."\"></div> 216 </a> 217 </div> 218 </div>"; 219 220 } elseif ($subiz_notify_setting == 's3') { 221 if($visibility['revert_default_l'] == "set"){ 222 if($visibility['subiz_noti_button_default_l']){ 223 $image3 = $visibility['subiz_noti_button_default_l']; 224 }else{ 225 $image3 = plugins_url("../assets/buttons/left/default_1_".get_locale().".png" , __FILE__ ); 226 } 227 }else{ 228 if($visibility['image_attachment_id_3'] != ''){ 229 $image3 = wp_get_attachment_url($visibility['image_attachment_id_3']); 230 } 231 } 232 echo "<style type=\"text/css\"> 233 .popup-subscribire{position: fixed; top: 50%; left: 0px; z-index:100;display: block;} 234 235 </style> 236 237 <div class=\"popup-subscribire\"> 238 <a href=\"#\" class=\"ok\" onclick=\"subiz('subscribePushNotification');closePopUp()\"> 239 <img src=\"". $image3."\"></div> 240 </a> 241 </div> 242 </div>"; 243 244 } 245 if($visibility['subiz_widget_button']){ 246 if($visibility['subiz_widget_button_width'] == 60){ 247 echo "<script type=\"text/javascript\"> window.subiz('changeCss', '.button-chat{ border-radius: 0; -webkit-mask-image: url(".$visibility['subiz_widget_button']."); } .button-chat-icon{ display: none;} @supports (-ms-ime-align:auto) { .button-chat{border-radius:50%;} .button-chat-icon{ display: inline-block;} }') </script>"; 248 }else{ 249 echo "<script type=\"text/javascript\"> window.subiz('changeCss', '.button-chat-icon{display:none}@supports (-ms-ime-align:auto){.button-chat{border-radius:50%}.button-chat-icon{display:inline-block}}.widget-button{width:240px;height:146px}.button-chat{background-image:url(".$visibility['subiz_widget_button'].");background-repeat:no-repeat;-webkit-mask-image: none;border-radius:0!important;box-shadow: none;background-color: transparent !important;position: inherit;}.button-chat .avatar-preview img,.widget-button:after,.widget_mini .close-widget-icon{display:none}') </script>"; 250 } 251 }; 252 } 253 }} 254 255 if(class_exists('Subiz')){ 256 register_activation_hook(__FILE__, array('Subiz', 'activate')); 257 register_deactivation_hook(__FILE__, array('Subiz', 'deactivate')); 258 259 $subiz = new Subiz(); 260 261 262 add_action('wp_footer', array($subiz, 'sfw_insert_code')); 89 $subiz = new SubizPlugin(); 90 add_action('wp_footer', array($subiz, 'print_embed_code')); 263 91 }
Note: See TracChangeset
for help on using the changeset viewer.