Media from FTP - Version 10.00

Version Description

Fixed problem of error of "Screen Options". Fixed fine problem.

Download this release

Release Info

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

Code changes from version 9.99 to 10.00

inc/MediaFromFtp.php CHANGED
@@ -33,7 +33,7 @@ class MediaFromFtp {
33
  * Construct
34
  * @since 9.81
35
  */
36
- function __construct() {
37
 
38
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
39
  $slugs = explode('/', $plugin_base_dir);
@@ -68,7 +68,7 @@ class MediaFromFtp {
68
  * @return array $list
69
  * @since 1.0
70
  */
71
- function scan_file($dir, $extpattern, $mediafromftp_settings) {
72
 
73
  // for media-from-ftp-add-on-wpcron and mediafromftpcmd.php
74
  $cmdoptions = array();
@@ -175,7 +175,7 @@ class MediaFromFtp {
175
  * @return array $dirlist
176
  * @since 2.1
177
  */
178
- function scan_dir($dir) {
179
 
180
  $excludedir = 'media-from-ftp-tmp'; // tmp dir
181
  global $blog_id;
@@ -208,7 +208,7 @@ class MediaFromFtp {
208
  * @return string $extpattern
209
  * @since 2.2
210
  */
211
- function extpattern($extfilter){
212
 
213
  $extpattern = NULL;
214
 
@@ -232,7 +232,7 @@ class MediaFromFtp {
232
  * @return string $mimetype
233
  * @since 1.0
234
  */
235
- function mime_type($suffix){
236
 
237
  $suffix = str_replace('.', '', $suffix);
238
 
@@ -256,7 +256,7 @@ class MediaFromFtp {
256
  * @return string $view_thumb_url
257
  * @since 2.36
258
  */
259
- function create_cash($ext, $file, $new_url){
260
 
261
  $cash_thumb_key = md5($new_url);
262
  if ( strtolower($ext) === 'pdf' ) {
@@ -320,7 +320,7 @@ class MediaFromFtp {
320
  * @return none
321
  * @since 2.36
322
  */
323
- 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);
@@ -345,7 +345,7 @@ class MediaFromFtp {
345
  * @return int $del_cash_count(int)
346
  * @since 7.5
347
  */
348
- function delete_all_cash(){
349
 
350
  global $wpdb;
351
  $search_transients = $this->plugin_tmp_url;
@@ -382,7 +382,7 @@ class MediaFromFtp {
382
  * @return string $date
383
  * @since 2.36
384
  */
385
- function get_date_check($file, $dateset){
386
 
387
  $date = get_date_from_gmt(date("Y-m-d H:i:s", filemtime($file)));
388
 
@@ -413,7 +413,7 @@ class MediaFromFtp {
413
  * @return array $new_file(bool), $ext(string), $new_url(string)
414
  * @since 2.36
415
  */
416
- function input_url($file, $attachments, $character_code, $thumb_deep_search){
417
 
418
  $ext = NULL;
419
  $new_url = NULL;
@@ -467,7 +467,7 @@ class MediaFromFtp {
467
  * @return array $input_html(string), $date_time_html(string)
468
  * @since 9.30
469
  */
470
- function input_html($ext, $file, $new_url, $postcount, $mediafromftp_settings){
471
 
472
  $input_html = NULL;
473
 
@@ -526,7 +526,7 @@ class MediaFromFtp {
526
  * @return string $html
527
  * @since 9.98
528
  */
529
- function search_option_html($mediafromftp_settings){
530
 
531
  $html = '<div class="item-mediafromftp-settings">';
532
  $html .= '<h3>'.__('Pagination').'</h3>';
@@ -613,7 +613,7 @@ class MediaFromFtp {
613
  * @return string $linkselectbox
614
  * @since 9.98
615
  */
616
- function dir_select_box($searchdir, $character_code, $wordpress_path) {
617
 
618
  $linkselectbox = NULL;
619
  $linkselectbox .= '<div style="font-size: small; font-weight: bold;"><code>'.$wordpress_path.'</code></div>';
@@ -649,7 +649,7 @@ class MediaFromFtp {
649
  * @return string $form_html
650
  * @since 9.50
651
  */
652
- function form_html($mediafromftp_settings) {
653
 
654
  $scriptname = admin_url('admin.php?page=mediafromftp-search-register');
655
 
@@ -729,7 +729,7 @@ class MediaFromFtp {
729
  * @return array $attach_id(int), $new_attach_title(string), $new_url_attach(string), $metadata(array)
730
  * @since 2.36
731
  */
732
- function regist($ext, $new_url_attach, $new_url_datetime, $dateset, $datefixed, $yearmonth_folders, $character_code, $cron_user){
733
 
734
  // Rename and Move file
735
  $suffix_attach_file = '.'.$ext;
@@ -915,7 +915,7 @@ class MediaFromFtp {
915
  * @return array $imagethumburls(string), $mimetype(string), $length(string), $stamptime(string), $file_size(string), $exif_text(string)
916
  * @since 7.4
917
  */
918
- function output_metadata($ext, $attach_id, $metadata, $character_code, $exif_text_tag){
919
 
920
  $imagethumburls = array();
921
  $mimetype = NULL;
@@ -983,7 +983,7 @@ class MediaFromFtp {
983
  * @return string $output_html
984
  * @since 9.30
985
  */
986
- function output_html_and_log($ext, $attach_id, $new_attach_title, $new_url_attach, $imagethumburls, $mimetype, $length, $stamptime, $file_size, $exif_text, $image_attr_thumbnail, $mediafromftp_settings, $cat_html, $mlccategory, $emlcategory, $mlacategory, $mlatag){
987
 
988
  $thumbnails = array();
989
 
@@ -1066,7 +1066,7 @@ class MediaFromFtp {
1066
  * @return string realurl
1067
  * @since 7.7
1068
  */
1069
- function realurl( $base, $relationalpath ){
1070
  $parse = array(
1071
  "scheme" => null,
1072
  "user" => null,
@@ -1113,7 +1113,7 @@ class MediaFromFtp {
1113
  * @return array $upload_dir, $upload_url, $upload_path
1114
  * @since 7.8
1115
  */
1116
- function upload_dir_url_path(){
1117
 
1118
  $wp_uploads = wp_upload_dir();
1119
 
@@ -1152,7 +1152,7 @@ class MediaFromFtp {
1152
  * @return $siteurl
1153
  * @since 8.5
1154
  */
1155
- function siteurl(){
1156
  if ( is_multisite() ) {
1157
  global $blog_id;
1158
  $siteurl = trailingslashit(get_blog_details($blog_id)->siteurl);
@@ -1167,7 +1167,7 @@ class MediaFromFtp {
1167
  * @return array $extensions
1168
  * @since 8.2
1169
  */
1170
- function scan_extensions($ext2typefilter){
1171
 
1172
  $extensions = array();
1173
  global $user_ID;
@@ -1199,7 +1199,7 @@ class MediaFromFtp {
1199
  * @return string $ret
1200
  * @since 9.02
1201
  */
1202
- function utf8mb4_html_numeric_encode($str, $character_code) {
1203
 
1204
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1205
  $length = mb_strlen($str, 'UTF-8');
@@ -1227,7 +1227,7 @@ class MediaFromFtp {
1227
  * @return string none
1228
  * @since 9.05
1229
  */
1230
- function mb_initialize($character_code) {
1231
 
1232
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1233
  if( get_locale() === 'ja' ) {
@@ -1247,7 +1247,7 @@ class MediaFromFtp {
1247
  * @return string $str
1248
  * @since 9.10
1249
  */
1250
- function mb_encode_multibyte($str, $character_code) {
1251
 
1252
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1253
  $str = mb_convert_encoding($str, $character_code, "auto");
@@ -1263,7 +1263,7 @@ class MediaFromFtp {
1263
  * @return string $str
1264
  * @since 9.05
1265
  */
1266
- function mb_utf8($str, $character_code) {
1267
 
1268
  if ( function_exists('mb_convert_encoding') && $character_code <> 'none' ) {
1269
  $str = mb_convert_encoding($str, "UTF-8", "auto");
@@ -1279,7 +1279,7 @@ class MediaFromFtp {
1279
  * @return array $array
1280
  * @since 9.11
1281
  */
1282
- function array_replace() {
1283
 
1284
  $array = array();
1285
  $n = func_num_args();
@@ -1297,7 +1297,7 @@ class MediaFromFtp {
1297
  * @return array $authors
1298
  * @since 9.43
1299
  */
1300
- function author_select($filename) {
1301
 
1302
  $scriptname = admin_url('admin.php?page=mediafromftp-import');
1303
 
@@ -1373,7 +1373,7 @@ MEDIAFROMFTP_AUTHOR_SELECT;
1373
  * @return string $add_js
1374
  * @since 9.40
1375
  */
1376
- function make_object($filename, $select_author) {
1377
 
1378
  $s = @file_get_contents($filename);
1379
  $controlCode = array("\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\x0b", "\x0c", "\x0e", "\x0f");
@@ -1548,7 +1548,7 @@ MEDIAFROMFTP;
1548
  * @return string $_a
1549
  * @since 9.88
1550
  */
1551
- function sanitize_array($a) {
1552
 
1553
  $_a = array();
1554
  foreach($a as $key=>$value) {
33
  * Construct
34
  * @since 9.81
35
  */
36
+ public function __construct() {
37
 
38
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
39
  $slugs = explode('/', $plugin_base_dir);
68
  * @return array $list
69
  * @since 1.0
70
  */
71
+ public function scan_file($dir, $extpattern, $mediafromftp_settings) {
72
 
73
  // for media-from-ftp-add-on-wpcron and mediafromftpcmd.php
74
  $cmdoptions = array();
175
  * @return array $dirlist
176
  * @since 2.1
177
  */
178
+ private function scan_dir($dir) {
179
 
180
  $excludedir = 'media-from-ftp-tmp'; // tmp dir
181
  global $blog_id;
208
  * @return string $extpattern
209
  * @since 2.2
210
  */
211
+ public function extpattern($extfilter){
212
 
213
  $extpattern = NULL;
214
 
232
  * @return string $mimetype
233
  * @since 1.0
234
  */
235
+ private function mime_type($suffix){
236
 
237
  $suffix = str_replace('.', '', $suffix);
238
 
256
  * @return string $view_thumb_url
257
  * @since 2.36
258
  */
259
+ private function create_cash($ext, $file, $new_url){
260
 
261
  $cash_thumb_key = md5($new_url);
262
  if ( strtolower($ext) === 'pdf' ) {
320
  * @return none
321
  * @since 2.36
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);
345
  * @return int $del_cash_count(int)
346
  * @since 7.5
347
  */
348
+ public function delete_all_cash(){
349
 
350
  global $wpdb;
351
  $search_transients = $this->plugin_tmp_url;
382
  * @return string $date
383
  * @since 2.36
384
  */
385
+ public function get_date_check($file, $dateset){
386
 
387
  $date = get_date_from_gmt(date("Y-m-d H:i:s", filemtime($file)));
388
 
413
  * @return array $new_file(bool), $ext(string), $new_url(string)
414
  * @since 2.36
415
  */
416
+ public function input_url($file, $attachments, $character_code, $thumb_deep_search){
417
 
418
  $ext = NULL;
419
  $new_url = NULL;
467
  * @return array $input_html(string), $date_time_html(string)
468
  * @since 9.30
469
  */
470
+ public function input_html($ext, $file, $new_url, $postcount, $mediafromftp_settings){
471
 
472
  $input_html = NULL;
473
 
526
  * @return string $html
527
  * @since 9.98
528
  */
529
+ public function search_option_html($mediafromftp_settings){
530
 
531
  $html = '<div class="item-mediafromftp-settings">';
532
  $html .= '<h3>'.__('Pagination').'</h3>';
613
  * @return string $linkselectbox
614
  * @since 9.98
615
  */
616
+ public function dir_select_box($searchdir, $character_code, $wordpress_path) {
617
 
618
  $linkselectbox = NULL;
619
  $linkselectbox .= '<div style="font-size: small; font-weight: bold;"><code>'.$wordpress_path.'</code></div>';
649
  * @return string $form_html
650
  * @since 9.50
651
  */
652
+ public function form_html($mediafromftp_settings) {
653
 
654
  $scriptname = admin_url('admin.php?page=mediafromftp-search-register');
655
 
729
  * @return array $attach_id(int), $new_attach_title(string), $new_url_attach(string), $metadata(array)
730
  * @since 2.36
731
  */
732
+ public function regist($ext, $new_url_attach, $new_url_datetime, $dateset, $datefixed, $yearmonth_folders, $character_code, $cron_user){
733
 
734
  // Rename and Move file
735
  $suffix_attach_file = '.'.$ext;
915
  * @return array $imagethumburls(string), $mimetype(string), $length(string), $stamptime(string), $file_size(string), $exif_text(string)
916
  * @since 7.4
917
  */
918
+ public function output_metadata($ext, $attach_id, $metadata, $character_code, $exif_text_tag){
919
 
920
  $imagethumburls = array();
921
  $mimetype = NULL;
983
  * @return string $output_html
984
  * @since 9.30
985
  */
986
+ public function output_html_and_log($ext, $attach_id, $new_attach_title, $new_url_attach, $imagethumburls, $mimetype, $length, $stamptime, $file_size, $exif_text, $image_attr_thumbnail, $mediafromftp_settings, $cat_html, $mlccategory, $emlcategory, $mlacategory, $mlatag){
987
 
988
  $thumbnails = array();
989
 
1066
  * @return string realurl
1067
  * @since 7.7
1068
  */
1069
+ private function realurl( $base, $relationalpath ){
1070
  $parse = array(
1071
  "scheme" => null,
1072
  "user" => null,
1113
  * @return array $upload_dir, $upload_url, $upload_path
1114
  * @since 7.8
1115
  */
1116
+ public function upload_dir_url_path(){
1117
 
1118
  $wp_uploads = wp_upload_dir();
1119
 
1152
  * @return $siteurl
1153
  * @since 8.5
1154
  */
1155
+ private function siteurl(){
1156
  if ( is_multisite() ) {
1157
  global $blog_id;
1158
  $siteurl = trailingslashit(get_blog_details($blog_id)->siteurl);
1167
  * @return array $extensions
1168
  * @since 8.2
1169
  */
1170
+ private function scan_extensions($ext2typefilter){
1171
 
1172
  $extensions = array();
1173
  global $user_ID;
1199
  * @return string $ret
1200
  * @since 9.02
1201
  */
1202
+ private function utf8mb4_html_numeric_encode($str, $character_code) {
1203
 
1204
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1205
  $length = mb_strlen($str, 'UTF-8');
1227
  * @return string none
1228
  * @since 9.05
1229
  */
1230
+ public function mb_initialize($character_code) {
1231
 
1232
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1233
  if( get_locale() === 'ja' ) {
1247
  * @return string $str
1248
  * @since 9.10
1249
  */
1250
+ public function mb_encode_multibyte($str, $character_code) {
1251
 
1252
  if ( function_exists('mb_language') && $character_code <> 'none' ) {
1253
  $str = mb_convert_encoding($str, $character_code, "auto");
1263
  * @return string $str
1264
  * @since 9.05
1265
  */
1266
+ public function mb_utf8($str, $character_code) {
1267
 
1268
  if ( function_exists('mb_convert_encoding') && $character_code <> 'none' ) {
1269
  $str = mb_convert_encoding($str, "UTF-8", "auto");
1279
  * @return array $array
1280
  * @since 9.11
1281
  */
1282
+ private function array_replace() {
1283
 
1284
  $array = array();
1285
  $n = func_num_args();
1297
  * @return array $authors
1298
  * @since 9.43
1299
  */
1300
+ public function author_select($filename) {
1301
 
1302
  $scriptname = admin_url('admin.php?page=mediafromftp-import');
1303
 
1373
  * @return string $add_js
1374
  * @since 9.40
1375
  */
1376
+ public function make_object($filename, $select_author) {
1377
 
1378
  $s = @file_get_contents($filename);
1379
  $controlCode = array("\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", "\x08", "\x0b", "\x0c", "\x0e", "\x0f");
1548
  * @return string $_a
1549
  * @since 9.88
1550
  */
1551
+ public function sanitize_array($a) {
1552
 
1553
  $_a = array();
1554
  foreach($a as $key=>$value) {
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: 9.99
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.00
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: 9.99
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -126,6 +126,10 @@ Register to media library from files that have been uploaded by FTP.
126
 
127
  == Changelog ==
128
 
 
 
 
 
129
  = 9.99 =
130
  Fixed fine problem.
131
 
5
  Requires at least: 3.6.0
6
  Requires PHP: 5.3.0
7
  Tested up to: 4.9
8
+ Stable tag: 10.00
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
126
 
127
  == Changelog ==
128
 
129
+ = 10.00 =
130
+ Fixed problem of error of "Screen Options".
131
+ Fixed fine problem.
132
+
133
  = 9.99 =
134
  Fixed fine problem.
135
 
req/MediaFromFtpAdmin.php CHANGED
@@ -40,7 +40,7 @@ class MediaFromFtpAdmin {
40
  * Construct
41
  * @since 9.81
42
  */
43
- function __construct() {
44
 
45
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
46
  $slugs = explode('/', $plugin_base_dir);
@@ -103,7 +103,7 @@ class MediaFromFtpAdmin {
103
  * Add a "Settings" link to the plugins page
104
  * @since 1.0
105
  */
106
- function settings_link( $links, $file ) {
107
  static $this_plugin;
108
  if ( empty($this_plugin) ) {
109
  $this_plugin = $this->plugin_base_file;
@@ -112,7 +112,6 @@ class MediaFromFtpAdmin {
112
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp').'">Media from FTP</a>';
113
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp-search-register').'">'.__('Search & Register', 'media-from-ftp').'</a>';
114
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp-settings').'">'.__( 'Settings').'</a>';
115
- $mediafromftp = new MediaFromFtp();
116
  if ( $this->is_add_on_activate['wpcron'] ) {
117
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
118
  $links[] = $mediafromftpaddonwpcron->mediafromftp_settings_link_html();
@@ -129,7 +128,7 @@ class MediaFromFtpAdmin {
129
  * Add page
130
  * @since 1.0
131
  */
132
- function add_pages() {
133
  add_menu_page(
134
  'Media from FTP',
135
  'Media from FTP',
@@ -154,7 +153,6 @@ class MediaFromFtpAdmin {
154
  'mediafromftp-settings',
155
  array($this, 'settings_page')
156
  );
157
- $mediafromftp = new MediaFromFtp();
158
  if ( $this->is_add_on_activate['wpcron'] ) {
159
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
160
  $mediafromftpaddonwpcron->mediafromftp_add_submenu();
@@ -190,7 +188,7 @@ class MediaFromFtpAdmin {
190
  * Show Screen Option Search & Register
191
  * @since 9.52
192
  */
193
- function search_register_show_screen_options( $status, $args ) {
194
 
195
  $mediafromftp_settings = get_option($this->wp_options_name());
196
 
@@ -214,7 +212,7 @@ class MediaFromFtpAdmin {
214
  * Save Screen Option Search & Register
215
  * @since 9.52
216
  */
217
- function search_register_set_screen_options($status, $option, $value) {
218
  if ( 'media_from_ftp_show_screen' == $option ) {
219
  $this->options_updated($value);
220
  return $value;
@@ -226,7 +224,7 @@ class MediaFromFtpAdmin {
226
  * Help Tab
227
  * @since 9.53
228
  */
229
- function search_register_help_tab($help, $screen_id, $screen) {
230
 
231
  if( $screen_id === 'media-from-ftp_page_mediafromftp-search-register' || $screen_id === 'media-from-ftp_page_mediafromftp-settings' || $screen_id === 'media-from-ftp_page_mediafromftp-event' || $screen_id === 'media-from-ftp_page_mediafromftp-log' || $screen_id === 'media-from-ftp_page_mediafromftp-import' || $screen_id === 'media-from-ftp_page_mediafromftp-addons' ) {
232
  $sidebar = '<p><strong>'.__('For more information:').'</strong></p>';
@@ -251,10 +249,9 @@ class MediaFromFtpAdmin {
251
  * @return array $tab
252
  * @since 9.53
253
  */
254
- function get_help_message($screen_id) {
255
 
256
  $upload_dir_html = '<span style="color: red;">'.$this->upload_path.'</span>';
257
- $mediafromftp = new MediaFromFtp();
258
 
259
  switch ($screen_id) {
260
  case "media-from-ftp_page_mediafromftp-search-register":
@@ -305,7 +302,7 @@ class MediaFromFtpAdmin {
305
  * Add Css and Script
306
  * @since 2.23
307
  */
308
- function load_custom_wp_admin_style() {
309
  if ($this->is_my_plugin_screen()) {
310
  $mediafromftp_settings = get_option($this->wp_options_name());
311
  if ( $mediafromftp_settings['datetimepicker'] ) {
@@ -342,7 +339,7 @@ class MediaFromFtpAdmin {
342
  * Add Script on footer
343
  * @since 1.0
344
  */
345
- function load_custom_wp_admin_style2() {
346
  if ($this->is_my_plugin_screen2()) {
347
  if ( isset($_POST['media_from_ftp_select_author']) && $_POST['media_from_ftp_select_author'] ) {
348
  if ( check_admin_referer('mff_select_author', 'media_from_ftp_select_author') ) {
@@ -375,7 +372,7 @@ class MediaFromFtpAdmin {
375
  * For only admin style
376
  * @since 8.82
377
  */
378
- function is_my_plugin_screen() {
379
  $screen = get_current_screen();
380
  if (is_object($screen) && $screen->id == 'toplevel_page_mediafromftp') {
381
  return TRUE;
@@ -400,7 +397,7 @@ class MediaFromFtpAdmin {
400
  * For only admin style
401
  * @since 8.82
402
  */
403
- function is_my_plugin_screen2() {
404
  $screen = get_current_screen();
405
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-import') {
406
  return TRUE;
@@ -413,7 +410,7 @@ class MediaFromFtpAdmin {
413
  * For only admin style
414
  * @since 9.63
415
  */
416
- function is_my_plugin_screen3() {
417
  $screen = get_current_screen();
418
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-search-register') {
419
  return TRUE;
@@ -427,7 +424,7 @@ class MediaFromFtpAdmin {
427
  /* ==================================================
428
  * Main
429
  */
430
- function manage_page() {
431
 
432
  if ( !current_user_can( 'upload_files' ) ) {
433
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -465,7 +462,7 @@ class MediaFromFtpAdmin {
465
  /* ==================================================
466
  * Credit
467
  */
468
- function credit() {
469
 
470
  $plugin_name = NULL;
471
  $plugin_ver_num = NULL;
@@ -524,7 +521,7 @@ class MediaFromFtpAdmin {
524
  /* ==================================================
525
  * Sub Menu
526
  */
527
- function settings_page() {
528
 
529
  if ( !current_user_can( 'upload_files' ) ) {
530
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -904,7 +901,7 @@ class MediaFromFtpAdmin {
904
  /* ==================================================
905
  * Sub Menu
906
  */
907
- function search_register_page(){
908
 
909
  if ( !current_user_can( 'upload_files' ) ) {
910
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -979,7 +976,7 @@ class MediaFromFtpAdmin {
979
  * Bulk Change Date Time
980
  * @since 9.63
981
  */
982
- function custom_bulk_admin_footer() {
983
  $mediafromftp_settings = get_option($this->wp_options_name());
984
  if ( $mediafromftp_settings['dateset'] === 'server' || $mediafromftp_settings['dateset'] === 'exif' ) {
985
  if ($this->is_my_plugin_screen3()) {
@@ -999,7 +996,7 @@ class MediaFromFtpAdmin {
999
  * Sub Menu
1000
  * for media-from-ftp-add-on-wpcron
1001
  */
1002
- function event_page() {
1003
 
1004
  $mediafromftp_addon_wpcron = FALSE;
1005
  $mediafromftp = new MediaFromFtp();
@@ -1068,7 +1065,7 @@ class MediaFromFtpAdmin {
1068
  /* ==================================================
1069
  * Sub Menu
1070
  */
1071
- function log_page() {
1072
 
1073
  if ( !current_user_can( 'upload_files' ) ) {
1074
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -1093,7 +1090,6 @@ class MediaFromFtpAdmin {
1093
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1094
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1095
  <?php
1096
- $mediafromftp = new MediaFromFtp();
1097
  if ( $this->is_add_on_activate['wpcron'] ) {
1098
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1099
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
@@ -1317,7 +1313,7 @@ class MediaFromFtpAdmin {
1317
  /* ==================================================
1318
  * Sub Menu
1319
  */
1320
- function medialibrary_import_page() {
1321
 
1322
  if ( !current_user_can( 'upload_files' ) ) {
1323
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -1331,7 +1327,6 @@ class MediaFromFtpAdmin {
1331
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1332
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1333
  <?php
1334
- $mediafromftp = new MediaFromFtp();
1335
  if ( $this->is_add_on_activate['wpcron'] ) {
1336
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1337
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
@@ -1409,7 +1404,7 @@ class MediaFromFtpAdmin {
1409
  /* ==================================================
1410
  * Sub Menu
1411
  */
1412
- function addons_page() {
1413
 
1414
  if ( !current_user_can( 'upload_files' ) ) {
1415
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
@@ -1424,7 +1419,6 @@ class MediaFromFtpAdmin {
1424
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1425
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1426
  <?php
1427
- $mediafromftp = new MediaFromFtp();
1428
  if ( $this->is_add_on_activate['wpcron'] ) {
1429
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1430
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
@@ -1555,7 +1549,7 @@ class MediaFromFtpAdmin {
1555
  * @param int $submenu
1556
  * @since 2.36
1557
  */
1558
- function options_updated($submenu){
1559
 
1560
  $mediafromftp = new MediaFromFtp();
1561
 
@@ -1702,7 +1696,6 @@ class MediaFromFtpAdmin {
1702
  $mediafromftp_settings['thumb_deep_search'] = sanitize_text_field($_POST['mediafromftp_thumb_deep_search']);
1703
  }
1704
  update_option( $this->wp_options_name(), $mediafromftp_settings );
1705
- echo '<div class="notice notice-success is-dismissible"><ul><li>'.__('Settings').' --> '.__('Changes saved.').'</li></ul></div>';
1706
  break;
1707
  case 3:
1708
  if ( !empty($_POST['mediafromftp_clear_cash']) ) {
@@ -1787,7 +1780,7 @@ class MediaFromFtpAdmin {
1787
  * @return string $wp_options_name
1788
  * @since 9.18
1789
  */
1790
- function wp_options_name(){
1791
 
1792
  $wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
1793
 
@@ -1800,7 +1793,7 @@ class MediaFromFtpAdmin {
1800
  * @return string $wp_cron_events_name
1801
  * @since 9.71
1802
  */
1803
- function wp_add_on_wpcron_events_name(){
1804
 
1805
  $wp_cron_events_name = 'mediafromftp_add_on_wpcron_events'.'_'.get_current_user_id();
1806
 
@@ -1813,7 +1806,7 @@ class MediaFromFtpAdmin {
1813
  * @return string $output
1814
  * @since 9.75
1815
  */
1816
- function custom_robots_txt($output) {
1817
 
1818
  $public = get_option( 'blog_public' );
1819
  if ( '0' != $public ) {
@@ -1829,7 +1822,7 @@ class MediaFromFtpAdmin {
1829
  * @return string
1830
  * @since 9.84
1831
  */
1832
- function notices() {
1833
 
1834
  $screen = get_current_screen();
1835
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-search-register') {
@@ -1842,6 +1835,19 @@ class MediaFromFtpAdmin {
1842
  echo '<div class="notice notice-warning is-dismissible"><ul><li>'.sprintf(__('"%1$s" is checked. This is the default setting for the WordPress Media Library. In this setting, the file is moved to month- and year-based folders. If you do not want to move, please uncheck.(%2$s,%3$s)', 'media-from-ftp'), $html1, $link1, $link2).'</li></ul></div>';
1843
  }
1844
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
1845
 
1846
  }
1847
 
40
  * Construct
41
  * @since 9.81
42
  */
43
+ public function __construct() {
44
 
45
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
46
  $slugs = explode('/', $plugin_base_dir);
103
  * Add a "Settings" link to the plugins page
104
  * @since 1.0
105
  */
106
+ public function settings_link( $links, $file ) {
107
  static $this_plugin;
108
  if ( empty($this_plugin) ) {
109
  $this_plugin = $this->plugin_base_file;
112
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp').'">Media from FTP</a>';
113
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp-search-register').'">'.__('Search & Register', 'media-from-ftp').'</a>';
114
  $links[] = '<a href="'.admin_url('admin.php?page=mediafromftp-settings').'">'.__( 'Settings').'</a>';
 
115
  if ( $this->is_add_on_activate['wpcron'] ) {
116
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
117
  $links[] = $mediafromftpaddonwpcron->mediafromftp_settings_link_html();
128
  * Add page
129
  * @since 1.0
130
  */
131
+ public function add_pages() {
132
  add_menu_page(
133
  'Media from FTP',
134
  'Media from FTP',
153
  'mediafromftp-settings',
154
  array($this, 'settings_page')
155
  );
 
156
  if ( $this->is_add_on_activate['wpcron'] ) {
157
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
158
  $mediafromftpaddonwpcron->mediafromftp_add_submenu();
188
  * Show Screen Option Search & Register
189
  * @since 9.52
190
  */
191
+ public function search_register_show_screen_options( $status, $args ) {
192
 
193
  $mediafromftp_settings = get_option($this->wp_options_name());
194
 
212
  * Save Screen Option Search & Register
213
  * @since 9.52
214
  */
215
+ public function search_register_set_screen_options($status, $option, $value) {
216
  if ( 'media_from_ftp_show_screen' == $option ) {
217
  $this->options_updated($value);
218
  return $value;
224
  * Help Tab
225
  * @since 9.53
226
  */
227
+ public function search_register_help_tab($help, $screen_id, $screen) {
228
 
229
  if( $screen_id === 'media-from-ftp_page_mediafromftp-search-register' || $screen_id === 'media-from-ftp_page_mediafromftp-settings' || $screen_id === 'media-from-ftp_page_mediafromftp-event' || $screen_id === 'media-from-ftp_page_mediafromftp-log' || $screen_id === 'media-from-ftp_page_mediafromftp-import' || $screen_id === 'media-from-ftp_page_mediafromftp-addons' ) {
230
  $sidebar = '<p><strong>'.__('For more information:').'</strong></p>';
249
  * @return array $tab
250
  * @since 9.53
251
  */
252
+ private function get_help_message($screen_id) {
253
 
254
  $upload_dir_html = '<span style="color: red;">'.$this->upload_path.'</span>';
 
255
 
256
  switch ($screen_id) {
257
  case "media-from-ftp_page_mediafromftp-search-register":
302
  * Add Css and Script
303
  * @since 2.23
304
  */
305
+ public function load_custom_wp_admin_style() {
306
  if ($this->is_my_plugin_screen()) {
307
  $mediafromftp_settings = get_option($this->wp_options_name());
308
  if ( $mediafromftp_settings['datetimepicker'] ) {
339
  * Add Script on footer
340
  * @since 1.0
341
  */
342
+ public function load_custom_wp_admin_style2() {
343
  if ($this->is_my_plugin_screen2()) {
344
  if ( isset($_POST['media_from_ftp_select_author']) && $_POST['media_from_ftp_select_author'] ) {
345
  if ( check_admin_referer('mff_select_author', 'media_from_ftp_select_author') ) {
372
  * For only admin style
373
  * @since 8.82
374
  */
375
+ private function is_my_plugin_screen() {
376
  $screen = get_current_screen();
377
  if (is_object($screen) && $screen->id == 'toplevel_page_mediafromftp') {
378
  return TRUE;
397
  * For only admin style
398
  * @since 8.82
399
  */
400
+ private function is_my_plugin_screen2() {
401
  $screen = get_current_screen();
402
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-import') {
403
  return TRUE;
410
  * For only admin style
411
  * @since 9.63
412
  */
413
+ private function is_my_plugin_screen3() {
414
  $screen = get_current_screen();
415
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-search-register') {
416
  return TRUE;
424
  /* ==================================================
425
  * Main
426
  */
427
+ public function manage_page() {
428
 
429
  if ( !current_user_can( 'upload_files' ) ) {
430
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
462
  /* ==================================================
463
  * Credit
464
  */
465
+ private function credit() {
466
 
467
  $plugin_name = NULL;
468
  $plugin_ver_num = NULL;
521
  /* ==================================================
522
  * Sub Menu
523
  */
524
+ public function settings_page() {
525
 
526
  if ( !current_user_can( 'upload_files' ) ) {
527
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
901
  /* ==================================================
902
  * Sub Menu
903
  */
904
+ public function search_register_page(){
905
 
906
  if ( !current_user_can( 'upload_files' ) ) {
907
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
976
  * Bulk Change Date Time
977
  * @since 9.63
978
  */
979
+ public function custom_bulk_admin_footer() {
980
  $mediafromftp_settings = get_option($this->wp_options_name());
981
  if ( $mediafromftp_settings['dateset'] === 'server' || $mediafromftp_settings['dateset'] === 'exif' ) {
982
  if ($this->is_my_plugin_screen3()) {
996
  * Sub Menu
997
  * for media-from-ftp-add-on-wpcron
998
  */
999
+ public function event_page() {
1000
 
1001
  $mediafromftp_addon_wpcron = FALSE;
1002
  $mediafromftp = new MediaFromFtp();
1065
  /* ==================================================
1066
  * Sub Menu
1067
  */
1068
+ public function log_page() {
1069
 
1070
  if ( !current_user_can( 'upload_files' ) ) {
1071
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
1090
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1091
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1092
  <?php
 
1093
  if ( $this->is_add_on_activate['wpcron'] ) {
1094
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1095
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
1313
  /* ==================================================
1314
  * Sub Menu
1315
  */
1316
+ public function medialibrary_import_page() {
1317
 
1318
  if ( !current_user_can( 'upload_files' ) ) {
1319
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
1327
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1328
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1329
  <?php
 
1330
  if ( $this->is_add_on_activate['wpcron'] ) {
1331
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1332
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
1404
  /* ==================================================
1405
  * Sub Menu
1406
  */
1407
+ public function addons_page() {
1408
 
1409
  if ( !current_user_can( 'upload_files' ) ) {
1410
  wp_die( __( 'You do not have sufficient permissions to access this page.' ) );
1419
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-search-register'); ?>" class="page-title-action"><?php _e('Search & Register', 'media-from-ftp'); ?></a>
1420
  <a href="<?php echo admin_url('admin.php?page=mediafromftp-settings'); ?>" class="page-title-action"><?php _e('Settings'); ?></a>
1421
  <?php
 
1422
  if ( $this->is_add_on_activate['wpcron'] ) {
1423
  $mediafromftpaddonwpcron = new MediaFromFtpAddOnWpcron();
1424
  $mediafromftpaddonwpcron->mediafromftp_event_link_html();
1549
  * @param int $submenu
1550
  * @since 2.36
1551
  */
1552
+ private function options_updated($submenu){
1553
 
1554
  $mediafromftp = new MediaFromFtp();
1555
 
1696
  $mediafromftp_settings['thumb_deep_search'] = sanitize_text_field($_POST['mediafromftp_thumb_deep_search']);
1697
  }
1698
  update_option( $this->wp_options_name(), $mediafromftp_settings );
 
1699
  break;
1700
  case 3:
1701
  if ( !empty($_POST['mediafromftp_clear_cash']) ) {
1780
  * @return string $wp_options_name
1781
  * @since 9.18
1782
  */
1783
+ public function wp_options_name(){
1784
 
1785
  $wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
1786
 
1793
  * @return string $wp_cron_events_name
1794
  * @since 9.71
1795
  */
1796
+ private function wp_add_on_wpcron_events_name(){
1797
 
1798
  $wp_cron_events_name = 'mediafromftp_add_on_wpcron_events'.'_'.get_current_user_id();
1799
 
1806
  * @return string $output
1807
  * @since 9.75
1808
  */
1809
+ public function custom_robots_txt($output) {
1810
 
1811
  $public = get_option( 'blog_public' );
1812
  if ( '0' != $public ) {
1822
  * @return string
1823
  * @since 9.84
1824
  */
1825
+ public function notices() {
1826
 
1827
  $screen = get_current_screen();
1828
  if (is_object($screen) && $screen->id == 'media-from-ftp_page_mediafromftp-search-register') {
1835
  echo '<div class="notice notice-warning is-dismissible"><ul><li>'.sprintf(__('"%1$s" is checked. This is the default setting for the WordPress Media Library. In this setting, the file is moved to month- and year-based folders. If you do not want to move, please uncheck.(%2$s,%3$s)', 'media-from-ftp'), $html1, $link1, $link2).'</li></ul></div>';
1836
  }
1837
  }
1838
+ if ($this->is_my_plugin_screen()) {
1839
+ if ( function_exists( 'extend_media_upload_load_textdomain' ) ) {
1840
+ $html2 = '<strong>Extend Media Upload</strong>';
1841
+ $html3 = '<strong>'.__('Update Media').'</strong>';
1842
+ if ( is_multisite() ) {
1843
+ $link_url3 = network_admin_url('plugins.php');
1844
+ } else {
1845
+ $link_url3 = admin_url('plugins.php');
1846
+ }
1847
+ $link3 = '<strong>'.'<a href="'.$link_url3.'">'.__('Plugins').'</a>'.'</strong>';
1848
+ echo '<div class="notice notice-error is-dismissible"><ul><li>'.sprintf(__('"%1$s" is activate. When "%2$s", it will be overwritten with "%1$s" setting. Please deactivate.(%3$s)', 'media-from-ftp'), $html2, $html3, $link3).'</li></ul></div>';
1849
+ }
1850
+ }
1851
 
1852
  }
1853
 
req/MediaFromFtpAjax.php CHANGED
@@ -31,7 +31,7 @@ class MediaFromFtpAjax {
31
  * Construct
32
  * @since 9.81
33
  */
34
- function __construct() {
35
 
36
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
37
  $slugs = explode('/', $plugin_base_dir);
@@ -72,7 +72,7 @@ class MediaFromFtpAjax {
72
  *
73
  * @since 9.30
74
  */
75
- function mediafromftp_update_callback(){
76
 
77
  $action1 = 'mediafromftp-update-ajax-action';
78
  if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], $action1 ) ) {
@@ -165,7 +165,7 @@ class MediaFromFtpAjax {
165
  *
166
  * @since 9.30
167
  */
168
- function mediafromftp_message_callback(){
169
 
170
  $error_count = intval($_POST["error_count"]);
171
  $error_update = sanitize_text_field($_POST["error_update"]);
@@ -191,7 +191,7 @@ class MediaFromFtpAjax {
191
  *
192
  * @since 9.40
193
  */
194
- function mediafromftp_medialibraryimport_update_callback(){
195
 
196
  $action2 = 'mediafromftp-import-ajax-action';
197
  if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], $action2 ) ) {
@@ -254,7 +254,7 @@ class MediaFromFtpAjax {
254
  *
255
  * @since 9.40
256
  */
257
- function mediafromftp_medialibraryimport_message_callback(){
258
 
259
  $error_count = intval($_POST["error_count"]);
260
  $error_update = sanitize_text_field($_POST["error_update"]);
@@ -282,7 +282,7 @@ class MediaFromFtpAjax {
282
  * @return string $str
283
  * @since 9.41
284
  */
285
- function esc_title($str){
286
 
287
  $str = esc_html($str);
288
  $str = str_replace(',', '&#44;', $str);
31
  * Construct
32
  * @since 9.81
33
  */
34
+ public function __construct() {
35
 
36
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
37
  $slugs = explode('/', $plugin_base_dir);
72
  *
73
  * @since 9.30
74
  */
75
+ public function mediafromftp_update_callback(){
76
 
77
  $action1 = 'mediafromftp-update-ajax-action';
78
  if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], $action1 ) ) {
165
  *
166
  * @since 9.30
167
  */
168
+ public function mediafromftp_message_callback(){
169
 
170
  $error_count = intval($_POST["error_count"]);
171
  $error_update = sanitize_text_field($_POST["error_update"]);
191
  *
192
  * @since 9.40
193
  */
194
+ public function mediafromftp_medialibraryimport_update_callback(){
195
 
196
  $action2 = 'mediafromftp-import-ajax-action';
197
  if ( isset( $_REQUEST['nonce'] ) && wp_verify_nonce( $_REQUEST['nonce'], $action2 ) ) {
254
  *
255
  * @since 9.40
256
  */
257
+ public function mediafromftp_medialibraryimport_message_callback(){
258
 
259
  $error_count = intval($_POST["error_count"]);
260
  $error_update = sanitize_text_field($_POST["error_update"]);
282
  * @return string $str
283
  * @since 9.41
284
  */
285
+ private function esc_title($str){
286
 
287
  $str = esc_html($str);
288
  $str = str_replace(',', '&#44;', $str);
req/MediaFromFtpListTable.php CHANGED
@@ -33,7 +33,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
33
  public $max_items;
34
  private $is_add_on_activate;
35
 
36
- function __construct(){
37
 
38
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
39
  $slugs = explode('/', $plugin_base_dir);
@@ -97,7 +97,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
97
  * @return array $listtable_array
98
  * @since 9.50
99
  */
100
- function read_data(){
101
 
102
  $mediafromftp = new MediaFromFtp();
103
  $mediafromftp_settings = get_option($this->wp_options_name());
@@ -175,7 +175,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
175
  * @since 9.18
176
  * There is the same function. (rec/MediaFromFtpAdmin.php)
177
  */
178
- function wp_options_name(){
179
 
180
  $wp_options_name = 'mediafromftp_settings'.'_'.get_current_user_id();
181
 
@@ -183,7 +183,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
183
 
184
  }
185
 
186
- function column_default($item, $column_name){
187
  switch($column_name){
188
  case 'datetime':
189
  case 'mlccategories':
@@ -195,14 +195,14 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
195
  }
196
  }
197
 
198
- function column_title($item){
199
  //Return the title contents
200
  return sprintf('%1$s <span style="color:silver"></span>',
201
  /*$1%s*/ $item['title']
202
  );
203
  }
204
 
205
- function column_cb($item){
206
  return sprintf(
207
  '<input type="checkbox" name="%1$s[%2$s][url]" value="%3$s" form="mediafromftp_ajax_update" />',
208
  /*%1$s*/ $this->_args['singular'],
@@ -211,7 +211,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
211
  );
212
  }
213
 
214
- function get_columns(){
215
  $columns = array(
216
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
217
  'title' => 'URL',
@@ -236,7 +236,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
236
  return $columns;
237
  }
238
 
239
- function get_sortable_columns() {
240
  $sortable_columns = array(
241
  'title' => array('title',false)
242
  );
@@ -258,7 +258,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
258
  * @uses $this->get_pagenum()
259
  * @uses $this->set_pagination_args()
260
  **************************************************************************/
261
- function prepare_items() {
262
 
263
  /**
264
  * First, lets decide how many records per page to show
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);
97
  * @return array $listtable_array
98
  * @since 9.50
99
  */
100
+ private function read_data(){
101
 
102
  $mediafromftp = new MediaFromFtp();
103
  $mediafromftp_settings = get_option($this->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
 
183
 
184
  }
185
 
186
+ public function column_default($item, $column_name){
187
  switch($column_name){
188
  case 'datetime':
189
  case 'mlccategories':
195
  }
196
  }
197
 
198
+ public function column_title($item){
199
  //Return the title contents
200
  return sprintf('%1$s <span style="color:silver"></span>',
201
  /*$1%s*/ $item['title']
202
  );
203
  }
204
 
205
+ public function column_cb($item){
206
  return sprintf(
207
  '<input type="checkbox" name="%1$s[%2$s][url]" value="%3$s" form="mediafromftp_ajax_update" />',
208
  /*%1$s*/ $this->_args['singular'],
211
  );
212
  }
213
 
214
+ public function get_columns(){
215
  $columns = array(
216
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
217
  'title' => 'URL',
236
  return $columns;
237
  }
238
 
239
+ public function get_sortable_columns() {
240
  $sortable_columns = array(
241
  'title' => array('title',false)
242
  );
258
  * @uses $this->get_pagenum()
259
  * @uses $this->set_pagination_args()
260
  **************************************************************************/
261
+ public function prepare_items() {
262
 
263
  /**
264
  * First, lets decide how many records per page to show
req/MediaFromFtpRegist.php CHANGED
@@ -29,7 +29,7 @@ class MediaFromFtpRegist {
29
  * Construct
30
  * @since 9.81
31
  */
32
- function __construct() {
33
 
34
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
35
 
@@ -54,7 +54,7 @@ class MediaFromFtpRegist {
54
  * Settings Log Settings
55
  * @since 9.19
56
  */
57
- function log_settings(){
58
 
59
  $mediafromftp_log_db_version = '3.0';
60
  $installed_ver = get_option( 'mediafromftp_log_version' );
@@ -146,7 +146,7 @@ class MediaFromFtpRegist {
146
  * Settings register
147
  * @since 2.3
148
  */
149
- function register_settings(){
150
 
151
  $user = wp_get_current_user();
152
  $cron_mail = $user->user_email;
29
  * Construct
30
  * @since 9.81
31
  */
32
+ public function __construct() {
33
 
34
  $plugin_base_dir = untrailingslashit(plugin_dir_path( __DIR__ ));
35
 
54
  * Settings Log Settings
55
  * @since 9.19
56
  */
57
+ public function log_settings(){
58
 
59
  $mediafromftp_log_db_version = '3.0';
60
  $installed_ver = get_option( 'mediafromftp_log_version' );
146
  * Settings register
147
  * @since 2.3
148
  */
149
+ public function register_settings(){
150
 
151
  $user = wp_get_current_user();
152
  $cron_mail = $user->user_email;