Plugin Directory

Changeset 3152227


Ignore:
Timestamp:
09/15/2024 05:03:22 PM (19 months ago)
Author:
shelfplanner
Message:

2.3.2

  • Minor fixes
Location:
shelf-planner/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • shelf-planner/trunk/includes/lib/class-shelf-planner-connector-helper.php

    r3142164 r3152227  
    1515{
    1616    // protected $shelf_planner_connector_env = 'LOCALDEV';
    17     //protected $shelf_planner_connector_env = 'DEV';
    18     //protected $shelf_planner_connector_env = 'UAT';
     17    // protected $shelf_planner_connector_env = 'DEV';
     18    // protected $shelf_planner_connector_env = 'UAT';
    1919    protected $shelf_planner_connector_env = 'PROD';
    2020
  • shelf-planner/trunk/readme.txt

    r3142164 r3152227  
    33Requires at least: 6.0.0
    44Tested up to: 6.6
    5 Requires PHP: 7.4
    6 Stable tag: 2.3.1
     5Requires PHP: 5.3
     6Stable tag: 2.3.2
    77Tags: Inventory Management,ABC Analysis,Demand Forecasting,Replenishment,Purchasing
    88License: GPLv2 or later
     
    9696== Changelog ==
    9797
     98= 2.3.2 =
     99- Minor fixes
     100
    98101= 2.3.1 =
    99102- Includes a new logic to manage launch dates for products that will support the optimisation life cycle management in the forecast.
  • shelf-planner/trunk/shelf-planner.php

    r3142164 r3152227  
    1010 * Description:         AI-driven Stock Management, Demand Forecasting, Replenishment and Order Management for WooCommerce, all in one powerful tool.
    1111 *
    12  * Version:             2.3.1
     12 * Version:             2.3.2
    1313 * Author:              Shelf Planner
    1414 * Author URI:          https://www.shelfplanner.com
     
    3333 * Use SemVer - https://semver.org
    3434 */
    35 $shelf_planner_connector_version = "2.3.1";
     35$shelf_planner_connector_version = "2.3.2";
    3636define('SHELF_PLANNER_CONNECTOR_VERSION', $shelf_planner_connector_version);
    3737update_option('shelf_planner_connector_version', $shelf_planner_connector_version);
     
    330330
    331331    /*return array(
    332                                                         'orderby'    => 'date',
    333                                                         'order'      => 'DESC',
    334                                                         'post_type'  => 'shop_order',
    335                                                         'limit'      => 2,
    336                                                         'meta_query' => [
    337                                                             [
    338                                                                 'key'     => "SHELF-PLANNER-CONNECTOR-SYNC",
    339                                                                 'value'   => 0,
    340                                                                 'compare' => 'NOT EXISTS',
    341                                                             ],
    342                                                         ],
    343                                                         'include' =>  $params['IDS']
    344                                                     );*/
     332                                                           'orderby'    => 'date',
     333                                                           'order'      => 'DESC',
     334                                                           'post_type'  => 'shop_order',
     335                                                           'limit'      => 2,
     336                                                           'meta_query' => [
     337                                                               [
     338                                                                   'key'     => "SHELF-PLANNER-CONNECTOR-SYNC",
     339                                                                   'value'   => 0,
     340                                                                   'compare' => 'NOT EXISTS',
     341                                                               ],
     342                                                           ],
     343                                                           'include' =>  $params['IDS']
     344                                                       );*/
    345345    /*$orders = wc_get_orders(array(
    346                                                         'include'   =>  array{106,207,83},
    347                                                         'orderby'    => 'date',
    348                                                         'order'      => 'DESC',
    349                                                         'post_type'  => 'shop_order',
    350                                                         'limit'      => 10
    351                                                        
    352                                                          
    353                                                     ));*/
     346                                                           'include'    =>  array{106,207,83},
     347                                                           'orderby'    => 'date',
     348                                                           'order'      => 'DESC',
     349                                                           'post_type'  => 'shop_order',
     350                                                           'limit'      => 10
     351                                                           
     352                                                           
     353                                                       ));*/
    354354
    355355    if ($orders) {
     
    386386
    387387    /*$args = array(
    388                                             'orderby' => 'name',
    389                                             'limit' => -1, // Retrieves all products
    390                                         );
    391                                         $products = wc_get_products($args);
    392                                     */
     388                                               'orderby' => 'name',
     389                                               'limit' => -1, // Retrieves all products
     390                                           );
     391                                           $products = wc_get_products($args);
     392                                       */
    393393    $tmpProduct = [];
    394394    $tmpSubProducts = [];
     
    532532}
    533533
     534function validate_request_auth_website_url($data)
     535{
     536    global $spc_helper;
     537
     538    // Verify WebsiteUrl validity
     539    if ($spc_helper->get_website_url() != $data['WebsiteUrl']) {
     540        spcApiLog("ERROR SITE: doesn't match ");
     541        return false;
     542    }
     543
     544    return true;
     545}
     546
     547function validate_request_auth_website_url_server_key($data)
     548{
     549    global $spc_helper;
     550
     551    // Verify WebsiteUrl validity
     552    if ($spc_helper->get_website_url() != $data['WebsiteUrl']) {
     553        spcApiLog("ERROR SITE: doesn't match ");
     554        return false;
     555    }
     556
     557    // Verify ServerKey validity
     558    if ($spc_helper->get_server_key() != $data['ServerKey']) {
     559        spcApiLog("ERROR SERVER: doesn't match ");
     560        return false;
     561    }
     562
     563    return true;
     564}
     565
    534566function validate_request_auth($data)
    535567{
     
    637669            'methods' => 'POST',
    638670            'callback' => 'get_store_info',
     671            'permission_callback' => 'validate_request_auth',
    639672        )
    640673    );
     
    646679            'methods' => 'POST',
    647680            'callback' => 'setup_connector_helo',
     681            'permission_callback' => 'validate_request_auth_website_url',
    648682        )
    649683    );
     
    655689            'methods' => 'POST',
    656690            'callback' => 'setup_connector',
     691            'permission_callback' => 'validate_request_auth_website_url_server_key',
    657692        )
    658693    );
     
    664699            'methods' => 'POST',
    665700            'callback' => 'my_awesome_func',
     701            'permission_callback' => 'validate_request_auth',
    666702        )
    667703    );
     
    673709            'methods' => 'POST',
    674710            'callback' => 'get_categories_list',
     711            'permission_callback' => 'validate_request_auth',
    675712        )
    676713    );
     
    682719            'methods' => 'POST',
    683720            'callback' => 'get_products_list',
     721            'permission_callback' => 'validate_request_auth',
    684722        )
    685723    );
     
    692730            'methods' => 'POST',
    693731            'callback' => 'get_products_list_v2',
     732            'permission_callback' => 'validate_request_auth',
    694733        )
    695734    );
     
    702741            'methods' => 'POST',
    703742            'callback' => 'get_products_detail_v2',
     743            'permission_callback' => 'validate_request_auth',
    704744        )
    705745    );
     
    713753            'methods' => 'POST',
    714754            'callback' => 'get_order_list',
     755            'permission_callback' => 'validate_request_auth',
    715756        )
    716757    );
     
    722763            'methods' => 'POST',
    723764            'callback' => 'get_order_detail',
     765            'permission_callback' => 'validate_request_auth',
    724766            'args' => array(
    725767                'IDS' => array(
     
    738780            'methods' => 'PUT',
    739781            'callback' => 'add_product_stock',
     782            'permission_callback' => 'validate_request_auth',
    740783            'args' => array(
    741784                'ProductId' => array(
     
    755798            'methods' => 'PUT',
    756799            'callback' => 'update_product_stock',
     800            'permission_callback' => 'validate_request_auth',
    757801            'args' => array(
    758802                'ProductId' => array(
     
    772816            'methods' => 'PUT',
    773817            'callback' => 'update_products_track_stock',
     818            'permission_callback' => 'validate_request_auth',
    774819        )
    775820    );
     
    781826            'methods' => 'POST',
    782827            'callback' => 'dummy_response_func',
     828            'permission_callback' => 'validate_request_auth',
    783829        )
    784830    );
     
    790836            'methods' => 'GET',
    791837            'callback' => 'ping',
     838            'permission_callback' => 'validate_request_auth',
    792839        )
    793840    );
     
    799846            'methods' => 'POST',
    800847            'callback' => 'ping',
     848            'permission_callback' => 'validate_request_auth',
    801849        )
    802850    );
Note: See TracChangeset for help on using the changeset viewer.