Plugin Directory

Changeset 2245014


Ignore:
Timestamp:
02/16/2020 04:37:09 AM (6 years ago)
Author:
keeross
Message:

Update to version 2.2.0 from GitHub

Location:
do-spaces-sync
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • do-spaces-sync/tags/2.2.0/dos_class.php

    r2134607 r2245014  
    184184    $new_filename = $filename;
    185185    $fileparts = pathinfo($filename);
    186 
    187     while ( $filesystem->has( $subdir . "/$new_filename" ) ) {
     186    $cdnPath = rtrim($this->storage_path,'/') . '/' . ltrim($subdir,'/') . '/' . $new_filename;
     187    while ( $filesystem->has( $cdnPath ) ) {
    188188      $new_filename = $fileparts['filename'] . "-$number." . $fileparts['extension'];
    189189      $number = (int) $number + 1;
     190      $cdnPath = rtrim($this->storage_path,'/') . '/' . ltrim($subdir,'/') . '/' . $new_filename;
    190191    }
    191192
     
    228229
    229230        $path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $metadata['file'];
    230         array_push($paths, $path);
     231
     232        if ( !in_array($path, $paths) ) {
     233          array_push($paths, $path);
     234        }
    231235
    232236        // set basepath for other sizes
     
    268272  // METHODS
    269273  public function test_connection () {
    270 
     274    if($_SERVER['REQUEST_METHOD'] === 'POST'){
     275        $postData = $_POST;
     276        $keys = ['key' => 'dos_key','secret' => 'dos_secret','endpoint' => 'dos_endpoint','container' => 'dos_container'];
     277        foreach ($keys as $prop => $key) {
     278            if(isset($postData[$key])){
     279                $this->$prop = $postData[$key];
     280            }
     281        }
     282    }
    271283    try {
    272284   
  • do-spaces-sync/tags/2.2.0/loader.php

    r2134611 r2245014  
    44 * Plugin URI: https://github.com/keeross/DO-Spaces-Wordpress-Sync
    55 * Description: This WordPress plugin syncs your media library with DigitalOcean Spaces Container.
    6  * Version: 2.1.0
     6 * Version: 2.2.0
    77 * Author: keeross
    88 * Author URI: https://github.com/keeross
  • do-spaces-sync/tags/2.2.0/readme.txt

    r2134611 r2245014  
    44Tags: digitalocean, spaces, cloud, storage, object, s3
    55Requires at least: 4.6
    6 Tested up to: 5.2.2
    7 Stable tag: 2.1.0
     6Tested up to: 5.3.2
     7Stable tag: 2.2.0
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    4646
    4747== Changelog ==
     48
     49= 2.2.0 =
     50* Fix Test Connection ignore post data (https://github.com/keeross/DigitalOcean-Spaces-Sync/pull/27)
     51* Fix dupe files in delete attachment (https://github.com/keeross/DigitalOcean-Spaces-Sync/pull/33)
    4852
    4953= 2.1.0 =
  • do-spaces-sync/trunk/dos_class.php

    r2134607 r2245014  
    184184    $new_filename = $filename;
    185185    $fileparts = pathinfo($filename);
    186 
    187     while ( $filesystem->has( $subdir . "/$new_filename" ) ) {
     186    $cdnPath = rtrim($this->storage_path,'/') . '/' . ltrim($subdir,'/') . '/' . $new_filename;
     187    while ( $filesystem->has( $cdnPath ) ) {
    188188      $new_filename = $fileparts['filename'] . "-$number." . $fileparts['extension'];
    189189      $number = (int) $number + 1;
     190      $cdnPath = rtrim($this->storage_path,'/') . '/' . ltrim($subdir,'/') . '/' . $new_filename;
    190191    }
    191192
     
    228229
    229230        $path = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . $metadata['file'];
    230         array_push($paths, $path);
     231
     232        if ( !in_array($path, $paths) ) {
     233          array_push($paths, $path);
     234        }
    231235
    232236        // set basepath for other sizes
     
    268272  // METHODS
    269273  public function test_connection () {
    270 
     274    if($_SERVER['REQUEST_METHOD'] === 'POST'){
     275        $postData = $_POST;
     276        $keys = ['key' => 'dos_key','secret' => 'dos_secret','endpoint' => 'dos_endpoint','container' => 'dos_container'];
     277        foreach ($keys as $prop => $key) {
     278            if(isset($postData[$key])){
     279                $this->$prop = $postData[$key];
     280            }
     281        }
     282    }
    271283    try {
    272284   
  • do-spaces-sync/trunk/loader.php

    r2134611 r2245014  
    44 * Plugin URI: https://github.com/keeross/DO-Spaces-Wordpress-Sync
    55 * Description: This WordPress plugin syncs your media library with DigitalOcean Spaces Container.
    6  * Version: 2.1.0
     6 * Version: 2.2.0
    77 * Author: keeross
    88 * Author URI: https://github.com/keeross
  • do-spaces-sync/trunk/readme.txt

    r2134611 r2245014  
    44Tags: digitalocean, spaces, cloud, storage, object, s3
    55Requires at least: 4.6
    6 Tested up to: 5.2.2
    7 Stable tag: 2.1.0
     6Tested up to: 5.3.2
     7Stable tag: 2.2.0
    88License: MIT
    99License URI: https://opensource.org/licenses/MIT
     
    4646
    4747== Changelog ==
     48
     49= 2.2.0 =
     50* Fix Test Connection ignore post data (https://github.com/keeross/DigitalOcean-Spaces-Sync/pull/27)
     51* Fix dupe files in delete attachment (https://github.com/keeross/DigitalOcean-Spaces-Sync/pull/33)
    4852
    4953= 2.1.0 =
Note: See TracChangeset for help on using the changeset viewer.