Changeset 2272741
- Timestamp:
- 04/01/2020 10:48:32 AM (6 years ago)
- Location:
- humcommerce
- Files:
-
- 25 added
- 3 deleted
- 5 edited
-
tags/2.1.15 (added)
-
tags/2.1.15/LICENSE.txt (added)
-
tags/2.1.15/README.txt (added)
-
tags/2.1.15/admin (added)
-
tags/2.1.15/admin/class-humcommerce-admin.php (added)
-
tags/2.1.15/admin/class-humcommerce-settings.php (added)
-
tags/2.1.15/admin/css (added)
-
tags/2.1.15/admin/css/humcommerce-admin.css (added)
-
tags/2.1.15/admin/images (added)
-
tags/2.1.15/admin/images/icon.png (added)
-
tags/2.1.15/admin/images/logo.png (added)
-
tags/2.1.15/admin/js (added)
-
tags/2.1.15/admin/js/humcommerce-admin.js (added)
-
tags/2.1.15/humcommerce-functions.php (added)
-
tags/2.1.15/humcommerce-settings.php (added)
-
tags/2.1.15/humcommerce.php (added)
-
tags/2.1.15/images (added)
-
tags/2.1.15/images/icon.png (added)
-
tags/2.1.15/images/logo.png (added)
-
tags/2.1.15/includes (added)
-
tags/2.1.15/includes/class-humcommerce-loader.php (added)
-
tags/2.1.15/includes/class-humcommerce.php (added)
-
tags/2.1.15/public (added)
-
tags/2.1.15/public/class-humcommerce-public.php (added)
-
tags/2.1.15/uninstall.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/humcommerce-functions.php (modified) (2 diffs)
-
trunk/humcommerce.php (modified) (2 diffs)
-
trunk/includes/class-humcommerce-helper.php (deleted)
-
trunk/includes/class-humcommerce-logger.php (deleted)
-
trunk/includes/class-humcommerce.php (modified) (1 diff)
-
trunk/libs (deleted)
-
trunk/public/class-humcommerce-public.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
humcommerce/trunk/README.txt
r2270695 r2272741 5 5 Tested up to: 5.3.1 6 6 Requires PHP: 5.2.4 7 Stable tag: 2.1.1 47 Stable tag: 2.1.15 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 143 143 == Changelog == 144 144 145 Ver 2.1.15 (1 Apr 2020) 146 * Fix : Removed dependency on woocommerce from the plugin. 147 145 148 Ver 2.1.14 (27 Mar 2020) 146 149 * Fix : Removed e-commerce integration. -
humcommerce/trunk/humcommerce-functions.php
r2270638 r2272741 11 11 { 12 12 $options = get_option('humcommerce_options'); 13 echo " <!-- Hum Dash-->13 echo " <!-- HumCommerce Tracking code --> 14 14 <script type=\"text/javascript\"> 15 15 var _ha = _ha || []; " . get_option("humcommerce_add_to_cart") . "" . get_option("humcommerce_track_order") . "" . get_option("humcommerce_product_view") . "" . get_option("humcommerce_category_view") . " … … 23 23 </script> 24 24 <script type=\"text/javascript\" src=\"//app.humcommerce.com/humdash.js\"></script> 25 <!-- End Hum Dash Code -->";25 <!-- End HumCommerce Tracking code -->"; 26 26 delete_option('humcommerce_add_to_cart'); 27 27 delete_option('humcommerce_track_order'); -
humcommerce/trunk/humcommerce.php
r2217514 r2272741 16 16 * Plugin URI: https://wordpress.org/plugins/humcommerce/ 17 17 * Description: HumCommerce WordPress plugin to Record, Analyze & Convert your visitors. 18 * Version: 2.1.1 318 * Version: 2.1.15 19 19 * Author: HumCommerce 20 20 * Author URI: https://www.humcommerce.com … … 29 29 } 30 30 31 define( 'HUMCOMMERCE_VERSION', '2.1.1 3' );31 define( 'HUMCOMMERCE_VERSION', '2.1.15' ); 32 32 define( 'HUMCOMMERCE_HOST', 'app.humcommerce.com' ); 33 33 -
humcommerce/trunk/includes/class-humcommerce.php
r2270638 r2272741 104 104 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-humcommerce-settings.php'; 105 105 106 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'libs/class-humdashtracker.php';107 108 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-humcommerce-logger.php';109 110 require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-humcommerce-helper.php';111 112 106 $this->loader = new Humcommerce_Loader(); 113 107 -
humcommerce/trunk/public/class-humcommerce-public.php
r2270638 r2272741 57 57 $this->humcommerce_custom = $humcommerce; 58 58 $this->version = $version; 59 $this->tracker = $this->get_tracker();60 59 61 60 } … … 118 117 $set_user_id = null; 119 118 include_once ABSPATH . 'wp-admin/includes/plugin.php'; 120 if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {121 if ( is_product() ) {122 $product = get_page_by_path( get_post()->post_name, OBJECT, 'product' );123 if ( ! empty( $product ) ) {124 $product = wc_get_product( $product );125 $category_terms = get_the_terms( $product->get_id(), 'product_cat' );126 $category_array = $this->get_categories_array( $category_terms );127 $product_sku = $product->get_sku();128 if ( empty( $product_sku ) ) {129 $product_name = $product->get_title();130 $product_id = $product->get_id();131 $product_sku = $product_name . $product_id;132 }133 $set_ecommerce_view = '_ha.push(["setEcommerceView",134 "' . $product_sku . '",135 "' . $product->get_title() . '",136 ' . $category_array . ',137 "' . $product->get_price() . '",])';138 }139 }140 119 141 if ( is_product_category() ) { 142 $set_ecommerce_view = '_ha.push(["setEcommerceView", 143 ' . false . ', 144 ' . false . ', 145 "' . single_cat_title( '', false ) . '",])'; 146 } 147 } 148 149 if ( is_array( $options ) ) { 120 if ( is_array( $options ) ) { 150 121 if ( array_key_exists( 'host', $options ) && ! empty( $options['host'] ) ) { 151 122 $host_url = $options['host']; 152 } else {153 $host_url = HUMCOMMERCE_HOST;154 }123 } else { 124 $host_url = HUMCOMMERCE_HOST; 125 } 155 126 156 127 if ( is_user_logged_in() && array_key_exists( 'set-user-id', $options ) ) { … … 159 130 } 160 131 } 161 162 if ( isset( $options['si'] ) && ! empty( $options['si'] ) ) { 163 echo ' <!-- HumDash --> 132 if ( isset( $options['si'] ) && ! empty( $options['si'] ) ) { 133 echo ' <!-- HumCommerce Tracking code --> 164 134 <script type="text/javascript"> 165 var _ha = _ha || []; ' . $set_ecommerce_view . '135 var _ha = _ha || []; 166 136 ' . $set_user_id . ' 167 137 _ha.push(["trackPageView"]); … … 169 139 (function() { 170 140 var u="https://' . esc_js( $host_url ) . '/"; 171 _ha.push(["setTrackerUrl", u+"humdash.php"]);141 _ha.push([\'setTrackerUrl\', u+\'humdash.php\']); 172 142 _ha.push(["setSiteId", "' . esc_js( $options['si'] ) . '"]); 173 143 var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; … … 175 145 })(); 176 146 </script> 177 <!-- End HumDash Code -->'; // phpcs:ignore 147 <!-- End of HumCommerce Code -->';// phpcs:ignore 148 178 149 } 179 150 } 180 151 181 /** 182 * To get HumDash Tracker object. 183 * 184 * @since 2.1.4 185 * @return HumDashTracker 186 */ 187 protected function get_tracker() { 188 $humcommerce_options = get_option( 'humcommerce_options' ); 189 return new HumDashTracker( isset( $humcommerce_options['si'] ) ? $humcommerce_options['si'] : 0, isset( $humcommerce_options['host'] ) ? 'https://' . $humcommerce_options['host'] : '' ); 190 } 152 191 153 }
Note: See TracChangeset
for help on using the changeset viewer.