Plugin Directory

Changeset 2329143


Ignore:
Timestamp:
06/23/2020 09:44:16 AM (6 years ago)
Author:
recotrust
Message:

tagging version 1.0.6

Location:
recotrust-integration
Files:
10 edited
3 copied

Legend:

Unmodified
Added
Removed
  • recotrust-integration/tags/1.0.6/ac-reco-plugin.php

    r1976833 r2329143  
    55Plugin URI: https://www.recotrust.com
    66Description: Sends invitation requests to Recotrust and displays Recotrust widgets on ecommerce sites.
    7 Version: 1.0.5
     7Version: 1.0.6
    88Author: Recotrust, Angry Creative, Elias Chalhoub
    99Author URI: https://angrycreative.se
  • recotrust-integration/tags/1.0.6/assets/javascript/ac-reco-plugin.js

    r1887513 r2329143  
    1 console.log("Reco trust integration installed on this website.");
     1console.log( "Reco trust integration installed on this website." );
  • recotrust-integration/tags/1.0.6/includes/class-ac-reco-widget.php

    r1887513 r2329143  
    8989            // Badges.
    9090            for ( $i = date( 'Y' );$i >= ( date( 'Y' ) - 5 );$i-- ) {
    91             ?>
     91                ?>
    9292          <!--<p>
    9393           <input id="<?php echo esc_attr( $this->get_field_id( 'badges[' . $i . ']' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'badges[' . $i . ']' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $current['badges'][ $i ] ); ?> />
  • recotrust-integration/tags/1.0.6/includes/class-admin-general-options.php

    r2095604 r2329143  
    2424        add_action( 'woocommerce_settings_tabs_settings_tab_ac_reco', __CLASS__ . '::settings_tab' );
    2525        add_action( 'woocommerce_update_options_settings_tab_ac_reco', __CLASS__ . '::update_settings' );
    26         add_action( 'woocommerce_thankyou', __CLASS__ . '::ac_reco_thankyou_page' );
     26        add_action( 'template_redirect', __CLASS__ . '::ac_reco_thankyou_page' );
    2727        add_action(
    28             'widgets_init', function() {
     28            'widgets_init',
     29            function() {
    2930                register_widget( 'Ac_Reco_Widget' );
    3031            }
     
    5859         */
    5960    public static function ac_reco_thankyou_page( $order_id ) {
    60         if ( empty( $order_id ) ) {
    61             return;
     61        global $wp;
     62        if ( is_wc_endpoint_url( 'order-received' ) && ! empty( $wp->query_vars['order-received'] ) ) {
     63            $order     = wc_get_order( $wp->query_vars['order-received'] );
     64            $address   = $order->get_address( 'billing' );
     65            $reco_data = [
     66                'ac_reco_plugin_is_active'     => get_option( 'woocommerce_reco_plugin_is_active' ),
     67                'ac_reco_plugin_reco_id'       => get_option( 'woocommerce_reco_plugin_reco_id' ),
     68                'ac_reco_plugin_reco_key'      => get_option( 'woocommerce_reco_plugin_api_key' ),
     69                'ac_reco_plugin_send_order'    => get_option( 'woocommerce_reco_plugin_send_order' ),
     70                'ac_reco_plugin_send_interval' => empty( get_option( 'woocommerce_reco_plugin_send_interval' ) ) ? 1 : (int) get_option( 'woocommerce_reco_plugin_send_interval' ),
     71            ];
     72            if ( empty( $reco_data['ac_reco_plugin_reco_id'] ) || empty( $reco_data['ac_reco_plugin_reco_key'] ) ) {
     73                return;
     74            }
     75            /*
     76            here I am going to send data to Reco's API
     77            */
     78
     79            $curl                                       = curl_init( 'https://api.reco.se/invite/mail/venue/' . $reco_data['ac_reco_plugin_reco_id'] );
     80            $options                                    = [
     81                'X-Reco-ApiKey: ' . $reco_data['ac_reco_plugin_reco_key'],
     82                'Content-Type: application/json',
     83            ];
     84            $reco_api_data['invites'][]                 = (object) [
     85                'email'     => $address['email'],
     86                'firstName' => $address['first_name'],
     87                'lastName'  => $address['last_name'],
     88            ];
     89            $reco_api_data['scheduled']['sendDateFrom'] = date( 'Y-m-d', strtotime( $order->get_date_completed() . ' + ' . $reco_data['ac_reco_plugin_send_interval'] . ' days ' ) );
     90            $reco_json_data                             = json_encode( $reco_api_data );
     91            curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'POST' );
     92            curl_setopt( $curl, CURLOPT_HTTPHEADER, $options );
     93            curl_setopt( $curl, CURLOPT_POSTFIELDS, $reco_json_data );
     94            curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
     95            $response = curl_exec( $curl );
     96            curl_close( $curl );
    6297        }
    63         $order     = wc_get_order( $order_id );
    64         $address   = $order->get_address( 'billing' );
    65         $reco_data = [
    66             'ac_reco_plugin_is_active'     => get_option( 'woocommerce_reco_plugin_is_active' ),
    67             'ac_reco_plugin_reco_id'       => get_option( 'woocommerce_reco_plugin_reco_id' ),
    68             'ac_reco_plugin_reco_key'      => get_option( 'woocommerce_reco_plugin_api_key' ),
    69             'ac_reco_plugin_send_order'    => get_option( 'woocommerce_reco_plugin_send_order' ),
    70             'ac_reco_plugin_send_interval' => empty( get_option( 'woocommerce_reco_plugin_send_interval' ) ) ? 1 : (int) get_option( 'woocommerce_reco_plugin_send_interval' ),
    71         ];
    72         if ( empty( $reco_data['ac_reco_plugin_reco_id'] ) || empty( $reco_data['ac_reco_plugin_reco_key'] ) ) {
    73             return;
    74         }
    75         /*
    76         here I am going to send data to Reco's API
    77         */
    78 
    79         $curl                       = curl_init( 'https://api.reco.se/invite/mail/venue/' . $reco_data['ac_reco_plugin_reco_id'] );
    80         $options                    = [
    81             'X-Reco-ApiKey: ' . $reco_data['ac_reco_plugin_reco_key'],
    82             'Content-Type: application/json',
    83         ];
    84         $reco_api_data['invites'][] = (object) [
    85             'email'     => $address['email'],
    86             'firstName' => $address['first_name'],
    87             'lastName'  => $address['last_name'],
    88         ];
    89         $reco_api_data['scheduled']['sendDateFrom'] = date( 'Y-m-d', strtotime( $order->order_date . ' + ' . $reco_data['ac_reco_plugin_send_interval'] . ' days ' ) );
    90         $reco_json_data             = json_encode( $reco_api_data );
    91         curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'POST' );
    92         curl_setopt( $curl, CURLOPT_HTTPHEADER, $options );
    93         curl_setopt( $curl, CURLOPT_POSTFIELDS, $reco_json_data );
    94         curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
    95         $response = curl_exec( $curl );
    96         curl_close( $curl );
    97         $recipients = [
    98             '[email protected]',
    99         ];
    100         $subject    = "[neworder][{$reco_data['ac_reco_plugin_reco_id']}][{$order_id}]";
    101         $headers    = [ 'From: ' . $address['first_name'] . ' ' . $address['last_name'] . ' <' . $address['email'] . '>' ];
    102         wp_mail( $recipients, $subject, $reco_json_data, $headers );
    103 
    10498    }
    10599
  • recotrust-integration/tags/1.0.6/includes/class-plugin.php

    r1976833 r2329143  
    1515     * @var string
    1616     */
    17     protected $version = '1.0.5';
     17    protected $version = '1.0.6';
    1818
    1919    /**
     
    149149
    150150        wp_localize_script(
    151             $this->plugin_slug . '-script', $namespace, [
     151            $this->plugin_slug . '-script',
     152            $namespace,
     153            [
    152154                'awesome' => true,
    153155            ]
  • recotrust-integration/tags/1.0.6/readme.txt

    r2095604 r2329143  
    44Requires at least: 4.8
    55Requires PHP: 5.6
    6 Tested up to: 5.2.1
    7 Stable tag: 1.0.5
     6Tested up to: 5.4.2
     7Stable tag: 1.0.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • recotrust-integration/trunk/ac-reco-plugin.php

    r1976833 r2329143  
    55Plugin URI: https://www.recotrust.com
    66Description: Sends invitation requests to Recotrust and displays Recotrust widgets on ecommerce sites.
    7 Version: 1.0.5
     7Version: 1.0.6
    88Author: Recotrust, Angry Creative, Elias Chalhoub
    99Author URI: https://angrycreative.se
  • recotrust-integration/trunk/assets/javascript/ac-reco-plugin.js

    r1887513 r2329143  
    1 console.log("Reco trust integration installed on this website.");
     1console.log( "Reco trust integration installed on this website." );
  • recotrust-integration/trunk/includes/class-ac-reco-widget.php

    r1887513 r2329143  
    8989            // Badges.
    9090            for ( $i = date( 'Y' );$i >= ( date( 'Y' ) - 5 );$i-- ) {
    91             ?>
     91                ?>
    9292          <!--<p>
    9393           <input id="<?php echo esc_attr( $this->get_field_id( 'badges[' . $i . ']' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'badges[' . $i . ']' ) ); ?>" type="checkbox" value="1" <?php checked( '1', $current['badges'][ $i ] ); ?> />
  • recotrust-integration/trunk/includes/class-admin-general-options.php

    r2095604 r2329143  
    2424        add_action( 'woocommerce_settings_tabs_settings_tab_ac_reco', __CLASS__ . '::settings_tab' );
    2525        add_action( 'woocommerce_update_options_settings_tab_ac_reco', __CLASS__ . '::update_settings' );
    26         add_action( 'woocommerce_thankyou', __CLASS__ . '::ac_reco_thankyou_page' );
     26        add_action( 'template_redirect', __CLASS__ . '::ac_reco_thankyou_page' );
    2727        add_action(
    28             'widgets_init', function() {
     28            'widgets_init',
     29            function() {
    2930                register_widget( 'Ac_Reco_Widget' );
    3031            }
     
    5859         */
    5960    public static function ac_reco_thankyou_page( $order_id ) {
    60         if ( empty( $order_id ) ) {
    61             return;
     61        global $wp;
     62        if ( is_wc_endpoint_url( 'order-received' ) && ! empty( $wp->query_vars['order-received'] ) ) {
     63            $order     = wc_get_order( $wp->query_vars['order-received'] );
     64            $address   = $order->get_address( 'billing' );
     65            $reco_data = [
     66                'ac_reco_plugin_is_active'     => get_option( 'woocommerce_reco_plugin_is_active' ),
     67                'ac_reco_plugin_reco_id'       => get_option( 'woocommerce_reco_plugin_reco_id' ),
     68                'ac_reco_plugin_reco_key'      => get_option( 'woocommerce_reco_plugin_api_key' ),
     69                'ac_reco_plugin_send_order'    => get_option( 'woocommerce_reco_plugin_send_order' ),
     70                'ac_reco_plugin_send_interval' => empty( get_option( 'woocommerce_reco_plugin_send_interval' ) ) ? 1 : (int) get_option( 'woocommerce_reco_plugin_send_interval' ),
     71            ];
     72            if ( empty( $reco_data['ac_reco_plugin_reco_id'] ) || empty( $reco_data['ac_reco_plugin_reco_key'] ) ) {
     73                return;
     74            }
     75            /*
     76            here I am going to send data to Reco's API
     77            */
     78
     79            $curl                                       = curl_init( 'https://api.reco.se/invite/mail/venue/' . $reco_data['ac_reco_plugin_reco_id'] );
     80            $options                                    = [
     81                'X-Reco-ApiKey: ' . $reco_data['ac_reco_plugin_reco_key'],
     82                'Content-Type: application/json',
     83            ];
     84            $reco_api_data['invites'][]                 = (object) [
     85                'email'     => $address['email'],
     86                'firstName' => $address['first_name'],
     87                'lastName'  => $address['last_name'],
     88            ];
     89            $reco_api_data['scheduled']['sendDateFrom'] = date( 'Y-m-d', strtotime( $order->get_date_completed() . ' + ' . $reco_data['ac_reco_plugin_send_interval'] . ' days ' ) );
     90            $reco_json_data                             = json_encode( $reco_api_data );
     91            curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'POST' );
     92            curl_setopt( $curl, CURLOPT_HTTPHEADER, $options );
     93            curl_setopt( $curl, CURLOPT_POSTFIELDS, $reco_json_data );
     94            curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
     95            $response = curl_exec( $curl );
     96            curl_close( $curl );
    6297        }
    63         $order     = wc_get_order( $order_id );
    64         $address   = $order->get_address( 'billing' );
    65         $reco_data = [
    66             'ac_reco_plugin_is_active'     => get_option( 'woocommerce_reco_plugin_is_active' ),
    67             'ac_reco_plugin_reco_id'       => get_option( 'woocommerce_reco_plugin_reco_id' ),
    68             'ac_reco_plugin_reco_key'      => get_option( 'woocommerce_reco_plugin_api_key' ),
    69             'ac_reco_plugin_send_order'    => get_option( 'woocommerce_reco_plugin_send_order' ),
    70             'ac_reco_plugin_send_interval' => empty( get_option( 'woocommerce_reco_plugin_send_interval' ) ) ? 1 : (int) get_option( 'woocommerce_reco_plugin_send_interval' ),
    71         ];
    72         if ( empty( $reco_data['ac_reco_plugin_reco_id'] ) || empty( $reco_data['ac_reco_plugin_reco_key'] ) ) {
    73             return;
    74         }
    75         /*
    76         here I am going to send data to Reco's API
    77         */
    78 
    79         $curl                       = curl_init( 'https://api.reco.se/invite/mail/venue/' . $reco_data['ac_reco_plugin_reco_id'] );
    80         $options                    = [
    81             'X-Reco-ApiKey: ' . $reco_data['ac_reco_plugin_reco_key'],
    82             'Content-Type: application/json',
    83         ];
    84         $reco_api_data['invites'][] = (object) [
    85             'email'     => $address['email'],
    86             'firstName' => $address['first_name'],
    87             'lastName'  => $address['last_name'],
    88         ];
    89         $reco_api_data['scheduled']['sendDateFrom'] = date( 'Y-m-d', strtotime( $order->order_date . ' + ' . $reco_data['ac_reco_plugin_send_interval'] . ' days ' ) );
    90         $reco_json_data             = json_encode( $reco_api_data );
    91         curl_setopt( $curl, CURLOPT_CUSTOMREQUEST, 'POST' );
    92         curl_setopt( $curl, CURLOPT_HTTPHEADER, $options );
    93         curl_setopt( $curl, CURLOPT_POSTFIELDS, $reco_json_data );
    94         curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
    95         $response = curl_exec( $curl );
    96         curl_close( $curl );
    97         $recipients = [
    98             '[email protected]',
    99         ];
    100         $subject    = "[neworder][{$reco_data['ac_reco_plugin_reco_id']}][{$order_id}]";
    101         $headers    = [ 'From: ' . $address['first_name'] . ' ' . $address['last_name'] . ' <' . $address['email'] . '>' ];
    102         wp_mail( $recipients, $subject, $reco_json_data, $headers );
    103 
    10498    }
    10599
  • recotrust-integration/trunk/includes/class-plugin.php

    r1976833 r2329143  
    1515     * @var string
    1616     */
    17     protected $version = '1.0.5';
     17    protected $version = '1.0.6';
    1818
    1919    /**
     
    149149
    150150        wp_localize_script(
    151             $this->plugin_slug . '-script', $namespace, [
     151            $this->plugin_slug . '-script',
     152            $namespace,
     153            [
    152154                'awesome' => true,
    153155            ]
  • recotrust-integration/trunk/readme.txt

    r2095604 r2329143  
    44Requires at least: 4.8
    55Requires PHP: 5.6
    6 Tested up to: 5.2.1
    7 Stable tag: 1.0.5
     6Tested up to: 5.4.2
     7Stable tag: 1.0.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.