Plugin Directory

Changeset 2587340


Ignore:
Timestamp:
08/23/2021 08:04:12 PM (5 years ago)
Author:
wpconcierges
Message:

fixed $curren key issue, added furture key checks, tested with woo 5.6.0 and wp 5.8

Location:
order-postback-woo/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • order-postback-woo/trunk/README.txt

    r2480338 r2587340  
    44Tags: affiliate pixel tracking, pixel tracking, woocommerce, order postback, affiliates
    55Requires at least: 3.1
    6 Tested up to: 5.6.2
    7 Stable tag: 1.0.7
     6Tested up to: 5.8
     7Stable tag: 1.0.8
    88Requires PHP: 5.6 or above
    99License: GPLv2 or later
     
    3636Taboola
    3737zapier webhooks
     38CAKE
     39MyLead
     40LemonAds
     41Affiliaxe
    3842image url callback
    39 CAKE
    4043Any affiliate network that supports image or server 2 server postback calls
    4144
     
    8184
    8285== Changelog ==
     86= 1.0.8 =
     87Tested upto WooCommerce 5.6.0 and WP 5.8
     88fixed special characters for $curren as a key
     89
    8390= 1.0.7 =
    8491fixed issue with incoming click id
  • order-postback-woo/trunk/includes/class-order-postback-woo.php

    r2480333 r2587340  
    7171            $this->version = ORDER_POSTBACK_WOO_VERSION;
    7272        } else {
    73             $this->version = '1.0.7';
     73            $this->version = '1.0.8';
    7474        }
    7575        $this->plugin_name = $this->order_postback_woo = 'order-postback-woo';
  • order-postback-woo/trunk/order-postback-woo.php

    r2480333 r2587340  
    1717 * Plugin URI:        https://www.wpconcierges.com/plugins/order_postback_woo/
    1818 * Description:       This plugin sends your order information from your Woocomerce store as a key/value pair to any url of your choice, using either a POST or GET.  This is useful if you would like to store your orders or process orders outside of your Woocommerce store.
    19  * Version:           1.0.7
     19 * Version:           1.0.8
    2020 * Author:            WpConcierges
    2121 * Author URI:        https://www.wpconcierges.com/
     
    2525 * Domain Path:       /languages
    2626 * WC requires at least: 3.0
    27  * WC tested up to: 5.0.0
     27 * WC tested up to: 5.6.0
    2828 */
    2929
     
    3838 * Rename this for your plugin and update it as you release new versions.
    3939 */
    40 define( 'ORDER_POSTBACK_WOO_VERSION', '1.0.7' );
     40define( 'ORDER_POSTBACK_WOO_VERSION', '1.0.8' );
    4141
    4242/**
  • order-postback-woo/trunk/public/class-order-postback-woo-public.php

    r2480333 r2587340  
    256256       
    257257     foreach($metas as $meta_key => $meta_value){           
     258
    258259               if(in_array($meta_value,$keys)){
    259260                 $params[$meta_key]=$this->order_values[$meta_value];
     
    291292   
    292293        foreach($links as $link){
    293        
    294                 $click_id = $this->get_postback_link($link,'opw_incoming_click_id');
     294                 $click_id = get_post_meta($link['ID'],'opw_incoming_click_id',true);
     295               
    295296               
    296297                if(isset($_GET[$click_id])){
     
    329330        $fields = array();
    330331       
    331         if(strlen($field_to_get)>0){
    332             $fields =$this->get_postback_link_field($link,$field_to_get);
    333         }else{
    334             $fields =$this->get_postback_link_fields($link);
    335         }
     332      $fields =$this->get_postback_link_fields($link);
     333       
    336334        return $fields;
    337335    }
    338336   
    339     private function get_postback_link_field($link,$field_to_get){
    340        $post_id = $link['ID'];
    341        $field = get_post_meta($link['ID'],$field_to_get,true);
    342      
    343         return $field;
    344     }
     337
    345338   
    346339     
     
    394387       
    395388    }
     389   
     390    private function build_query_string($params){
     391        $query="";
     392        $count=0;
     393        $specail_chars = array("currency");
     394       
     395        foreach($params as $key => $value){
     396            if($count==0){
     397                $query=$key."=".$value;
     398            }else{
     399                $and ="&";
     400                if(in_array($key,$specail_chars)){
     401                    $and="&";
     402                }
     403                $query.=$and.$key."=".$value;
     404            }
     405            $count++;
     406        }
     407        return $query;
     408    }
     409   
    396410
    397411    private function do_postback_woo()
    398     {       
     412    {     
     413         setlocale(LC_ALL, 'us_En');
    399414        $links = $this->get_all_links();
    400415      $response = array();
     
    405420        $opw = $this->get_postback_link($link);
    406421     
    407              $this->can_fire_check($opw);   
     422           $this->can_fire_check($opw);   
    408423           
    409              if($this->can_fire){
     424           if($this->can_fire){
    410425            $this->postback_url = $opw['opw_url'];
     426           
    411427           $this->postback_params = $this->get_postback_params($opw);
    412428         
    413          
     429         
     430           
    414431            $args = array();
    415432     
    416433            if($opw['opw_method'] == "get"){
    417434              if(strpos($this->postback_url,"?")>0){
    418                 $this->postback_url = $this->postback_url."&".http_build_query($this->postback_params);
     435                $this->postback_url = $this->postback_url."&".$this->build_query_string($this->postback_params);
    419436              }else{
    420                 $this->postback_url = $this->postback_url."?".http_build_query($this->postback_params);
     437                $this->postback_url = $this->postback_url."?".$this->build_query_string($this->postback_params);
    421438              }
    422439               
     
    428445             
    429446                }
    430           }
     447       }
    431448         
    432         }
     449    }
    433450     
    434451        return $response;   
Note: See TracChangeset for help on using the changeset viewer.