Plugin Directory

Changeset 3248887


Ignore:
Timestamp:
03/01/2025 01:45:16 PM (12 months ago)
Author:
khorshidlab
Message:

Plugin Version 1.13.0

Location:
arvancloud-object-storage
Files:
28 added
4 deleted
16 edited
1 copied

Legend:

Unmodified
Added
Removed
  • arvancloud-object-storage/tags/1.13.0/README.txt

    r3243158 r3248887  
    55Tested up to: 6.7
    66Requires PHP: 7.1
    7 Stable tag: 1.12.0
     7Stable tag: 1.13.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4848
    4949== Changelog ==
     50= 1.13.0 - 2025-03-01 =
     51* fix: Resolved the issue with permanent file deletion
     52* improvement: Enhanced bulk upload and bulk download operations
     53
    5054= 1.12.0 - 2025-02-19 =
    5155* feature: Added new WP CLI commands for better control over plugin operations. Includes: 
     
    5963
    6064For more details, use: `wp ac-storage help` 
    61 
    6265
    6366= 1.11.1 - 2025-02-09 =
  • arvancloud-object-storage/tags/1.13.0/admin/partials/partial-bulk-upload-modal.php

    r3243158 r3248887  
    120120    jQuery(document).ready(function () {
    121121        /* Runs when form loaded if current scheduled process is running */
    122         update_progress_form('get_bulk_upload_task_status');
     122        <?php
     123        global $wpdb;
     124        $active = $wpdb->get_var("select ifnull(count(id),0) from {$wpdb->prefix}obs_operations where operation='UPLOAD' and status='pending'");
     125        //prevent show complete in loop if task is complete
     126        if(!empty($active))
     127        echo "update_progress_form('get_bulk_upload_task_status');";
     128        ?>
     129    });
    123130
    124 });
    125 
    126 var input = document.querySelector('textarea[name=file_ext]');
    127 new Tagify(input);
     131    var input = document.querySelector('textarea[name=file_ext]');
     132    new Tagify(input);
    128133</script>
  • arvancloud-object-storage/tags/1.13.0/assets/js/bulkops.js

    r3237224 r3248887  
    1313                '_nonce': acs_media.nonces.generate_acl_url
    1414            },
     15            timeout: 30000,
    1516            success:function(data) {
    1617
     
    6970                url: acs_media.ajax_url,
    7071                data: data,
     72                timeout: 30000,
    7173                success: function (response) {
    72                     console.log(response);
     74                    console.log('submit: '.response);
    7375                    success_handler(response, status_action);
    7476                    jQuery('#submit-form-acceptance').removeClass('loading');
     
    7880                },
    7981                failed: function (response) {
    80                     console.log(response);
    8182                    jQuery('#form-acceptance-response-fail').text(response.data.message);
    8283                    jQuery('#form-acceptance-response-fail').show();
     
    104105                'action': action,
    105106            },
    106 
     107            timeout: 30000,
    107108            success: function (raw_response, e) {
    108109
     
    120121            },
    121122            failed: function (response) {
    122                 console.error(response);
     123                console.error('stop: '.response);
    123124            }
    124125        })
     
    173174function update_progress_form(action) {
    174175
    175     let timeOutResult = setTimeout(function () {
     176    let timeOutResult = setInterval(function () {
    176177        get_schedule_status(function (response) {
    177             console.log(response.hasOwnProperty('ref_msg'));
     178           
    178179            if (response.task_status === 'processing') {
    179180
     
    191192                if(response.message && jQuery('#task-status-modal bdi').length==0 && jQuery('#task-status-modal-percentage-text').is(":visible")){
    192193                    jQuery(response.message).insertAfter('#task-status-modal .obs-progress');
    193                     console.log((jQuery('#task-status-modal-percentage-text').is(":visible")?'true':'false'));
     194                   
    194195                }
    195196                if (response.hasOwnProperty('ref_msg')){
    196                     alert('complete suceess');
    197                     window.location.reload(true);   
     197                    jQuery('#stop-current-task').hide();
     198                    alert(response.ref_msg);
     199                    /*setTimeout(function() {
     200                        window.location.reload(true);
     201                    }, 5000);*/
     202                   
     203                    clearInterval(timeOutResult);
    198204                }
    199205                return;
    200206            }
    201207            /* Recurse it */
    202             update_progress_form(action);
     208            //update_progress_form(action);
    203209
    204210        }, action);
    205211
    206     }, 1500);
     212    }, 5000);
    207213
    208214}
     
    217223            'action': action,
    218224        },
    219 
     225        timeout: 30000,
    220226        success: function (raw_response, e) {
    221227
     
    228234        },
    229235        failed: function (response) {
    230             console.error(response);
     236            console.error('scheduler:'.response);
    231237        }
    232238    })
  • arvancloud-object-storage/tags/1.13.0/inc/Admin/Admin.php

    r3243158 r3248887  
    679679
    680680        $acs_settings = get_option( 'acs_settings' );
    681         if(false == $acs_settings['sync-attachment-deletion'])
     681        if(isset($acs_settings['sync-attachment-deletion']) and false == $acs_settings['sync-attachment-deletion'])
    682682            return;
    683683
  • arvancloud-object-storage/tags/1.13.0/inc/Admin/Controllers/BulkDownloadController.php

    r3243158 r3248887  
    109109                foreach ($all_downloadable_file_names as $source_file) {
    110110
     111                   
     112
    111113                    $is_already_pending = $memory_db->get_option_by_fields(array(
    112114                        'operation'=>'DOWNLOAD',
     
    118120                        continue;
    119121
    120                         $result = $s3client->getObjectTagging([
    121                             'Bucket' => $bucket,
    122                             'Key' => $source_file,
    123                         ]);
    124 
     122                    /*$result = $s3client->getObjectTagging([
     123                        'Bucket' => $bucket,
     124                        'Key' => $source_file,
     125                    ]);
     126                   
    125127                    if(!isset($result['TagSet'][0]['Key']))
    126128                        continue;
    127 
     129                    */
    128130                    $memory_db->create_operation(array(
    129131                        'operation'=>'DOWNLOAD',
     
    269271        $bucket = Helper::get_bucket_name();
    270272
    271 
    272273        $upload_dir = wp_upload_dir();
    273274
     
    308309
    309310
    310     public function get_full_file_list($bucket){
     311    public function get_full_file_list($bucket=''){
     312        global $wpdb;
     313        $bucket   = empty($bucket)?$bucket = Helper::get_bucket_name():$bucket;
    311314        $s3client = (S3Singletone::get_instance())->get_s3client();
    312         $results = $s3client->getPaginator('ListObjectsV2', [
     315        $results  = $s3client->getPaginator('ListObjectsV2', [
    313316            'Bucket' => $bucket
    314317        ]);
    315 
    316318        $keys = array();
    317319
    318320        foreach ($results->search('Contents[].Key') as $key) {
     321            $filename = basename($key);
     322            if(strpos(wp_check_filetype($filename , null )['type'], 'image/')===0){
     323                $f_name = preg_replace('/\-\d+x\d+\./','.',$filename);
     324                if($filename != $f_name){
     325                    $check = $wpdb->get_var("select post_id from $wpdb->postmeta where meta_key='_wp_attached_file' and meta_value like '%$f_name'");
     326                    $filtered = array_filter($keys, function($item) use ($f_name) {
     327                        return strpos($item, $f_name) !== false;
     328                    });
     329                   
     330                    if(!empty($check) or !empty($filtered))
     331                        continue;
     332                }
     333            }
    319334            $keys[] = $key;
    320335        }
  • arvancloud-object-storage/tags/1.13.0/inc/Admin/Controllers/BulkUploaderController.php

    r3243158 r3248887  
    250250                    ));
    251251                    $date = date('Y-m-d H:i:s');
    252                     file_put_contents($this->bulk_err_file, "[$date] [#$post_id] [".$e->getMessage()."]\n", FILE_APPEND);
     252                    file_put_contents($this->bulk_err_file, "[$date] [#{$unserialized_key['post_id']}] [".$e->getMessage()."]\n", FILE_APPEND);
    253253               
    254254                    continue;
     
    550550
    551551    public function get_bulk_upload_task_status(){
     552        //in-progress
    552553        $memory_db = CustomDB::get_instance();
    553554
     
    570571
    571572        }else{
    572 
     573            $updir = wp_upload_dir();
    573574            if( !(KueueCore::get_instance())->has_pending_job('obs_do_bulk_upload')){
    574575                $option_values['task_status'] = 'done';
    575576                if($option_values['files_count']>$option_values['processed_files_count']){
    576                     $updir = wp_upload_dir();
    577577                    $option_values['message'] = sprintf("<p><bdi>%d ". __('item failed and skipped. ' ,'arvancloud-object-storage' ). ' <a href="'.$updir['baseurl'].'/bulk_upload.txt">'.__('Download Log','arvancloud-object-storage').'</a></bdi></p>', ($option_values['files_count']-$option_values['processed_files_count']));
    578578                }
    579579                if($option_values['files_count']>0 and $option_values['processed_files_count']>0)
    580580                $option_values['ref_msg'] = __('The bulk upload operation has been successfully done','arvancloud-object-storage');
    581             }
    582 
     581            }else{
     582                //end task if scheduler task is failed
     583                global $wpdb;
     584                $action = $wpdb->get_var("select status from {$wpdb->prefix}actionscheduler_actions where hook='obs_do_bulk_upload' order by action_id desc limit 1");
     585                if($action=='failed'){
     586                    $option_values['message'] = sprintf("<p><bdi>%d ". __('item failed and skipped. ' ,'arvancloud-object-storage' ). ' <a href="'.$updir['baseurl'].'/bulk_upload.txt">'.__('Download Log','arvancloud-object-storage').'</a></bdi></p>', ($option_values['files_count']-$option_values['processed_files_count']));
     587                    $option_values['ref_msg'] = __('The bulk upload operation has been failed done','arvancloud-object-storage');
     588                }
     589            }
    583590        }
    584591
  • arvancloud-object-storage/tags/1.13.0/vendor/composer/installed.php

    r3243158 r3248887  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'db0ef1454413071850c2ec40154823a077857e9c',
     6        'reference' => '0e7132884dc1b3ab39b32007f142a3b0da346e61',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    5959            'pretty_version' => 'dev-master',
    6060            'version' => 'dev-master',
    61             'reference' => 'db0ef1454413071850c2ec40154823a077857e9c',
     61            'reference' => '0e7132884dc1b3ab39b32007f142a3b0da346e61',
    6262            'type' => 'library',
    6363            'install_path' => __DIR__ . '/../../',
  • arvancloud-object-storage/tags/1.13.0/wp-arvancloud-storage.php

    r3243158 r3248887  
    1010 * Plugin URI:        https://www.arvancloud.com/fa/products/cloud-storage
    1111 * Description:       Using ArvanCloud Storage Plugin you can offload, back up and upload your WordPress files and databases directly to your ArvanCloud object storage bucket. This easy-to-use plugin allows you to back up, restore and store your files simply and securely to a cost-effective, unlimited cloud storage. No need for expensive hosting services anymore.
    12  * Version:           1.12.0
     12 * Version:           1.13.0
    1313 * Author:            ArvanCloud
    1414 * Author URI:        https://www.arvancloud.com/en/products/cloud-storage
     
    2929}
    3030
    31 define( 'ACS_VERSION', '1.12.0' );
     31define( 'ACS_VERSION', '1.13.0' );
    3232define( 'ACS_NAME', __( 'ArvanCloud Storage', 'arvancloud-object-storage' ) );
    3333define( 'ACS_SLUG', 'wp-arvancloud-storage');
  • arvancloud-object-storage/trunk/README.txt

    r3243158 r3248887  
    55Tested up to: 6.7
    66Requires PHP: 7.1
    7 Stable tag: 1.12.0
     7Stable tag: 1.13.0
    88License: GPLv3
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    4848
    4949== Changelog ==
     50= 1.13.0 - 2025-03-01 =
     51* fix: Resolved the issue with permanent file deletion
     52* improvement: Enhanced bulk upload and bulk download operations
     53
    5054= 1.12.0 - 2025-02-19 =
    5155* feature: Added new WP CLI commands for better control over plugin operations. Includes: 
     
    5963
    6064For more details, use: `wp ac-storage help` 
    61 
    6265
    6366= 1.11.1 - 2025-02-09 =
  • arvancloud-object-storage/trunk/admin/partials/partial-bulk-upload-modal.php

    r3243158 r3248887  
    120120    jQuery(document).ready(function () {
    121121        /* Runs when form loaded if current scheduled process is running */
    122         update_progress_form('get_bulk_upload_task_status');
     122        <?php
     123        global $wpdb;
     124        $active = $wpdb->get_var("select ifnull(count(id),0) from {$wpdb->prefix}obs_operations where operation='UPLOAD' and status='pending'");
     125        //prevent show complete in loop if task is complete
     126        if(!empty($active))
     127        echo "update_progress_form('get_bulk_upload_task_status');";
     128        ?>
     129    });
    123130
    124 });
    125 
    126 var input = document.querySelector('textarea[name=file_ext]');
    127 new Tagify(input);
     131    var input = document.querySelector('textarea[name=file_ext]');
     132    new Tagify(input);
    128133</script>
  • arvancloud-object-storage/trunk/assets/js/bulkops.js

    r3237224 r3248887  
    1313                '_nonce': acs_media.nonces.generate_acl_url
    1414            },
     15            timeout: 30000,
    1516            success:function(data) {
    1617
     
    6970                url: acs_media.ajax_url,
    7071                data: data,
     72                timeout: 30000,
    7173                success: function (response) {
    72                     console.log(response);
     74                    console.log('submit: '.response);
    7375                    success_handler(response, status_action);
    7476                    jQuery('#submit-form-acceptance').removeClass('loading');
     
    7880                },
    7981                failed: function (response) {
    80                     console.log(response);
    8182                    jQuery('#form-acceptance-response-fail').text(response.data.message);
    8283                    jQuery('#form-acceptance-response-fail').show();
     
    104105                'action': action,
    105106            },
    106 
     107            timeout: 30000,
    107108            success: function (raw_response, e) {
    108109
     
    120121            },
    121122            failed: function (response) {
    122                 console.error(response);
     123                console.error('stop: '.response);
    123124            }
    124125        })
     
    173174function update_progress_form(action) {
    174175
    175     let timeOutResult = setTimeout(function () {
     176    let timeOutResult = setInterval(function () {
    176177        get_schedule_status(function (response) {
    177             console.log(response.hasOwnProperty('ref_msg'));
     178           
    178179            if (response.task_status === 'processing') {
    179180
     
    191192                if(response.message && jQuery('#task-status-modal bdi').length==0 && jQuery('#task-status-modal-percentage-text').is(":visible")){
    192193                    jQuery(response.message).insertAfter('#task-status-modal .obs-progress');
    193                     console.log((jQuery('#task-status-modal-percentage-text').is(":visible")?'true':'false'));
     194                   
    194195                }
    195196                if (response.hasOwnProperty('ref_msg')){
    196                     alert('complete suceess');
    197                     window.location.reload(true);   
     197                    jQuery('#stop-current-task').hide();
     198                    alert(response.ref_msg);
     199                    /*setTimeout(function() {
     200                        window.location.reload(true);
     201                    }, 5000);*/
     202                   
     203                    clearInterval(timeOutResult);
    198204                }
    199205                return;
    200206            }
    201207            /* Recurse it */
    202             update_progress_form(action);
     208            //update_progress_form(action);
    203209
    204210        }, action);
    205211
    206     }, 1500);
     212    }, 5000);
    207213
    208214}
     
    217223            'action': action,
    218224        },
    219 
     225        timeout: 30000,
    220226        success: function (raw_response, e) {
    221227
     
    228234        },
    229235        failed: function (response) {
    230             console.error(response);
     236            console.error('scheduler:'.response);
    231237        }
    232238    })
  • arvancloud-object-storage/trunk/inc/Admin/Admin.php

    r3243158 r3248887  
    679679
    680680        $acs_settings = get_option( 'acs_settings' );
    681         if(false == $acs_settings['sync-attachment-deletion'])
     681        if(isset($acs_settings['sync-attachment-deletion']) and false == $acs_settings['sync-attachment-deletion'])
    682682            return;
    683683
  • arvancloud-object-storage/trunk/inc/Admin/Controllers/BulkDownloadController.php

    r3243158 r3248887  
    109109                foreach ($all_downloadable_file_names as $source_file) {
    110110
     111                   
     112
    111113                    $is_already_pending = $memory_db->get_option_by_fields(array(
    112114                        'operation'=>'DOWNLOAD',
     
    118120                        continue;
    119121
    120                         $result = $s3client->getObjectTagging([
    121                             'Bucket' => $bucket,
    122                             'Key' => $source_file,
    123                         ]);
    124 
     122                    /*$result = $s3client->getObjectTagging([
     123                        'Bucket' => $bucket,
     124                        'Key' => $source_file,
     125                    ]);
     126                   
    125127                    if(!isset($result['TagSet'][0]['Key']))
    126128                        continue;
    127 
     129                    */
    128130                    $memory_db->create_operation(array(
    129131                        'operation'=>'DOWNLOAD',
     
    269271        $bucket = Helper::get_bucket_name();
    270272
    271 
    272273        $upload_dir = wp_upload_dir();
    273274
     
    308309
    309310
    310     public function get_full_file_list($bucket){
     311    public function get_full_file_list($bucket=''){
     312        global $wpdb;
     313        $bucket   = empty($bucket)?$bucket = Helper::get_bucket_name():$bucket;
    311314        $s3client = (S3Singletone::get_instance())->get_s3client();
    312         $results = $s3client->getPaginator('ListObjectsV2', [
     315        $results  = $s3client->getPaginator('ListObjectsV2', [
    313316            'Bucket' => $bucket
    314317        ]);
    315 
    316318        $keys = array();
    317319
    318320        foreach ($results->search('Contents[].Key') as $key) {
     321            $filename = basename($key);
     322            if(strpos(wp_check_filetype($filename , null )['type'], 'image/')===0){
     323                $f_name = preg_replace('/\-\d+x\d+\./','.',$filename);
     324                if($filename != $f_name){
     325                    $check = $wpdb->get_var("select post_id from $wpdb->postmeta where meta_key='_wp_attached_file' and meta_value like '%$f_name'");
     326                    $filtered = array_filter($keys, function($item) use ($f_name) {
     327                        return strpos($item, $f_name) !== false;
     328                    });
     329                   
     330                    if(!empty($check) or !empty($filtered))
     331                        continue;
     332                }
     333            }
    319334            $keys[] = $key;
    320335        }
  • arvancloud-object-storage/trunk/inc/Admin/Controllers/BulkUploaderController.php

    r3243158 r3248887  
    250250                    ));
    251251                    $date = date('Y-m-d H:i:s');
    252                     file_put_contents($this->bulk_err_file, "[$date] [#$post_id] [".$e->getMessage()."]\n", FILE_APPEND);
     252                    file_put_contents($this->bulk_err_file, "[$date] [#{$unserialized_key['post_id']}] [".$e->getMessage()."]\n", FILE_APPEND);
    253253               
    254254                    continue;
     
    550550
    551551    public function get_bulk_upload_task_status(){
     552        //in-progress
    552553        $memory_db = CustomDB::get_instance();
    553554
     
    570571
    571572        }else{
    572 
     573            $updir = wp_upload_dir();
    573574            if( !(KueueCore::get_instance())->has_pending_job('obs_do_bulk_upload')){
    574575                $option_values['task_status'] = 'done';
    575576                if($option_values['files_count']>$option_values['processed_files_count']){
    576                     $updir = wp_upload_dir();
    577577                    $option_values['message'] = sprintf("<p><bdi>%d ". __('item failed and skipped. ' ,'arvancloud-object-storage' ). ' <a href="'.$updir['baseurl'].'/bulk_upload.txt">'.__('Download Log','arvancloud-object-storage').'</a></bdi></p>', ($option_values['files_count']-$option_values['processed_files_count']));
    578578                }
    579579                if($option_values['files_count']>0 and $option_values['processed_files_count']>0)
    580580                $option_values['ref_msg'] = __('The bulk upload operation has been successfully done','arvancloud-object-storage');
    581             }
    582 
     581            }else{
     582                //end task if scheduler task is failed
     583                global $wpdb;
     584                $action = $wpdb->get_var("select status from {$wpdb->prefix}actionscheduler_actions where hook='obs_do_bulk_upload' order by action_id desc limit 1");
     585                if($action=='failed'){
     586                    $option_values['message'] = sprintf("<p><bdi>%d ". __('item failed and skipped. ' ,'arvancloud-object-storage' ). ' <a href="'.$updir['baseurl'].'/bulk_upload.txt">'.__('Download Log','arvancloud-object-storage').'</a></bdi></p>', ($option_values['files_count']-$option_values['processed_files_count']));
     587                    $option_values['ref_msg'] = __('The bulk upload operation has been failed done','arvancloud-object-storage');
     588                }
     589            }
    583590        }
    584591
  • arvancloud-object-storage/trunk/vendor/composer/installed.php

    r3243158 r3248887  
    44        'pretty_version' => 'dev-master',
    55        'version' => 'dev-master',
    6         'reference' => 'db0ef1454413071850c2ec40154823a077857e9c',
     6        'reference' => '0e7132884dc1b3ab39b32007f142a3b0da346e61',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    5959            'pretty_version' => 'dev-master',
    6060            'version' => 'dev-master',
    61             'reference' => 'db0ef1454413071850c2ec40154823a077857e9c',
     61            'reference' => '0e7132884dc1b3ab39b32007f142a3b0da346e61',
    6262            'type' => 'library',
    6363            'install_path' => __DIR__ . '/../../',
  • arvancloud-object-storage/trunk/wp-arvancloud-storage.php

    r3243158 r3248887  
    1010 * Plugin URI:        https://www.arvancloud.com/fa/products/cloud-storage
    1111 * Description:       Using ArvanCloud Storage Plugin you can offload, back up and upload your WordPress files and databases directly to your ArvanCloud object storage bucket. This easy-to-use plugin allows you to back up, restore and store your files simply and securely to a cost-effective, unlimited cloud storage. No need for expensive hosting services anymore.
    12  * Version:           1.12.0
     12 * Version:           1.13.0
    1313 * Author:            ArvanCloud
    1414 * Author URI:        https://www.arvancloud.com/en/products/cloud-storage
     
    2929}
    3030
    31 define( 'ACS_VERSION', '1.12.0' );
     31define( 'ACS_VERSION', '1.13.0' );
    3232define( 'ACS_NAME', __( 'ArvanCloud Storage', 'arvancloud-object-storage' ) );
    3333define( 'ACS_SLUG', 'wp-arvancloud-storage');
Note: See TracChangeset for help on using the changeset viewer.