Changeset 3342631
- Timestamp:
- 08/11/2025 05:06:05 AM (3 months ago)
- Location:
- cloud-s3-storage
- Files:
-
- 8 edited
- 1 copied
- tags/1.4.3 (copied) (copied from cloud-s3-storage/trunk)
- tags/1.4.3/class/base/cloud-s3-storage_db.php (modified) (3 diffs)
- tags/1.4.3/class/base/cloud-s3-storage_image_function.php (modified) (2 diffs)
- tags/1.4.3/cloud-s3-storage.php (modified) (1 diff)
- tags/1.4.3/readme.txt (modified) (1 diff)
- trunk/class/base/cloud-s3-storage_db.php (modified) (3 diffs)
- trunk/class/base/cloud-s3-storage_image_function.php (modified) (2 diffs)
- trunk/cloud-s3-storage.php (modified) (1 diff)
- trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
cloud-s3-storage/tags/1.4.3/class/base/cloud-s3-storage_db.php
r3267508 r3342631 7 7 8 8 public function __construct() { 9 10 9 global $wpdb; 11 10 … … 27 26 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 28 27 dbDelta( $sql ); 29 28 29 $column_exists = $wpdb->get_var( "SHOW COLUMNS FROM $table_name LIKE 'last_update'" ); 30 if ( ! $column_exists ) { 31 $wpdb->query( "ALTER TABLE $table_name ADD last_update DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL" ); 32 error_log("[cloud-s3-storage] Colonna 'last_update' aggiunta automaticamente alla tabella."); 33 } 34 35 $image_id_unique = $wpdb->get_var( 36 $wpdb->prepare( 37 "SHOW INDEX FROM $table_name WHERE Column_name = %s AND Non_unique = 0", 38 'image_id' 39 ) 40 ); 41 42 if ( $image_id_unique ) { 43 // 🔧 Rimuove l'indice UNIQUE su image_id 44 $wpdb->query( "ALTER TABLE $table_name DROP INDEX image_id" ); 45 error_log("[cloud-s3-storage] Indice UNIQUE su 'image_id' rimosso."); 46 } 47 30 48 $this->check_and_insert_all_images(); 31 49 } … … 84 102 85 103 foreach ($missing_images as $image) { 104 if (!isset($image['image_id'])) { 105 error_log("[cloud-s3-storage] image_id mancante per URL: " . $image['url']); 106 continue; 107 } 86 108 $image_id = isset($image["image_id"]) ? $image["image_id"] : null; 87 109 $image_url = $image["url"]; -
cloud-s3-storage/tags/1.4.3/class/base/cloud-s3-storage_image_function.php
r3219893 r3342631 16 16 static function getFileAttachFullVersion() { 17 17 $file_list = []; 18 18 19 $cached_file_list = get_transient('cloud_s3_storage_cached_file_attach_list'); 19 20 … … 52 53 53 54 $file_list[$file['file']] = [ 55 'image_id' => $attachment->ID, 54 56 'url' => self::sanitize_key_static($relative_path), 55 57 'complete_path' => $full_path, -
cloud-s3-storage/tags/1.4.3/cloud-s3-storage.php
r3294892 r3342631 3 3 Plugin Name: Cloud S3 Storage 4 4 Description: The plugin allows you to manage WordPress media on S3 compatible object storage services. 5 Version: 1.4. 25 Version: 1.4.3 6 6 Author: VHosting & Matteo Enna 7 7 Text Domain: cloud-s3-storage -
cloud-s3-storage/tags/1.4.3/readme.txt
r3294892 r3342631 6 6 Requires PHP: 7.2.5 7 7 Tested up to: 6.8.1 8 Stable tag: 1.4. 28 Stable tag: 1.4.3 9 9 License: GPLv2 or later 10 10 -
cloud-s3-storage/trunk/class/base/cloud-s3-storage_db.php
r3267508 r3342631 7 7 8 8 public function __construct() { 9 10 9 global $wpdb; 11 10 … … 27 26 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 28 27 dbDelta( $sql ); 29 28 29 $column_exists = $wpdb->get_var( "SHOW COLUMNS FROM $table_name LIKE 'last_update'" ); 30 if ( ! $column_exists ) { 31 $wpdb->query( "ALTER TABLE $table_name ADD last_update DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL" ); 32 error_log("[cloud-s3-storage] Colonna 'last_update' aggiunta automaticamente alla tabella."); 33 } 34 35 $image_id_unique = $wpdb->get_var( 36 $wpdb->prepare( 37 "SHOW INDEX FROM $table_name WHERE Column_name = %s AND Non_unique = 0", 38 'image_id' 39 ) 40 ); 41 42 if ( $image_id_unique ) { 43 // 🔧 Rimuove l'indice UNIQUE su image_id 44 $wpdb->query( "ALTER TABLE $table_name DROP INDEX image_id" ); 45 error_log("[cloud-s3-storage] Indice UNIQUE su 'image_id' rimosso."); 46 } 47 30 48 $this->check_and_insert_all_images(); 31 49 } … … 84 102 85 103 foreach ($missing_images as $image) { 104 if (!isset($image['image_id'])) { 105 error_log("[cloud-s3-storage] image_id mancante per URL: " . $image['url']); 106 continue; 107 } 86 108 $image_id = isset($image["image_id"]) ? $image["image_id"] : null; 87 109 $image_url = $image["url"]; -
cloud-s3-storage/trunk/class/base/cloud-s3-storage_image_function.php
r3219893 r3342631 16 16 static function getFileAttachFullVersion() { 17 17 $file_list = []; 18 18 19 $cached_file_list = get_transient('cloud_s3_storage_cached_file_attach_list'); 19 20 … … 52 53 53 54 $file_list[$file['file']] = [ 55 'image_id' => $attachment->ID, 54 56 'url' => self::sanitize_key_static($relative_path), 55 57 'complete_path' => $full_path, -
cloud-s3-storage/trunk/cloud-s3-storage.php
r3294892 r3342631 3 3 Plugin Name: Cloud S3 Storage 4 4 Description: The plugin allows you to manage WordPress media on S3 compatible object storage services. 5 Version: 1.4. 25 Version: 1.4.3 6 6 Author: VHosting & Matteo Enna 7 7 Text Domain: cloud-s3-storage -
cloud-s3-storage/trunk/readme.txt
r3294892 r3342631 6 6 Requires PHP: 7.2.5 7 7 Tested up to: 6.8.1 8 Stable tag: 1.4. 28 Stable tag: 1.4.3 9 9 License: GPLv2 or later 10 10
Note: See TracChangeset for help on using the changeset viewer.