Plugin Directory

Changeset 3398106


Ignore:
Timestamp:
11/18/2025 01:54:15 PM (4 months ago)
Author:
ali2woo
Message:

new plugin release

Location:
ali2woo-lite/trunk
Files:
1 added
12 edited

Legend:

Unmodified
Added
Removed
  • ali2woo-lite/trunk/alinext-lite.php

    r3369759 r3398106  
    66Text Domain: ali2woo
    77Domain Path: /languages
    8 Version: 3.6.3
     8Version: 3.6.4
    99Author: Dropshipping Guru
    1010Author URI: https://ali2woo.com/dropshipping-plugin/?utm_source=lite&utm_medium=author&utm_campaign=alinext-lite
     
    1212Requires at least: 5.9
    1313Tested up to: 6.8
    14 WC tested up to: 10.2
     14WC tested up to: 10.3
    1515WC requires at least: 5.0
    1616Requires PHP: 8.0
  • ali2woo-lite/trunk/includes/classes/connector/AbstractConnector.php

    r3287804 r3398106  
    3030    abstract public function load_order(string $order_id): array;
    3131    abstract public function loadCategory(int $categoryId): array;
    32     abstract static function get_images_from_description($data);
     32    abstract static function get_images_from_description(array $data);
    3333}
  • ali2woo-lite/trunk/includes/classes/connector/AliexpressDefaultConnector.php

    r3287804 r3398106  
    235235    }
    236236
    237     public static function get_images_from_description($product)
    238     {
    239         $src_result = array();
    240 
    241         if (isset($product['desc_meta']) && isset($product['desc_meta']['images']) && is_array($product['desc_meta']['images'])) {
    242             foreach ($product['desc_meta']['images'] as $image_src) {
     237    public static function get_images_from_description(array $data): array
     238    {
     239        $src_result = [];
     240
     241        if (!empty($data['desc_meta']['images']) && is_array($data['desc_meta']['images'])) {
     242            foreach ($data['desc_meta']['images'] as $image_src) {
    243243                $image_key = Utils::buildImageIdFromPath($image_src);
    244244                $src_result[$image_key] = $image_src;
  • ali2woo-lite/trunk/includes/classes/controller/SettingPageAjaxController.php

    r3369759 r3398106  
    258258            set_setting(
    259259                Settings::SETTING_ADD_SHIPPING_TO_PRICE,
    260                 isset($_POST[Settings::SETTING_ADD_SHIPPING_TO_PRICE])
     260                !empty($_POST[Settings::SETTING_ADD_SHIPPING_TO_PRICE]) ? filter_var($_POST[Settings::SETTING_ADD_SHIPPING_TO_PRICE], FILTER_VALIDATE_BOOLEAN) : false
    261261            );
    262             set_setting('apply_price_rules_after_shipping_cost', !empty($_POST['apply_price_rules_after_shipping_cost']) ? filter_var($_POST['apply_price_rules_after_shipping_cost'], FILTER_VALIDATE_BOOLEAN) : false);
     262            set_setting(
     263                'apply_price_rules_after_shipping_cost',
     264                !empty($_POST['apply_price_rules_after_shipping_cost']) ? filter_var($_POST['apply_price_rules_after_shipping_cost'], FILTER_VALIDATE_BOOLEAN) : false
     265            );
    263266
    264267            settings()->commit();
  • ali2woo-lite/trunk/includes/classes/job/ApplyPricingRulesProcess.php

    r3254982 r3398106  
    118118                            }
    119119                            wc_delete_product_transients($product_id);
     120                            clean_post_cache($product_id);
    120121                        }
    121122                    } else {
  • ali2woo-lite/trunk/includes/classes/model/Woocommerce.php

    r3308596 r3398106  
    327327            }
    328328
     329            if (!is_wp_error($product_id) && $product_id) {
     330                // Explicitly set the product type taxonomy because 'tax_input' may not reliably save it in newer WooCommerce versions
     331                wp_set_object_terms($product_id, $product_type, 'product_type');
     332            }
     333
    329334            if (a2wl_check_defined('A2WL_ON_UPDATE_LOG_AFFILIATE_URL')) {
    330335                $infoLogMessage = sprintf(
     
    610615    {
    611616        do_action('a2wl_woocommerce_upd_product', $product_id, $product, $params);
    612        
     617
    613618        global $wpdb;
    614619
     
    11611166            }
    11621167
     1168            // Check: if the sale price is greater than the regular price
     1169            if ($price > $regular_price) {
     1170                a2wl_info_log(sprintf(
     1171                    "ERROR: Skip updating product_id=%s, variation_external_id=%s because sale price (%s) > regular price (%s)",
     1172                    $wc_product->get_id(),
     1173                    $variation['sku_id'] ?? $variation['id'] ?? 'n/a',
     1174                    $price,
     1175                    $regular_price
     1176                ));
     1177                return;
     1178            }
     1179
    11631180            $wc_product->set_regular_price($regular_price);
    11641181            if (round(abs($regular_price - $price), 2) == 0) {
     
    11771194            $wc_product->delete_meta_data('_aliexpress_price');
    11781195        }
     1196
     1197        a2wl_info_log(sprintf(
     1198            "Update price: product_id=%s, variation_external_id=%s, regular_price=%s, price=%s, sale_price=%s",
     1199            $wc_product->get_id(),
     1200            $variation['sku_id'] ?? $variation['id'] ?? 'n/a',
     1201            $wc_product->get_regular_price(),
     1202            $wc_product->get_price(),
     1203            $wc_product->get_sale_price()
     1204        ));
    11791205
    11801206        $wc_product->save();
  • ali2woo-lite/trunk/includes/classes/repository/AliexpressRegionRepository.php

    r3369759 r3398106  
    3434            'AE' => 'United Arab Emirates',
    3535            'SA' => 'Saudi Arabia',
     36            'AR' => 'Argentina',
    3637            'ZA' => 'South Africa',
    3738            'AU' => 'Australia',
     
    4748            'GR' => 'Greece',
    4849            'RU' => 'Russia',
    49             'NL' => 'Nederland',
     50            'NL' => 'Netherlands',
    5051            'IE' => 'Ireland',
    5152            'ES' => 'Spain',
  • ali2woo-lite/trunk/includes/classes/utils/Logs.php

    r3107543 r3398106  
    1111use Throwable;
    1212
    13 class Logs {
     13class Logs{
    1414
    15     private static $_instance = null;
     15    private static ?Logs $_instance = null;
    1616
    17     private $a2wl_logs_file = '/ali2woo/a2wl_debug.log';
     17    private string $a2wl_logs_file = '/ali2woo/a2wl_debug.txt';
     18
     19    //old version log
     20    private string $a2wl_old_logs_file = '/ali2woo/a2wl_debug.log';
    1821
    1922    protected function __construct() {
    2023        if (get_setting('write_info_log')) {
    21             $upload_dir = wp_upload_dir();
    22             $log_file_parts = pathinfo($this->a2wl_logs_file);
     24            $upload_dir   = wp_upload_dir();
     25            $a2wl_logs_dir = $upload_dir['basedir'] . '/ali2woo';
    2326
    24             $a2wl_logs_dir = $upload_dir['basedir'].$log_file_parts['dirname'];
    25             $a2wl_logs_file = $a2wl_logs_dir.'/'.$log_file_parts['basename'];
    26        
     27            $old_file = $upload_dir['basedir'] . $this->a2wl_old_logs_file;
     28            $new_file = $upload_dir['basedir'] . $this->a2wl_logs_file;
     29
    2730            if (!file_exists($a2wl_logs_dir)) {
    28                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_mkdir
    2931                mkdir($a2wl_logs_dir, 0755, true);
    3032            }
    3133
    32             if (!file_exists($a2wl_logs_file)) {
    33                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen
    34                 $fp = fopen($a2wl_logs_file, 'w');
    35                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     34            if (file_exists($old_file) && !file_exists($new_file)) {
     35                if (!rename($old_file, $new_file)) {
     36                    error_log("Failed to rename old log file");
     37                }
     38            } elseif (!file_exists($new_file)) {
     39                $fp = fopen($new_file, 'w');
    3640                fclose($fp);
    37                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_chmod
    38                 chmod($a2wl_logs_file, 0644);
     41                chmod($new_file, 0644);
    3942            }
    4043        }
    4144    }
    4245
    43     protected function __clone() {
    44        
    45     }
     46    protected function __clone() {}
    4647
    47     static public function getInstance() {
     48    static public function getInstance(): ?Logs
     49    {
    4850        if (is_null(self::$_instance)) {
    4951            self::$_instance = new self();
     
    5254    }
    5355
    54 
    5556    public function write($message): void
    5657    {
    57         if(get_setting('write_info_log')){
    58             $ft = false;
     58        if (get_setting('write_info_log')) {
    5959            try {
    60                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fopen
    6160                $fp = fopen($this->log_path(), 'a');
    62                 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fwrite
    63                 fwrite($fp, $message."\r\n");
     61                fwrite($fp, $message . "\r\n");
    6462            } catch (Throwable $e) {
    6563                error_log($e->getTraceAsString());
    6664            } finally {
    67                 if ($fp) {
    68                     // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_fclose
     65                if (!empty($fp)) {
    6966                    fclose($fp);
    7067                }
     
    7572    public function delete(): void
    7673    {
    77         // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink
    7874        unlink($this->log_path());
    7975    }
     
    8278    {
    8379        $upload_dir = wp_upload_dir();
    84 
    8580        return $upload_dir['basedir'] . $this->a2wl_logs_file;
    8681    }
     
    8984    {
    9085        $upload_dir = wp_upload_dir();
    91 
    9286        return $upload_dir['baseurl'] . $this->a2wl_logs_file;
    9387    }
    94 
    9588}
  • ali2woo-lite/trunk/includes/classes/utils/Utils.php

    r3369759 r3398106  
    354354            $connector = AliexpressDefaultConnector::getInstance();
    355355            $desc_images = $connector::get_images_from_description($product);
     356
     357            //add description image only if it's not already available as image of other type
    356358            foreach ($desc_images as $img_id => $img) {
    357359                if (!isset($tmp_all_images[$img_id])) {
  • ali2woo-lite/trunk/includes/libs/json_api/controllers/core.php

    r3333646 r3398106  
    2020    protected PriceFormulaService $PriceFormulaService;
    2121    protected ProductImportTransactionService $ProductImportTransactionService;
     22    protected PurchaseCodeInfoService $PurchaseCodeInfoService;
    2223
    2324    public function __construct(
     
    2829        Aliexpress $AliexpressModel,
    2930        PriceFormulaService $PriceFormulaService,
    30         ProductImportTransactionService $ProductImportTransactionService
     31        ProductImportTransactionService $ProductImportTransactionService,
     32        PurchaseCodeInfoService $PurchaseCodeInfoService
    3133    ) {
    3234
     
    3840        $this->PriceFormulaService = $PriceFormulaService;
    3941        $this->ProductImportTransactionService = $ProductImportTransactionService;
     42        $this->PurchaseCodeInfoService = $PurchaseCodeInfoService;
    4043
    4144        //todo: perhaps it would be better to move this call to some other controller
     
    331334    }
    332335
    333     public function get_settings()
     336    public function get_settings(): array
    334337    {
    335338        global $a2wl_json_api;
     
    337340        $localizator = AliexpressLocalizator::getInstance();
    338341
    339         $settings = array('a2w_fulfillment_prefship' => get_setting('fulfillment_prefship', 'ePacket'),
     342        $settings = [
     343            'a2w_fulfillment_prefship' => get_setting('fulfillment_prefship', 'ePacket'),
    340344            'a2w_aliship_shipto' => get_setting('aliship_shipto', 'US'),
    341345            'a2w_import_language' => $localizator->language,
     
    343347            'a2w_local_currency' => $localizator->currency,
    344348            'a2wl_chrome_ext_import' => a2wl_check_defined('A2WL_CHROME_EXT_IMPORT'),
    345         );
    346 
    347         return array('settings' => $settings);
     349            'a2wl_premium' => false
     350        ];
     351
     352        if (EditionHelper::isFull()) {
     353            $PurchaseCodeInfo = $this->PurchaseCodeInfoService->getFromCache();
     354            $supportedUntilTimestamp = $PurchaseCodeInfo->getSupportedUntilStamp();
     355            if ($supportedUntilTimestamp && $supportedUntilTimestamp >= time()) {
     356                $settings['a2wl_premium'] = true;
     357            }
     358        }
     359
     360        return ['settings' => $settings];
    348361    }
    349362
  • ali2woo-lite/trunk/readme.txt

    r3369763 r3398106  
    8787- Edit product data before publishing: Lite ✅ | Pro ✅ 
    8888- Import product videos: Lite ✅ | Pro ✅ 
    89 - Import & synchronize reviews with ratings/images: Lite ❌ | Pro ✅ 
     89- Import & synchronize reviews with ratings/images: Lite ❌ | Pro ✅
     90- Mass product import: Lite ❌ | Pro ✅   
    9091- Translate reviews into multiple languages: Lite ❌ | Pro ✅ 
    9192- Phrase‑based filtering (titles, descriptions, reviews): Lite ✅ | Pro ✅ 
     
    170171
    171172== Changelog ==
     173= 3.6.4 - 2025-11-18
     174Fix: Prevent price update when the calculated sale price exceeds the regular price due to an incorrect formula
     175Fix: Resolved issue where product variations were not loaded on certain WordPress installations during import
     176Fix: Various minor bug fixes
     177 
    172178= 3.6.3 – 2025-09-29 =
    173179* Premium: Added "delivery time only" option in shipping settings 
     
    211217- 🌐 [Official homepage](https://ali2woo.com/?utm_source=lite&utm_medium=wporg&utm_campaign=alinext-lite) 
    212218- 👍 [Facebook](https://facebook.com/ali2woo) 
    213 - 🐦 [Twitter](https://twitter.com/ali2woo) 
    214219- ▶️ [YouTube tutorials](https://www.youtube.com/channel/UCmcs_NMPkHi0IE_x9UENsoA) 
    215220- 📌 [Pinterest](https://www.pinterest.ru/ali2woo/) 
  • ali2woo-lite/trunk/view/settings/price_formula.php

    r3369759 r3398106  
    452452</div>
    453453
    454 <div class="modal-overlay modal-apply-pricing-rules">
    455     <div class="modal-content">
    456         <div class="modal-header">
    457             <h3 class="modal-title"><?php echo esc_html_e('Apply pricing rules to existing products', 'ali2woo'); ?></h3>
    458             <a class="modal-btn-close" href="#"></a>
    459         </div>
    460         <div class="modal-body">
    461             <label><?php echo esc_html_e('Select the update type', 'ali2woo'); ?></label>
    462             <div style="padding-bottom: 20px;">
    463                 <div class="type btn-group" role="group">
    464                     <button type="button" class="btn btn-default" value="price"><?php echo esc_html_e('Prices', 'ali2woo'); ?></button>
    465                     <button type="button" class="btn btn-default" value="regular_price"><?php echo esc_html_e('Regular Prices', 'ali2woo'); ?></button>
    466                     <button type="button" class="btn btn-default" value="all"><?php echo esc_html_e('Prices and Regular Prices', 'ali2woo'); ?></button>
    467                 </div>
    468             </div>
    469             <label><?php echo esc_html_e('Select the update scope', 'ali2woo'); ?></label>
    470             <div>
    471                 <div class="scope btn-group" role="group">
    472                     <button type="button" class="btn btn-default" value="shop"><?php echo esc_html_e('Shop', 'ali2woo'); ?></button>
    473                     <button type="button" class="btn btn-default" value="import"><?php echo esc_html_e('Import List', 'ali2woo'); ?></button>
    474                     <button type="button" class="btn btn-default" value="all"><?php echo esc_html_e('Shop and Import List', 'ali2woo'); ?></button>
    475                 </div>
    476             </div>
    477         </div>
    478         <div class="modal-footer">
    479             <span class="status" style="padding-right: 10px;">xxx</span>
    480             <button class="btn btn-default close-btn" type="button"><?php echo esc_html_e('Close', 'ali2woo'); ?></button>
    481             <button class="btn btn-success apply-btn" type="button"><div class="btn-icon-wrap cssload-container"><div class="cssload-speeding-wheel"></div></div><?php echo esc_html_e('Apply', 'ali2woo'); ?></button>
    482         </div>
    483     </div>
    484 </div>
    485 
    486 
     454<?php include_once A2WL()->plugin_path() . '/view/includes/bulk_price_formula_modal.php'; ?>
    487455
    488456<script>
Note: See TracChangeset for help on using the changeset viewer.