Version Description
Fixed problem of getting user ID.
Download this release
Release Info
Developer | Katsushi Kawamori |
Plugin | Media from FTP |
Version | 10.09 |
Comparing to | |
See all releases |
Code changes from version 10.08 to 10.09
- mediafromftp.php +1 -1
- readme.txt +4 -1
- req/MediaFromFtpAdmin.php +37 -27
- req/MediaFromFtpAjax.php +10 -7
- req/MediaFromFtpListTable.php +12 -9
- req/MediaFromFtpRegist.php +0 -3
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.
|
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.09
|
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.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -130,6 +130,9 @@ Password: live789user
|
|
130 |
|
131 |
== Changelog ==
|
132 |
|
|
|
|
|
|
|
133 |
= 10.08 =
|
134 |
Fixed problem of getting user ID.
|
135 |
|
5 |
Requires at least: 3.6.0
|
6 |
Requires PHP: 5.3.0
|
7 |
Tested up to: 4.9
|
8 |
+
Stable tag: 10.09
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
130 |
|
131 |
== Changelog ==
|
132 |
|
133 |
+
= 10.09 =
|
134 |
+
Fixed problem of getting user ID.
|
135 |
+
|
136 |
= 10.08 =
|
137 |
Fixed problem of getting user ID.
|
138 |
|
req/MediaFromFtpAdmin.php
CHANGED
@@ -35,8 +35,6 @@ class MediaFromFtpAdmin {
|
|
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,12 +42,6 @@ class MediaFromFtpAdmin {
|
|
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,7 +189,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +303,7 @@ class MediaFromFtpAdmin {
|
|
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 |
}
|
@@ -504,13 +496,13 @@ class MediaFromFtpAdmin {
|
|
504 |
$facebook = 'https://www.facebook.com/katsushikawamori/';
|
505 |
$twitter = 'https://twitter.com/dodesyo312';
|
506 |
$youtube = 'https://www.youtube.com/channel/UC5zTLeyROkvZm86OgNRcb_w';
|
507 |
-
$donate = __('https://riverforest-wp.info/donate/', $slug);
|
508 |
|
509 |
?>
|
510 |
<span style="font-weight: bold;">
|
511 |
<div>
|
512 |
<?php echo $plugin_version; ?> |
|
513 |
-
<a style="text-decoration: none;" href="<?php echo $faq; ?>" target="_blank"><?php _e('FAQ'); ?></a> | <a style="text-decoration: none;" href="<?php echo $support; ?>" target="_blank"><?php _e('Support Forums'); ?></a> | <a style="text-decoration: none;" href="<?php echo $review; ?>" target="_blank"><?php _e('Reviews',
|
514 |
</div>
|
515 |
<div>
|
516 |
<a style="text-decoration: none;" href="<?php echo $translate; ?>" target="_blank"><?php echo sprintf(__('Translations for %s'), $plugin_name); ?></a> | <a style="text-decoration: none;" href="<?php echo $facebook; ?>" target="_blank"><span class="dashicons dashicons-facebook"></span></a> | <a style="text-decoration: none;" href="<?php echo $twitter; ?>" target="_blank"><span class="dashicons dashicons-twitter"></span></a> | <a style="text-decoration: none;" href="<?php echo $youtube; ?>" target="_blank"><span class="dashicons dashicons-video-alt3"></span></a>
|
@@ -634,7 +626,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +923,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +950,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1014,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1073,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1081,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1091,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1108,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1590,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1678,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1732,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1748,7 @@ class MediaFromFtpAdmin {
|
|
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,7 +1762,7 @@ class MediaFromFtpAdmin {
|
|
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,9 +1801,9 @@ class MediaFromFtpAdmin {
|
|
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 |
}
|
@@ -1870,5 +1862,23 @@ class MediaFromFtpAdmin {
|
|
1870 |
|
1871 |
}
|
1872 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1873 |
}
|
1874 |
?>
|
35 |
private $plugin_tmp_dir;
|
36 |
private $plugin_disallow_tmp_dir;
|
37 |
private $is_add_on_activate;
|
|
|
|
|
38 |
|
39 |
/* ==================================================
|
40 |
* Construct
|
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 |
*/
|
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 |
*/
|
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 |
}
|
496 |
$facebook = 'https://www.facebook.com/katsushikawamori/';
|
497 |
$twitter = 'https://twitter.com/dodesyo312';
|
498 |
$youtube = 'https://www.youtube.com/channel/UC5zTLeyROkvZm86OgNRcb_w';
|
499 |
+
$donate = __('https://shop.riverforest-wp.info/donate/', $slug);
|
500 |
|
501 |
?>
|
502 |
<span style="font-weight: bold;">
|
503 |
<div>
|
504 |
<?php echo $plugin_version; ?> |
|
505 |
+
<a style="text-decoration: none;" href="<?php echo $faq; ?>" target="_blank"><?php _e('FAQ'); ?></a> | <a style="text-decoration: none;" href="<?php echo $support; ?>" target="_blank"><?php _e('Support Forums'); ?></a> | <a style="text-decoration: none;" href="<?php echo $review; ?>" target="_blank"><?php _e('Reviews', $slug); ?></a>
|
506 |
</div>
|
507 |
<div>
|
508 |
<a style="text-decoration: none;" href="<?php echo $translate; ?>" target="_blank"><?php echo sprintf(__('Translations for %s'), $plugin_name); ?></a> | <a style="text-decoration: none;" href="<?php echo $facebook; ?>" target="_blank"><span class="dashicons dashicons-facebook"></span></a> | <a style="text-decoration: none;" href="<?php echo $twitter; ?>" target="_blank"><span class="dashicons dashicons-twitter"></span></a> | <a style="text-decoration: none;" href="<?php echo $youtube; ?>" target="_blank"><span class="dashicons dashicons-video-alt3"></span></a>
|
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 |
|
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 |
$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 |
* @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 |
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 |
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 |
|
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 |
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 |
|
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 |
} 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 |
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 |
// 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 |
}
|
1763 |
} else {
|
1764 |
$mediafromftp_settings['cron']['apply'] = FALSE;
|
1765 |
+
update_option( $this->wp_options_name(), $mediafromftp_settings );
|
1766 |
}
|
1767 |
break;
|
1768 |
case 5:
|
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 |
}
|
1862 |
|
1863 |
}
|
1864 |
|
1865 |
+
/* ==================================================
|
1866 |
+
* @param none
|
1867 |
+
* @return string $this->wp_options_name()
|
1868 |
+
* @since 10.09
|
1869 |
+
*/
|
1870 |
+
private function wp_options_name() {
|
1871 |
+
return 'mediafromftp_settings'.'_'.get_current_user_id();
|
1872 |
+
}
|
1873 |
+
|
1874 |
+
/* ==================================================
|
1875 |
+
* @param none
|
1876 |
+
* @return string $this->wp_add_on_wpcron_events_name()
|
1877 |
+
* @since 10.09
|
1878 |
+
*/
|
1879 |
+
private function wp_add_on_wpcron_events_name() {
|
1880 |
+
return 'mediafromftp_add_on_wpcron_events'.'_'.get_current_user_id();
|
1881 |
+
}
|
1882 |
+
|
1883 |
}
|
1884 |
?>
|
req/MediaFromFtpAjax.php
CHANGED
@@ -26,7 +26,6 @@ class MediaFromFtpAjax {
|
|
26 |
private $upload_dir;
|
27 |
private $upload_url;
|
28 |
private $is_add_on_activate;
|
29 |
-
private $wp_options_name;
|
30 |
|
31 |
/* ==================================================
|
32 |
* Construct
|
@@ -34,11 +33,6 @@ class MediaFromFtpAjax {
|
|
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);
|
@@ -93,7 +87,7 @@ class MediaFromFtpAjax {
|
|
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 |
|
@@ -290,6 +284,15 @@ class MediaFromFtpAjax {
|
|
290 |
return $str;
|
291 |
}
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
}
|
294 |
|
295 |
?>
|
26 |
private $upload_dir;
|
27 |
private $upload_url;
|
28 |
private $is_add_on_activate;
|
|
|
29 |
|
30 |
/* ==================================================
|
31 |
* Construct
|
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);
|
87 |
$new_url_mlatags = sanitize_text_field($_POST["new_mlatags"]);
|
88 |
}
|
89 |
|
90 |
+
$mediafromftp_settings = get_option($this->wp_options_name());
|
91 |
|
92 |
if (!empty($new_url_attach)) {
|
93 |
|
284 |
return $str;
|
285 |
}
|
286 |
|
287 |
+
/* ==================================================
|
288 |
+
* @param none
|
289 |
+
* @return string $this->wp_options_name()
|
290 |
+
* @since 10.09
|
291 |
+
*/
|
292 |
+
private function wp_options_name() {
|
293 |
+
return 'mediafromftp_settings'.'_'.get_current_user_id();
|
294 |
+
}
|
295 |
+
|
296 |
}
|
297 |
|
298 |
?>
|
req/MediaFromFtpListTable.php
CHANGED
@@ -32,15 +32,9 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
|
|
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,7 +100,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
|
|
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'];
|
@@ -212,7 +206,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
|
|
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,7 +249,7 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
|
|
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 |
/**
|
@@ -356,6 +350,15 @@ class TT_MediaFromFtp_List_Table extends WP_List_Table {
|
|
356 |
) );
|
357 |
}
|
358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
359 |
}
|
360 |
|
361 |
?>
|
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 |
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'];
|
206 |
'emlcategories' => '<div>'.__('Categories').'<div></div>'.'Enhanced Media Library'.'</div>',
|
207 |
'mlacategories' => '<div>'.__('Categories').' & '.__('Tags').'<div></div>'.'Media Library Assistant'.'</div>'
|
208 |
);
|
209 |
+
$mediafromftp_settings = get_option($this->wp_options_name());
|
210 |
if ( $mediafromftp_settings['dateset'] === 'new' || $mediafromftp_settings['dateset'] === 'fixed' ) unset($columns['datetime']);
|
211 |
|
212 |
if ( $this->is_add_on_activate['category'] ) {
|
249 |
/**
|
250 |
* First, lets decide how many records per page to show
|
251 |
*/
|
252 |
+
$mediafromftp_settings = get_option($this->wp_options_name());
|
253 |
$per_page = $mediafromftp_settings['pagemax'];
|
254 |
|
255 |
/**
|
350 |
) );
|
351 |
}
|
352 |
|
353 |
+
/* ==================================================
|
354 |
+
* @param none
|
355 |
+
* @return string $this->wp_options_name()
|
356 |
+
* @since 10.09
|
357 |
+
*/
|
358 |
+
private function wp_options_name() {
|
359 |
+
return 'mediafromftp_settings'.'_'.get_current_user_id();
|
360 |
+
}
|
361 |
+
|
362 |
}
|
363 |
|
364 |
?>
|
req/MediaFromFtpRegist.php
CHANGED
@@ -171,9 +171,6 @@ class MediaFromFtpRegist {
|
|
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;
|
171 |
*/
|
172 |
public function register_settings(){
|
173 |
|
|
|
|
|
|
|
174 |
$user = wp_get_current_user();
|
175 |
$cron_mail = $user->user_email;
|
176 |
$cron_user = $user->ID;
|