Plugin Directory

Changeset 3342631

Timestamp:
08/11/2025 05:06:05 AM (3 months ago)
Author:
matteoenna
Message:

Release 1.4.3

Location:
cloud-s3-storage
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • cloud-s3-storage/tags/1.4.3/class/base/cloud-s3-storage_db.php

    r3267508 r3342631  
    77
    88        public function __construct() {
    9 
    109            global $wpdb;
    1110
     
    2726            require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    2827            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
    3048            $this->check_and_insert_all_images();
    3149        }
     
    84102
    85103                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                    }
    86108                    $image_id = isset($image["image_id"]) ? $image["image_id"] : null;
    87109                    $image_url = $image["url"];
  • cloud-s3-storage/tags/1.4.3/class/base/cloud-s3-storage_image_function.php

    r3219893 r3342631  
    1616        static function getFileAttachFullVersion() {   
    1717            $file_list = [];
     18
    1819            $cached_file_list = get_transient('cloud_s3_storage_cached_file_attach_list');
    1920       
     
    5253       
    5354                            $file_list[$file['file']] = [
     55                                'image_id' => $attachment->ID,
    5456                                'url' => self::sanitize_key_static($relative_path),
    5557                                'complete_path' => $full_path,
  • cloud-s3-storage/tags/1.4.3/cloud-s3-storage.php

    r3294892 r3342631  
    33Plugin Name: Cloud S3 Storage
    44Description: The plugin allows you to manage WordPress media on S3 compatible object storage services.
    5 Version: 1.4.2
     5Version: 1.4.3
    66Author: VHosting & Matteo Enna
    77Text Domain: cloud-s3-storage
  • cloud-s3-storage/tags/1.4.3/readme.txt

    r3294892 r3342631  
    66Requires PHP: 7.2.5
    77Tested up to: 6.8.1
    8 Stable tag: 1.4.2
     8Stable tag: 1.4.3
    99License: GPLv2 or later
    1010
  • cloud-s3-storage/trunk/class/base/cloud-s3-storage_db.php

    r3267508 r3342631  
    77
    88        public function __construct() {
    9 
    109            global $wpdb;
    1110
     
    2726            require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    2827            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
    3048            $this->check_and_insert_all_images();
    3149        }
     
    84102
    85103                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                    }
    86108                    $image_id = isset($image["image_id"]) ? $image["image_id"] : null;
    87109                    $image_url = $image["url"];
  • cloud-s3-storage/trunk/class/base/cloud-s3-storage_image_function.php

    r3219893 r3342631  
    1616        static function getFileAttachFullVersion() {   
    1717            $file_list = [];
     18
    1819            $cached_file_list = get_transient('cloud_s3_storage_cached_file_attach_list');
    1920       
     
    5253       
    5354                            $file_list[$file['file']] = [
     55                                'image_id' => $attachment->ID,
    5456                                'url' => self::sanitize_key_static($relative_path),
    5557                                'complete_path' => $full_path,
  • cloud-s3-storage/trunk/cloud-s3-storage.php

    r3294892 r3342631  
    33Plugin Name: Cloud S3 Storage
    44Description: The plugin allows you to manage WordPress media on S3 compatible object storage services.
    5 Version: 1.4.2
     5Version: 1.4.3
    66Author: VHosting & Matteo Enna
    77Text Domain: cloud-s3-storage
  • cloud-s3-storage/trunk/readme.txt

    r3294892 r3342631  
    66Requires PHP: 7.2.5
    77Tested up to: 6.8.1
    8 Stable tag: 1.4.2
     8Stable tag: 1.4.3
    99License: GPLv2 or later
    1010
Note: See TracChangeset for help on using the changeset viewer.