Version Description
- 2021.02.09 =
- Fixed an issue with the file size function
- Fixed an issue with UI selection option
Download this release
Release Info
Developer | codename065 |
Plugin | WordPress Download Manager |
Version | 3.1.14 |
Comparing to | |
See all releases |
Code changes from version 3.1.12 to 3.1.14
- admin/menus/class.Settings.php +1 -1
- admin/tpls/dashboard-widget.php +2 -2
- admin/tpls/metaboxes/package-settings.php +1 -1
- download-manager.php +3 -3
- libs/class.Apply.php +1 -0
- libs/class.Package.php +11 -4
- readme.txt +8 -0
- tpls/asset-manager-ui.php +8 -0
- tpls/user-dashboard/edit-profile.php +1 -1
- tpls3/user-dashboard/edit-profile.php +1 -1
- tpls3/wpdm-edit-user-profile.php +1 -1
- wpdm-functions.php +5 -5
admin/menus/class.Settings.php
CHANGED
@@ -11,7 +11,7 @@ class Settings
|
|
11 |
{
|
12 |
add_action('admin_init', array($this, 'initiateSettings'));
|
13 |
add_action('wp_ajax_wpdm_settings', array($this, 'loadSettingsPage'));
|
14 |
-
add_action('admin_menu', array($this, 'menu'));
|
15 |
}
|
16 |
|
17 |
function menu(){
|
11 |
{
|
12 |
add_action('admin_init', array($this, 'initiateSettings'));
|
13 |
add_action('wp_ajax_wpdm_settings', array($this, 'loadSettingsPage'));
|
14 |
+
add_action('admin_menu', array($this, 'menu'), 9999);
|
15 |
}
|
16 |
|
17 |
function menu(){
|
admin/tpls/dashboard-widget.php
CHANGED
@@ -6,6 +6,6 @@ if(!defined('ABSPATH')) die();
|
|
6 |
</div>
|
7 |
<div class="w3eden">
|
8 |
|
9 |
-
<iframe src="//cdn.wpdownloadmanager.com/notice.php?wpdmvarsion=<?php echo WPDM_Version; ?>&origin=<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on'?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" style="height: 390px;width:100%;border:0px"></iframe>
|
10 |
|
11 |
-
</div>
|
6 |
</div>
|
7 |
<div class="w3eden">
|
8 |
|
9 |
+
<iframe id="wpdmdbwframeh" src="//cdn.wpdownloadmanager.com/notice.php?wpdmvarsion=<?php echo WPDM_Version; ?>&origin=<?php echo (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on'?'https://':'http://').$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; ?>" style="min-height: 390px;width:100%;border:0px"></iframe>
|
10 |
|
11 |
+
</div>
|
admin/tpls/metaboxes/package-settings.php
CHANGED
@@ -97,7 +97,7 @@
|
|
97 |
<?php if(isset($_GET['post'])&&$_GET['post']!=''){ ?>
|
98 |
<tr>
|
99 |
<td><?php echo __('Master Key','download-manager'); ?></td>
|
100 |
-
<td><input type="text" readonly="readonly" value="<?php echo get_post_meta($post->ID, '__wpdm_masterkey', true); ?>"> <input type="checkbox" value="1" name="reset_key" /> <?php echo __('Regenerate Master Key
|
101 |
</tr>
|
102 |
<?php } ?>
|
103 |
<?php do_action("wpdm_package_settings_tr", $post->ID); ?>
|
97 |
<?php if(isset($_GET['post'])&&$_GET['post']!=''){ ?>
|
98 |
<tr>
|
99 |
<td><?php echo __('Master Key','download-manager'); ?></td>
|
100 |
+
<td><input style="display: inline-block;margin-right: 5px;background: #fff" type="text" class="form-control" readonly="readonly" value="<?php echo get_post_meta($post->ID, '__wpdm_masterkey', true); ?>"> <label><input type="checkbox" value="1" name="reset_key" /> <?php echo __('Regenerate Master Key','download-manager'); ?> <i class="info fa fa-info" title="<?php echo __('This key can be used for direct download','download-manager'); ?>"></i></label></td>
|
101 |
</tr>
|
102 |
<?php } ?>
|
103 |
<?php do_action("wpdm_package_settings_tr", $post->ID); ?>
|
download-manager.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Download Manager
|
|
4 |
Plugin URI: https://www.wpdownloadmanager.com/pricing/
|
5 |
Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
|
6 |
Author: W3 Eden
|
7 |
-
Version: 3.1.
|
8 |
Author URI: https://www.wpdownloadmanager.com/
|
9 |
Text Domain: download-manager
|
10 |
Domain Path: /languages
|
@@ -95,7 +95,7 @@ class WordPressDownloadManager{
|
|
95 |
public $asset;
|
96 |
public $shortCode;
|
97 |
public $setting;
|
98 |
-
public $bsversion =
|
99 |
|
100 |
private static $wpdm_instance = null;
|
101 |
|
@@ -108,7 +108,7 @@ class WordPressDownloadManager{
|
|
108 |
|
109 |
function __construct(){
|
110 |
|
111 |
-
define('WPDM_Version','3.1.
|
112 |
|
113 |
register_activation_hook(__FILE__, array($this, 'Install'));
|
114 |
|
4 |
Plugin URI: https://www.wpdownloadmanager.com/pricing/
|
5 |
Description: Manage, Protect and Track file downloads, and sell digital products from your WordPress site. A complete digital asset management solution.
|
6 |
Author: W3 Eden
|
7 |
+
Version: 3.1.14
|
8 |
Author URI: https://www.wpdownloadmanager.com/
|
9 |
Text Domain: download-manager
|
10 |
Domain Path: /languages
|
95 |
public $asset;
|
96 |
public $shortCode;
|
97 |
public $setting;
|
98 |
+
public $bsversion = '';
|
99 |
|
100 |
private static $wpdm_instance = null;
|
101 |
|
108 |
|
109 |
function __construct(){
|
110 |
|
111 |
+
define('WPDM_Version','3.1.14');
|
112 |
|
113 |
register_activation_hook(__FILE__, array($this, 'Install'));
|
114 |
|
libs/class.Apply.php
CHANGED
@@ -188,6 +188,7 @@ class Apply {
|
|
188 |
} else {
|
189 |
wp_set_auth_cookie($user->ID);
|
190 |
wp_set_current_user($user->ID);
|
|
|
191 |
Session::set('login_try', 0);
|
192 |
do_action('wp_login', $creds['user_login'], $user);
|
193 |
|
188 |
} else {
|
189 |
wp_set_auth_cookie($user->ID);
|
190 |
wp_set_current_user($user->ID);
|
191 |
+
update_user_meta($user->ID, '__wpdm_last_login_time', time());
|
192 |
Session::set('login_try', 0);
|
193 |
do_action('wp_login', $creds['user_login'], $user);
|
194 |
|
libs/class.Package.php
CHANGED
@@ -47,9 +47,9 @@ class Package {
|
|
47 |
$post_vars['description'] = wpautop(stripslashes($post_vars['description']));
|
48 |
$post_vars['excerpt'] = stripcslashes(strip_tags($post_vars['post_excerpt']));
|
49 |
$author = get_user_by('id', $post_vars['post_author']);
|
50 |
-
$post_vars['author_name'] = $author->display_name;
|
51 |
$post_vars['author_profile_url'] = get_author_posts_url($post_vars['post_author']);
|
52 |
-
$post_vars['avatar_url'] = get_avatar_url($author->user_email);
|
53 |
$post_vars['author_package_count'] = count_user_posts( $post_vars['post_author'] , "wpdmpro" );
|
54 |
|
55 |
|
@@ -215,8 +215,15 @@ class Package {
|
|
215 |
}
|
216 |
|
217 |
if(isset($data['terms_lock']) && $data['terms_lock'] != 0 && (!function_exists('wpdmpp_effective_price') || wpdmpp_effective_price($post_vars['ID']) ==0) && $limit_over == 0){
|
218 |
-
$
|
219 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
$data['terms_check_label'] = !isset($data['terms_check_label']) || $data['terms_check_label'] == ''?__("I Agree With Terms and Conditions",'download-manager'):sanitize_text_field($data['terms_check_label']);
|
221 |
if(!self::isLocked($post_vars)) {
|
222 |
$post_vars['download_link_popup'] = $post_vars['download_link'] = "<a href='#unlock' class='wpdm-download-link wpdm-download-locked {$post_vars['btnclass']}' data-package='{$post_vars['ID']}'>{$post_vars['link_label']}</a>";
|
47 |
$post_vars['description'] = wpautop(stripslashes($post_vars['description']));
|
48 |
$post_vars['excerpt'] = stripcslashes(strip_tags($post_vars['post_excerpt']));
|
49 |
$author = get_user_by('id', $post_vars['post_author']);
|
50 |
+
if(is_object($author)) $post_vars['author_name'] = $author->display_name;
|
51 |
$post_vars['author_profile_url'] = get_author_posts_url($post_vars['post_author']);
|
52 |
+
if(is_object($author)) $post_vars['avatar_url'] = get_avatar_url($author->user_email);
|
53 |
$post_vars['author_package_count'] = count_user_posts( $post_vars['post_author'] , "wpdmpro" );
|
54 |
|
55 |
|
215 |
}
|
216 |
|
217 |
if(isset($data['terms_lock']) && $data['terms_lock'] != 0 && (!function_exists('wpdmpp_effective_price') || wpdmpp_effective_price($post_vars['ID']) ==0) && $limit_over == 0){
|
218 |
+
$terms_page = (int)$data['terms_page'];
|
219 |
+
if($terms_page > 0) {
|
220 |
+
$terms_page = get_post($terms_page);
|
221 |
+
$data['terms_title'] = $terms_page->post_title;
|
222 |
+
$data['terms_conditions'] = wpautop($terms_page->post_content);
|
223 |
+
} else {
|
224 |
+
$data['terms_conditions'] = wpautop(strip_tags($data['terms_conditions'], "<p><br><a><strong><b><i>"));
|
225 |
+
$data['terms_title'] = !isset($data['terms_title']) || $data['terms_title'] == '' ? __("Terms and Conditions", 'download-manager') : sanitize_text_field($data['terms_title']);
|
226 |
+
}
|
227 |
$data['terms_check_label'] = !isset($data['terms_check_label']) || $data['terms_check_label'] == ''?__("I Agree With Terms and Conditions",'download-manager'):sanitize_text_field($data['terms_check_label']);
|
228 |
if(!self::isLocked($post_vars)) {
|
229 |
$post_vars['download_link_popup'] = $post_vars['download_link'] = "<a href='#unlock' class='wpdm-download-link wpdm-download-locked {$post_vars['btnclass']}' data-package='{$post_vars['ID']}'>{$post_vars['link_label']}</a>";
|
readme.txt
CHANGED
@@ -182,6 +182,14 @@ Check download stats and get a push notification when someone downloads, install
|
|
182 |
|
183 |
== Changelog ==
|
184 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
= 3.1.12 =
|
186 |
* Improved terms lock option
|
187 |
* Added zip and unzip option with the asset manager
|
182 |
|
183 |
== Changelog ==
|
184 |
|
185 |
+
= 3.1.14 - 2021.02.09 =
|
186 |
+
* Fixed an issue with the file size function
|
187 |
+
* Fixed an issue with UI selection option
|
188 |
+
|
189 |
+
= 3.1.13 - 2021.01.28 =
|
190 |
+
* Fixed an issue with the terms lock
|
191 |
+
* Fixed an UI issue with the asset manager file editor
|
192 |
+
|
193 |
= 3.1.12 =
|
194 |
* Improved terms lock option
|
195 |
* Added zip and unzip option with the asset manager
|
tpls/asset-manager-ui.php
CHANGED
@@ -332,6 +332,14 @@ if(is_admin()){
|
|
332 |
#wpdmeditor .panel-footer{
|
333 |
border-radius: 0;
|
334 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
335 |
#wpdmeditor #filecontent_alt,
|
336 |
#wpdmeditor #filecontent{
|
337 |
height: calc(100% - 94px);
|
332 |
#wpdmeditor .panel-footer{
|
333 |
border-radius: 0;
|
334 |
}
|
335 |
+
|
336 |
+
pre.CodeMirror-line {
|
337 |
+
border: 0;
|
338 |
+
margin: 0;
|
339 |
+
padding: 3px;
|
340 |
+
background: #fff;
|
341 |
+
}
|
342 |
+
|
343 |
#wpdmeditor #filecontent_alt,
|
344 |
#wpdmeditor #filecontent{
|
345 |
height: calc(100% - 94px);
|
tpls/user-dashboard/edit-profile.php
CHANGED
@@ -34,7 +34,7 @@ $member_success = \WPDM\Session::get('member_success');
|
|
34 |
<div class="col-md-6"><div class="form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div></div>
|
35 |
|
36 |
|
37 |
-
<?php do_action('
|
38 |
|
39 |
|
40 |
</div>
|
34 |
<div class="col-md-6"><div class="form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div></div>
|
35 |
|
36 |
|
37 |
+
<?php do_action('wpdm_update_profile_field_html', $user); ?>
|
38 |
|
39 |
|
40 |
</div>
|
tpls3/user-dashboard/edit-profile.php
CHANGED
@@ -34,7 +34,7 @@ $member_success = \WPDM\Session::get('member_success');
|
|
34 |
<div class="col-md-6 form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div>
|
35 |
|
36 |
|
37 |
-
<?php do_action('
|
38 |
|
39 |
|
40 |
<div class="col-md-12 wpdm-clear form-group"><label for="message"><?php _e( "Description:" , "download-manager" );?></label><textarea class="text form-control" cols="40" rows="8" name="wpdm_profile[description]" id="message"><?php echo htmlspecialchars(stripslashes($current_user->description));?></textarea></div>
|
34 |
<div class="col-md-6 form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div>
|
35 |
|
36 |
|
37 |
+
<?php do_action('wpdm_update_profile_field_html', $user); ?>
|
38 |
|
39 |
|
40 |
<div class="col-md-12 wpdm-clear form-group"><label for="message"><?php _e( "Description:" , "download-manager" );?></label><textarea class="text form-control" cols="40" rows="8" name="wpdm_profile[description]" id="message"><?php echo htmlspecialchars(stripslashes($current_user->description));?></textarea></div>
|
tpls3/wpdm-edit-user-profile.php
CHANGED
@@ -34,7 +34,7 @@ $member_success = \WPDM\Session::get('member_success');
|
|
34 |
<div class="col-md-6 form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div>
|
35 |
|
36 |
|
37 |
-
<?php do_action('
|
38 |
|
39 |
|
40 |
<div class="col-md-12 wpdm-clear form-group"><label for="message"><?php _e( "Description:" , "download-manager" );?></label><textarea class="text form-control" cols="40" rows="8" name="wpdm_profile[description]" id="message"><?php echo htmlspecialchars(stripslashes($current_user->description));?></textarea></div>
|
34 |
<div class="col-md-6 form-group"><label for="re_new_pass"><?php _e( "Re-type New Password:" , "download-manager" );?> </label><input autocomplete="off" type="password" value="" class="form-control" name="cpassword" id="re_new_pass"> </div>
|
35 |
|
36 |
|
37 |
+
<?php do_action('wpdm_update_profile_field_html', $user); ?>
|
38 |
|
39 |
|
40 |
<div class="col-md-12 wpdm-clear form-group"><label for="message"><?php _e( "Description:" , "download-manager" );?></label><textarea class="text form-control" cols="40" rows="8" name="wpdm_profile[description]" id="message"><?php echo htmlspecialchars(stripslashes($current_user->description));?></textarea></div>
|
wpdm-functions.php
CHANGED
@@ -457,7 +457,7 @@ function wpdm_file_size($file)
|
|
457 |
else if (file_exists(UPLOAD_DIR . $file))
|
458 |
$_size = filesize(UPLOAD_DIR . $file);
|
459 |
else if (file_exists(ABSPATH . $file))
|
460 |
-
$_size = filesize(
|
461 |
else $_size = 0;
|
462 |
$size = $_size / 1024;
|
463 |
if ($size > 1024) $size = number_format($size / 1024, 2) . ' MB';
|
@@ -467,7 +467,6 @@ function wpdm_file_size($file)
|
|
467 |
return $size;
|
468 |
}
|
469 |
|
470 |
-
|
471 |
/**
|
472 |
* @usage Returns icons for package file types
|
473 |
* @param $id
|
@@ -530,6 +529,7 @@ function wpdm_valueof($var, $index, $params = [])
|
|
530 |
{
|
531 |
$index = explode("/", $index);
|
532 |
$default = is_string($params) ? $params : '';
|
|
|
533 |
$default = is_array($params) && isset($params['default']) ? $params['default'] : $default;
|
534 |
if (count($index) > 1) {
|
535 |
$val = $var;
|
@@ -1686,7 +1686,7 @@ function wpdm_tpl_path1($file, $tpldir = '')
|
|
1686 |
*/
|
1687 |
function wpdm_tpl_path($file, $tpldir = '', $fallback = '')
|
1688 |
{
|
1689 |
-
if (file_exists(get_stylesheet_directory() . '/download-manager/' . $file))
|
1690 |
$path = get_stylesheet_directory() . '/download-manager/' . $file;
|
1691 |
else if (file_exists(get_template_directory() . '/download-manager/' . $file))
|
1692 |
$path = get_template_directory() . '/download-manager/' . $file;
|
@@ -1696,14 +1696,14 @@ function wpdm_tpl_path($file, $tpldir = '', $fallback = '')
|
|
1696 |
$path = get_template_directory() . '/download-manager/' . $tpldir . '/' . $file;
|
1697 |
else $path = WPDM_TPL_DIR . $file;
|
1698 |
|
1699 |
-
/* Fallack template directory*/
|
1700 |
if ($fallback == '') $fallback = WPDM_TPL_FALLBACK;
|
1701 |
if ($fallback !== '' && !file_exists($path))
|
1702 |
$path = $fallback . "/" . $file;
|
1703 |
|
1704 |
//if(!file_exists($path))
|
1705 |
//wpdmdd($path);
|
1706 |
-
return $path
|
|
|
1707 |
|
1708 |
}
|
1709 |
|
457 |
else if (file_exists(UPLOAD_DIR . $file))
|
458 |
$_size = filesize(UPLOAD_DIR . $file);
|
459 |
else if (file_exists(ABSPATH . $file))
|
460 |
+
$_size = filesize(ABSPATH . $file);
|
461 |
else $_size = 0;
|
462 |
$size = $_size / 1024;
|
463 |
if ($size > 1024) $size = number_format($size / 1024, 2) . ' MB';
|
467 |
return $size;
|
468 |
}
|
469 |
|
|
|
470 |
/**
|
471 |
* @usage Returns icons for package file types
|
472 |
* @param $id
|
529 |
{
|
530 |
$index = explode("/", $index);
|
531 |
$default = is_string($params) ? $params : '';
|
532 |
+
if (is_object($var)) $var = (array)$var;
|
533 |
$default = is_array($params) && isset($params['default']) ? $params['default'] : $default;
|
534 |
if (count($index) > 1) {
|
535 |
$val = $var;
|
1686 |
*/
|
1687 |
function wpdm_tpl_path($file, $tpldir = '', $fallback = '')
|
1688 |
{
|
1689 |
+
/*if (file_exists(get_stylesheet_directory() . '/download-manager/' . $file))
|
1690 |
$path = get_stylesheet_directory() . '/download-manager/' . $file;
|
1691 |
else if (file_exists(get_template_directory() . '/download-manager/' . $file))
|
1692 |
$path = get_template_directory() . '/download-manager/' . $file;
|
1696 |
$path = get_template_directory() . '/download-manager/' . $tpldir . '/' . $file;
|
1697 |
else $path = WPDM_TPL_DIR . $file;
|
1698 |
|
|
|
1699 |
if ($fallback == '') $fallback = WPDM_TPL_FALLBACK;
|
1700 |
if ($fallback !== '' && !file_exists($path))
|
1701 |
$path = $fallback . "/" . $file;
|
1702 |
|
1703 |
//if(!file_exists($path))
|
1704 |
//wpdmdd($path);
|
1705 |
+
return $path;*/
|
1706 |
+
return \WPDM\Template::locate($file, $tpldir, $fallback);
|
1707 |
|
1708 |
}
|
1709 |
|