Changeset 1970919
- Timestamp:
- 11/08/2018 12:39:32 PM (7 years ago)
- Location:
- ghostmonitor
- Files:
-
- 78 added
- 6 edited
-
tags/1.12.0 (added)
-
tags/1.12.0/assets (added)
-
tags/1.12.0/assets/js (added)
-
tags/1.12.0/assets/js/ghostmonitor_messenger_widget.js (added)
-
tags/1.12.0/assets/js/ghostmonitor_push.js (added)
-
tags/1.12.0/config.json (added)
-
tags/1.12.0/includes (added)
-
tags/1.12.0/includes/class-wc-ghostmonitor-api.php (added)
-
tags/1.12.0/includes/class-wc-ghostmonitor.php (added)
-
tags/1.12.0/includes/ghostmonitor_api (added)
-
tags/1.12.0/includes/ghostmonitor_api/ghost-api.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/controller (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/controller/class-base-controller.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/controller/class-stat-controller.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/model (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/model/class-order-model.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils/request (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils/request/class-request-interface.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils/request/class-request.php (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils/response (added)
-
tags/1.12.0/includes/ghostmonitor_api/src/utils/response/class-response.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/autoload.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/ClassLoader.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/LICENSE (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/autoload_classmap.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/autoload_files.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/autoload_namespaces.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/autoload_psr4.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/autoload_real.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/composer/installed.json (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/.gitignore (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/.travis.yml (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/LICENSE (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/README.md (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/bin (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/bin/generate_method_docs.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/composer.json (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/Assertion.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/AssertionChain.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/AssertionFailedException.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/InvalidArgumentException.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/LazyAssertion.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/LazyAssertionException.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/lib/Assert/functions.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/phpunit.xml.dist (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/Assert (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/Assert/Tests (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/Assert/Tests/AssertTest.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/Assert/Tests/AssertionChainTest.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/Assert/Tests/LazyAssertionTest.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/assert/tests/bootstrap.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper/.gitignore (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper/composer.json (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper/ghostmonitor (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper/ghostmonitor/Helper.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/helper/ghostmonitor/Logger.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/.gitignore (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/.travis.yml (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/LeLogger.php (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/README.md (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/composer.json (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/phpunit.xml (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/unit_tests (added)
-
tags/1.12.0/includes/ghostmonitor_helper/vendor/ghostmonitor/logentries/unit_tests/LeLoggerTests.php (added)
-
tags/1.12.0/readme.txt (added)
-
tags/1.12.0/woocommerce-ghostmonitor.php (added)
-
trunk/config.json (modified) (1 diff)
-
trunk/includes/class-wc-ghostmonitor.php (modified) (7 diffs)
-
trunk/includes/ghostmonitor_helper/vendor/autoload.php (modified) (1 diff)
-
trunk/includes/ghostmonitor_helper/vendor/composer/autoload_real.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/woocommerce-ghostmonitor.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ghostmonitor/trunk/config.json
r1944763 r1970919 4 4 "settingsUrl": "https://api.recart.com/tracking/v2/settings/", 5 5 "cdnUrl": "https://cdn.ghostmonitor.com", 6 "version": "v1.1 1.0",6 "version": "v1.12.0", 7 7 "logentriesToken": "d3695c56-67af-4c86-8c7d-26c6c252987b", 8 8 "env": "production" -
ghostmonitor/trunk/includes/class-wc-ghostmonitor.php
r1944763 r1970919 74 74 // Add content below add to cart button on single product page 75 75 add_action('woocommerce_after_add_to_cart_button', array($this, 'output_messenger_widget_html')); 76 77 //Apply discount code based on URL pattern /discount/discountcode 78 add_action('wp_loaded', array($this, 'attempt_apply_saved_discount_code')); 79 add_action('wp_loaded', array($this, 'handle_url_discount_code')); 76 80 77 81 // wc-ajax is only available from WC 2.4 … … 253 257 } 254 258 255 $cart_url = $woocommerce->cart->get_checkout_url();259 $cart_url = wc_get_checkout_url(); 256 260 257 261 unset($_GET['gm_cart']); … … 372 376 $product = $product->get_product($i['variation_id'] == '0' ? $i['product_id'] : $i['variation_id']); 373 377 374 $thumb_id = get_post_thumbnail_id($product-> post->ID);378 $thumb_id = get_post_thumbnail_id($product->get_id()); 375 379 $thumb_url = wp_get_attachment_image_src($thumb_id, 'shop_thumbnail', true); 376 380 … … 447 451 448 452 if ($_product && $_product->exists() && $cart_item_data['quantity'] > 0) { 449 $thumb_id = get_post_thumbnail_id($_product-> post->ID);453 $thumb_id = get_post_thumbnail_id($_product->get_id()); 450 454 $thumb_url = wp_get_attachment_image_src($thumb_id, 'shop_thumbnail', true); 451 455 … … 475 479 } 476 480 477 $gm_cart_item['productId'] = $_product-> post->ID. '-' . $variation_data['variation_id'];481 $gm_cart_item['productId'] = $_product-> get_id() . '-' . $variation_data['variation_id']; 478 482 $gm_cart_item['productAttributeId'] = $variation_data; 479 483 } else { 480 $gm_cart_item['productId'] = $_product-> post->ID;484 $gm_cart_item['productId'] = $_product-> get_id(); 481 485 } 482 486 } … … 485 489 } 486 490 487 $return_url = add_query_arg('gm_cart', $gm_session_id, WC()->cart->get_checkout_url());491 $return_url = add_query_arg('gm_cart', $gm_session_id, wc_get_checkout_url()); 488 492 $setCartData = array( 489 493 'returnUrl' => $return_url, … … 684 688 return $default; 685 689 } 690 691 public function handle_url_discount_code() { 692 preg_match("/\/discount\/(\w+)/", $_SERVER['REQUEST_URI'], $url_subitems); 693 694 // Only proceed if url matched /discount/somediscountcode 695 if (count($url_subitems) < 1) return; 696 if (!isset($url_subitems[1])) return; 697 698 $discount_code = $url_subitems[1]; 699 700 if (!WC()->cart->is_empty() && !WC()->cart->has_discount($discount_code)) { 701 WC()->cart->add_discount($discount_code); 702 } else { 703 setcookie("recart_saved_discount_code", $discount_code, time() + (86400 * 7), "/"); 704 } 705 706 $this->handle_redirect_parameter(); 707 } 708 709 private function handle_redirect_parameter() { 710 $requested_url = $_SERVER['REQUEST_URI']; 711 $discount_code_pattern_in_url; 712 $redirection_pattern_in_url; 713 preg_match("/\/discount\/\w+/", $requested_url , $discount_code_pattern_in_url); 714 preg_match("/\?redirect=/", $requested_url , $redirection_pattern_in_url); 715 if (empty($discount_code_pattern_in_url) && empty($redirection_pattern_in_url)) { 716 return; 717 } 718 $redirect_url = $requested_url; 719 if (isset($discount_code_pattern_in_url[0])) { 720 $redirect_url = str_replace($discount_code_pattern_in_url[0],'', $redirect_url); 721 } 722 if (isset($redirection_pattern_in_url[0])) { 723 $replace_char = '/'; 724 if (strpos($redirect_url, '=/') !== false) { 725 $replace_char = ''; 726 } 727 $redirect_url = str_replace($redirection_pattern_in_url[0], $replace_char, $redirect_url); 728 } 729 if (empty($redirect_url)) { 730 $redirect_url = '/'; 731 } 732 $this->redirect_client_to_url($redirect_url); 733 } 734 735 function attempt_apply_saved_discount_code() { 736 // Can apply discount code only if cart exists & not empty 737 if (is_null(WC()->cart) || WC()->cart->is_empty()) return; 738 739 if (key_exists("recart_saved_discount_code", $_COOKIE)) { 740 $discount_code_in_cookie = $_COOKIE["recart_saved_discount_code"]; 741 if (!empty($discount_code_in_cookie)) { 742 if (! WC()->cart->has_discount($discount_code_in_cookie)) { 743 WC()->cart->add_discount($discount_code_in_cookie); 744 setcookie("recart_saved_discount_code", "", time() - 3600); 745 } 746 } 747 } 748 } 749 750 function redirect_client_to_url($redirect_url) { 751 echo '<script type="text/javascript">' . 752 'window.location.replace("' . $redirect_url . '");' . 753 '</script>'; 754 } 686 755 } -
ghostmonitor/trunk/includes/ghostmonitor_helper/vendor/autoload.php
r1944763 r1970919 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 9a6560dde374de692410468a5a9cbbff::getLoader();7 return ComposerAutoloaderInitf967499b5214ba75f256ccf0ec9738a3::getLoader(); -
ghostmonitor/trunk/includes/ghostmonitor_helper/vendor/composer/autoload_real.php
r1944763 r1970919 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 9a6560dde374de692410468a5a9cbbff5 class ComposerAutoloaderInitf967499b5214ba75f256ccf0ec9738a3 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 9a6560dde374de692410468a5a9cbbff', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInitf967499b5214ba75f256ccf0ec9738a3', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 9a6560dde374de692410468a5a9cbbff', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInitf967499b5214ba75f256ccf0ec9738a3', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 43 43 $includeFiles = require __DIR__ . '/autoload_files.php'; 44 44 foreach ($includeFiles as $fileIdentifier => $file) { 45 composerRequire 9a6560dde374de692410468a5a9cbbff($fileIdentifier, $file);45 composerRequiref967499b5214ba75f256ccf0ec9738a3($fileIdentifier, $file); 46 46 } 47 47 … … 50 50 } 51 51 52 function composerRequire 9a6560dde374de692410468a5a9cbbff($fileIdentifier, $file)52 function composerRequiref967499b5214ba75f256ccf0ec9738a3($fileIdentifier, $file) 53 53 { 54 54 if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { -
ghostmonitor/trunk/readme.txt
r1944763 r1970919 3 3 Tags: recart, add to cart popup, atc popup, push notification, cart abandonment, cart recovery, cart abandonment campaign, cart recovery campaign, shopping cart abandonment, shopping cart recovery, shopping cart abandonment campaign, cart abandonment email, cart recovery email, cart abandonment emails, cart recovery emails, abandon, bounce rate, conversion optimization, grow, revenue grow, abandon cart, abandoned cart, shopping cart abandonment, woocommerce cart abandon, woocommerce cart abandonment, woocommerce cart recovery, woocommerce cart abandonment emails, cart recovery emails, cart abandonment emails, woocommerce cart abandonment solution, wordpress cart abandonment, wordpress cart recovery, wordpress cart recovery emails, cart abandonment, cart recovery, make money from cart recovery, push notifications, popup, add to cart, autofill, email capture, subscriber capture, login capture, subscription, subscription tracking, add cart popup, woocommerce popup, checkout autofill, checkout auto fill, 4 4 Requires at least: 3.9 5 Tested up to: 4. 8.36 Stable tag: 1.1 1.05 Tested up to: 4.9.8 6 Stable tag: 1.12.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 264 264 265 265 = 1.10.0 = 266 * Added Messenger wdiget266 * Added Facebook Messenger features 267 267 268 268 = 1.9.2 = 269 * Query var hotfix269 * Minor changes and fixes 270 270 271 271 = 1.9.1 = 272 * recart_info notice fix272 * Minor changes and fixes 273 273 274 274 = 1.9.0 = 275 * Add diagnostic endpoint275 * Minor changes and fixes 276 276 277 277 = 1.8.2 = 278 * Minor fixes278 * Minor changes and fixes 279 279 280 280 = 1.8.1 = 281 * JSON escape fix281 * Minor changes and fixes 282 282 283 283 = 1.8.0 = 284 * Compatibility update: WordPress 4.6.1,WooCommerce 2.6.4284 * Improved support for WordPress 4.6.1 and WooCommerce 2.6.4 285 285 286 286 = 1.7.0 = 287 * WooCommerce 2.6 compatibility287 * Added support for WooCommerce version 2.6 288 288 289 289 = 1.6.4 = 290 * Shipping price fix290 * Minor changes and fixes 291 291 292 292 = 1.6.2 = 293 * HTML charcodes in product name fix293 * Minor changes and fixes 294 294 295 295 = 1.6.1 = 296 * WooCommerce compatibility fix296 * Minor changes and fixes 297 297 298 298 = 1.6.0 = 299 * Better performance 300 * Client side HTTP 301 * Security fix 299 * Minor changes and fixes 302 300 303 301 = 1.5.0 = 304 * Email first feature 305 * Logging changes 306 * Minor fixes 302 * Minor changes and fixes 307 303 308 304 = 1.4.0 = 309 * Better support for payment gateways305 * Improved payment gateways support 310 306 311 307 = 1.3.0 = 312 * Loggingfixes308 * Minor changes and fixes 313 309 314 310 = 1.2.1 = 315 * Compatibility fix311 * Minor changes and fixes 316 312 317 313 = 1.2.0 = 318 * Logging314 * Minor changes and fixes 319 315 320 316 = 1.1.2 = 321 * Cookie fix317 * Minor changes and fixes 322 318 323 319 = 1.1.1 = 324 * Request fix320 * Minor changes and fixes 325 321 326 322 = 1.1.0 = 327 * Faster API323 * API speed improvements 328 324 329 325 = 1.0.2 = … … 334 330 335 331 = 0.2.0 = 336 * U i changes332 * UI updates 337 333 338 334 = 0.1.4 = … … 349 345 350 346 = 0.1.0 = 351 * Fist stable version347 * Welcome to the Recart WooCommerce Plugin. To start using Recart on your WooCommerce store, please create an account on recart.com and install this plugin. -
ghostmonitor/trunk/woocommerce-ghostmonitor.php
r1944763 r1970919 6 6 * Author: Ghostmonitor INC 7 7 * Author URI: http://www.recart.com 8 * Version: v1.1 1.08 * Version: v1.12.0 9 9 */ 10 10 … … 44 44 global $wp_version; 45 45 46 $version = 'v1.1 1.0';46 $version = 'v1.12.0'; 47 47 48 48 $discount_enabled = get_option('woocommerce_enable_coupons') === 'yes' ? 'true' : 'false';
Note: See TracChangeset
for help on using the changeset viewer.