Media from FTP - Version 11.01

Version Description

Supported WordPress 5.3.

Download this release

Release Info

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

Code changes from version 11.00 to 11.01

inc/class-mediafromftp.php CHANGED
@@ -914,7 +914,11 @@ class MediaFromFtp {
914
  $copy_file_new1 = null;
915
  $copy_file_new2 = null;
916
  $copy_file_new3 = null;
917
- $postdategmt = date_i18n( 'Y-m-d H:i:s', false, true );
 
 
 
 
918
  if ( 'server' === $dateset || 'exif' === $dateset ) {
919
  $postdategmt = get_gmt_from_date( $new_url_datetime . ':00' );
920
  }
@@ -956,7 +960,12 @@ class MediaFromFtp {
956
  wp_mkdir_p( $this->mb_encode_multibyte( $this->upload_dir . $subdir, $character_code ) );
957
  }
958
  if ( file_exists( $this->mb_encode_multibyte( $this->upload_dir . $subdir . '/' . $filename_base, $character_code ) ) ) {
959
- $filename_base = wp_basename( $filename, $suffix_attach_file ) . date_i18n( 'dHis', false, false ) . $suffix_attach_file;
 
 
 
 
 
960
  }
961
  $copy_file_org3 = $this->mb_encode_multibyte( $filename, $character_code );
962
  $copy_file_new3 = $this->mb_encode_multibyte( $this->upload_dir . $subdir . '/' . $filename_base, $character_code );
914
  $copy_file_new1 = null;
915
  $copy_file_new2 = null;
916
  $copy_file_new3 = null;
917
+ if ( function_exists( 'wp_date' ) ) {
918
+ $postdategmt = wp_date( 'Y-m-d H:i:s', null, new DateTimeZone( 'UTC' ) );
919
+ } else {
920
+ $postdategmt = date_i18n( 'Y-m-d H:i:s', false, true );
921
+ }
922
  if ( 'server' === $dateset || 'exif' === $dateset ) {
923
  $postdategmt = get_gmt_from_date( $new_url_datetime . ':00' );
924
  }
960
  wp_mkdir_p( $this->mb_encode_multibyte( $this->upload_dir . $subdir, $character_code ) );
961
  }
962
  if ( file_exists( $this->mb_encode_multibyte( $this->upload_dir . $subdir . '/' . $filename_base, $character_code ) ) ) {
963
+ if ( function_exists( 'wp_date' ) ) {
964
+ $regist_date = wp_date( 'dHis' );
965
+ } else {
966
+ $regist_date = date_i18n( 'dHis' );
967
+ }
968
+ $filename_base = wp_basename( $filename, $suffix_attach_file ) . $regist_date . $suffix_attach_file;
969
  }
970
  $copy_file_org3 = $this->mb_encode_multibyte( $filename, $character_code );
971
  $copy_file_new3 = $this->mb_encode_multibyte( $this->upload_dir . $subdir . '/' . $filename_base, $character_code );
mediafromftp.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Media from FTP
4
  * Plugin URI: https://wordpress.org/plugins/media-from-ftp/
5
  * Description: Register to media library from files that have been uploaded by FTP.
6
- * Version: 11.00
7
  * Author: Katsushi Kawamori
8
  * Author URI: https://riverforest-wp.info/
9
  * License: GPL2
3
  * Plugin Name: Media from FTP
4
  * Plugin URI: https://wordpress.org/plugins/media-from-ftp/
5
  * Description: Register to media library from files that have been uploaded by FTP.
6
+ * Version: 11.01
7
  * Author: Katsushi Kawamori
8
  * Author URI: https://riverforest-wp.info/
9
  * License: GPL2
readme.txt CHANGED
@@ -4,8 +4,8 @@ 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.6
7
- Tested up to: 5.2
8
- Stable tag: 11.00
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -41,6 +41,7 @@ Password: live789user
41
  * Français [Li-An](https://www.echodesplugins.li-an.fr/)
42
  * Italian [ironicmoka](https://profiles.wordpress.org/photoironic/)
43
  * Russian [khomenkov](https://awesomeprintstudio.com/)
 
44
 
45
  == Installation ==
46
 
@@ -130,6 +131,9 @@ Password: live789user
130
 
131
  == Changelog ==
132
 
 
 
 
133
  = 11.00 =
134
  Conformed to the WordPress coding standard.
135
  The code at the time of registration was reviewed and the speed has improved.
4
  Tags: files, ftp, import, media, sync, uploads
5
  Requires at least: 3.6.0
6
  Requires PHP: 5.6
7
+ Tested up to: 5.3
8
+ Stable tag: 11.01
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
41
  * Français [Li-An](https://www.echodesplugins.li-an.fr/)
42
  * Italian [ironicmoka](https://profiles.wordpress.org/photoironic/)
43
  * Russian [khomenkov](https://awesomeprintstudio.com/)
44
+ * Persian[lusha](https://profiles.wordpress.org/lusha/)
45
 
46
  == Installation ==
47
 
131
 
132
  == Changelog ==
133
 
134
+ = 11.01 =
135
+ Supported WordPress 5.3.
136
+
137
  = 11.00 =
138
  Conformed to the WordPress coding standard.
139
  The code at the time of registration was reviewed and the speed has improved.
req/class-mediafromftpadmin.php CHANGED
@@ -1229,7 +1229,11 @@ class MediaFromFtpAdmin {
1229
  $mediafromftp_settings = get_option( $this->wp_options_name() );
1230
  if ( 'server' === $mediafromftp_settings['dateset'] || 'exif' === $mediafromftp_settings['dateset'] ) {
1231
  if ( $this->is_my_plugin_screen3() ) {
1232
- $now_date_time = date_i18n( 'Y-m-d H:i' );
 
 
 
 
1233
  $html = '<div style="float: right;">' . __( 'Bulk Change', 'media-from-ftp' ) . '<input type="text" id="datetimepicker-mediafromftp0" name="bulk_mediafromftp_datetime" value="' . $now_date_time . '" style="width: 160px; height: 1.7em;" /></div>';
1234
  $allowed_html = array(
1235
  'div' => array(
@@ -2179,7 +2183,11 @@ class MediaFromFtpAdmin {
2179
  if ( isset( $_POST['media_from_ftp_settings_cron_event_create'] ) && ! empty( $_POST['media_from_ftp_settings_cron_event_create'] ) ) {
2180
  if ( check_admin_referer( 'mff_settings_cron_event_create', 'media_from_ftp_settings_cron_event_create' ) ) {
2181
  if ( ! empty( $_POST['mediafromftp_cron_event_create'] ) ) {
2182
- $event_id = date_i18n( 'Y-m-d-H-i-s' );
 
 
 
 
2183
  $event_option_name = 'mediafromftp_cronevent-' . $event_id;
2184
  $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name(), array() );
2185
  $mediafromftp_cron_events[ $event_id ] = $event_option_name;
1229
  $mediafromftp_settings = get_option( $this->wp_options_name() );
1230
  if ( 'server' === $mediafromftp_settings['dateset'] || 'exif' === $mediafromftp_settings['dateset'] ) {
1231
  if ( $this->is_my_plugin_screen3() ) {
1232
+ if ( function_exists( 'wp_date' ) ) {
1233
+ $now_date_time = wp_date( 'Y-m-d H:i' );
1234
+ } else {
1235
+ $now_date_time = date_i18n( 'Y-m-d H:i' );
1236
+ }
1237
  $html = '<div style="float: right;">' . __( 'Bulk Change', 'media-from-ftp' ) . '<input type="text" id="datetimepicker-mediafromftp0" name="bulk_mediafromftp_datetime" value="' . $now_date_time . '" style="width: 160px; height: 1.7em;" /></div>';
1238
  $allowed_html = array(
1239
  'div' => array(
2183
  if ( isset( $_POST['media_from_ftp_settings_cron_event_create'] ) && ! empty( $_POST['media_from_ftp_settings_cron_event_create'] ) ) {
2184
  if ( check_admin_referer( 'mff_settings_cron_event_create', 'media_from_ftp_settings_cron_event_create' ) ) {
2185
  if ( ! empty( $_POST['mediafromftp_cron_event_create'] ) ) {
2186
+ if ( function_exists( 'wp_date' ) ) {
2187
+ $event_id = wp_date( 'Y-m-d-H-i-s' );
2188
+ } else {
2189
+ $event_id = date_i18n( 'Y-m-d-H-i-s' );
2190
+ }
2191
  $event_option_name = 'mediafromftp_cronevent-' . $event_id;
2192
  $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name(), array() );
2193
  $mediafromftp_cron_events[ $event_id ] = $event_option_name;
req/class-mediafromftpregist.php CHANGED
@@ -203,7 +203,11 @@ class MediaFromFtpRegist {
203
  $extfilter = 'all';
204
  $search_display_metadata = true;
205
  $dateset = 'new';
206
- $datefixed = date_i18n( 'Y-m-d H:i' );
 
 
 
 
207
  $datetimepicker = 1;
208
  $max_execution_time = 300;
209
  if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' && get_locale() === 'ja' ) { /* Japanese Windows */
203
  $extfilter = 'all';
204
  $search_display_metadata = true;
205
  $dateset = 'new';
206
+ if ( function_exists( 'wp_date' ) ) {
207
+ $datefixed = wp_date( 'Y-m-d H:i' );
208
+ } else {
209
+ $datefixed = date_i18n( 'Y-m-d H:i' );
210
+ }
211
  $datetimepicker = 1;
212
  $max_execution_time = 300;
213
  if ( strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN' && get_locale() === 'ja' ) { /* Japanese Windows */