Plugin Directory

Changeset 2780283


Ignore:
Timestamp:
09/05/2022 05:35:41 PM (4 years ago)
Author:
allkeyshop
Message:

Bug fix with the test-api-key ajax action

Location:
allkeyshop-affiliate/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • allkeyshop-affiliate/trunk/main.php

    r2763492 r2780283  
    33 * Plugin Name:       Allkeyshop Affiliate
    44 * Description:       Earn money by adding game prices comparison widgets
    5  * Version:           1.0.1
     5 * Version:           1.0.2
    66 * Requires at least: 5.9
    77 * Requires PHP:      7.0
  • allkeyshop-affiliate/trunk/readme.txt

    r2763492 r2780283  
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
    9 Stable tag: 1.0.1
     9Stable tag: 1.0.2
    1010
    1111Allkeyshop Widget integration for WordPress
  • allkeyshop-affiliate/trunk/src/Controller/Manager.php

    r2763492 r2780283  
    268268        }
    269269    }
     270
     271    public function testApiKey() {
     272        if (!isset($_POST['apiKey'])) {
     273            wp_send_json_error();
     274        }
     275        $apiKey = sanitize_text_field($_POST['apiKey']);
     276        $data = AffiliateApi::checkApiKey($apiKey);
     277        if ($data['success'] === true) {
     278            self::_saveApiKey($apiKey, $data['data']['affiliateKey']);
     279            wp_send_json_success();
     280        }
     281        wp_send_json_error();
     282    }
    270283}
Note: See TracChangeset for help on using the changeset viewer.