WordPress Download Manager - Version 3.2.58

Version Description

  • 2022.10.17 =
  • Fixed an issue with sorting by download count for packages shortcode
  • Fixed an issue with absolute path recovery for Windows server
Download this release

Release Info

Developer codename065
Plugin Icon 128x128 WordPress Download Manager
Version 3.2.58
Comparing to
See all releases

Code changes from version 3.2.57 to 3.2.58

download-manager.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://www.wpdownloadmanager.com/purchases/
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, Inc.
7
  Author URI: https://www.wpdownloadmanager.com/
8
- Version: 3.2.57
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
@@ -39,7 +39,7 @@ use WPDM\Widgets\WidgetController;
39
 
40
  global $WPDM;
41
 
42
- define('WPDM_VERSION','3.2.57');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
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, Inc.
7
  Author URI: https://www.wpdownloadmanager.com/
8
+ Version: 3.2.58
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
39
 
40
  global $WPDM;
41
 
42
+ define('WPDM_VERSION','3.2.58');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: download manager, document management, file manager, digital store, ecomme
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
- Stable tag: 3.2.57
9
 
10
 
11
  This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
@@ -181,6 +181,10 @@ Check download stats and get a push notification when someone downloads, install
181
 
182
  == Changelog ==
183
 
 
 
 
 
184
  = 3.2.57 - 2022.09.22 =
185
  * Fixed an issue with the view count function
186
 
5
  Requires at least: 5.3
6
  Tested up to: 6.0
7
  License: GPLv2 or later
8
+ Stable tag: 3.2.58
9
 
10
 
11
  This File Management & Digital Store plugin will help you to control file downloads & sell digital products from your WP site.
181
 
182
  == Changelog ==
183
 
184
+ = 3.2.58 - 2022.10.17 =
185
+ * Fixed an issue with sorting by download count for packages shortcode
186
+ * Fixed an issue with absolute path recovery for Windows server
187
+
188
  = 3.2.57 - 2022.09.22 =
189
  * Fixed an issue with the view count function
190
 
src/Package/views/packages-shortcode-toolbar.php CHANGED
@@ -47,8 +47,8 @@ if ($toolbar) {
47
  <option value="date" <?php selected('date', wpdm_query_var('orderby')) ?>><?php echo __( "Publish Date", "download-manager" ) ?></option>
48
  <option value="title" <?php selected('title', wpdm_query_var('orderby')) ?>><?php echo __( "Title", "download-manager" ) ?></option>
49
  <option value="update_date" <?php selected('update_date', wpdm_query_var('orderby')) ?>><?php echo __( "Update Date", "download-manager" ) ?></option>
50
- <option value="download_count" <?php selected('downloads', wpdm_query_var('orderby')) ?>><?php echo __( "Downloads", "download-manager" ) ?></option>
51
- <option value="view_count" <?php selected('views', wpdm_query_var('orderby')) ?>><?php echo __( "Views", "download-manager" ) ?></option>
52
  </select>
53
  </div>
54
  <div class="col-lg-<?php echo $od; ?> col-md-4">
47
  <option value="date" <?php selected('date', wpdm_query_var('orderby')) ?>><?php echo __( "Publish Date", "download-manager" ) ?></option>
48
  <option value="title" <?php selected('title', wpdm_query_var('orderby')) ?>><?php echo __( "Title", "download-manager" ) ?></option>
49
  <option value="update_date" <?php selected('update_date', wpdm_query_var('orderby')) ?>><?php echo __( "Update Date", "download-manager" ) ?></option>
50
+ <option value="downloads" <?php selected('downloads', wpdm_query_var('orderby')) ?>><?php echo __( "Downloads", "download-manager" ) ?></option>
51
+ <option value="views" <?php selected('views', wpdm_query_var('orderby')) ?>><?php echo __( "Views", "download-manager" ) ?></option>
52
  </select>
53
  </div>
54
  <div class="col-lg-<?php echo $od; ?> col-md-4">
src/User/Dashboard.php CHANGED
@@ -92,7 +92,7 @@ class Dashboard
92
 
93
  $default_icons = apply_filters("wpdm_user_dashboard_icons", $default_icons);
94
 
95
- include Template::locate("dashboard.php", __DIR__ . '/views/dashboard');
96
  }
97
  return ob_get_clean();
98
  }
@@ -100,7 +100,7 @@ class Dashboard
100
  function profile($params = array())
101
  {
102
  ob_start();
103
- include Template::locate("profile.php", __DIR__ . '/views/dashboard');
104
  return ob_get_clean();
105
  }
106
 
@@ -108,7 +108,7 @@ class Dashboard
108
  {
109
  global $wpdb, $current_user;
110
  ob_start();
111
- include Template::locate("download-history.php", __DIR__ . '/views/dashboard');
112
  return ob_get_clean();
113
  }
114
 
92
 
93
  $default_icons = apply_filters("wpdm_user_dashboard_icons", $default_icons);
94
 
95
+ include Template::locate("dashboard/dashboard.php", __DIR__ . '/views');
96
  }
97
  return ob_get_clean();
98
  }
100
  function profile($params = array())
101
  {
102
  ob_start();
103
+ include Template::locate("dashboard/profile.php", __DIR__ . '/views');
104
  return ob_get_clean();
105
  }
106
 
108
  {
109
  global $wpdb, $current_user;
110
  ob_start();
111
+ include Template::locate("dashboard/download-history.php", __DIR__ . '/views');
112
  return ob_get_clean();
113
  }
114
 
src/__/Email.php CHANGED
@@ -230,6 +230,7 @@ class Email {
230
  $template['to_email'] = str_replace( array_keys( $params ), array_values( $params ), $template['to_email'] );
231
  $template['message'] = str_replace( array_keys( $params ), array_values( $params ), $template['message'] );
232
  $template['message'] = self::compile($template['message']);
 
233
  return $template;
234
  }
235
 
230
  $template['to_email'] = str_replace( array_keys( $params ), array_values( $params ), $template['to_email'] );
231
  $template['message'] = str_replace( array_keys( $params ), array_values( $params ), $template['message'] );
232
  $template['message'] = self::compile($template['message']);
233
+ $template['message'] = self::compile($template['message'], "/\{\{([^\}]+)\}\}/");
234
  return $template;
235
  }
236
 
src/__/FileSystem.php CHANGED
@@ -923,7 +923,11 @@ class FileSystem
923
  function allowedPath($absPath)
924
  {
925
  if(!$absPath) return false;
926
- if(substr_count($absPath, UPLOAD_DIR) || substr_count($absPath, AssetManager::root())) return true;
 
 
 
 
927
  return false;
928
  }
929
  }
923
  function allowedPath($absPath)
924
  {
925
  if(!$absPath) return false;
926
+ $absPath = str_replace("\\", "/", $absPath);
927
+ $upload_dir = str_replace("\\", "/", UPLOAD_DIR);
928
+ $asset_root = str_replace("\\", "/", AssetManager::root());
929
+ $allowedPathCheck = apply_filters("wpdm_allowed_path_check", true);
930
+ if(substr_count($absPath, $upload_dir) || substr_count($absPath, $asset_root) || !$allowedPathCheck) return true;
931
  return false;
932
  }
933
  }
src/__/Query.php CHANGED
@@ -57,6 +57,8 @@ class Query
57
  */
58
  function sort($order_field = 'date', $order = 'DESC')
59
  {
 
 
60
 
61
  $order_fields = ['__wpdm_download_count', '__wpdm_view_count', '__wpdm_package_size_b'];
62
  if (!in_array("__wpdm_" . $order_field, $order_fields)) {
57
  */
58
  function sort($order_field = 'date', $order = 'DESC')
59
  {
60
+ if($order_field === 'downloads') $order_field = 'download_count';
61
+ if($order_field === 'views') $order_field = 'view_count';
62
 
63
  $order_fields = ['__wpdm_download_count', '__wpdm_view_count', '__wpdm_package_size_b'];
64
  if (!in_array("__wpdm_" . $order_field, $order_fields)) {
src/__/__MailUI.php CHANGED
@@ -29,4 +29,10 @@ class __MailUI
29
  ->fetch("email-templates/ui-blocks/table.php", __DIR__.'/views');
30
  }
31
 
 
 
 
 
 
 
32
  }
29
  ->fetch("email-templates/ui-blocks/table.php", __DIR__.'/views');
30
  }
31
 
32
+ static function button( $link, $label, $bg = '#0085d8', $padding = '10px 20px', $radius = 4, $width = 'block', $margin = '10px 0') {
33
+ $link = esc_attr( $link );
34
+ $button = "<a href='{$link}' style='background: {$bg}; color: #ffffff; border-radius: {$radius}px;display: {$width}; padding: {$padding};margin: {$margin}'>{$label}</a>";
35
+ return $button;
36
+ }
37
+
38
  }