Plugin Directory

Changeset 2693190


Ignore:
Timestamp:
03/13/2022 10:27:35 AM (4 years ago)
Author:
sokangroup
Message:

update version ==> 1.2.1

Location:
sokan-integration
Files:
18 added
5 edited

Legend:

Unmodified
Added
Removed
  • sokan-integration/trunk/Sokan-integration.php

    r2693175 r2693190  
    77 * Plugin Name: sokan Integration
    88 * Description:  افزونه ای برای استخراج تمامی اطلاعات ووکامرس مورد نیاز پلتفرم سکان
    9  * Version: 1.2.0
     9 * Version: 1.2.1
    1010 * Author: Sokan
    1111 * Author URI: https://Sokan.tech/
  • sokan-integration/trunk/admin.php

    r2693175 r2693190  
    4343            $logger = new Skng_Sokan_logger();
    4444            $logger->skng_logger([
    45                 'entity' => "LoginException",
     45                'entity' => Skng_Sokan_logger::LOGIN_EXCEPTION,
    4646                'errors' => [json_encode($result)]
    4747            ]);
  • sokan-integration/trunk/include/classes/class-skng-logger.php

    r2693175 r2693190  
    99class Skng_Sokan_logger {
    1010
     11    /**
     12     * log entity enums
     13     * @since 1.2.0
     14     */
     15    const PING = 'Ping';
     16    const ORDER  = 'Invoice';
     17    const CUSTOMER  = 'Customer';
     18    const CATEGORY   = 'ProductCategory';
     19    const BRAND = 'Brand';
     20    const PRODUCT   = 'Product';
     21    const REGION   = 'Region';
     22    const LOGIN_EXCEPTION   = 'LoginException';
     23    const SYNC_EXCEPTION   = 'SyncException';
     24    const UNAUTHORIZED_EXCEPTION   = 'Unauthorized';
     25    const CUSTOM_CODE_EXCEPTION   = 'CustomCodeException';
    1126
    1227    /**
     
    3752     * @since 1.2.0
    3853     */
    39     public function skng_logger(array $logData = ['entity' => "Ping"])
     54    public function skng_logger(array $logData = ['entity' => self::PING])
    4055    {
    4156
     
    4762        $recordCount = $logData['synced'] ?? 0;
    4863
    49         if ($logData['entity'] == 'Ping'){
     64        if ($name == self::PING){
    5065            $errorDetail = "شروع عملیات همگام سازی";
    5166        }elseif ($errorCount == 0 and $recordCount == 0){
     
    100115
    101116                $this->skng_logger([
    102                     'entity' => "CustomCodeException",
     117                    'entity' => self::CUSTOM_CODE_EXCEPTION,
    103118                    'errors' => [$exception->getMessage()." / ".$exception->getTraceAsString()]
    104119                ]);
  • sokan-integration/trunk/job/sync_data.php

    r2693175 r2693190  
    3232            $errors = array_merge($errors , $result['errors']);
    3333            $logger->skng_logger([
    34                 'entity' => "Brand",
     34                'entity' => Skng_Sokan_logger::BRAND,
    3535                'errors' => $result['errors'],
    3636                'synced' => count($brands) - count($result['errors'])
     
    4242            $errors = array_merge($errors , $result['errors']);
    4343            $logger->skng_logger([
    44                 'entity' => "ProductCategory",
     44                'entity' => Skng_Sokan_logger::CATEGORY,
    4545                'errors' => $result['errors'],
    4646                'synced' => count($categories) - count($result['errors'])
     
    5353        $errors = array_merge($errors , $result['errors']);
    5454        $logger->skng_logger([
    55             'entity' => "Product",
     55            'entity' => Skng_Sokan_logger::PRODUCT,
    5656            'errors' => $result['errors'],
    5757            'synced' => count($products) - count($result['errors'])
     
    5959
    6060    }else{
    61         $logger->skng_logger(['entity' => "Product"]);
    62         $logger->skng_logger(['entity' => "Brand"]);
    63         $logger->skng_logger(['entity' => "ProductCategory"]);
     61        $logger->skng_logger(['entity' => Skng_Sokan_logger::BRAND]);
     62        $logger->skng_logger(['entity' => Skng_Sokan_logger::CATEGORY]);
     63        $logger->skng_logger(['entity' => Skng_Sokan_logger::PRODUCT]);
    6464    }
    6565
     
    7777        $errors = array_merge($errors , $result['errors']);
    7878        $logger->skng_logger([
    79             'entity' => "Customer",
     79            'entity' => Skng_Sokan_logger::CUSTOMER,
    8080            'errors' => $result['errors'],
    8181            'synced' => count($customers) - count($result['errors'])
    8282        ]);
    8383    }else{
    84         $logger->skng_logger(['entity' => "Customer"]);
     84        $logger->skng_logger(['entity' => Skng_Sokan_logger::CUSTOMER]);
    8585    }
    8686
     
    8989        $errors = array_merge($errors , $result['errors']);
    9090        $logger->skng_logger([
    91             'entity' => "Region",
     91            'entity' => Skng_Sokan_logger::REGION,
    9292            'errors' => $result['errors'],
    9393            'synced' => count($regions) - count($result['errors'])
    9494        ]);
    9595    }else{
    96         $logger->skng_logger(['entity' => "Region"]);
     96        $logger->skng_logger(['entity' => Skng_Sokan_logger::REGION]);
    9797    }
    9898
     
    111111            update_option(SKNG_PLUGIN_NAME."_token" , " ");
    112112            $logger->skng_logger([
    113                 'entity' => "Unauthorized",
     113                'entity' => Skng_Sokan_logger::UNAUTHORIZED_EXCEPTION,
    114114                'errors' => ['حساب کاربری فروشگاه غیرفعال و کاربر به صفحه ورود به حساب کاربری منتقل شد'],
    115115            ]);
     
    126126
    127127        $logger->skng_logger([
    128             'entity' => "Invoice",
     128            'entity' => Skng_Sokan_logger::ORDER,
    129129            'errors' => $result['errors'],
    130130            'synced' => count($orders) - count($result['errors'])
     
    148148    }else{
    149149
    150         $logger->skng_logger(['entity' => "Invoice"]);
     150        $logger->skng_logger(['entity' => Skng_Sokan_logger::ORDER]);
    151151
    152152        echo json_encode([
     
    162162
    163163    $logger->skng_logger([
    164         'entity' => "SyncException",
     164        'entity' => Skng_Sokan_logger::SYNC_EXCEPTION,
    165165        'errors' => [$exception->getMessage()." / ".$exception->getTraceAsString()]
    166166    ]);
  • sokan-integration/trunk/readme.txt

    r2693175 r2693190  
    55Tested up to: 5.8
    66Donate link: http://sokan.tech/
    7 Stable tag: 1.2.0
     7Stable tag: 1.2.1
    88Requires PHP: 7.0
    99License: GPLv2 or later
     
    7979== Changelog ==
    8080
     81= 1.2.1 =
     82* بهبود عملکرد
     83
    8184= 1.2.0 =
    8285* تغییر نحوه استخراج داده ها و بهبود عملکرد
     
    9194== Upgrade Notice ==
    9295
     96= 1.2.1 =
     97* بهبود عملکرد
     98
    9399= 1.2.0 =
    94100* جداول میانی برای استخراج داده حذف شد و داده ها مستقیم از جداول ووکامرس استخراج و به سکان ارسال می شود
Note: See TracChangeset for help on using the changeset viewer.