Plugin Directory

Changeset 2783969


Ignore:
Timestamp:
09/13/2022 12:14:20 PM (4 years ago)
Author:
JonasBreuer
Message:

release 2.3.1

Location:
affiliate-power/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • affiliate-power/trunk/affiliate-power.php

    r2689542 r2783969  
    66AUTHOR: Jonas Breuer
    77AUTHOR URI: https://www.j-breuer.de
    8 VERSION: 2.3.0
     8VERSION: 2.3.1
    99Text Domain: affiliate-power
    1010Min WP Version: 4.6
    11 Max WP Version: 5.9.1
     11Max WP Version: 6.0
    1212*/
    1313if (!defined('ABSPATH')) die; //no direct access
    1414
    15 define('AFFILIATE_POWER_VERSION', '2.3.0');
     15define('AFFILIATE_POWER_VERSION', '2.3.1');
    1616
    1717define('AFFILIATE_POWER_DIR', dirname(__FILE__).'/'); 
    18 define('AFFILIATE_POWER_API_URL', 'https://www.affiliatepowerplugin.com/ap-api/api.php');
     18define('AFFILIATE_POWER_API_URL', 'https://ap-api.banana-content.de/api.php');
    1919
    2020Affiliate_Power::prepare();
  • affiliate-power/trunk/apis/ds24_api.php

    r1369957 r2783969  
    11<?php
    2 if (!defined('ABSPATH')) die; //no direct access
    3 
    42/**
    53 * Digistore24 REST Api Connector
    64 * @author Christian Neise
    7  * @link https://doc.digistore24.com/api-de/
     5 * @link https://doc.digistore24.com/api-en/
    86 *
    97 * A php class providing a connection to the Digistore24 REST api server.
     
    1210 * Even if the Digistore24 api is extended, you still can use this connector.
    1311 *
    14  * © 2015 Digistore24 GmbH, alle Rechte vorbehalten
     12 * © 2022 Digistore24 Inc., all rights reserved
    1513 */
    1614
    1715/*
    1816
    19 Copyright (c) 2015 Digistore24 GmbH
     17Copyright (c) 2022
    2018
    2119Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
     
    3937define( 'DS_ERR_UNKNOWN',                  0 );
    4038define( 'DS_ERR_NOT_CONNECTED',            1 );
    41 define( 'DS_ERR_BAD_API_CALL',             2 );
     39define( 'DS_ERR_BAD_API_KEY',              2 );
    4240define( 'DS_ERR_BAD_FUNCTION_PARAMS',      3 );
    4341define( 'DS_ERR_NOT_FOUND',                4 );
     
    4644define( 'DS_ERR_BAD_HTTP_CODE',            7 );
    4745define( 'DS_ERR_PERMISSION_DENIED',        8 );
     46define( 'DS_ERR_BAD_API_CALL',             9 );
    4847
    4948
     
    6564    * use the api function ping()
    6665    *
    67     * See api reference at https://doc.digistore24.com/api-en/
     66    * See api reference at https://docs.digistore24.com/api-en/
    6867    *
    6968    * @param string $api_key Your api key from you Digistore24 account, e.g. 123-iKWIrTsUTbCyrFuotOdV8yO20nfMI5bbrZhDCUAG
     
    119118        $tokens = explode( '_', $language );
    120119
    121         $language = $tokens[0];
    122 
    123         $is_language_valid = in_array( $language, $this->_validLangs() );
    124 
    125         if ($is_language_valid)
     120        $language = strtolower(trim($tokens[0]));
     121
     122        if ($language)
    126123        {
    127124            $this->language = $language;
     
    171168    */
    172169    public function setBaseUrl( $url='https://www.digistore24.com' ){
    173         $this->base_url = $url;
    174     }
    175 
     170        $this->base_url = rtrim( $url, '/' );
     171    }
     172
     173    //
     174    // private section /////////////////////////////////////////////////////////////////////////////////////////////
     175    //
    176176    private $api_key  = '';
    177177    private $language = '';
     
    220220        $base_url = $this->base_url;
    221221
    222         return "$base_url/api/call/$key/json/";
     222        return "$base_url/api/call/";
    223223    }
    224224
     
    257257
    258258
    259     private function _http_request( $url, $params, $settings = array() )
     259    private function _http_request( $url, $params, $settings=array() )
    260260    {
    261261        $this->last_url    = $url;
     
    264264        $querystring = http_build_query( $params, '', '&' );
    265265
    266         $headers = array (
     266        $headers = [
    267267                        'Content-type: application/x-www-form-urlencoded; charset=utf-8',
    268268                        'Accept-Charset: utf-8',
    269                    );
     269                        'Accept: application/json',
     270                        'X-DS-API-KEY: ' . $this->api_key,
     271        ];
    270272
    271273        if (!function_exists('curl_init')) {
     
    319321            if ($must_report) {
    320322
     323                $api_key_disp = 'XXXX-XXXXXXXXXXXXXXXXX';
     324                if ($this->api_key)
     325                {
     326                    $parts = explode( '-', $this->api_key );
     327                    if (count($parts) >= 2)
     328                    {
     329                        $api_key_disp = $parts[0] . '-XXXXXXXXXXXXXXXXX';
     330                    }
     331                }
     332
    321333                ob_start();
    322                 echo "<pre>URL: $url\nQuery: $querystring\nParams: ";
     334                echo "<pre>URL: $url\nApi key: $api_key_disp\nQuery: $querystring\nParams: ";
    323335                print_r( $params );
    324336                echo "\nResponse:</pre>$contents";
     
    379391    }
    380392
    381     private function _validLangs() {
    382         return array_keys( $this->_errorMsgList() );
    383     }
    384 
    385393    private function _errorMsgList()
    386394    {
     
    389397                DS_ERR_UNKNOWN                   => 'Unbekannter Fehler!',
    390398                DS_ERR_NOT_CONNECTED             => 'Nicht zum Digistore24-Server verbunden.',
    391                 DS_ERR_BAD_API_CALL              => 'Die Verbindungsparameter sind ungültig.',
     399                DS_ERR_BAD_API_KEY               => 'Die Verbindungsparameter sind ungültig.',
     400                DS_ERR_BAD_API_CALL              => 'Ungültiger Funktionsaufruf.',
    392401                DS_ERR_BAD_FUNCTION_PARAMS       => 'Ungültige Parameter bei Funktionsaufruf %s.',
    393402                DS_ERR_BAD_SERVER_RESPONSE       => 'Der Digistore24-Server hat eine ungültige Antwort geliefert. (Technische Information: %s)',
     
    398407                DS_ERR_UNKNOWN                   => 'Unknown error!',
    399408                DS_ERR_NOT_CONNECTED             => 'Not connected to the Digistore24 server.',
    400                 DS_ERR_BAD_API_CALL              => 'Invalid connection parameters.',
     409                DS_ERR_BAD_API_KEY               => 'Invalid connection parameters.',
     410                DS_ERR_BAD_API_CALL              => 'Invalid function call.',
    401411                DS_ERR_BAD_FUNCTION_PARAMS       => 'Invalid parameters for function call %s.',
    402412                DS_ERR_BAD_SERVER_RESPONSE       => 'The Digistore24 server delivered an invalid response. (Technical information: %s)',
  • affiliate-power/trunk/readme.txt

    r2689542 r2783969  
    44Tags: affiliate marketing, tracking, sales, financeads, awin
    55Requires at least: 4.6
    6 Tested up to: 5.9.1
     6Tested up to: 6.0
    77Requires PHP: 5.6
    88Stable tag: trunk
Note: See TracChangeset for help on using the changeset viewer.