⚡ NEW: Changeset/ - High Quality

Changeset 2627045


Ignore:
Timestamp:
11/10/2021 01:24:48 AM (4 years ago)
Author:
redmonkey73
Message:

update trunk

Location:
bonus-plus-wp/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • bonus-plus-wp/trunk/bonus-plus-wp.php

    r2623740 r2627045  
    1515 * WP requires at least: 5.0
    1616 * Tested up to: 5.8
    17  * Version: 2.0
     17 * Version: 2.2
    1818 */
    1919namespace BPWP;
     
    2828    public static function init()
    2929    {
    30         define('BPWP_PLUGIN_VERSION', '2.0');
     30        define('BPWP_PLUGIN_VERSION', '2.1');
    3131
    3232        require_once __DIR__ . '/functions.php';
  • bonus-plus-wp/trunk/inc/ClientProfile.php

    r2623740 r2627045  
    153153    {
    154154        $user_id = $user->ID;
     155        delete_user_meta($user_id, 'bonus-plus');
     156        // Check billing_phone
     157        $phone = bpwp_api_get_customer_phone($user_id);
    155158        // Если у пользователя есть мета bonus-plus, значит телефон ранее верифицирован
    156         if (!empty(get_user_meta($user_id, 'bonus-plus', true))){
     159        // if (!empty(get_user_meta($user_id, 'bonus-plus', true))){
    157160            // Значит обновим данные
    158             $phone = bpwp_api_get_customer_phone($user_id);
    159             $isPhoneVerified = get_user_meta($user_id, 'bpwp_phone_verified', true);
    160             if (!empty($phone) && $isPhoneVerified) {
     161            //$phone = bpwp_api_get_customer_phone($user_id);
     162            //$isPhoneVerified = get_user_meta($user_id, 'bpwp_phone_verified', true);
     163            if (!empty($phone)) {
    161164                $res = bpwp_api_request(
    162165                    'customer',
     
    166169                    'GET'
    167170                );
    168                 update_user_meta($user_id, 'bonus-plus', $res['request']);
    169             } else {
     171                if ($res['code'] == 200){
     172                    update_user_meta($user_id, 'bonus-plus', $res['request']);
     173                } else {
     174                    do_action(
     175                        'bpwp_logger',
     176                        $type = __CLASS__,
     177                        $title = __('Ошибка при получении данных клиента', 'bonus-plus-wp'),
     178                        $desc = sprintf(__('У пользователя с ИД %s, данные не получены!', 'bonus-plus-wp'), $user_id),
     179                    );
     180                }
     181               
     182            } else { 
    170183                do_action(
    171184                    'bpwp_logger',
     
    175188                );
    176189            }
    177         }   
     190        //}   
    178191    }
    179192
  • bonus-plus-wp/trunk/readme.txt

    r2623740 r2627045  
    55Requires at least: 4.0
    66Tested up to: 5.8
    7 Stable tag: 2.0
     7Stable tag: 2.2
    88Requires PHP: 7.1
    99License: GPLv2 or later
     
    9393== Changelog ==
    9494
     95= 2.1 =
     96- clear client meta after login
     97- include account.js at my-account page
     98
    9599= 2.0 =
    96100- add registration interface at my-account
Note: See TracChangeset for help on using the changeset viewer.