Media from FTP - Version 10.08

Version Description

Fixed problem of getting user ID.

Download this release

Release Info

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

Code changes from version 10.07 to 10.08

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.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/
2
  /*
3
  Plugin Name: Media from FTP
4
  Plugin URI: https://wordpress.org/plugins/media-from-ftp/
5
+ Version: 10.08
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
@@ -5,7 +5,7 @@ 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
 
@@ -130,99 +130,14 @@ Password: live789user
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.
141
-
142
- = 10.05 =
143
- Fixed initial setup problem of log creation for multi-site.
144
-
145
- = 10.04 =
146
- Built in addons update checker.
147
- Fixed problem of server path status view.
148
-
149
- = 10.03 =
150
- Add server path status.
151
-
152
- = 10.02 =
153
- Fixed problem of cache at search.
154
- Fixed problem of translation.
155
-
156
- = 10.01 =
157
- Fixed problem of database error when first activation.
158
- Added file type and file extension to the search options on the setting page.
159
-
160
- = 10.00 =
161
- Fixed problem of error of "Screen Options".
162
- Fixed fine problem.
163
-
164
- = 9.99 =
165
- Fixed fine problem.
166
-
167
- = 9.98 =
168
- Search option was added to the settings page.
169
-
170
- = 9.97 =
171
- Add thumbnail generation of PDF when Imagick is enabled.
172
-
173
- = 9.96 =
174
- Fixed problem of logs.
175
- Changed Add On link.
176
-
177
- = 9.95 =
178
- Fixed problem of robots.txt.
179
-
180
- = 9.94 =
181
- Changed donate link.
182
-
183
- = 9.93 =
184
- Fixed problem of category for Add On.
185
-
186
- = 9.92 =
187
- Fixed problem of category for Add On.
188
-
189
- = 9.91 =
190
- Added file recursive search option.
191
-
192
- = 9.90 =
193
- Security measures.
194
- Fixed problem of "Date and time input assistance" settings.
195
-
196
- = 9.89 =
197
- Fixed problem of date and time acquisition at registration.
198
-
199
- = 9.88 =
200
- Security measures.
201
-
202
- = 9.87 =
203
- Security measures.
204
-
205
- = 9.86 =
206
- Fixed problem of Directory-Traversal. Thanks[Plugin Vulnerabilities](https://www.pluginvulnerabilities.com/).
207
-
208
- = 9.85 =
209
- Fixed problem of Directory-Traversal. Thanks[wpl0v3r](https://wordpress.org/support/users/wpl0v3r/).
210
-
211
- = 9.84 =
212
- Notices for when "Organize my uploads into month- and year-based folders" is checked.
213
-
214
- = 9.83 =
215
- Fixed by adding some functions of addon.
216
-
217
- = 9.82 =
218
- Fixed problem of add-ons.
219
-
220
- = 9.81 =
221
- Fixed problem of add-ons.
222
-
223
- = 9.80 =
224
- Fixed [PHP Object Injection Vulnerability](https://www.pluginvulnerabilities.com/2017/09/13/authenticated-php-object-injection-vulnerability-in-media-from-ftp/). Please do not use the previous version.
225
-
226
  == Upgrade Notice ==
227
 
228
  = 9.90 =
5
  Requires at least: 3.6.0
6
  Requires PHP: 5.3.0
7
  Tested up to: 4.9
8
+ Stable tag: 10.08
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
130
 
131
  == Changelog ==
132
 
133
+ = 10.08 =
134
+ Fixed problem of getting user ID.
135
+
136
  = 10.07 =
137
  Fixed problem of uppercase file suffix.
138
  Fixed the problem of obtaining the shooting date and time of Exif.
139
  Changed add-ons link.
140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  == Upgrade Notice ==
142
 
143
  = 9.90 =
req/MediaFromFtpAdmin.php CHANGED
@@ -35,6 +35,8 @@ class MediaFromFtpAdmin {
35
  private $plugin_tmp_dir;
36
  private $plugin_disallow_tmp_dir;
37
  private $is_add_on_activate;
 
 
38
 
39
  /* ==================================================
40
  * Construct
@@ -42,6 +44,12 @@ class MediaFromFtpAdmin {
42
  */
43
  public function __construct() {
44
 
 
 
 
 
 
 
45
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
46
  $slugs = explode('/', $plugin_base_dir);
47
  $slug = end($slugs);
@@ -189,7 +197,7 @@ class MediaFromFtpAdmin {
189
  */
190
  public function search_register_show_screen_options( $status, $args ) {
191
 
192
- $mediafromftp_settings = get_option($this->wp_options_name());
193
 
194
  $return = $status;
195
  if ( $args->base == 'media-from-ftp_page_mediafromftp-search-register' ) {
@@ -303,7 +311,7 @@ class MediaFromFtpAdmin {
303
  */
304
  public function load_custom_wp_admin_style() {
305
  if ($this->is_my_plugin_screen()) {
306
- $mediafromftp_settings = get_option($this->wp_options_name());
307
  if ( $mediafromftp_settings['datetimepicker'] ) {
308
  wp_enqueue_style( 'jquery-datetimepicker', $this->plugin_base_url.'/css/jquery.datetimepicker.css' );
309
  }
@@ -626,7 +634,7 @@ class MediaFromFtpAdmin {
626
  $mediafromftp_addon_exif = TRUE;
627
  }
628
 
629
- $mediafromftp_settings = get_option($this->wp_options_name());
630
 
631
  $def_max_execution_time = ini_get('max_execution_time');
632
  $scriptname = admin_url('admin.php?page=mediafromftp-settings');
@@ -923,7 +931,7 @@ class MediaFromFtpAdmin {
923
 
924
  <?php
925
  if ( $this->is_add_on_activate['cli'] ) {
926
- $mediafromftpcli->mediafromftp_command_line_html($this->wp_options_name());
927
  unset($mediafromftpcli);
928
  }
929
  ?>
@@ -950,7 +958,7 @@ class MediaFromFtpAdmin {
950
  $this->options_updated($submenu);
951
  }
952
  }
953
- $mediafromftp_settings = get_option($this->wp_options_name());
954
 
955
  $def_max_execution_time = ini_get('max_execution_time');
956
  $max_execution_time = $mediafromftp_settings['max_execution_time'];
@@ -1014,7 +1022,7 @@ class MediaFromFtpAdmin {
1014
  * @since 9.63
1015
  */
1016
  public function custom_bulk_admin_footer() {
1017
- $mediafromftp_settings = get_option($this->wp_options_name());
1018
  if ( $mediafromftp_settings['dateset'] === 'server' || $mediafromftp_settings['dateset'] === 'exif' ) {
1019
  if ($this->is_my_plugin_screen3()) {
1020
  $now_date_time = date_i18n("Y-m-d H:i");
@@ -1073,7 +1081,7 @@ class MediaFromFtpAdmin {
1073
  if ( check_admin_referer('mff_event', 'media_from_ftp_event') ) {
1074
  if ( isset($_POST['event-mediafromftp']) && $_POST['event-mediafromftp'] ) {
1075
  $events_mediafromftp = $mediafromftp->sanitize_array($_POST['event-mediafromftp']);
1076
- $events = get_option( $this->wp_add_on_wpcron_events_name() );
1077
  $event_names = NULL;
1078
  foreach ($events_mediafromftp as $key => $event_id ) {
1079
  $option_name = $events[$event_id];
@@ -1081,7 +1089,7 @@ class MediaFromFtpAdmin {
1081
  delete_option($option_name);
1082
  $event_names .= ' '.$event_id.' ';
1083
  unset($events[$event_id]);
1084
- update_option($this->wp_add_on_wpcron_events_name(), $events);
1085
  }
1086
  unset($mediafromftpcron);
1087
  echo $mediafromftpaddonwpcron->mediafromftp_event_notice_html($event_names);
@@ -1091,7 +1099,7 @@ class MediaFromFtpAdmin {
1091
 
1092
  $scriptname = admin_url('admin.php?page=mediafromftp-event');
1093
 
1094
- echo $mediafromftpaddonwpcron->mediafromftp_event_html( $scriptname, get_option($this->wp_add_on_wpcron_events_name()) );
1095
 
1096
  ?>
1097
  </div>
@@ -1108,7 +1116,7 @@ class MediaFromFtpAdmin {
1108
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
1109
  }
1110
 
1111
- $mediafromftp_settings = get_option($this->wp_options_name());
1112
  if ( !$mediafromftp_settings['log'] ) {
1113
  echo '<div class="notice notice-info is-dismissible"><ul><li>'.__('Current, log is not created. If you want to create a log, please put a check in the [Create log] in the settings.', 'media-from-ftp').'</li></ul></div>';
1114
  }
@@ -1590,7 +1598,7 @@ class MediaFromFtpAdmin {
1590
 
1591
  $mediafromftp = new MediaFromFtp();
1592
 
1593
- $mediafromftp_settings = get_option($this->wp_options_name());
1594
 
1595
  $addonwpcron = FALSE;
1596
  if ( $this->is_add_on_activate['wpcron'] ) {
@@ -1678,7 +1686,7 @@ class MediaFromFtpAdmin {
1678
  } else {
1679
  $mediafromftp_settings['mlat'] = NULL;
1680
  }
1681
- update_option( $this->wp_options_name(), $mediafromftp_settings );
1682
  if ( !empty($_POST['move_yearmonth_folders']) ) {
1683
  update_option( 'uploads_use_yearmonth_folders', 1 );
1684
  } else {
@@ -1732,7 +1740,7 @@ class MediaFromFtpAdmin {
1732
  if (isset($_POST['mediafromftp_thumb_deep_search'])){
1733
  $mediafromftp_settings['thumb_deep_search'] = sanitize_text_field($_POST['mediafromftp_thumb_deep_search']);
1734
  }
1735
- update_option( $this->wp_options_name(), $mediafromftp_settings );
1736
  break;
1737
  case 3:
1738
  if ( !empty($_POST['mediafromftp_clear_cash']) ) {
@@ -1748,7 +1756,7 @@ class MediaFromFtpAdmin {
1748
  // for media-from-ftp-add-on-wpcron
1749
  if ( $addonwpcron ) {
1750
  if ( !empty($_POST['mediafromftp_run_cron']) ) {
1751
- $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name() );
1752
  if ( !empty($_POST['cron-run']) ) {
1753
  $option_name = sanitize_text_field($_POST['cron-run']);
1754
  echo $mediafromftpaddonwpcron->CronRun($option_name);
@@ -1762,7 +1770,7 @@ class MediaFromFtpAdmin {
1762
  }
1763
  } else {
1764
  $mediafromftp_settings['cron']['apply'] = FALSE;
1765
- update_option( $this->wp_options_name(), $mediafromftp_settings );
1766
  }
1767
  break;
1768
  case 5:
@@ -1801,9 +1809,9 @@ class MediaFromFtpAdmin {
1801
  if ( !empty($_POST['mediafromftp_cron_event_create']) ) {
1802
  $event_id = date_i18n("Y-m-d-H-i-s");
1803
  $event_option_name = 'mediafromftp_cronevent-'.$event_id;
1804
- $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name(), array() );
1805
  $mediafromftp_cron_events[$event_id] = $event_option_name;
1806
- update_option( $this->wp_add_on_wpcron_events_name(), $mediafromftp_cron_events );
1807
  update_option( $event_option_name, $mediafromftp_settings);
1808
  echo $mediafromftpaddonwpcron->mediafromftp_cronevent_create_html();
1809
  }
@@ -1812,32 +1820,6 @@ class MediaFromFtpAdmin {
1812
 
1813
  }
1814
 
1815
- /* ==================================================
1816
- * @param none
1817
- * @return string $wp_options_name
1818
- * @since 9.18
1819
- */
1820
- public function wp_options_name(){
1821
-
1822
- $wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
1823
-
1824
- return $wp_options_name;
1825
-
1826
- }
1827
-
1828
- /* ==================================================
1829
- * @param none
1830
- * @return string $wp_cron_events_name
1831
- * @since 9.71
1832
- */
1833
- private function wp_add_on_wpcron_events_name(){
1834
-
1835
- $wp_cron_events_name = 'mediafromftp_add_on_wpcron_events'.'_'.get_current_user_id();
1836
-
1837
- return $wp_cron_events_name;
1838
-
1839
- }
1840
-
1841
  /* ==================================================
1842
  * @param string $output
1843
  * @return string $output
35
  private $plugin_tmp_dir;
36
  private $plugin_disallow_tmp_dir;
37
  private $is_add_on_activate;
38
+ private $wp_options_name;
39
+ private $wp_add_on_wpcron_events_name;
40
 
41
  /* ==================================================
42
  * Construct
44
  */
45
  public function __construct() {
46
 
47
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
48
+ include_once(ABSPATH . 'wp-includes/pluggable.php');
49
+ }
50
+ $this->wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
51
+ $this->wp_add_on_wpcron_events_name = 'mediafromftp_add_on_wpcron_events'.'_'.get_current_user_id();
52
+
53
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
54
  $slugs = explode('/', $plugin_base_dir);
55
  $slug = end($slugs);
197
  */
198
  public function search_register_show_screen_options( $status, $args ) {
199
 
200
+ $mediafromftp_settings = get_option($this->wp_options_name);
201
 
202
  $return = $status;
203
  if ( $args->base == 'media-from-ftp_page_mediafromftp-search-register' ) {
311
  */
312
  public function load_custom_wp_admin_style() {
313
  if ($this->is_my_plugin_screen()) {
314
+ $mediafromftp_settings = get_option($this->wp_options_name);
315
  if ( $mediafromftp_settings['datetimepicker'] ) {
316
  wp_enqueue_style( 'jquery-datetimepicker', $this->plugin_base_url.'/css/jquery.datetimepicker.css' );
317
  }
634
  $mediafromftp_addon_exif = TRUE;
635
  }
636
 
637
+ $mediafromftp_settings = get_option($this->wp_options_name);
638
 
639
  $def_max_execution_time = ini_get('max_execution_time');
640
  $scriptname = admin_url('admin.php?page=mediafromftp-settings');
931
 
932
  <?php
933
  if ( $this->is_add_on_activate['cli'] ) {
934
+ $mediafromftpcli->mediafromftp_command_line_html($this->wp_options_name);
935
  unset($mediafromftpcli);
936
  }
937
  ?>
958
  $this->options_updated($submenu);
959
  }
960
  }
961
+ $mediafromftp_settings = get_option($this->wp_options_name);
962
 
963
  $def_max_execution_time = ini_get('max_execution_time');
964
  $max_execution_time = $mediafromftp_settings['max_execution_time'];
1022
  * @since 9.63
1023
  */
1024
  public function custom_bulk_admin_footer() {
1025
+ $mediafromftp_settings = get_option($this->wp_options_name);
1026
  if ( $mediafromftp_settings['dateset'] === 'server' || $mediafromftp_settings['dateset'] === 'exif' ) {
1027
  if ($this->is_my_plugin_screen3()) {
1028
  $now_date_time = date_i18n("Y-m-d H:i");
1081
  if ( check_admin_referer('mff_event', 'media_from_ftp_event') ) {
1082
  if ( isset($_POST['event-mediafromftp']) && $_POST['event-mediafromftp'] ) {
1083
  $events_mediafromftp = $mediafromftp->sanitize_array($_POST['event-mediafromftp']);
1084
+ $events = get_option( $this->wp_add_on_wpcron_events_name );
1085
  $event_names = NULL;
1086
  foreach ($events_mediafromftp as $key => $event_id ) {
1087
  $option_name = $events[$event_id];
1089
  delete_option($option_name);
1090
  $event_names .= ' '.$event_id.' ';
1091
  unset($events[$event_id]);
1092
+ update_option($this->wp_add_on_wpcron_events_name, $events);
1093
  }
1094
  unset($mediafromftpcron);
1095
  echo $mediafromftpaddonwpcron->mediafromftp_event_notice_html($event_names);
1099
 
1100
  $scriptname = admin_url('admin.php?page=mediafromftp-event');
1101
 
1102
+ echo $mediafromftpaddonwpcron->mediafromftp_event_html( $scriptname, get_option($this->wp_add_on_wpcron_events_name) );
1103
 
1104
  ?>
1105
  </div>
1116
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
1117
  }
1118
 
1119
+ $mediafromftp_settings = get_option($this->wp_options_name);
1120
  if ( !$mediafromftp_settings['log'] ) {
1121
  echo '<div class="notice notice-info is-dismissible"><ul><li>'.__('Current, log is not created. If you want to create a log, please put a check in the [Create log] in the settings.', 'media-from-ftp').'</li></ul></div>';
1122
  }
1598
 
1599
  $mediafromftp = new MediaFromFtp();
1600
 
1601
+ $mediafromftp_settings = get_option($this->wp_options_name);
1602
 
1603
  $addonwpcron = FALSE;
1604
  if ( $this->is_add_on_activate['wpcron'] ) {
1686
  } else {
1687
  $mediafromftp_settings['mlat'] = NULL;
1688
  }
1689
+ update_option( $this->wp_options_name, $mediafromftp_settings );
1690
  if ( !empty($_POST['move_yearmonth_folders']) ) {
1691
  update_option( 'uploads_use_yearmonth_folders', 1 );
1692
  } else {
1740
  if (isset($_POST['mediafromftp_thumb_deep_search'])){
1741
  $mediafromftp_settings['thumb_deep_search'] = sanitize_text_field($_POST['mediafromftp_thumb_deep_search']);
1742
  }
1743
+ update_option( $this->wp_options_name, $mediafromftp_settings );
1744
  break;
1745
  case 3:
1746
  if ( !empty($_POST['mediafromftp_clear_cash']) ) {
1756
  // for media-from-ftp-add-on-wpcron
1757
  if ( $addonwpcron ) {
1758
  if ( !empty($_POST['mediafromftp_run_cron']) ) {
1759
+ $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name );
1760
  if ( !empty($_POST['cron-run']) ) {
1761
  $option_name = sanitize_text_field($_POST['cron-run']);
1762
  echo $mediafromftpaddonwpcron->CronRun($option_name);
1770
  }
1771
  } else {
1772
  $mediafromftp_settings['cron']['apply'] = FALSE;
1773
+ update_option( $this->wp_options_name, $mediafromftp_settings );
1774
  }
1775
  break;
1776
  case 5:
1809
  if ( !empty($_POST['mediafromftp_cron_event_create']) ) {
1810
  $event_id = date_i18n("Y-m-d-H-i-s");
1811
  $event_option_name = 'mediafromftp_cronevent-'.$event_id;
1812
+ $mediafromftp_cron_events = get_option( $this->wp_add_on_wpcron_events_name, array() );
1813
  $mediafromftp_cron_events[$event_id] = $event_option_name;
1814
+ update_option( $this->wp_add_on_wpcron_events_name, $mediafromftp_cron_events );
1815
  update_option( $event_option_name, $mediafromftp_settings);
1816
  echo $mediafromftpaddonwpcron->mediafromftp_cronevent_create_html();
1817
  }
1820
 
1821
  }
1822
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1823
  /* ==================================================
1824
  * @param string $output
1825
  * @return string $output
req/MediaFromFtpAjax.php CHANGED
@@ -26,6 +26,7 @@ class MediaFromFtpAjax {
26
  private $upload_dir;
27
  private $upload_url;
28
  private $is_add_on_activate;
 
29
 
30
  /* ==================================================
31
  * Construct
@@ -33,6 +34,11 @@ class MediaFromFtpAjax {
33
  */
34
  public function __construct() {
35
 
 
 
 
 
 
36
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
37
  $slugs = explode('/', $plugin_base_dir);
38
  $slug = end($slugs);
@@ -44,10 +50,6 @@ class MediaFromFtpAjax {
44
  $mediafromftp = new MediaFromFtp();
45
  list($this->upload_dir, $this->upload_url, $upload_path) = $mediafromftp->upload_dir_url_path();
46
 
47
- if(!class_exists('MediaFromFtpAdmin')){
48
- require_once( $plugin_base_dir.'/req/MediaFromFtpAdmin.php' );
49
- }
50
-
51
  $category_active = FALSE;
52
  if( function_exists('media_from_ftp_add_on_category_load_textdomain') ){
53
  include_once $plugin_dir.'/media-from-ftp-add-on-category/inc/MediaFromFtpAddOnCategory.php';
@@ -91,9 +93,7 @@ class MediaFromFtpAjax {
91
  $new_url_mlatags = sanitize_text_field($_POST["new_mlatags"]);
92
  }
93
 
94
- $mediafromftpadmin = new MediaFromFtpAdmin();
95
- $mediafromftp_settings = get_option($mediafromftpadmin->wp_options_name());
96
- unset($mediafromftpadmin);
97
 
98
  if (!empty($new_url_attach)) {
99
 
26
  private $upload_dir;
27
  private $upload_url;
28
  private $is_add_on_activate;
29
+ private $wp_options_name;
30
 
31
  /* ==================================================
32
  * Construct
34
  */
35
  public function __construct() {
36
 
37
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
38
+ include_once(ABSPATH . 'wp-includes/pluggable.php');
39
+ }
40
+ $this->wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
41
+
42
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
43
  $slugs = explode('/', $plugin_base_dir);
44
  $slug = end($slugs);
50
  $mediafromftp = new MediaFromFtp();
51
  list($this->upload_dir, $this->upload_url, $upload_path) = $mediafromftp->upload_dir_url_path();
52
 
 
 
 
 
53
  $category_active = FALSE;
54
  if( function_exists('media_from_ftp_add_on_category_load_textdomain') ){
55
  include_once $plugin_dir.'/media-from-ftp-add-on-category/inc/MediaFromFtpAddOnCategory.php';
93
  $new_url_mlatags = sanitize_text_field($_POST["new_mlatags"]);
94
  }
95
 
96
+ $mediafromftp_settings = get_option($this->wp_options_name);
 
 
97
 
98
  if (!empty($new_url_attach)) {
99
 
req/MediaFromFtpListTable.php CHANGED
@@ -32,9 +32,15 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
32
 
33
  public $max_items;
34
  private $is_add_on_activate;
 
35
 
36
  public function __construct(){
37
 
 
 
 
 
 
38
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
39
  $slugs = explode('/', $plugin_base_dir);
40
  $slug = end($slugs);
@@ -100,7 +106,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
100
  private function read_data(){
101
 
102
  $mediafromftp = new MediaFromFtp();
103
- $mediafromftp_settings = get_option($this->wp_options_name());
104
  $pagemax = $mediafromftp_settings['pagemax'];
105
  $searchdir = $mediafromftp_settings['searchdir'];
106
  $ext2typefilter = $mediafromftp_settings['ext2typefilter'];
@@ -169,20 +175,6 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
169
 
170
  }
171
 
172
- /* ==================================================
173
- * @param none
174
- * @return string $wp_options_name
175
- * @since 9.18
176
- * There is the same function. (rec/MediaFromFtpAdmin.php)
177
- */
178
- private function wp_options_name(){
179
-
180
- $wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
181
-
182
- return $wp_options_name;
183
-
184
- }
185
-
186
  public function column_default($item, $column_name){
187
  switch($column_name){
188
  case 'datetime':
@@ -220,7 +212,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
220
  'emlcategories' => '<div>'.__('Categories').'<div></div>'.'Enhanced Media Library'.'</div>',
221
  'mlacategories' => '<div>'.__('Categories').' & '.__('Tags').'<div></div>'.'Media Library Assistant'.'</div>'
222
  );
223
- $mediafromftp_settings = get_option($this->wp_options_name());
224
  if ( $mediafromftp_settings['dateset'] === 'new' || $mediafromftp_settings['dateset'] === 'fixed' ) unset($columns['datetime']);
225
 
226
  if ( $this->is_add_on_activate['category'] ) {
@@ -263,7 +255,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
263
  /**
264
  * First, lets decide how many records per page to show
265
  */
266
- $mediafromftp_settings = get_option($this->wp_options_name());
267
  $per_page = $mediafromftp_settings['pagemax'];
268
 
269
  /**
32
 
33
  public $max_items;
34
  private $is_add_on_activate;
35
+ private $wp_options_name;
36
 
37
  public function __construct(){
38
 
39
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
40
+ include_once(ABSPATH . 'wp-includes/pluggable.php');
41
+ }
42
+ $this->wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
43
+
44
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
45
  $slugs = explode('/', $plugin_base_dir);
46
  $slug = end($slugs);
106
  private function read_data(){
107
 
108
  $mediafromftp = new MediaFromFtp();
109
+ $mediafromftp_settings = get_option($this->wp_options_name);
110
  $pagemax = $mediafromftp_settings['pagemax'];
111
  $searchdir = $mediafromftp_settings['searchdir'];
112
  $ext2typefilter = $mediafromftp_settings['ext2typefilter'];
175
 
176
  }
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  public function column_default($item, $column_name){
179
  switch($column_name){
180
  case 'datetime':
212
  'emlcategories' => '<div>'.__('Categories').'<div></div>'.'Enhanced Media Library'.'</div>',
213
  'mlacategories' => '<div>'.__('Categories').' & '.__('Tags').'<div></div>'.'Media Library Assistant'.'</div>'
214
  );
215
+ $mediafromftp_settings = get_option($this->wp_options_name);
216
  if ( $mediafromftp_settings['dateset'] === 'new' || $mediafromftp_settings['dateset'] === 'fixed' ) unset($columns['datetime']);
217
 
218
  if ( $this->is_add_on_activate['category'] ) {
255
  /**
256
  * First, lets decide how many records per page to show
257
  */
258
+ $mediafromftp_settings = get_option($this->wp_options_name);
259
  $per_page = $mediafromftp_settings['pagemax'];
260
 
261
  /**
req/MediaFromFtpRegist.php CHANGED
@@ -171,6 +171,9 @@ class MediaFromFtpRegist {
171
  */
172
  public function register_settings(){
173
 
 
 
 
174
  $user = wp_get_current_user();
175
  $cron_mail = $user->user_email;
176
  $cron_user = $user->ID;
171
  */
172
  public function register_settings(){
173
 
174
+ if ( ! function_exists( 'wp_get_current_user' ) ) {
175
+ include_once(ABSPATH . 'wp-includes/pluggable.php');
176
+ }
177
  $user = wp_get_current_user();
178
  $cron_mail = $user->user_email;
179
  $cron_user = $user->ID;