Plugin Directory

Changeset 2215875


Ignore:
Timestamp:
12/20/2019 05:54:32 PM (6 years ago)
Author:
oometrics
Message:

v.1.0.5 fixed

Location:
oometrics/trunk/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • oometrics/trunk/inc/activity-class.php

    r2215856 r2215875  
    126126    {
    127127        // echo $this->table.'ssssss';
    128         if($settings['main_user'] != $this->act_uid){
     128        if($settings['main_user'] != get_current_user_id()){
    129129            global $wpdb;
    130130            $wpdb->insert($this->table,$data);
  • oometrics/trunk/inc/session-class.php

    r2215856 r2215875  
    150150                    }
    151151                }
    152                 session_start();
    153152                $random_number = mt_rand(1111111,99999999);
    154153                $this->ses_hash = wp_hash($now.$random_number);
    155154                // $this->ses_hash = wp_get_session_token();
    156                 $_SESSION['oometrics_ses_id'] = $this->ses_hash;
    157 
    158155                if($this->db_exists()){
    159156                    $this->ses_hash = wp_hash($now.$random_number.'x'.$now);
    160                     $_SESSION['oometrics_ses_id'] = $this->ses_hash;
    161157                }
    162158                $this->add();
     
    249245        return false;
    250246    }
    251    
     247
    252248    // check if a session is stored in database for cart manipulation at the begining
    253249    public function woo_session(){
    254         if ( null === WC()->session ) {
    255             $session_class = apply_filters( 'woocommerce_session_handler', 'WC_Session_Handler' );
    256             WC()->session = new $session_class();
    257             WC()->session->init();
    258             WC()->session->set_customer_session_cookie( true );
    259         } else {
    260             WC()->session->set_customer_session_cookie( true );
    261         }
    262     }
    263    
     250        WC()->session->set_customer_session_cookie( true );
     251    }
     252
    264253    public function add(){
    265254        $this->woo_session();
     
    428417                $wpdb->prepare(
    429418                    "DELETE FROM $this->table
    430                      WHERE ses_value <= '%d' && ses_date < '%d'",
    431                      array(0,$now - 20)
     419                     WHERE ses_value <= '%d' &&ses_uid != '%d' && ses_date < '%d'",
     420                     array(0,$settings['main_user'],$now - 30)
    432421                )
    433422            );
Note: See TracChangeset for help on using the changeset viewer.