Plugin Directory

Changeset 3262736


Ignore:
Timestamp:
03/27/2025 10:34:56 AM (12 months ago)
Author:
extendago
Message:

Version 1.6.4

Location:
extendago-wp-connection/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extendago-wp-connection/trunk/extendago-wp-connection.php

    r3258358 r3262736  
    44Plugin URI:  https://extendago-connect.com/
    55Description: The Wordpress plugin for connecting Woocommerce with Extenda GO / Wallmob. You can manage your products inside Extenda GO or make your webshop as leading foor product manangement. You Stock changes will be two-way binding.
    6 Version:     1.6.3
     6Version:     1.6.4
    77Requires Plugins: woocommerce
    88Author:      Arture B.V.
  • extendago-wp-connection/trunk/includes/api/class-extendago-web-api-functions.php

    r3255254 r3262736  
    44    private $functions;
    55    private $extendago_masterdata;
     6    private $logging;
    67
    78    public function __construct() {
     
    2021            $this->extendago_masterdata = $extendago_masterdata;
    2122        }
     23
     24        $this->logging = new ExtendaGo_WP_Connection_Logging();
    2225    }
    2326
    2427    public function extendago_update_wc_product( $product, $full_sync = false ){
    25 
    26         $logging = new ExtendaGo_WP_Connection_Logging();
    27 
    2828        $product = apply_filters('before_extendago_product_process', $product);
    2929
     
    4848        if( $hide_from_web == '1' || isset($product['active']) && $product['active'] == '0' ){
    4949            if (isset($post_id) && !empty($post_id)) {
    50                 $logging->log_file_write('GetProductRemoved | Product removed from webshop ' . $post_id);
     50                $this->logging->log_file_write('GetProductRemoved | Product removed from webshop ' . $post_id);
    5151                wp_trash_post($post_id);
    5252                return true;
     
    281281                    if( isset($new_product_size_list) && !empty($new_product_size_list) ) {
    282282                        if (!in_array($extendago_size_id, $new_product_size_list)) {
    283                             $logging = new ExtendaGo_WP_Connection_Logging();
    284                             $logging->log_file_write('NOTICE | Variation ' . $variation_post_id . ' deleted from product: ' . $post_id);
     283                            $this->logging->log_file_write('NOTICE | Variation ' . $variation_post_id . ' deleted from product: ' . $post_id);
    285284                            wp_delete_post($variation_post_id, true);
    286285                        }
     
    468467                if (!isset($extendago_keep_product_status) || !$extendago_keep_product_status) {
    469468                    $Product->set_status($no_image_post_status);
    470                     $logging->log_file_write('Status | Post (' . $post_id . ') has no image. Updating post-status to: ' . $no_image_post_status);
     469                    $this->logging->log_file_write('Status | Post (' . $post_id . ') has no image. Updating post-status to: ' . $no_image_post_status);
    471470                }
    472471            }
     
    554553            }
    555554
     555            $product_categories = array_values($product_categories);
    556556            $product_category_index = array_search($product_category_name, array_column($product_categories, 'name'));
    557557
     
    680680            if( isset($attribute_id->errors) ){
    681681                foreach( $attribute_id->errors as $error ){
    682                     $logging = new ExtendaGo_WP_Connection_Logging();
    683                     $logging->log_file_write('ERROR | ' . $error[0]);
     682                    $this->logging->log_file_write('ERROR | ' . $error[0]);
    684683                }
    685684            }
     
    710709
    711710    public function insert_product_variations( $post_id, $product ){
    712 
    713         // Load classes
    714         $logging = new Extendago_WP_Connection_Logging();
    715 
    716711        $variations = $product['product_variants'];
    717712
     
    749744                if( count($product_variations_by_size_id) > 0 ){
    750745                    foreach( $product_variations_by_size_id as $product_variation_by_size_id ){
    751                         $logging->log_file_write('NOTICE | Duplicate variation delete by size_id: ' .$product_variation_by_size_id->ID. ' for post ID: ' .$post_id);
     746                        $this->logging->log_file_write('NOTICE | Duplicate variation delete by size_id: ' .$product_variation_by_size_id->ID. ' for post ID: ' .$post_id);
    752747                        wp_delete_post($product_variation_by_size_id->ID);
    753748                    }
     
    940935    public function extendago_update_wc_product_stock( $stock_event_line ){
    941936
    942         $logging = new Extendago_WP_Connection_Logging();
    943 
    944937        // Variation check
    945938        if( isset($stock_event_line['product_variant_id']) && !empty($stock_event_line['product_variant_id']) ){
     
    950943                $product_id = wp_get_post_parent_id($variation_post_id);
    951944
    952                 $logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . '/' . $stock_event_line['product_variant_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')');
     945                $this->logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . '/' . $stock_event_line['product_variant_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ')');
    953946
    954947                if ( FALSE === get_post_status( $product_id ) ) {
     
    980973                // Check if all variatons are out of stock
    981974                if( is_null( get_post($product_id) ) ) {
    982                     $logging = new ExtendaGo_WP_Connection_Logging();
    983                     $logging->log_file_write( 'NOTICE | Product ID '.$product_id.' no longer exist' );
     975                    $this->logging->log_file_write( 'NOTICE | Product ID '.$product_id.' no longer exist' );
    984976                }
    985977                else {
     
    1000992            }
    1001993            else{
    1002                 $logging->log_file_write('WARNING | Product variation not found with ID: ' . $stock_event_line['product_variant_id']);
     994                $this->logging->log_file_write('WARNING | Product variation not found with ID: ' . $stock_event_line['product_variant_id']);
    1003995            }
    1004996        }
     
    10101002            if (isset($product_id) && !empty($product_id)) {
    10111003
    1012                 $logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');
     1004                $this->logging->log_file_write('ExtendaGo | Processing stock change for product ' . $stock_event_line['product_id'] . ' | ' .$product_id. ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');
    10131005
    10141006                $Product = wc_get_product( $product_id );
     
    10321024            }
    10331025            else{
    1034                 $logging->log_file_write('ExtendaGo | Unable processing stock change for product ' . $stock_event_line['product_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');
     1026                $this->logging->log_file_write('ExtendaGo | Unable processing stock change for product ' . $stock_event_line['product_id'] . ' changing stock to ' . $stock_event_line['current_quantity'] . ' (' . $stock_event_line['delta_quantity'] . ') Product ID not found!');
    10351027            }
    10361028        }
     
    10461038
    10471039    function upload_external_file( $file, $post_id = 0, $desc = null ) {
    1048 
    1049         $logging = new ExtendaGo_WP_Connection_Logging();
    1050 
    10511040        require_once(ABSPATH . "wp-admin" . '/includes/image.php');
    10521041        require_once(ABSPATH . "wp-admin" . '/includes/file.php');
     
    10541043
    10551044        if( empty( $file ) ) {
    1056             $logging->log_file_write( 'ERROR | File is empty' );
     1045            $this->logging->log_file_write( 'ERROR | File is empty' );
    10571046        }
    10581047
     
    10801069            if ( is_wp_error( $file_array['tmp_name'] ) ) {
    10811070                $attach_id = '';
    1082                 $logging->log_file_write( 'ERROR | Error while storing file temporarily' );
     1071                $this->logging->log_file_write( 'ERROR | Error while storing file temporarily' );
    10831072            }
    10841073            else{
     
    10901079                    unlink( $file_array['tmp_name'] );
    10911080                    $attach_id = '';
    1092                     $logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' );
     1081                    $this->logging->log_file_write( 'ERROR | Couldn\'t store upload permanently' );
    10931082                }
    10941083            }
  • extendago-wp-connection/trunk/includes/cronjob/class-extendago-cronjob-functions.php

    r3258358 r3262736  
    2222            $this->logging->log_file_write( 'INIT | Total Synchronisation' );
    2323            $this->extendago_woocommerce_sync();
     24            http_response_code(200);
    2425            exit;
    2526        }
     
    3839                $this->process_imported_extendago_batches();
    3940            }
     41            http_response_code(200);
    4042            exit;
    4143        }
     
    4345        if( $this->endsWith($_SERVER["REQUEST_URI"], '/extendago-process-export') ){
    4446            $this->process_exported_woocommerce_batches();
     47            http_response_code(200);
    4548            exit;
    4649        }
     
    5962                $this->process_changes_wc_products();
    6063            }
     64            http_response_code(200);
    6165            exit;
    6266        }
     
    7478                $this->process_stockchanges();
    7579            }
     80            http_response_code(200);
    7681            exit;
    7782        }
  • extendago-wp-connection/trunk/includes/woocommerce/class-extendago-woocommerce-functions.php

    r3257883 r3262736  
    208208                if( isset($product_categories) && !empty($product_categories) ){
    209209                    foreach( $product_categories as $product_category ){
    210                         $product_data['categories'][$product_category->term_id] = array(
     210
     211                        // 27-03-2025
     212                        $product_category_id = $product_category->term_id;
     213                        $extendago_category_id = get_term_meta( $product_category->term_id, "extendago_id", true);
     214                        if( isset($extendago_category_id) && !empty($extendago_category_id) ){
     215                            $product_category_id = $extendago_category_id;
     216                        }
     217
     218                        $product_data['categories'][$product_category_id] = array(
    211219                            'name' => $product_category->name,
    212220                            'slug' => $product_category->slug,
     
    609617        if (isset($product_categories) && !empty($product_categories)) {
    610618            foreach ($product_categories as $product_category) {
    611                 $product_data['categories'][$product_category->term_id] = array(
     619
     620                // 27-03-2025
     621                $product_category_id = $product_category->term_id;
     622                $extendago_category_id = get_term_meta( $product_category->term_id, "extendago_id", true);
     623                if( isset($extendago_category_id) && !empty($extendago_category_id) ){
     624                    $product_category_id = $extendago_category_id;
     625                }
     626
     627                $product_data['categories'][$product_category_id] = array(
    612628                    'name' => $product_category->name,
    613629                    'slug' => $product_category->slug,
  • extendago-wp-connection/trunk/readme.txt

    r3258358 r3262736  
    55Requires at least: 6.0
    66Tested up to: 6.7.1
    7 Stable tag: 1.6.3
     7Stable tag: 1.6.4
    88Requires PHP: 7.4
    99License: GPLv2 or later
     
    3131== Changelog =
    3232
     33= 1.6.4 =
     34* Bugfix with imported Extenda categories and unique mapping ID
     35
    3336= 1.6.3 =
    3437* Minor bugfix inside export processing runs
Note: See TracChangeset for help on using the changeset viewer.