Changeset 3179971
- Timestamp:
- 11/01/2024 01:44:04 PM (4 months ago)
- 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 */ 2 2 a.atakanau{content:"https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html"} 3 3 .tabarea-aauicri .tab-pane { … … 23 23 24 24 .aauicri-infobar>span{ 25 margin: auto;25 margin: auto; 26 26 } 27 27 … … 33 33 .aauicri-frame0 td{ 34 34 vertical-align:top; 35 } 36 37 .aauicri-importprogressbar-0 { 38 display: inline-block; 35 39 } 36 40 -
import-cdn-remote-images/trunk/assets/js/aauicri.js
r2585698 r3179971 1 1 jQuery(function ( $ ) { 2 aauicri_info=['Import CDN-Remote Images Plugin v2. 00https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html']2 aauicri_info=['Import CDN-Remote Images Plugin v2.1.2 https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html'] 3 3 // import page 4 4 if($("#aauicri_page-import").length){ -
import-cdn-remote-images/trunk/import-cdn-remote-images.php
r2671680 r3179971 4 4 Plugin URI: https://atakanau.blogspot.com/2020/10/import-cdn-remote-images-wp-plugin.html 5 5 Description: Add Cloudinary images and videos to the media library without importing, i.e. uploading them to your WordPress site. 6 Version: 2. 016 Version: 2.1.2 7 7 Author: Atakan Au 8 8 Author URI: https://atakanau.blogspot.com … … 22 22 23 23 #region define stuff 24 define('AAUICRI_VERSION', '2. 00');24 define('AAUICRI_VERSION', '2.1.2'); 25 25 define('AAUICRI_PLUGIN_URL', plugin_dir_url(__FILE__)); 26 26 define('AAUICRI_PLUGIN_DIR', plugin_dir_path(__FILE__)); … … 153 153 #region online 154 154 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 172 ,$rsc["width"]173 ,$rsc["height"]174 ,'image/' . ( $rsc["format"]=='jpg' ? 'jpeg' : $rsc["format"] )175 ];176 }177 178 if( $data->limit ) // finish179 $data->page = ".";180 else // read next page181 $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'] : "."; 182 182 183 183 #endregion online … … 186 186 elseif( $req_type == 'add_to_media_library'){ 187 187 $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 js192 188 } 193 189 } … … 819 815 } 820 816 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 ?> 822 839 <div class="aauicri-infobar"> 823 840 <span class=""> … … 825 842 <?php _e('Visit my blog. The ads on the website may help me earn some tip. ;)', AAUICRI_PLUGIN_DOMAIN); ?> 826 843 <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> 828 845 <br/><br/> 829 846 <i class="dashicons dashicons-wordpress-alt dashicons-wordpress"></i> … … 844 861 public function aauFooter(){?> 845 862 <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> 847 864 <?php } 848 865 #endregion pages -
import-cdn-remote-images/trunk/readme.txt
r3155649 r3179971 4 4 Tags: remote image, remote media, cdn image, external media, cloudinary 5 5 Requires at least: 4.7.4 6 Tested up to: 6. 67 Stable tag: 2. 016 Tested up to: 6.7 7 Stable tag: 2.1.2 8 8 Requires PHP: 5.6 9 9 License: GPLv3 or later … … 22 22 (others coming soon) 23 23 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=i cridesc&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) 25 25 26 26 Need a custom work? … … 50 50 == Changelog == 51 51 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` 54 56 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 57 For 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. 59 58 60 59 = Version 1.0.0 =
Note: See TracChangeset
for help on using the changeset viewer.