Media from FTP - Version 10.07

Version Description

Fixed problem of uppercase file suffix. Fixed the problem of obtaining the shooting date and time of Exif. Changed add-ons link.

Download this release

Release Info

Developer Katsushi Kawamori
Plugin Icon wp plugin Media from FTP
Version 10.07
Comparing to
See all releases

Code changes from version 10.06 to 10.07

inc/MediaFromFtp.php CHANGED
@@ -259,7 +259,10 @@ class MediaFromFtp {
259
  private function create_cash($ext, $file, $new_url){
260
 
261
  $cash_thumb_key = md5($new_url);
262
- if ( strtolower($ext) === 'pdf' ) {
 
 
 
263
  $cash_thumb_filename = $this->plugin_tmp_dir.'/'.$cash_thumb_key.'-pdf.jpg';
264
  } else {
265
  $cash_thumb_filename = $this->plugin_tmp_dir.'/'.$cash_thumb_key.'.'.$ext;
@@ -278,7 +281,7 @@ class MediaFromFtp {
278
  if ( ! file_exists( $cash_thumb_filename )) {
279
  $cash_thumb = wp_get_image_editor( $file );
280
  if ( ! is_wp_error( $cash_thumb ) ) {
281
- if ( strtolower($ext) === 'pdf' ) {
282
  $cash_thumb->generate_filename( 'image', null, 'jpg' );
283
  $cash_thumb->save( $cash_thumb_filename );
284
  $cash_thumb2 = wp_get_image_editor( $cash_thumb_filename );
@@ -322,7 +325,9 @@ class MediaFromFtp {
322
  */
323
  public function delete_cash($ext, $new_url_attach){
324
 
325
- if ( wp_ext2type($ext) === 'image' || strtolower($ext) === 'pdf' ){
 
 
326
  $del_cash_thumb_key = md5($new_url_attach);
327
  if ( strtolower($ext) === 'pdf' ) {
328
  $del_cash_thumb_filename = $this->plugin_tmp_dir.'/'.$del_cash_thumb_key.'-pdf.jpg';
@@ -387,15 +392,12 @@ class MediaFromFtp {
387
  $date = get_date_from_gmt(date("Y-m-d H:i:s", filemtime($file)));
388
 
389
  if ( $dateset === 'exif' ) {
390
- // for wp_read_image_metadata
391
- include_once( ABSPATH . 'wp-admin/includes/image.php' );
392
- $exifdata = wp_read_image_metadata( $file );
393
-
394
- if ( $exifdata ) {
395
- $exif_ux_time = $exifdata['created_timestamp'];
396
- if ( !empty($exif_ux_time) ) {
397
- $date = date_i18n( "Y-m-d H:i:s", $exif_ux_time, FALSE );
398
- }
399
  }
400
  }
401
 
259
  private function create_cash($ext, $file, $new_url){
260
 
261
  $cash_thumb_key = md5($new_url);
262
+
263
+ $ext = strtolower($ext);
264
+
265
+ if ( $ext === 'pdf' ) {
266
  $cash_thumb_filename = $this->plugin_tmp_dir.'/'.$cash_thumb_key.'-pdf.jpg';
267
  } else {
268
  $cash_thumb_filename = $this->plugin_tmp_dir.'/'.$cash_thumb_key.'.'.$ext;
281
  if ( ! file_exists( $cash_thumb_filename )) {
282
  $cash_thumb = wp_get_image_editor( $file );
283
  if ( ! is_wp_error( $cash_thumb ) ) {
284
+ if ( $ext === 'pdf' ) {
285
  $cash_thumb->generate_filename( 'image', null, 'jpg' );
286
  $cash_thumb->save( $cash_thumb_filename );
287
  $cash_thumb2 = wp_get_image_editor( $cash_thumb_filename );
325
  */
326
  public function delete_cash($ext, $new_url_attach){
327
 
328
+ $ext = strtolower($ext);
329
+
330
+ if ( wp_ext2type($ext) === 'image' || $ext === 'pdf' ){
331
  $del_cash_thumb_key = md5($new_url_attach);
332
  if ( strtolower($ext) === 'pdf' ) {
333
  $del_cash_thumb_filename = $this->plugin_tmp_dir.'/'.$del_cash_thumb_key.'-pdf.jpg';
392
  $date = get_date_from_gmt(date("Y-m-d H:i:s", filemtime($file)));
393
 
394
  if ( $dateset === 'exif' ) {
395
+ $exifdata = @exif_read_data( $file, FILE, TRUE );
396
+ if ( isset($exifdata["EXIF"]['DateTimeOriginal']) && !empty($exifdata["EXIF"]['DateTimeOriginal']) ) {
397
+ $shooting_date_time = $exifdata["EXIF"]['DateTimeOriginal'];
398
+ $shooting_date = str_replace( ':', '-', substr( $shooting_date_time , 0 , 10 ) );
399
+ $shooting_time = substr( $shooting_date_time , 10);
400
+ $date = $shooting_date.$shooting_time;
 
 
 
401
  }
402
  }
403
 
mediafromftp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Media from FTP
4
  Plugin URI: https://wordpress.org/plugins/media-from-ftp/
5
- Version: 10.06
6
  Description: Register to media library from files that have been uploaded by FTP.
7
  Author: Katsushi Kawamori
8
  Author URI: https://riverforest-wp.info/
2
  /*
3
  Plugin Name: Media from FTP
4
  Plugin URI: https://wordpress.org/plugins/media-from-ftp/
5
+ Version: 10.07
6
  Description: Register to media library from files that have been uploaded by FTP.
7
  Author: Katsushi Kawamori
8
  Author URI: https://riverforest-wp.info/
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
  === Media from FTP ===
2
  Contributors: Katsushi Kawamori
3
- Donate link: https://riverforest-wp.info/donate/
4
  Tags: files, ftp, import, media, sync, uploads
5
  Requires at least: 3.6.0
6
  Requires PHP: 5.3.0
7
  Tested up to: 4.9
8
- Stable tag: 10.06
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -22,8 +22,15 @@ Register to media library from files that have been uploaded by FTP.
22
  * To Import the files to Media Library from a WordPress export file.
23
  * You can register a large number of files without timeout work with Ajax.
24
 
 
25
  [youtube https://www.youtube.com/watch?v=vdxPvOFZaDk]
26
 
 
 
 
 
 
 
27
  = Why I made this? =
28
  * In the media uploader, you may not be able to upload by the environment of server. That's when the files are large. You do not mind the size of the file if FTP.
29
 
@@ -123,6 +130,11 @@ Register to media library from files that have been uploaded by FTP.
123
 
124
  == Changelog ==
125
 
 
 
 
 
 
126
  = 10.06 =
127
  Removed unnecessary code.
128
  Fixed problem of path acquisition.
1
  === Media from FTP ===
2
  Contributors: Katsushi Kawamori
3
+ Donate link: https://shop.riverforest-wp.info/donate/
4
  Tags: files, ftp, import, media, sync, uploads
5
  Requires at least: 3.6.0
6
  Requires PHP: 5.3.0
7
  Tested up to: 4.9
8
+ Stable tag: 10.07
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
22
  * To Import the files to Media Library from a WordPress export file.
23
  * You can register a large number of files without timeout work with Ajax.
24
 
25
+ = Tutorial Video =
26
  [youtube https://www.youtube.com/watch?v=vdxPvOFZaDk]
27
 
28
+ = Live Demo =
29
+ I prepared live demo including add-ons.
30
+ User Name: liveuser1
31
+ Password: live789user
32
+ [Live Demo](https://live1.riverforest-wp.info/wordpress/wp-login.php)
33
+
34
  = Why I made this? =
35
  * In the media uploader, you may not be able to upload by the environment of server. That's when the files are large. You do not mind the size of the file if FTP.
36
 
130
 
131
  == Changelog ==
132
 
133
+ = 10.07 =
134
+ Fixed problem of uppercase file suffix.
135
+ Fixed the problem of obtaining the shooting date and time of Exif.
136
+ Changed add-ons link.
137
+
138
  = 10.06 =
139
  Removed unnecessary code.
140
  Fixed problem of path acquisition.
req/MediaFromFtpAdmin.php CHANGED
@@ -1487,7 +1487,7 @@ class MediaFromFtpAdmin {
1487
  } else {
1488
  ?>
1489
  <div>
1490
- <a href="<?php _e('https://media-from-ftp.riverforest-wp.info/media-from-ftp-add-on-cli/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1491
  </div>
1492
  <?php
1493
  }
@@ -1515,7 +1515,7 @@ class MediaFromFtpAdmin {
1515
  } else {
1516
  ?>
1517
  <div>
1518
- <a href="<?php _e('https://media-from-ftp.riverforest-wp.info/media-from-ftp-add-on-wpcron/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1519
  </div>
1520
  <?php
1521
  }
@@ -1542,7 +1542,7 @@ class MediaFromFtpAdmin {
1542
  } else {
1543
  ?>
1544
  <div>
1545
- <a href="<?php _e('https://media-from-ftp.riverforest-wp.info/media-from-ftp-add-on-category/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1546
  </div>
1547
  <?php
1548
  }
@@ -1571,7 +1571,7 @@ class MediaFromFtpAdmin {
1571
  } else {
1572
  ?>
1573
  <div>
1574
- <a href="<?php _e('https://media-from-ftp.riverforest-wp.info/media-from-ftp-add-on-exif/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1575
  </div>
1576
  <?php
1577
  }
1487
  } else {
1488
  ?>
1489
  <div>
1490
+ <a href="<?php _e('https://shop.riverforest-wp.info/media-from-ftp-add-on-cli/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1491
  </div>
1492
  <?php
1493
  }
1515
  } else {
1516
  ?>
1517
  <div>
1518
+ <a href="<?php _e('https://shop.riverforest-wp.info/media-from-ftp-add-on-wpcron/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1519
  </div>
1520
  <?php
1521
  }
1542
  } else {
1543
  ?>
1544
  <div>
1545
+ <a href="<?php _e('https://shop.riverforest-wp.info/media-from-ftp-add-on-category/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1546
  </div>
1547
  <?php
1548
  }
1571
  } else {
1572
  ?>
1573
  <div>
1574
+ <a href="<?php _e('https://shop.riverforest-wp.info/media-from-ftp-add-on-exif/', 'media-from-ftp'); ?>" target="_blank" class="page-title-action"><?php _e('BUY', 'media-from-ftp'); ?></a>
1575
  </div>
1576
  <?php
1577
  }