Plugin Directory

Changeset 3241679


Ignore:
Timestamp:
02/17/2025 08:28:41 AM (14 months ago)
Author:
usermaven
Message:

tagging version 1.1.6

Location:
usermaven
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • usermaven/tags/1.1.6/README.txt

    r3240213 r3241679  
    66Tested up to: 6.7.1
    77Requires PHP: 5.6
    8 Stable tag: 1.1.5
     8Stable tag: 1.1.6
    99License: Massachusetts Institute of Technology (MIT) license
    1010License URI: https://opensource.org/licenses/MIT
  • usermaven/tags/1.1.6/includes/class-usermaven-woocommerce.php

    r3240213 r3241679  
    8383        add_action('woocommerce_checkout_order_processed', function() {
    8484            // Clear abandonment tracking when order is completed
    85             WC()->session->set('checkout_started', false);
    86             WC()->session->set('last_activity', null);
     85            if (function_exists('WC') && WC() && WC()->session) {
     86                WC()->session->set('checkout_started', false);
     87                WC()->session->set('last_activity', null);
     88            }
    8789        });
    8890   
     
    516518     */
    517519    public function maybe_track_checkout_init() {
     520        // Check if WooCommerce and cart are available
     521        if (!function_exists('WC') || !WC() || !WC()->cart || !WC()->session) {
     522            return;
     523        }
     524
    518525        // Early exit conditions
    519526        if (WC()->cart->is_empty()) {
     
    545552            (function_exists('is_checkout') && is_checkout()) ||
    546553            // For custom checkout pages
    547             (has_shortcode(get_post()->post_content ?? '', 'woocommerce_checkout')) ||
     554            (is_object(get_post()) && has_shortcode(get_post()->post_content ?? '', 'woocommerce_checkout')) ||
    548555            // For AJAX checkout requests
    549556            (isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] === 'checkout')
     
    680687     */
    681688    public function reset_checkout_tracking() {
    682         WC()->session->set('usermaven_tracked_cart_hash', null);
    683         WC()->session->set('usermaven_last_checkout_track_time', null);
     689        if (function_exists('WC') && WC() && WC()->session) {
     690            WC()->session->set('usermaven_tracked_cart_hash', null);
     691            WC()->session->set('usermaven_last_checkout_track_time', null);
     692        }
    684693    }
    685694
     
    16441653     */
    16451654    public function track_cart_abandonment() {
     1655        if (!function_exists('WC') || !WC() || !WC()->cart || !WC()->session) {
     1656            return;
     1657        }
     1658
    16461659        $cart = WC()->cart;
    16471660        if (!$cart || $cart->is_empty()) {
     
    17611774        // Mark checkout start as activity
    17621775        add_action('woocommerce_before_checkout_form', function() {
    1763             WC()->session->set('checkout_started', true);
     1776            if (function_exists('WC') && WC() && WC()->session) {
     1777                WC()->session->set('checkout_started', true);
     1778            }
    17641779            $this->update_last_activity();
    17651780        });
  • usermaven/tags/1.1.6/includes/class-usermaven.php

    r3240213 r3241679  
    8181            $this->version = USERMAVEN_VERSION;
    8282        } else {
    83             $this->version = '1.1.5';
     83            $this->version = '1.1.6';
    8484        }
    8585        $this->plugin_name = 'usermaven';
  • usermaven/tags/1.1.6/usermaven.php

    r3240213 r3241679  
    1919 * Description:       The Easiest Website and Product Analytics Platform
    2020
    21  * Version:           1.1.5
     21 * Version:           1.1.6
    2222 * Author:            Usermaven
    2323 * Author URI:        https://usermaven.com/
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'USERMAVEN_VERSION', '1.1.5' );
     40define( 'USERMAVEN_VERSION', '1.1.6' );
    4141
    4242/**
  • usermaven/trunk/README.txt

    r3240213 r3241679  
    66Tested up to: 6.7.1
    77Requires PHP: 5.6
    8 Stable tag: 1.1.5
     8Stable tag: 1.1.6
    99License: Massachusetts Institute of Technology (MIT) license
    1010License URI: https://opensource.org/licenses/MIT
  • usermaven/trunk/includes/class-usermaven-woocommerce.php

    r3240213 r3241679  
    8383        add_action('woocommerce_checkout_order_processed', function() {
    8484            // Clear abandonment tracking when order is completed
    85             WC()->session->set('checkout_started', false);
    86             WC()->session->set('last_activity', null);
     85            if (function_exists('WC') && WC() && WC()->session) {
     86                WC()->session->set('checkout_started', false);
     87                WC()->session->set('last_activity', null);
     88            }
    8789        });
    8890   
     
    516518     */
    517519    public function maybe_track_checkout_init() {
     520        // Check if WooCommerce and cart are available
     521        if (!function_exists('WC') || !WC() || !WC()->cart || !WC()->session) {
     522            return;
     523        }
     524
    518525        // Early exit conditions
    519526        if (WC()->cart->is_empty()) {
     
    545552            (function_exists('is_checkout') && is_checkout()) ||
    546553            // For custom checkout pages
    547             (has_shortcode(get_post()->post_content ?? '', 'woocommerce_checkout')) ||
     554            (is_object(get_post()) && has_shortcode(get_post()->post_content ?? '', 'woocommerce_checkout')) ||
    548555            // For AJAX checkout requests
    549556            (isset($_REQUEST['wc-ajax']) && $_REQUEST['wc-ajax'] === 'checkout')
     
    680687     */
    681688    public function reset_checkout_tracking() {
    682         WC()->session->set('usermaven_tracked_cart_hash', null);
    683         WC()->session->set('usermaven_last_checkout_track_time', null);
     689        if (function_exists('WC') && WC() && WC()->session) {
     690            WC()->session->set('usermaven_tracked_cart_hash', null);
     691            WC()->session->set('usermaven_last_checkout_track_time', null);
     692        }
    684693    }
    685694
     
    16441653     */
    16451654    public function track_cart_abandonment() {
     1655        if (!function_exists('WC') || !WC() || !WC()->cart || !WC()->session) {
     1656            return;
     1657        }
     1658
    16461659        $cart = WC()->cart;
    16471660        if (!$cart || $cart->is_empty()) {
     
    17611774        // Mark checkout start as activity
    17621775        add_action('woocommerce_before_checkout_form', function() {
    1763             WC()->session->set('checkout_started', true);
     1776            if (function_exists('WC') && WC() && WC()->session) {
     1777                WC()->session->set('checkout_started', true);
     1778            }
    17641779            $this->update_last_activity();
    17651780        });
  • usermaven/trunk/includes/class-usermaven.php

    r3240213 r3241679  
    8181            $this->version = USERMAVEN_VERSION;
    8282        } else {
    83             $this->version = '1.1.5';
     83            $this->version = '1.1.6';
    8484        }
    8585        $this->plugin_name = 'usermaven';
  • usermaven/trunk/usermaven.php

    r3240213 r3241679  
    1919 * Description:       The Easiest Website and Product Analytics Platform
    2020
    21  * Version:           1.1.5
     21 * Version:           1.1.6
    2222 * Author:            Usermaven
    2323 * Author URI:        https://usermaven.com/
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'USERMAVEN_VERSION', '1.1.5' );
     40define( 'USERMAVEN_VERSION', '1.1.6' );
    4141
    4242/**
Note: See TracChangeset for help on using the changeset viewer.