Plugin Directory

Changeset 2862982


Ignore:
Timestamp:
02/10/2023 01:36:57 AM (3 years ago)
Author:
rafalautopilot
Message:

1.0.16

Location:
autopilot
Files:
49 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • autopilot/trunk/README.txt

    r2860530 r2862982  
    22Contributors: rafalautopilot
    33Tags: ortto, autopilot, woocommerce, email, marketing, tracking, analytics, conversion, ecommerce, e-commerce, commerce, popups, cdp, marketing automation
    4 Stable tag: 1.0.15
     4Stable tag: 1.0.16
    55Tested up to: 6.1
    66Requires at least: 5.0
     
    114114= 1.0.15 =
    115115* Fix cookie hash
     116
     117= 1.0.16 =
     118* Add multi region support
  • autopilot/trunk/admin/class-autopilot-admin.php

    r2711289 r2862982  
    9494        }
    9595
    96         // disable plugin for them to reconnect in order to update capture_js_url
    97         if ( empty( $this->options["capture_js_url"] ) ) {
     96        // disable plugin for them to reconnect in order to update configuration
     97        if ( empty( $this->options["capture_js_url"] ) || empty( $this->options["capture_api_url"] ) ) {
    9898            $this->options["tracking_key"] = "";
    9999            update_option( self::OPTION_NAME, $this->options, true );
     
    102102        $this->is_wc = in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) );
    103103
    104         $code           = $_GET['code'] ?? "";
    105         $uid            = $_GET['uid'] ?? "";
    106         $instance       = $_GET['instance'] ?? "";
    107         $company_name   = $_GET['company_name'] ?? "";
    108         $capture_js_url = $_GET['capture_js_url'] ?? "";
     104        $code               = $_GET['code'] ?? "";
     105        $uid                = $_GET['uid'] ?? "";
     106        $instance           = $_GET['instance'] ?? "";
     107        $company_name       = $_GET['company_name'] ?? "";
     108        $capture_api_url    = $_GET['capture_api_url'] ?? "";
     109        $capture_js_url     = $_GET['capture_js_url'] ?? "";
    109110        $woocommerce_js_url = $_GET['woocommerce_js_url'] ?? "";
    110111
    111         if ( $code != "" && $this->options['code'] == $code && $uid != "" && $instance != "" && $company_name != "" && $capture_js_url != "" && $woocommerce_js_url != "" ) {
     112        if ( $code != "" && $this->options['code'] == $code && $uid != "" && $instance != "" && $company_name != "" && $capture_api_url != "" && $capture_js_url != "" && $woocommerce_js_url != "" ) {
    112113            $this->options["tracking_key"]       = $uid;
    113114            $this->options["instance"]           = $instance;
    114115            $this->options["company_name"]       = $company_name;
     116            $this->options["capture_api_url"]    = $capture_api_url;
    115117            $this->options["capture_js_url"]     = $capture_js_url;
    116118            $this->options["woocommerce_js_url"] = $woocommerce_js_url;
     
    330332            $sanitary_values['tracking_key'] = sanitize_text_field( $input['tracking_key'] );
    331333        }
     334        if ( isset( $input['capture_api_url'] ) ) {
     335            $sanitary_values['capture_api_url'] = sanitize_text_field( $input['capture_api_url'] );
     336        }
    332337        if ( isset( $input['capture_js_url'] ) ) {
    333338            $sanitary_values['capture_js_url'] = sanitize_text_field( $input['capture_js_url'] );
  • autopilot/trunk/autopilot.php

    r2860530 r2862982  
    99 * Plugin URI:        https://wordpress.org/plugins/autopilot
    1010 * Description:       Customer data and marketing automation platform.
    11  * Version:           1.0.15
     11 * Version:           1.0.16
    1212 * Author:            Ortto
    1313 * Author URI:        https://ortto.app
  • autopilot/trunk/public/class-autopilot-public.php

    r2860530 r2862982  
    129129                $this->options["woocommerce_js_url"] = self::WOOCOMMERCE_SCRIPT_URL;
    130130            }
     131            if ( empty( $this->options["capture_api_url"] ) ) {
     132                $this->options["capture_api_url"] = self::API_URL;
     133            }
    131134
    132135            $ap3Options = [
    133136                              "customer" => $this->customer_to_array(),
    134                               "api_url"  => self::API_URL,
     137                              "api_url"  => $this->options["capture_api_url"],
    135138                          ] + $this->options;
    136139
     
    233236        $context = stream_context_create( $options );
    234237        if ( isset( $customer['email'] ) || $_COOKIE['ap3c'] ) {
    235             file_get_contents( self::API_URL . self::WC_EVENT_PATH, false, $context );
     238            $apiURL = $this->options["capture_api_url"];
     239            if ( empty( $apiURL ) ) {
     240                $apiURL = self::API_URL;
     241            }
     242            file_get_contents( $apiURL . self::WC_EVENT_PATH, false, $context );
    236243        }
    237244    }
     
    659666        $context = stream_context_create( $options );
    660667        if ( isset( $customer['email'] ) || $_COOKIE['ap3c'] ) {
    661             file_get_contents( self::API_URL . self::WC_EVENT_PATH, false, $context );
     668            if ( empty( $this->options["capture_api_url"] ) ) {
     669                $this->options["capture_api_url"] = self::API_URL;
     670            }
     671            $apiURL = $this->options["capture_api_url"];
     672            if ( empty( $apiURL ) ) {
     673                $apiURL = self::API_URL;
     674            }
     675            file_get_contents( $apiURL . self::WC_EVENT_PATH, false, $context );
    662676        }
    663677    }
Note: See TracChangeset for help on using the changeset viewer.