Plugin Directory

Changeset 2315282


Ignore:
Timestamp:
05/31/2020 10:33:37 AM (6 years ago)
Author:
image4io
Message:

update version 0.3.3

Location:
image4io
Files:
9 edited
33 copied

Legend:

Unmodified
Added
Removed
  • image4io/tags/0.3.3/image4io.php

    r2315019 r2315282  
    88Description: Speeds up the images' load time: image optimization, image CDN and image storage, all-in-one platform. To get started: activate the image4io plugin and then go to your Image4io Settings page to set up your credentials.
    99Author: image4io
    10 Version: 0.3.2
     10Version: 0.3.3
    1111Author URI: https://image4.io
    1212*/
  • image4io/tags/0.3.3/inc/Api/Callbacks/AdminCallbacks.php

    r2292451 r2315282  
    5050    }
    5151
     52    public function image4ioTargetFolder($args){
     53        $name=$args['label_for'];
     54        $optionName=$args['option_name'];
     55        $options=get_option($optionName);
     56        $value=isset($options[$name])?$options[$name]:"";
     57
     58        echo "<input type='text' id='$name' class='regular-text' name='" . $optionName . "[" . $name . "]' value='$value' placeholder='/'>";
     59    }
    5260
    5361    public function image4ioAutoUpload($args){
  • image4io/tags/0.3.3/inc/Api/Image4IOApi.php

    r2292451 r2315282  
    8080    }
    8181
    82     public function deleteFile($name){
     82    public function deleteImage($name){
    8383        $args= array(
    8484            'headers'=>$this->getHeaders(),
    85             'method'=>'DELETE'
     85            'method'=>'DELETE',
     86            'body'=>json_encode(array(
     87                'name'=>$name,
     88            ))
    8689        );
    87         $response=wp_remote_request( $this->urlWithVersion . 'deletefile?name=' . urlencode($name), $args );
     90        $response=wp_remote_request( $this->urlWithVersion . 'deleteImage', $args );
    8891        return $response['body'];
    8992    }
  • image4io/tags/0.3.3/inc/Api/Image4IOManager.php

    r2261008 r2315282  
    7373        return json_decode($result);
    7474    }
     75
     76    public function deleteImage($name){
     77        if(!$this->isValidOptions()){
     78            return; //redirect to options page?
     79        }
     80        $result=$this->apiClient->deleteImage($name);
     81        return json_decode( $result );
     82    }
    7583}
  • image4io/tags/0.3.3/inc/Manager/MediaManager.php

    r2315242 r2315282  
    354354        }
    355355
     356        $name=$md['image4io_name'];
     357        $manager = new Image4IOManager;
     358        $manager->setup();
     359        $result = $manager->deleteImage($name);
     360
    356361        $this->update_image_src_all($attachment_id, $old_url, $md['original_url']);
    357362    }
     
    384389        $full_path = $this->update_urls_for_ssl($full_path);
    385390
     391        $target_path = "/";
     392        $values=get_option( "image4io_settings" );
     393        if(isset($values["target_folder"])){
     394            $target_path=$values["target_folder"];
     395        }
     396
    386397        $manager = new Image4IOManager;
    387398        $manager->setup();
    388         $result = $manager->uploadToImage4ioFromUrl($full_path,"/");
     399        $result = $manager->uploadToImage4ioFromUrl($full_path,$target_path);
    389400       
    390401        if(!isset($result->fetchedImage)){
  • image4io/tags/0.3.3/inc/Pages/Admin.php

    r2292451 r2315282  
    108108            ),
    109109            array(
     110                'id' => 'target_folder',
     111                'title' => '<div data-tooltip-location="right" data-tooltip="Images will be uploaded to a target folder path e.g. /myWebsite ">Target Folder<span class="dashicons dashicons-info"></span></div>',
     112                'callback' => array( $this->callbacks, 'image4ioTargetFolder' ),
     113                'page' => 'image4io_plugin',
     114                'section' => 'image4io_admin_dashboard_index',
     115                'args' => array(
     116                    'option_name'=>'image4io_settings',
     117                    'label_for' => 'target_folder'
     118                )
     119            ),
     120            array(
    110121                'id' => 'auto_upload',
    111122                'title' => '<div data-tooltip-location="right" data-tooltip="If checked, all new images uploaded to the Media Library will be uploaded to image4io Storage">Auto Upload to Image4io<span class="dashicons dashicons-info"></span></div>',
  • image4io/tags/0.3.3/package-lock.json

    r2315019 r2315282  
    11{
    22  "name": "image4io",
    3   "version": "0.3.2",
     3  "version": "0.3.3",
    44  "lockfileVersion": 1,
    55  "requires": true,
  • image4io/tags/0.3.3/package.json

    r2315019 r2315282  
    11{
    22  "name": "image4io",
    3   "version": "0.3.2",
     3  "version": "0.3.3",
    44  "description": "image4io Wordpress Plugin. Speeds up the images' load time: image optimization, image CDN and image storage, all-in-one platform.",
    55  "main": "index.js",
  • image4io/tags/0.3.3/readme.txt

    r2315019 r2315282  
    124124* Fixed a bug when uploading images to image4io servers.
    125125
     126= 0.3.3 =
     127* Fixed a bug when uploading images to image4io servers.
     128* Added an option of "Target Folder". It will configure your target folder of the image4io Storage.
     129
    126130== UPGRADE NOTICE ==
    127131
  • image4io/trunk/image4io.php

    r2315019 r2315282  
    88Description: Speeds up the images' load time: image optimization, image CDN and image storage, all-in-one platform. To get started: activate the image4io plugin and then go to your Image4io Settings page to set up your credentials.
    99Author: image4io
    10 Version: 0.3.2
     10Version: 0.3.3
    1111Author URI: https://image4.io
    1212*/
  • image4io/trunk/inc/Api/Callbacks/AdminCallbacks.php

    r2292451 r2315282  
    5050    }
    5151
     52    public function image4ioTargetFolder($args){
     53        $name=$args['label_for'];
     54        $optionName=$args['option_name'];
     55        $options=get_option($optionName);
     56        $value=isset($options[$name])?$options[$name]:"";
     57
     58        echo "<input type='text' id='$name' class='regular-text' name='" . $optionName . "[" . $name . "]' value='$value' placeholder='/'>";
     59    }
    5260
    5361    public function image4ioAutoUpload($args){
  • image4io/trunk/inc/Api/Image4IOApi.php

    r2292451 r2315282  
    8080    }
    8181
    82     public function deleteFile($name){
     82    public function deleteImage($name){
    8383        $args= array(
    8484            'headers'=>$this->getHeaders(),
    85             'method'=>'DELETE'
     85            'method'=>'DELETE',
     86            'body'=>json_encode(array(
     87                'name'=>$name,
     88            ))
    8689        );
    87         $response=wp_remote_request( $this->urlWithVersion . 'deletefile?name=' . urlencode($name), $args );
     90        $response=wp_remote_request( $this->urlWithVersion . 'deleteImage', $args );
    8891        return $response['body'];
    8992    }
  • image4io/trunk/inc/Api/Image4IOManager.php

    r2261008 r2315282  
    7373        return json_decode($result);
    7474    }
     75
     76    public function deleteImage($name){
     77        if(!$this->isValidOptions()){
     78            return; //redirect to options page?
     79        }
     80        $result=$this->apiClient->deleteImage($name);
     81        return json_decode( $result );
     82    }
    7583}
  • image4io/trunk/inc/Manager/MediaManager.php

    r2315242 r2315282  
    354354        }
    355355
     356        $name=$md['image4io_name'];
     357        $manager = new Image4IOManager;
     358        $manager->setup();
     359        $result = $manager->deleteImage($name);
     360
    356361        $this->update_image_src_all($attachment_id, $old_url, $md['original_url']);
    357362    }
     
    384389        $full_path = $this->update_urls_for_ssl($full_path);
    385390
     391        $target_path = "/";
     392        $values=get_option( "image4io_settings" );
     393        if(isset($values["target_folder"])){
     394            $target_path=$values["target_folder"];
     395        }
     396
    386397        $manager = new Image4IOManager;
    387398        $manager->setup();
    388         $result = $manager->uploadToImage4ioFromUrl($full_path,"/");
     399        $result = $manager->uploadToImage4ioFromUrl($full_path,$target_path);
    389400       
    390401        if(!isset($result->fetchedImage)){
  • image4io/trunk/inc/Pages/Admin.php

    r2292451 r2315282  
    108108            ),
    109109            array(
     110                'id' => 'target_folder',
     111                'title' => '<div data-tooltip-location="right" data-tooltip="Images will be uploaded to a target folder path e.g. /myWebsite ">Target Folder<span class="dashicons dashicons-info"></span></div>',
     112                'callback' => array( $this->callbacks, 'image4ioTargetFolder' ),
     113                'page' => 'image4io_plugin',
     114                'section' => 'image4io_admin_dashboard_index',
     115                'args' => array(
     116                    'option_name'=>'image4io_settings',
     117                    'label_for' => 'target_folder'
     118                )
     119            ),
     120            array(
    110121                'id' => 'auto_upload',
    111122                'title' => '<div data-tooltip-location="right" data-tooltip="If checked, all new images uploaded to the Media Library will be uploaded to image4io Storage">Auto Upload to Image4io<span class="dashicons dashicons-info"></span></div>',
  • image4io/trunk/package-lock.json

    r2315019 r2315282  
    11{
    22  "name": "image4io",
    3   "version": "0.3.2",
     3  "version": "0.3.3",
    44  "lockfileVersion": 1,
    55  "requires": true,
  • image4io/trunk/package.json

    r2315019 r2315282  
    11{
    22  "name": "image4io",
    3   "version": "0.3.2",
     3  "version": "0.3.3",
    44  "description": "image4io Wordpress Plugin. Speeds up the images' load time: image optimization, image CDN and image storage, all-in-one platform.",
    55  "main": "index.js",
  • image4io/trunk/readme.txt

    r2315019 r2315282  
    124124* Fixed a bug when uploading images to image4io servers.
    125125
     126= 0.3.3 =
     127* Fixed a bug when uploading images to image4io servers.
     128* Added an option of "Target Folder". It will configure your target folder of the image4io Storage.
     129
    126130== UPGRADE NOTICE ==
    127131
Note: See TracChangeset for help on using the changeset viewer.