Plugin Directory

Changeset 3179971


Ignore:
Timestamp:
11/01/2024 01:44:04 PM (4 months ago)
Author:
atakanau
Message:

Version 2.1.2

Location:
import-cdn-remote-images
Files:
14 added
4 edited

Legend:

Unmodified
Added
Removed
  • import-cdn-remote-images/trunk/assets/css/aauicri.css

    r2585698 r3179971  
    1 /* Import CDN-Remote Images Plugin https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html v2.00 */
     1/* Import CDN-Remote Images Plugin https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html v2.1.2 */
    22a.atakanau{content:"https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html"}
    33.tabarea-aauicri .tab-pane {
     
    2323
    2424.aauicri-infobar>span{
    25 margin: auto;
     25    margin: auto;
    2626}
    2727
     
    3333.aauicri-frame0 td{
    3434    vertical-align:top;
     35}
     36
     37.aauicri-importprogressbar-0 {
     38    display: inline-block;
    3539}
    3640
  • import-cdn-remote-images/trunk/assets/js/aauicri.js

    r2585698 r3179971  
    11jQuery(function ( $ ) {
    2 aauicri_info=['Import CDN-Remote Images Plugin v2.00 https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html']
     2aauicri_info=['Import CDN-Remote Images Plugin v2.1.2 https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html']
    33// import page
    44if($("#aauicri_page-import").length){
  • import-cdn-remote-images/trunk/import-cdn-remote-images.php

    r2671680 r3179971  
    44Plugin URI: https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html
    55Description: Add Cloudinary images and videos to the media library without importing, i.e. uploading them to your WordPress site.
    6 Version: 2.01
     6Version: 2.1.2
    77Author: Atakan Au
    88Author URI: https://atakanau.blogspot.com
     
    2222
    2323#region define stuff
    24 define('AAUICRI_VERSION', '2.00');
     24define('AAUICRI_VERSION', '2.1.2');
    2525define('AAUICRI_PLUGIN_URL', plugin_dir_url(__FILE__));
    2626define('AAUICRI_PLUGIN_DIR', plugin_dir_path(__FILE__));
     
    153153                    #region online
    154154
    155     $handle = curl_init();
    156     $url = 'https://'.$data->cloudinary->api_key.':'.$data->cloudinary->api_secret.'@api.cloudinary.com/v1_1/'.$data->cloudinary->cloud_name.'/resources/image'
    157         .'?max_results='.( $data->limit ? $data->limit : '500' )
    158         .( $data->page == '' ? '' : '&next_cursor='.$data->page )
    159         ;
    160     curl_setopt($handle, CURLOPT_URL, $url);
    161     curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
    162     $readed = curl_exec($handle);
    163     curl_close($handle);
    164     $data_result=json_decode($readed, true);
    165 
    166     $data->results = $data_result;
    167     $data->library = array();
    168     if(isset($data_result['resources']))
    169         foreach($data_result['resources'] as $rsc){
    170             $data->library[] = [    // [URL],[Width],[Height],[mime]
    171                  $data->https ? $rsc["secure_url"] : $rsc["url"]
    172                 ,$rsc["width"]
    173                 ,$rsc["height"]
    174                 ,'image/' . ( $rsc["format"]=='jpg' ? 'jpeg' : $rsc["format"] )
    175             ];
    176         }
    177 
    178     if( $data->limit )  // finish
    179         $data->page = ".";
    180     else    // read next page
    181         $data->page = isset($data_result['next_cursor']) ? $data_result['next_cursor'] : ".";
     155                    $handle = curl_init();
     156                    $url = 'https://'.$data->cloudinary->api_key.':'.$data->cloudinary->api_secret.'@api.cloudinary.com/v1_1/'.$data->cloudinary->cloud_name.'/resources/image'
     157                        .'?max_results='.( $data->limit ? $data->limit : '500' )
     158                        .( $data->page == '' ? '' : '&next_cursor='.$data->page )
     159                        ;
     160                    curl_setopt($handle, CURLOPT_URL, $url);
     161                    curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
     162                    $readed = curl_exec($handle);
     163                    curl_close($handle);
     164                    $data_result=json_decode($readed, true);
     165
     166                    $data->results = $data_result;
     167                    $data->library = array();
     168                    if(isset($data_result['resources']))
     169                        foreach($data_result['resources'] as $rsc){
     170                            $data->library[] = [    // [URL],[Width],[Height],[mime]
     171                                $data->https ? $rsc["secure_url"] : $rsc["url"]
     172                                ,$rsc["width"]
     173                                ,$rsc["height"]
     174                                ,'image/' . ( $rsc["format"]=='jpg' ? 'jpeg' : $rsc["format"] )
     175                            ];
     176                        }
     177
     178                    if( $data->limit )  // finish
     179                        $data->page = ".";
     180                    else    // read next page
     181                        $data->page = isset($data_result['next_cursor']) ? $data_result['next_cursor'] : ".";
    182182
    183183                    #endregion online
     
    186186            elseif( $req_type == 'add_to_media_library'){
    187187                $data->result = $this->fn_prepae_external_image_data();
    188 
    189                 $msg_single = isset($_POST["single"]) ? sanitize_text_field( $_POST["single"] ) : false;
    190                 $msg_multi  = isset($_POST["multi" ]) ? sanitize_text_field( $_POST["multi" ] ) : false;
    191                 $data->msg = sprintf( ( $attached > 1 ? $msg_multi : $msg_single ), number_format_i18n( $attached ) ); // unused in js
    192188            }
    193189        }
     
    819815    }
    820816
    821     public function aauInfoBar(){?>
     817    public function add_utm_parameters(){
     818        $url_blog = "https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html";
     819        $utm_parameters = array(
     820            'utm_source'    => home_url(),
     821            'utm_medium'    => 'link',
     822            'utm_content'   => 'textlink',
     823            'utm_campaign'  => AAUICRI_PLUGIN_DOMAIN
     824        );
     825        $url_parts = parse_url($url_blog);
     826        $query = [];
     827        if (isset($url_parts['query'])) {
     828            parse_str($url_parts['query'], $query);
     829        }
     830        $query = array_merge($query, $utm_parameters);
     831        $url_parts['query'] = http_build_query($query);
     832   
     833        // Yeni URL'yi oluştur
     834        return $url_blog .= "?{$url_parts['query']}";
     835    }
     836
     837    public function aauInfoBar(){
     838        ?>
    822839            <div class="aauicri-infobar">
    823840            <span class="">
     
    825842<?php _e('Visit my blog. The ads on the website may help me earn some tip. ;)', AAUICRI_PLUGIN_DOMAIN); ?>
    826843<br/>
    827 <a href="https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html" target="_blank">atakanau.blogspot.com</a>
     844<a href="<?php echo $this->add_utm_parameters(); ?>" target="_blank">atakanau.blogspot.com</a>
    828845<br/><br/>
    829846<i class="dashicons dashicons-wordpress-alt dashicons-wordpress"></i>
     
    844861    public function aauFooter(){?>
    845862            <hr/>
    846             <div class="metabox-holder-disabled textright"><span class="postbox">   <a href="<?php echo AAUICRI_SUPPORT_LINK; ?>" target="_blank">atakanau.blogspot.com</a>   </span></div>
     863            <div class="metabox-holder-disabled textright"><span class="postbox">   <a href="<?php echo $this->add_utm_parameters(); ?>" target="_blank">atakanau.blogspot.com</a>   </span></div>
    847864    <?php }
    848865    #endregion pages
  • import-cdn-remote-images/trunk/readme.txt

    r3155649 r3179971  
    44Tags: remote image, remote media, cdn image, external media, cloudinary
    55Requires at least: 4.7.4
    6 Tested up to: 6.6
    7 Stable tag: 2.01
     6Tested up to: 6.7
     7Stable tag: 2.1.2
    88Requires PHP: 5.6
    99License: GPLv3 or later
     
    2222(others coming soon)
    2323
    24 [Blog and feedback](https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html?utm_content=textlink&utm_medium=link&utm_source=wporg&utm_campaign=icridesc&utm_term=icri)
     24[Blog and feedback](https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html?utm_content=textlink&utm_medium=link&utm_source=wporg&utm_campaign=import-cdn-remote-images-desc)
    2525
    2626Need a custom work?
     
    5050== Changelog ==
    5151
    52 = Version 2.01 =
    53 * Bumped up "Tested up to: 5.9"
     52= Version 2.1.2 =
     53* Minor code changes
     54* Tested up to:
     55  * `6.7`
    5456
    55 = Version 2.00 =
    56 * Added: Bulk custom URL import
    57 * Improved: User interface
    58 * Fixed: Not showing submenu link for WooCommerce Shop Manager users
     57For the changelog of earlier versions, please refer to [Import CDN-Remote Images changelog](https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html?utm_content=textlink&utm_medium=link&utm_source=wporg&utm_campaign=import-cdn-remote-images-changelog) section on blog.
    5958
    6059= Version 1.0.0 =
Note: See TracChangeset for help on using the changeset viewer.