Changeset 3487557
- Timestamp:
- 03/21/2026 01:59:58 AM (11 days ago)
- Location:
- meliconnect/trunk
- Files:
-
- 8 edited
-
includes/Core/DatabaseManager.php (modified) (2 diffs)
-
includes/Core/Initialize.php (modified) (3 diffs)
-
includes/Core/Services/ProductEdit.php (modified) (1 diff)
-
includes/Modules/Importer/Services/WooCommerceProductAdapter.php (modified) (3 diffs)
-
includes/Modules/Importer/UserListingsTable.php (modified) (2 diffs)
-
meliconnect.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
meliconnect/trunk/includes/Core/DatabaseManager.php
r3485956 r3487557 311 311 $current_version = get_option( 'meliconnect_db_version', '1.0' ); 312 312 313 if ( version_compare( $current_version, MELICONNECT_DATABASE_VERSION, '>=' ) ) { 314 return; 315 } 313 316 314 317 // Solo ejecutar si la versión del plugin es mayor que la versión guardada 315 if ( version_compare( MELICONNECT_DATABASE_VERSION, $current_version, '>' ) ) { 316 317 318 319 $db = new self(); 320 321 $tables = array( 322 'user_connection' => array( 323 'add' => array( 324 'plan_type' => "enum('free','pro','power') NOT NULL DEFAULT 'free'", 325 'active_connections' => 'int(11) NOT NULL DEFAULT 0', 326 'pending_connections' => 'int(11) NOT NULL DEFAULT 0', 327 'connected_listing_ids' => 'LONGTEXT DEFAULT NULL', 328 ), 329 ), 330 331 'notifications' => array( 332 'add' => array( 333 'to_version' => "varchar(50) DEFAULT NULL", 334 'type' => "varchar(100) DEFAULT NULL", 335 'priority' => "int(11) DEFAULT 0", 336 'meta' => "LONGTEXT DEFAULT NULL", 337 ), 338 'update' => array( 339 'from_version' => "varchar(50) DEFAULT NULL", 340 ), 341 ), 342 343 'user_listings_to_import' => array( 344 'add' => array( 345 'meli_family_id' => "varchar(50) DEFAULT NULL", 346 'meli_family_name' => "varchar(200) DEFAULT NULL", 347 'meli_user_product_id' => "varchar(50) DEFAULT NULL", 348 'meli_seller_custom_field' => "varchar(50) DEFAULT NULL", 349 'meli_family_is_parent' => "tinyint(1) DEFAULT 0", 350 'meli_parent_listing_id' => "varchar(50) DEFAULT NULL", 351 ), 352 ), 353 ); 318 $db = new self(); 319 320 $tables = array( 321 'user_connection' => array( 322 'add' => array( 323 'plan_type' => "enum('free','pro','power') NOT NULL DEFAULT 'free'", 324 'active_connections' => 'int(11) NOT NULL DEFAULT 0', 325 'pending_connections' => 'int(11) NOT NULL DEFAULT 0', 326 'connected_listing_ids' => 'LONGTEXT DEFAULT NULL', 327 ), 328 ), 329 330 'notifications' => array( 331 'add' => array( 332 'to_version' => 'varchar(50) DEFAULT NULL', 333 'type' => 'varchar(100) DEFAULT NULL', 334 'priority' => 'int(11) DEFAULT 0', 335 'meta' => 'LONGTEXT DEFAULT NULL', 336 ), 337 'update' => array( 338 'from_version' => 'varchar(50) DEFAULT NULL', 339 ), 340 ), 341 342 'user_listings_to_import' => array( 343 'add' => array( 344 'meli_family_id' => 'varchar(50) DEFAULT NULL', 345 'meli_family_name' => 'varchar(200) DEFAULT NULL', 346 'meli_user_product_id' => 'varchar(50) DEFAULT NULL', 347 'meli_seller_custom_field' => 'varchar(50) DEFAULT NULL', 348 'meli_family_is_parent' => 'tinyint(1) DEFAULT 0', 349 'meli_parent_listing_id' => 'varchar(50) DEFAULT NULL', 350 ), 351 ), 352 ); 354 353 355 354 foreach ( $tables as $table_key => $changes ) { … … 369 368 } 370 369 371 372 } 373 374 // Actualizamos la versión guardada 370 // Actualizamos la versión guardada 375 371 update_option( 'meliconnect_db_version', MELICONNECT_DATABASE_VERSION ); 376 372 } -
meliconnect/trunk/includes/Core/Initialize.php
r3485956 r3487557 84 84 self::createDefaultOptions(); 85 85 86 //update_option( 'meliconnect_db_version', MELICONNECT_DATABASE_VERSION );87 86 } 88 87 … … 180 179 181 180 public function initApp() { 182 add_action( 'plugins_loaded', 'meliconnect_register_text_domain' ); 181 182 // Check de migraciones de DB 183 184 add_action('admin_init', array($this, 'maybeUpdateDatabase')); 185 183 186 184 187 do_action( 'meliconnect_init' ); … … 201 204 $cron_manager->handleCronExecution(); 202 205 } 206 207 public function maybeUpdateDatabase() { 208 209 if ( ! current_user_can('manage_options') ) { 210 return; 211 } 212 213 \Meliconnect\Meliconnect\Core\DatabaseManager::meliconnect_update_tables(); 214 } 203 215 204 216 private function loadHooks() { -
meliconnect/trunk/includes/Core/Services/ProductEdit.php
r3485956 r3487557 682 682 $current_values = array(); 683 683 684 foreach ( $value['values'] as $possible_value ) { 685 686 $current_values[ $possible_value['id'] ] = $possible_value['name']; 687 } 684 if ( !empty( $value['values'] ) && is_array( $value['values'] ) ) { 685 foreach ( $value['values'] as $possible_value ) { 686 if ( isset( $possible_value['id'], $possible_value['name'] ) ) { 687 $current_values[ $possible_value['id'] ] = $possible_value['name']; 688 } 689 } 690 } 688 691 689 692 $current_attr_name = strtolower( $value['name'] ); -
meliconnect/trunk/includes/Modules/Importer/Services/WooCommerceProductAdapter.php
r3485956 r3487557 170 170 if ( is_wp_error( $response ) ) { 171 171 172 Helper::logData("Attempt {$attempt}: WP Error: " . $response->get_error_message() );172 Helper::logData("Attempt {$attempt}: WP Error: " . $response->get_error_message() . ". For product data: " . wp_json_encode($productData)); 173 173 174 174 // retry … … 187 187 if ( $status_code !== 200 ) { 188 188 189 Helper::logData("Attempt {$attempt}: HTTP Error {$status_code} ");189 Helper::logData("Attempt {$attempt}: HTTP Error {$status_code}. For product data: " . wp_json_encode($productData)); 190 190 Helper::logData("Response body: " . $body); 191 191 … … 202 202 if ( empty( $body ) ) { 203 203 204 Helper::logData("Attempt {$attempt}: Empty response body ");204 Helper::logData("Attempt {$attempt}: Empty response body. For product data: " . wp_json_encode($productData)); 205 205 206 206 if ( $attempt < $max_retries ) { -
meliconnect/trunk/includes/Modules/Importer/UserListingsTable.php
r3485956 r3487557 234 234 $hasMatch = ( $item['is_product_match_by_name'] == 1 || $item['is_product_match_by_sku'] == 1 || $item['is_product_match_manually'] == 1 ) && isset( $item['vinculated_product_id'] ) && ! empty( $item['vinculated_product_id'] ); 235 235 $product_type = esc_sql( $item['product_type'] ?? 'simple' ); 236 $meli_response = json_decode( $item['meli_response'], true ); 236 237 238 $meli_response = array(); 239 240 if ( ! empty( $item['meli_response'] ) && is_string( $item['meli_response'] ) ) { 241 $decoded = json_decode( $item['meli_response'], true ); 242 243 if ( json_last_error() === JSON_ERROR_NONE && is_array( $decoded ) ) { 244 $meli_response = $decoded; 245 } 246 } 247 237 248 238 249 if ( $hasMatch ) { … … 271 282 esc_attr( $item['meli_sku'] ), 272 283 esc_attr( $item['meli_status'] ), 273 esc_attr( $meli_response['price'] ),274 esc_attr( $meli_response['available_quantity'])284 esc_attr( $meli_response['price'] ?? '' ), 285 esc_attr( $meli_response['available_quantity'] ?? '' ) 275 286 ), 276 287 ); -
meliconnect/trunk/meliconnect.php
r3485956 r3487557 4 4 Plugin URI: https://mercadolibre.meliconnect.com/ 5 5 Description: WooCommerce & Mercado Libre integration to import, export, and synchronize products between your WooCommerce store and Mercado Libre accounts. 6 Version: 1.7. 06 Version: 1.7.1 7 7 Author: meliconnect 8 8 Text Domain: meliconnect … … 26 26 * Define constantes del plugin 27 27 */ 28 define( 'MELICONNECT_VERSION', '1.7. 0' );29 define( 'MELICONNECT_DATABASE_VERSION', '1.2. 5' );28 define( 'MELICONNECT_VERSION', '1.7.1' ); 29 define( 'MELICONNECT_DATABASE_VERSION', '1.2.6' ); 30 30 define( 'MELICONNECT_TEXTDOMAIN', 'meliconnect' ); 31 31 define( 'MELICONNECT_PLUGIN_ROOT', plugin_dir_path( __FILE__ ) ); -
meliconnect/trunk/readme.txt
r3485956 r3487557 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.9 8 Stable tag: 1.7. 08 Stable tag: 1.7.1 9 9 License: GPLv3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html -
meliconnect/trunk/vendor/composer/installed.php
r3485956 r3487557 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 175ab91c669b22f3642320f435dce20b630e4904',6 'reference' => '3a565876f642f8047f7e146b28a47e92e64b7c62', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 175ab91c669b22f3642320f435dce20b630e4904',16 'reference' => '3a565876f642f8047f7e146b28a47e92e64b7c62', 17 17 'type' => 'wordpress-plugin', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.