Changeset 1745993
- Timestamp:
- 10/13/2017 11:34:49 AM (8 years ago)
- Location:
- chatx-ai
- Files:
-
- 130 added
- 7 edited
-
tags/0.1.7 (added)
-
tags/0.1.7/admin (added)
-
tags/0.1.7/admin/assets (added)
-
tags/0.1.7/admin/assets/css (added)
-
tags/0.1.7/admin/assets/css/chatx-ai-admin.css (added)
-
tags/0.1.7/admin/assets/img (added)
-
tags/0.1.7/admin/assets/img/chatxai-logo.svg (added)
-
tags/0.1.7/admin/assets/js (added)
-
tags/0.1.7/admin/assets/js/chatx-ai-admin.js (added)
-
tags/0.1.7/admin/assets/js/dashboard.js (added)
-
tags/0.1.7/admin/class-chatx-ai-admin.php (added)
-
tags/0.1.7/admin/controllers (added)
-
tags/0.1.7/admin/controllers/abstract.php (added)
-
tags/0.1.7/admin/controllers/dashboard.php (added)
-
tags/0.1.7/admin/controllers/settings.php (added)
-
tags/0.1.7/admin/dashboard-widgets (added)
-
tags/0.1.7/admin/dashboard-widgets/abstract.php (added)
-
tags/0.1.7/admin/dashboard-widgets/chart-abandoned-carts.php (added)
-
tags/0.1.7/admin/dashboard-widgets/chart-abstract.php (added)
-
tags/0.1.7/admin/dashboard-widgets/chart-recovered-carts.php (added)
-
tags/0.1.7/admin/dashboard-widgets/free-trial.php (added)
-
tags/0.1.7/admin/dashboard-widgets/payments.php (added)
-
tags/0.1.7/admin/index.php (added)
-
tags/0.1.7/admin/settings-tabs (added)
-
tags/0.1.7/admin/settings-tabs/abstract.php (added)
-
tags/0.1.7/admin/settings-tabs/billing.php (added)
-
tags/0.1.7/admin/settings-tabs/chatbot.php (added)
-
tags/0.1.7/admin/settings-tabs/general.php (added)
-
tags/0.1.7/admin/views (added)
-
tags/0.1.7/admin/views/cart-modal.php (added)
-
tags/0.1.7/admin/views/page-dashboard.php (added)
-
tags/0.1.7/admin/views/page-settings.php (added)
-
tags/0.1.7/admin/views/payments-table.php (added)
-
tags/0.1.7/admin/views/settings-form.php (added)
-
tags/0.1.7/chatx-ai.php (added)
-
tags/0.1.7/includes (added)
-
tags/0.1.7/includes/class-chatx-ai-activator.php (added)
-
tags/0.1.7/includes/class-chatx-ai-deactivator.php (added)
-
tags/0.1.7/includes/class-chatx-ai-i18n.php (added)
-
tags/0.1.7/includes/class-chatx-ai-loader.php (added)
-
tags/0.1.7/includes/class-chatx-ai-options.php (added)
-
tags/0.1.7/includes/class-chatx-ai-reports.php (added)
-
tags/0.1.7/includes/class-chatx-ai-rest-api.php (added)
-
tags/0.1.7/includes/class-chatx-ai.php (added)
-
tags/0.1.7/includes/index.php (added)
-
tags/0.1.7/includes/lib (added)
-
tags/0.1.7/includes/lib/clean.php (added)
-
tags/0.1.7/includes/lib/config.php (added)
-
tags/0.1.7/includes/lib/format.php (added)
-
tags/0.1.7/includes/lib/helpers.php (added)
-
tags/0.1.7/includes/lib/notices.php (added)
-
tags/0.1.7/includes/lib/wp-orm (added)
-
tags/0.1.7/includes/lib/wp-orm/.gitignore (added)
-
tags/0.1.7/includes/lib/wp-orm/LICENSE.md (added)
-
tags/0.1.7/includes/lib/wp-orm/README.md (added)
-
tags/0.1.7/includes/lib/wp-orm/composer.json (added)
-
tags/0.1.7/includes/lib/wp-orm/composer.lock (added)
-
tags/0.1.7/includes/lib/wp-orm/src (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Admin (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Admin/AdminHelper.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Admin/ListTable.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/BaseModel.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Model (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Model/Comment.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Model/Page.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Model/Post.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Model/User.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/ModelInterface.php (added)
-
tags/0.1.7/includes/lib/wp-orm/src/Query.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/autoload.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/ClassLoader.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/LICENSE (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/autoload_classmap.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/autoload_namespaces.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/autoload_psr4.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/autoload_real.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/autoload_static.php (added)
-
tags/0.1.7/includes/lib/wp-orm/vendor/composer/installed.json (added)
-
tags/0.1.7/includes/lib/wp-orm/views (added)
-
tags/0.1.7/includes/lib/wp-orm/views/list-table.php (added)
-
tags/0.1.7/includes/lib/wp-orm/wp-orm.php (added)
-
tags/0.1.7/includes/modules (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/abandoned-carts-manager.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/abandoned-carts-tracking.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/admin.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers/abstract.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers/carts.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers/guests.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers/restored-carts.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/controllers/tests.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/report-list-table.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/reports (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/reports/carts.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/reports/dev_carts.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/reports/guests.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/reports/restored-carts.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/views (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/admin/views/page-table-with-sidebar.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/autoload.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/lib (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/lib/models (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/lib/models/AbandonedCart.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/lib/models/RestoredCart.php (added)
-
tags/0.1.7/includes/modules/abandoned_carts_tracking/lib/order.php (added)
-
tags/0.1.7/includes/modules/session_tracker (added)
-
tags/0.1.7/includes/modules/session_tracker/autoload.php (added)
-
tags/0.1.7/includes/modules/session_tracker/lib (added)
-
tags/0.1.7/includes/modules/session_tracker/lib/models (added)
-
tags/0.1.7/includes/modules/session_tracker/lib/models/Guest.php (added)
-
tags/0.1.7/includes/modules/session_tracker/session-tracker.php (added)
-
tags/0.1.7/index.php (added)
-
tags/0.1.7/languages (added)
-
tags/0.1.7/languages/chatx-ai.pot (added)
-
tags/0.1.7/public (added)
-
tags/0.1.7/public/class-chatx-ai-public.php (added)
-
tags/0.1.7/public/css (added)
-
tags/0.1.7/public/css/chatx-ai-public.css (added)
-
tags/0.1.7/public/index.php (added)
-
tags/0.1.7/public/js (added)
-
tags/0.1.7/public/js/chatx-ai-public.js (added)
-
tags/0.1.7/public/partials (added)
-
tags/0.1.7/public/partials/checkbox-plugin.php (added)
-
tags/0.1.7/public/partials/send-to-messenger-plugin.php (added)
-
tags/0.1.7/readme.txt (added)
-
tags/0.1.7/uninstall.php (added)
-
trunk/chatx-ai.php (modified) (1 diff)
-
trunk/includes/class-chatx-ai-rest-api.php (modified) (1 diff)
-
trunk/public/class-chatx-ai-public.php (modified) (8 diffs)
-
trunk/public/css/chatx-ai-public.css (modified) (3 diffs)
-
trunk/public/js/chatx-ai-public.js (modified) (2 diffs)
-
trunk/public/partials/checkbox-plugin.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chatx-ai/trunk/chatx-ai.php
r1744693 r1745993 4 4 * Plugin URI: https://chatx.ai 5 5 * Description: Recover abandoned carts on WooCommerce using an intelligent Facebook Messenger chatbot. 6 * Version: 0.1. 66 * Version: 0.1.7 7 7 * Author: chatx.ai 8 8 * Author URI: https://chatx.ai -
chatx-ai/trunk/includes/class-chatx-ai-rest-api.php
r1744693 r1745993 350 350 'campaign' => isset($template['campaign']) ? $template['campaign'] : null, 351 351 'button-selector' => isset($template['button-selector']) ? $template['button-selector'] : null, 352 'parent-selector' => isset($template['parent-selector']) ? $template['parent-selector'] : null, 352 353 'type' => isset($template['type']) ? $template['type'] : null, 353 'bubble' => isset($template['bubble']) ? $template['bubble'] : null 354 'bubble' => isset($template['bubble']) ? $template['bubble'] : null, 355 'customcss' => isset($template['customcss']) ? $template['customcss'] : null 354 356 ]; 355 357 -
chatx-ai/trunk/public/class-chatx-ai-public.php
r1744693 r1745993 51 51 $this->api_key = Chatx_Ai_Options::read('chatxai_api_key'); 52 52 53 $this->enable_carts_traking = Chatx_Ai_Options::read('chatxai_enable_carts_tracking') == "yes";54 $this->login_checkbox_enable = Chatx_Ai_Options::read('chatxai_login_checkbox_enable') == "yes";55 $this->register_checkbox_enable = Chatx_Ai_Options::read('chatxai_register_checkbox_enable') == "yes";56 $this->addtocart_checkbox_enable = Chatx_Ai_Options::read('chatxai_enable_add_to_cart_tracking') == "yes";53 $this->enable_carts_traking = Chatx_Ai_Options::read('chatxai_enable_carts_tracking') == "yes"; 54 $this->login_checkbox_enable = Chatx_Ai_Options::read('chatxai_login_checkbox_enable') == "yes"; 55 $this->register_checkbox_enable = Chatx_Ai_Options::read('chatxai_register_checkbox_enable') == "yes"; 56 $this->addtocart_checkbox_enable = Chatx_Ai_Options::read('chatxai_enable_add_to_cart_tracking') == "yes"; 57 57 $this->addtocart_archive_checkbox_enable = Chatx_Ai_Options::read('chatxai_enable_add_to_cart_archive_tracking') == "yes"; 58 58 … … 116 116 'method' => 'POST', 117 117 'content' => http_build_query($data), 118 ) 118 ), 119 119 ); 120 120 $url = CHATX_BAESURL . '/' . $url; … … 140 140 { 141 141 $session_tracker = Session_Tracker_Instance(); 142 $session_key = $session_tracker->get_tracking_key();142 $session_key = $session_tracker->get_tracking_key(); 143 143 $user_identifier = 'checkbox--' . $campaign . '--' . $session_key . '--' . time(true) . '--' . rand(0, 9999); 144 144 … … 163 163 'type' => 'form', 164 164 'button-selector' => '', 165 'parent-selector' => '', 165 166 'template' => null, 166 'bubble' => '' 167 'bubble' => '', 168 'customcss' => '', 169 'id' => '' 167 170 ], $atts, 'messenger_checkbox'); 168 171 169 if ($atts['template']){172 if ($atts['template']) { 170 173 $checkbox_templates = Chatx_Ai_Options::read('chatxai_checkbox_templates', []); 171 174 … … 174 177 $template_id = isset($template['id']) ? $template['id'] : null; 175 178 176 if ($template_id == $atts['template']){179 if ($template_id == $atts['template']) { 177 180 $foundTemplate = $template; 178 181 } 179 182 } 180 183 181 if (!$foundTemplate){182 if ($atts['template'] == "default-add-to-cart-product-page"){183 $atts['campaign'] = "add_to_cart_form";184 if (!$foundTemplate) { 185 if ($atts['template'] == "default-add-to-cart-product-page") { 186 $atts['campaign'] = "add_to_cart_form"; 184 187 $checkbox_templates[] = [ 185 'id' => "default-add-to-cart-product-page",186 'campaign' => 'add_to_cart_form',187 'type' => $atts['type'],188 'id' => "default-add-to-cart-product-page", 189 'campaign' => 'add_to_cart_form', 190 'type' => $atts['type'], 188 191 'button-selector' => $atts['button-selector'], 189 'bubble' => '173 customers got amazing discounts by checking this.'192 'bubble' => '173 customers got amazing discounts by checking this.', 190 193 ]; 191 194 Chatx_Ai_Options::update('chatxai_checkbox_templates', $checkbox_templates); 192 } 193 else if($atts['template'] == "default-add-to-cart-loop"){ 194 $atts['campaign'] = "add_to_cart_form"; 195 } else if ($atts['template'] == "default-add-to-cart-loop") { 196 $atts['campaign'] = "add_to_cart_form"; 195 197 $checkbox_templates[] = [ 196 'id' => "default-add-to-cart-loop",197 'campaign' => 'add_to_cart_form',198 'type' => 'button',198 'id' => "default-add-to-cart-loop", 199 'campaign' => 'add_to_cart_form', 200 'type' => 'button', 199 201 'button-selector' => '.product a.add_to_cart_button,.product button.add_to_cart_button', 200 'bubble' => '173 customers got amazing discounts by checking this.'202 'bubble' => '173 customers got amazing discounts by checking this.', 201 203 ]; 202 204 Chatx_Ai_Options::update('chatxai_checkbox_templates', $checkbox_templates); 203 } 204 else{ 205 } else { 205 206 echo '<span style="color:red;">Invalid checkbox template!</span>'; 206 207 return; 207 208 } 208 } 209 else{210 $atts['campaign'] = isset($foundTemplate['campaign']) ? $foundTemplate['campaign'] : '';211 $atts['type'] = isset($foundTemplate['type']) ? $foundTemplate['type'] : '';209 } else { 210 $atts['id'] = isset($foundTemplate['id']) ? $foundTemplate['id'] : ''; 211 $atts['campaign'] = isset($foundTemplate['campaign']) ? $foundTemplate['campaign'] : ''; 212 $atts['type'] = isset($foundTemplate['type']) ? $foundTemplate['type'] : ''; 212 213 $atts['button-selector'] = isset($foundTemplate['button-selector']) ? $foundTemplate['button-selector'] : ''; 213 $atts['bubble'] = isset($foundTemplate['bubble']) ? $foundTemplate['bubble'] : '173 customers got amazing discounts by checking this.'; 214 $atts['parent-selector'] = isset($foundTemplate['parent-selector']) ? $foundTemplate['parent-selector'] : ''; 215 $atts['bubble'] = isset($foundTemplate['bubble']) ? $foundTemplate['bubble'] : '173 customers got amazing discounts by checking this.'; 216 $atts['customcss'] = isset($foundTemplate['customcss']) ? $foundTemplate['customcss'] : ''; 214 217 } 215 218 } … … 268 271 } 269 272 270 if (!function_exists('ChatXACT')){273 if (!function_exists('ChatXACT')) { 271 274 return; 272 275 } 273 276 274 277 $current_ac = ChatXACT()->get_current_abandoned_cart(); 275 if ($current_ac){278 if ($current_ac) { 276 279 return; 277 280 } … … 286 289 } 287 290 288 if (!function_exists('ChatXACT')){291 if (!function_exists('ChatXACT')) { 289 292 return; 290 293 } 291 294 292 295 $current_ac = ChatXACT()->get_current_abandoned_cart(); 293 if ($current_ac){296 if ($current_ac) { 294 297 return; 295 298 } … … 303 306 } 304 307 305 function action_upgrade_completed( $upgrader_object, $options ) { 306 if($options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'])){ 308 public function action_upgrade_completed($upgrader_object, $options) 309 { 310 if ($options['action'] == 'update' && $options['type'] == 'plugin' && isset($options['plugins'])) { 307 311 Chatx_Ai_Options::trigger_changes(); 308 312 } -
chatx-ai/trunk/public/css/chatx-ai-public.css
r1744693 r1745993 32 32 .chatx-speech-bubble { 33 33 position: absolute; 34 top: 65px;35 left: 0;36 z-index: 12 ;34 top: -7px; 35 left: 69px; 36 z-index: 123456734352; 37 37 margin: 0 auto; 38 38 padding: 10px; 39 width: 300px;39 width: 240px; 40 40 height: 65px; 41 41 border-radius: 5px; … … 51 51 background: #f9f9f9; 52 52 border-radius: 50%; 53 width: 30px;54 height: 30px;53 width: 24px; 54 height: 24px; 55 55 position: absolute; 56 right: - 10px;57 top: - 10px;56 right: -7px; 57 top: -7px; 58 58 border: solid 2px #717171; 59 font-size: 20px;59 font-size: 18px; 60 60 padding: 0; 61 61 outline: none; 62 line-height: 0px; 62 63 } 63 64 … … 83 84 border-left: solid 50px #fff; 84 85 border-top: solid 6px #717171; 85 top: 1px;86 left: 24px;86 top: 40px; 87 left: -15px; 87 88 width: 0; 88 89 height: 1em; 89 transform: rotate( 45deg) skewX(75deg);90 transform: rotate(0deg) skewX(75deg); 90 91 } 91 92 -
chatx-ai/trunk/public/js/chatx-ai-public.js
r1744693 r1745993 4 4 this.loadFB(); 5 5 this.initBubble(); 6 7 /*8 jQuery('[name="add-to-cart"]').on('mousemove', function(event) {9 var offset = jQuery(this).offset();10 11 var btnX = event.pageX - offset.left;12 var btnY = event.pageY - offset.top;13 14 ChatxAI.canClick = true;15 16 jQuery('.chatx-checkbox-plugin').css({17 position: "fixed",18 opacity: "0.4",19 left: (event.pageX) + "px",20 top: (event.pageY) + "px",21 height: "12px",22 width: "12px",23 overflow: "hidden"24 });25 26 jQuery("html").css("cursor", "pointer");27 28 jQuery('.chatx-checkbox-plugin .fb-messenger-checkbox').css({29 position: "relative",30 top: "-18px",31 left: "-15px"32 })33 });34 */35 6 }, 36 7 cookies: { … … 71 42 jQuery('.chatx-checkbox-plugin').each(function(index, el) { 72 43 fb_app_id = jQuery(el).data('messenger_app_id'); 44 45 var parentSelector = jQuery(el).data('parent-selector'); 46 if(parentSelector && jQuery(parentSelector).length){ 47 jQuery(el).closest('.chatx-checkbox-plugin-container').appendTo(parentSelector); 48 } 49 73 50 ChatxAI.initCheckboxPlugin(index, jQuery(el)); 74 51 }); -
chatx-ai/trunk/public/partials/checkbox-plugin.php
r1744693 r1745993 2 2 <div class="chatx-checkbox-plugin-container"> 3 3 <div 4 class="chatx-checkbox-plugin "4 class="chatx-checkbox-plugin chatx-checkbox-plugin-<?php echo isset($atts['id']) && $atts['id'] ? $atts['id'] : 'defaultid'; ?>" 5 5 data-type="<?php echo $atts['type']; ?>" 6 6 data-button-selector="<?php echo $atts['button-selector']; ?>" 7 data-parent-selector="<?php echo $atts['parent-selector']; ?>" 7 8 data-messenger_app_id="<?php echo $mess_app_id; ?>" 8 9 data-page_id="<?php echo $page_id; ?>" … … 15 16 </div> 16 17 18 <?php if(isset($atts['customcss']) && $atts['customcss']): ?> 19 <style> 20 <?php echo $atts['customcss']; ?> 21 </style> 22 <?php endif; ?> 23 17 24 <span class="chatx-circle-mark"></span> 25 18 26 </div> 19 27 </div> -
chatx-ai/trunk/readme.txt
r1744693 r1745993 3 3 Tags: abandoned cart, recover abandoned cart, woocommerce, chatbot, facebook messenger 4 4 Tested up to: 4.8.2 5 Stable tag: 0.1. 65 Stable tag: 0.1.7 6 6 Requires at least: 3.0 7 7 … … 38 38 39 39 == Changelog == 40 = 0.1.7 = 41 * Fixed the tooltip to look better on mobile. 42 * Added an option to modify the position of the checkbox in your website. 43 40 44 = 0.1.6 = 41 45 * Added a quick fix for the checkbox not being checked by default.
Note: See TracChangeset
for help on using the changeset viewer.