Changeset 2273701
- Timestamp:
- 04/02/2020 08:38:05 AM (6 years ago)
- Location:
- snappic
- Files:
-
- 1 added
- 10 edited
- 9 copied
-
tags/1.2 (added)
-
tags/1.2/Gruntfile.js (copied) (copied from snappic/trunk/Gruntfile.js)
-
tags/1.2/assets (copied) (copied from snappic/trunk/assets)
-
tags/1.2/class-snappic-pixel-display.php (copied) (copied from snappic/trunk/includes/class-snappic-pixel-display.php) (1 diff)
-
tags/1.2/includes (copied) (copied from snappic/trunk/includes)
-
tags/1.2/includes/class-snappic-api-controller.php (modified) (2 diffs)
-
tags/1.2/includes/class-snappic-pixel-display.php (modified) (1 diff)
-
tags/1.2/includes/class-snappic-pixel.php (modified) (5 diffs)
-
tags/1.2/languages (copied) (copied from snappic/trunk/languages)
-
tags/1.2/languages/snappic-for-woocommerce.pot (modified) (1 diff)
-
tags/1.2/package.json (copied) (copied from snappic/trunk/package.json)
-
tags/1.2/readme.md (copied) (copied from snappic/trunk/readme.md)
-
tags/1.2/readme.txt (copied) (copied from snappic/trunk/readme.txt) (2 diffs)
-
tags/1.2/snappic-for-woocommerce.php (copied) (copied from snappic/trunk/snappic-for-woocommerce.php) (2 diffs)
-
trunk/includes/class-snappic-api-controller.php (modified) (2 diffs)
-
trunk/includes/class-snappic-pixel-display.php (modified) (1 diff)
-
trunk/includes/class-snappic-pixel.php (modified) (5 diffs)
-
trunk/languages/snappic-for-woocommerce.pot (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/snappic-for-woocommerce.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
snappic/tags/1.2/class-snappic-pixel-display.php
r2271526 r2273701 148 148 149 149 // @Todo: do we need to SSL verify? Skipping for now 150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false) );150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false, 'timeout' => 10 ) ); 151 151 152 152 if( ! is_wp_error( $result ) ) { -
snappic/tags/1.2/includes/class-snappic-api-controller.php
r1874793 r2273701 34 34 ) ); 35 35 36 register_rest_route( $this->namespace, '/' . $this->rest_base . '/get_setting', array( 37 array( 38 'methods' => WP_REST_Server::READABLE, 39 'callback' => array( $this, 'get_setting' ), 40 'permission_callback' => array( $this, 'get_items_permissions_check' ), 41 'args' => $this->get_collection_params(), 42 ), 43 'schema' => array( $this, 'get_public_item_schema' ), 44 ) ); 45 46 register_rest_route( $this->namespace, '/' . $this->rest_base . '/set_setting', array( 47 array( 48 'methods' => WP_REST_Server::READABLE, 49 'callback' => array( $this, 'set_setting' ), 50 'permission_callback' => array( $this, 'get_items_permissions_check' ), 51 'args' => $this->get_collection_params(), 52 ), 53 'schema' => array( $this, 'get_public_item_schema' ), 54 ) ); 55 36 56 } 37 57 … … 56 76 57 77 return rest_ensure_response( $data ); 78 } 79 80 public function get_setting( $request ) { 81 return rest_ensure_response( 82 array($request['param'] => Snappic_Integration::instance()->get_option($request['param'])) 83 ); 84 } 85 86 public function set_setting( $request ) { 87 Snappic_Helper::get_instance()->update_options(array($request['param'] => $request['value'])); 88 89 return rest_ensure_response( array('success' => true) ); 58 90 } 59 91 -
snappic/tags/1.2/includes/class-snappic-pixel-display.php
r1715114 r2273701 148 148 149 149 // @Todo: do we need to SSL verify? Skipping for now 150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false) );150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false, 'timeout' => 10 ) ); 151 151 152 152 if( ! is_wp_error( $result ) ) { -
snappic/tags/1.2/includes/class-snappic-pixel.php
r1715114 r2273701 18 18 */ 19 19 public function pixel_base_code() { 20 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 21 return; 22 } 23 20 24 $params = self::add_version_info(); 21 25 … … 30 34 document,'script','https://connect.facebook.net/en_US/fbevents.js'); 31 35 %s 32 fbq('track ', 'PageView', %s);36 fbq('trackSingle', '%s', 'PageView', %s); 33 37 34 38 <!-- Support AJAX add to cart --> … … 55 59 ", 56 60 $this->pixel_init_code(), 61 $this->pixel_id, 57 62 json_encode($params, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT), 58 63 esc_js($this->pixel_id)); … … 63 68 * instead of Snappic_Pixel::build_event() 64 69 */ 65 public function inject_event($event_name, $params, $method='track') { 70 public function inject_event($event_name, $params, $method='trackSingle') { 71 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 72 return; 73 } 74 66 75 $code = self::build_event($event_name, $params, $method); 67 76 wc_enqueue_js($code); … … 72 81 * this method is available if you need to modify the JS code somehow 73 82 */ 74 public static function build_event($event_name, $params, $method='track') { 83 public static function build_event($event_name, $params, $method='trackSingle') { 84 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 85 return; 86 } 87 75 88 $params = self::add_version_info($params); 76 89 return sprintf( 77 90 "// WooCommerce Snappic Integration Event Tracking\n". 78 "fbq('%s', '%s', %s);",91 "fbq('%s', '%s', '%s', %s);", 79 92 $method, 93 Snappic_Integration::instance()->get_option('pixel_id'), 80 94 $event_name, 81 95 json_encode($params, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT)); -
snappic/tags/1.2/languages/snappic-for-woocommerce.pot
r1987816 r2273701 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Snappic for WooCommerce 1. 1.0\n"5 "Project-Id-Version: Snappic for WooCommerce 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/snappic-for-woocommerce\n" -
snappic/tags/1.2/readme.txt
r2271526 r2273701 5 5 Requires at least: 4.7 6 6 Tested up to: 5.0 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 47 47 == Changelog == 48 48 49 = 1.2 (2020-3-31) = 50 51 * Track pixel activity by `trackSingle` 52 * Skip pixel injection if needed 53 49 54 = 1.1 (2018-12-7) = 50 55 * Updated to the new API url -
snappic/tags/1.2/snappic-for-woocommerce.php
r2271526 r2273701 4 4 Plugin URI: https://wordpress.org/plugins/snappic-for-woocommerce/ 5 5 Description: Link your WooCommerce store to Snappic 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Snappic 8 8 Author URI: https://www.snappic.io … … 15 15 16 16 class Snappic_Base { 17 const VERSION = '1. 1.0';17 const VERSION = '1.2.0'; 18 18 const REQUIRED_WOO = '3.1.0'; 19 19 -
snappic/trunk/includes/class-snappic-api-controller.php
r1874793 r2273701 34 34 ) ); 35 35 36 register_rest_route( $this->namespace, '/' . $this->rest_base . '/get_setting', array( 37 array( 38 'methods' => WP_REST_Server::READABLE, 39 'callback' => array( $this, 'get_setting' ), 40 'permission_callback' => array( $this, 'get_items_permissions_check' ), 41 'args' => $this->get_collection_params(), 42 ), 43 'schema' => array( $this, 'get_public_item_schema' ), 44 ) ); 45 46 register_rest_route( $this->namespace, '/' . $this->rest_base . '/set_setting', array( 47 array( 48 'methods' => WP_REST_Server::READABLE, 49 'callback' => array( $this, 'set_setting' ), 50 'permission_callback' => array( $this, 'get_items_permissions_check' ), 51 'args' => $this->get_collection_params(), 52 ), 53 'schema' => array( $this, 'get_public_item_schema' ), 54 ) ); 55 36 56 } 37 57 … … 56 76 57 77 return rest_ensure_response( $data ); 78 } 79 80 public function get_setting( $request ) { 81 return rest_ensure_response( 82 array($request['param'] => Snappic_Integration::instance()->get_option($request['param'])) 83 ); 84 } 85 86 public function set_setting( $request ) { 87 Snappic_Helper::get_instance()->update_options(array($request['param'] => $request['value'])); 88 89 return rest_ensure_response( array('success' => true) ); 58 90 } 59 91 -
snappic/trunk/includes/class-snappic-pixel-display.php
r1715114 r2273701 148 148 149 149 // @Todo: do we need to SSL verify? Skipping for now 150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false) );150 $result = wp_safe_remote_get( $url, array( 'sslverify' => false, 'timeout' => 10 ) ); 151 151 152 152 if( ! is_wp_error( $result ) ) { -
snappic/trunk/includes/class-snappic-pixel.php
r1715114 r2273701 18 18 */ 19 19 public function pixel_base_code() { 20 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 21 return; 22 } 23 20 24 $params = self::add_version_info(); 21 25 … … 30 34 document,'script','https://connect.facebook.net/en_US/fbevents.js'); 31 35 %s 32 fbq('track ', 'PageView', %s);36 fbq('trackSingle', '%s', 'PageView', %s); 33 37 34 38 <!-- Support AJAX add to cart --> … … 55 59 ", 56 60 $this->pixel_init_code(), 61 $this->pixel_id, 57 62 json_encode($params, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT), 58 63 esc_js($this->pixel_id)); … … 63 68 * instead of Snappic_Pixel::build_event() 64 69 */ 65 public function inject_event($event_name, $params, $method='track') { 70 public function inject_event($event_name, $params, $method='trackSingle') { 71 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 72 return; 73 } 74 66 75 $code = self::build_event($event_name, $params, $method); 67 76 wc_enqueue_js($code); … … 72 81 * this method is available if you need to modify the JS code somehow 73 82 */ 74 public static function build_event($event_name, $params, $method='track') { 83 public static function build_event($event_name, $params, $method='trackSingle') { 84 if (Snappic_Integration::instance()->get_option('skip_pixel')) { 85 return; 86 } 87 75 88 $params = self::add_version_info($params); 76 89 return sprintf( 77 90 "// WooCommerce Snappic Integration Event Tracking\n". 78 "fbq('%s', '%s', %s);",91 "fbq('%s', '%s', '%s', %s);", 79 92 $method, 93 Snappic_Integration::instance()->get_option('pixel_id'), 80 94 $event_name, 81 95 json_encode($params, JSON_PRETTY_PRINT | JSON_FORCE_OBJECT)); -
snappic/trunk/languages/snappic-for-woocommerce.pot
r1987816 r2273701 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Snappic for WooCommerce 1. 1.0\n"5 "Project-Id-Version: Snappic for WooCommerce 1.2.0\n" 6 6 "Report-Msgid-Bugs-To: " 7 7 "https://wordpress.org/support/plugin/snappic-for-woocommerce\n" -
snappic/trunk/readme.txt
r1987816 r2273701 5 5 Requires at least: 4.7 6 6 Tested up to: 5.0 7 Stable tag: 1. 17 Stable tag: 1.2 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 47 47 == Changelog == 48 48 49 = 1.2 (2020-3-31) = 50 51 * Track pixel activity by `trackSingle` 52 * Skip pixel injection if needed 53 49 54 = 1.1 (2018-12-7) = 50 55 * Updated to the new API url -
snappic/trunk/snappic-for-woocommerce.php
r1987816 r2273701 4 4 Plugin URI: https://wordpress.org/plugins/snappic-for-woocommerce/ 5 5 Description: Link your WooCommerce store to Snappic 6 Version: 1. 1.06 Version: 1.2.0 7 7 Author: Snappic 8 8 Author URI: https://www.snappic.io … … 15 15 16 16 class Snappic_Base { 17 const VERSION = '1. 1.0';17 const VERSION = '1.2.0'; 18 18 const REQUIRED_WOO = '3.1.0'; 19 19
Note: See TracChangeset
for help on using the changeset viewer.