Plugin Directory

Changeset 2272741


Ignore:
Timestamp:
04/01/2020 10:48:32 AM (6 years ago)
Author:
humcommerce
Message:

Removed dependency on WooCommerce and Changed Readme

Location:
humcommerce
Files:
25 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • humcommerce/trunk/README.txt

    r2270695 r2272741  
    55Tested up to: 5.3.1
    66Requires PHP: 5.2.4
    7 Stable tag: 2.1.14
     7Stable tag: 2.1.15
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    143143== Changelog ==
    144144
     145Ver 2.1.15 (1 Apr 2020)
     146* Fix : Removed dependency on woocommerce from the plugin.
     147
    145148Ver 2.1.14 (27 Mar 2020)
    146149* Fix : Removed e-commerce integration.
  • humcommerce/trunk/humcommerce-functions.php

    r2270638 r2272741  
    1111{
    1212    $options = get_option('humcommerce_options');
    13     echo " <!-- HumDash -->
     13    echo " <!-- HumCommerce Tracking code -->
    1414                <script type=\"text/javascript\">
    1515                  var _ha = _ha || []; " . get_option("humcommerce_add_to_cart") . "" . get_option("humcommerce_track_order") . "" . get_option("humcommerce_product_view") . "" . get_option("humcommerce_category_view") . "
     
    2323                </script>
    2424                <script type=\"text/javascript\" src=\"//app.humcommerce.com/humdash.js\"></script>
    25            <!-- End HumDash Code -->";
     25           <!-- End HumCommerce Tracking code -->";
    2626    delete_option('humcommerce_add_to_cart');
    2727    delete_option('humcommerce_track_order');
  • humcommerce/trunk/humcommerce.php

    r2217514 r2272741  
    1616 * Plugin URI:        https://wordpress.org/plugins/humcommerce/
    1717 * Description:       HumCommerce WordPress plugin to Record, Analyze & Convert your visitors.
    18  * Version:           2.1.13
     18 * Version:           2.1.15
    1919 * Author:            HumCommerce
    2020 * Author URI:        https://www.humcommerce.com
     
    2929}
    3030
    31 define( 'HUMCOMMERCE_VERSION', '2.1.13' );
     31define( 'HUMCOMMERCE_VERSION', '2.1.15' );
    3232define( 'HUMCOMMERCE_HOST', 'app.humcommerce.com' );
    3333
  • humcommerce/trunk/includes/class-humcommerce.php

    r2270638 r2272741  
    104104        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-humcommerce-settings.php';
    105105
    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 
    112106        $this->loader = new Humcommerce_Loader();
    113107
  • humcommerce/trunk/public/class-humcommerce-public.php

    r2270638 r2272741  
    5757        $this->humcommerce_custom = $humcommerce;
    5858        $this->version            = $version;
    59         $this->tracker            = $this->get_tracker();
    6059
    6160    }
     
    118117        $set_user_id        = null;
    119118        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             }
    140119
    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 ) ) {
    150121            if ( array_key_exists( 'host', $options ) && ! empty( $options['host'] ) ) {
    151122                $host_url = $options['host'];
    152             } else {
    153                 $host_url = HUMCOMMERCE_HOST;
    154             }
     123           } else {
     124                $host_url = HUMCOMMERCE_HOST;
     125            }
    155126
    156127            if ( is_user_logged_in() && array_key_exists( 'set-user-id', $options ) ) {
     
    159130            }
    160131        }
    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 -->
    164134                <script type="text/javascript">
    165                   var _ha = _ha || [];' . $set_ecommerce_view . '
     135                  var _ha = _ha || [];
    166136                  ' . $set_user_id . '
    167137                  _ha.push(["trackPageView"]);
     
    169139                  (function() {
    170140                    var u="https://' . esc_js( $host_url ) . '/";
    171                     _ha.push(["setTrackerUrl", u+"humdash.php"]);
     141                     _ha.push([\'setTrackerUrl\', u+\'humdash.php\']);
    172142                    _ha.push(["setSiteId", "' . esc_js( $options['si'] ) . '"]);
    173143                    var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0];
     
    175145                  })();
    176146                </script>
    177            <!-- End HumDash Code -->';  // phpcs:ignore
     147           <!-- End of HumCommerce Code -->';// phpcs:ignore
     148
    178149        }
    179150    }
    180151
    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
    191153}
Note: See TracChangeset for help on using the changeset viewer.