WordPress Download Manager - Version 3.2.31

Version Description

  • 2021.12.21 =
  • Improved input sanitization options
Download this release

Release Info

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

Code changes from version 3.2.30 to 3.2.31

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.30
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
@@ -24,6 +24,7 @@ use WPDM\__\Session;
24
  use WPDM\__\Settings;
25
  use WPDM\__\Template;
26
  use WPDM\__\UI;
 
27
  use WPDM\__\UserAgent;
28
  use WPDM\Admin\AdminController;
29
  use WPDM\AssetManager\AssetManager;
@@ -38,7 +39,7 @@ use WPDM\Widgets\WidgetController;
38
 
39
  global $WPDM;
40
 
41
- define('WPDM_VERSION','3.2.30');
42
 
43
  define('WPDM_TEXT_DOMAIN','download-manager');
44
 
@@ -135,6 +136,7 @@ final class WordPressDownloadManager{
135
  public $bsversion = '';
136
  public $userAgent;
137
  public $message;
 
138
  public $ui;
139
  public $wpdm_urls;
140
 
@@ -193,6 +195,7 @@ final class WordPressDownloadManager{
193
  $this->downloadHistory = new DownloadStats();
194
  $this->userAgent = new UserAgent();
195
  $this->message = new Messages();
 
196
  $this->ui = new UI();
197
  $this->email = new Email();
198
 
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.31
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
24
  use WPDM\__\Settings;
25
  use WPDM\__\Template;
26
  use WPDM\__\UI;
27
+ use WPDM\__\Updater;
28
  use WPDM\__\UserAgent;
29
  use WPDM\Admin\AdminController;
30
  use WPDM\AssetManager\AssetManager;
39
 
40
  global $WPDM;
41
 
42
+ define('WPDM_VERSION','3.2.31');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
136
  public $bsversion = '';
137
  public $userAgent;
138
  public $message;
139
+ public $updater;
140
  public $ui;
141
  public $wpdm_urls;
142
 
195
  $this->downloadHistory = new DownloadStats();
196
  $this->userAgent = new UserAgent();
197
  $this->message = new Messages();
198
+ $this->updater = new Updater();
199
  $this->ui = new UI();
200
  $this->email = new Email();
201
 
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: 5.8
7
  License: GPLv2 or later
8
- Stable tag: 3.2.30
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,9 @@ Check download stats and get a push notification when someone downloads, install
181
 
182
  == Changelog ==
183
 
 
 
 
184
  = 3.2.30 - 2021.12.27 =
185
  * Improved input sanitization options
186
 
5
  Requires at least: 5.3
6
  Tested up to: 5.8
7
  License: GPLv2 or later
8
+ Stable tag: 3.2.31
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.31 - 2021.12.21 =
185
+ * Improved input sanitization options
186
+
187
  = 3.2.30 - 2021.12.27 =
188
  * Improved input sanitization options
189
 
src/AssetManager/AssetManager.php CHANGED
@@ -95,9 +95,21 @@ class AssetManager
95
 
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
98
 
99
  function assetPicker()
100
  {
 
 
101
  global $wp_query;
102
  if (wpdm_query_var('assetpicker', 'int') === 1) {
103
  if(!current_user_can('access_server_browser')) Messages::fullPage("Error", esc_attr__( 'You are not authorized to access this page', 'download-manager' ), 'error');
95
 
96
  }
97
 
98
+ function dequeueScripts() {
99
+ global $wp_scripts;
100
+ $wp_scripts->queue = array();
101
+ }
102
+
103
+
104
+ function dequeueStyles() {
105
+ global $wp_styles;
106
+ $wp_styles->queue = array();
107
+ }
108
 
109
  function assetPicker()
110
  {
111
+ //$this->dequeueScripts();
112
+ //$this->dequeueStyles();
113
  global $wp_query;
114
  if (wpdm_query_var('assetpicker', 'int') === 1) {
115
  if(!current_user_can('access_server_browser')) Messages::fullPage("Error", esc_attr__( 'You are not authorized to access this page', 'download-manager' ), 'error');
src/AssetManager/views/asset-manager-picker.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
  if(!defined('ABSPATH')) die('Error!');
 
 
3
  ?>
4
  <!DOCTYPE html>
5
  <html style="background: transparent">
@@ -18,6 +20,7 @@ if(!defined('ABSPATH')) die('Error!');
18
 
19
 
20
  <?php
 
21
  \WPDM\__\Apply::googleFont();
22
  ?>
23
  <style>
1
  <?php
2
  if(!defined('ABSPATH')) die('Error!');
3
+ global $wp_scripts;
4
+
5
  ?>
6
  <!DOCTYPE html>
7
  <html style="background: transparent">
20
 
21
 
22
  <?php
23
+ //wp_head();
24
  \WPDM\__\Apply::googleFont();
25
  ?>
26
  <style>
src/Category/views/category-shortcode.php CHANGED
@@ -8,10 +8,10 @@
8
  if (!defined("ABSPATH")) die();
9
  ?>
10
  <div class='w3eden'>
11
- <div class='<?php echo $css_class; ?>'>
12
  <?php include \WPDM\__\Template::locate("category-shortcode-toolbar.php", __DIR__); ?>
13
 
14
- <div id="content_<?php echo $scid; ?>">
15
  <?php echo $cimg ?>
16
  <?php echo $subcats ?>
17
  <?php echo $html ?>
8
  if (!defined("ABSPATH")) die();
9
  ?>
10
  <div class='w3eden'>
11
+ <div class='<?php echo esc_attr($css_class); ?>'>
12
  <?php include \WPDM\__\Template::locate("category-shortcode-toolbar.php", __DIR__); ?>
13
 
14
+ <div id="content_<?php echo esc_attr($scid); ?>">
15
  <?php echo $cimg ?>
16
  <?php echo $subcats ?>
17
  <?php echo $html ?>
src/Package/Hooks.php CHANGED
@@ -27,7 +27,6 @@ class Hooks
27
  {
28
  $this->wpdmIframe();
29
  $this->shortcodeIframe();
30
- $this->customDownloadLinkPage();
31
  WPDM()->package->addViewCount();
32
  }
33
 
@@ -42,67 +41,7 @@ class Hooks
42
  function shortcodeIframe()
43
  {
44
  if (isset($_REQUEST['__wpdmxp'])) {
45
- include __Template::locate("shortcode-iframe.php", __DIR__.'/views');
46
- die();
47
- }
48
- }
49
-
50
- function customDownloadLinkPage()
51
- {
52
- global $wp_query;
53
- $url = parse_url($_SERVER['REQUEST_URI']);
54
- if (preg_match('/wpdm\-download\/([^\/]+)/', wpdm_valueof($url, 'path'), $matches)) {
55
- $pack = Crypt::decrypt($matches[1], true);
56
- $package = get_post($pack['pid']);
57
- if(!$package) Messages::error(__( 'Package not found!', 'download-manager' ), 1);
58
- $validity = TempStorage::get("__wpdmkey_{$pack['key']}");
59
- if (!$validity)
60
- $validity = get_post_meta($pack['pid'], "__wpdmkey_{$pack['key']}", true);
61
-
62
- if (!is_array($validity)) $validity = array('expire' => 0, 'use' => 0);
63
-
64
- $validity['expire'] = $validity['expire'] - time();
65
-
66
- $mtime = '';
67
- if ($validity['expire'] > 0 && $validity['use'] > 0) {
68
- $init = $validity['expire'];
69
- $days = round($init / 86400);
70
- $hours = round($init / 3600);
71
- $minutes = round(($init / 60) % 60);
72
- $seconds = $init % 60;
73
- if ($days > 0)
74
- $mtime .= "<b>{$days}</b> days ";
75
- else if ($hours > 0)
76
- $mtime .= "<b>{$hours}</b> hours ";
77
- else if ($minutes > 0)
78
- $mtime .= "<b>{$minutes}</b> mins ";
79
- else if ($seconds > 0)
80
- $mtime .= "<b>{$seconds}</b> secs ";
81
- $keyvalid = true;
82
- } else {
83
- $keyvalid = false;
84
- $init = abs($validity['expire']);
85
- $days = round($init / 86400);
86
- $hours = round($init / 3600);
87
- $minutes = round(($init / 60) % 60);
88
- $_mtime = '';
89
- $seconds = $init % 60;
90
- if ($days > 0)
91
- $_mtime .= "<b>{$days}</b> days ";
92
- else if ($hours > 0)
93
- $_mtime .= "<b>{$hours}</b> hours ";
94
- else if ($minutes > 0)
95
- $_mtime .= "<b>{$minutes}</b> mins ";
96
- else if ($seconds > 0)
97
- $_mtime .= "{$seconds} secs";
98
- $validity['expired'] = $_mtime;
99
- }
100
-
101
- $files = WPDM()->package->getFiles($package->ID, true);
102
- $picon = get_post_meta($package->ID, '__wpdm_icon', true);
103
- $validity['expire'] = $mtime;
104
- $download_url = add_query_arg(array('wpdmdl' => $pack['pid'], '_wpdmkey' => $pack['key']), home_url());
105
- include Template::locate("download-page-clean.php", __DIR__.'/views');
106
  die();
107
  }
108
  }
27
  {
28
  $this->wpdmIframe();
29
  $this->shortcodeIframe();
 
30
  WPDM()->package->addViewCount();
31
  }
32
 
41
  function shortcodeIframe()
42
  {
43
  if (isset($_REQUEST['__wpdmxp'])) {
44
+ include Template::locate("shortcode-iframe.php", __DIR__.'/views');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  die();
46
  }
47
  }
src/Package/PackageLocks.php CHANGED
@@ -5,10 +5,11 @@ namespace WPDM\Package;
5
  global $gp1c, $tbc;
6
 
7
 
 
8
  use WPDM\__\Crypt;
9
  use WPDM\__\Session;
10
  use WPDM\__\Template;
11
- use WPDM\SocialConnect\SocialConnect;
12
 
13
  class PackageLocks
14
  {
@@ -17,16 +18,6 @@ class PackageLocks
17
 
18
  }
19
 
20
-
21
- public static function linkedInShare($package)
22
- {
23
-
24
- return "<button class='wpdm-social-lock btn wpdm-linkedin' data-url='".SocialConnect::LinkedinAuthUrl($package['ID'])."'><i class='fab fa-linkedin-in'></i> ".__( "Share", "download-manager" )."</button>";
25
-
26
-
27
- }
28
-
29
-
30
  public static function askPassword($package){
31
  ob_start();
32
  $unqid = uniqid();
@@ -129,8 +120,8 @@ class PackageLocks
129
  $subject = esc_attr__( "Your Download Link", 'download-manager' );
130
  $site = get_option('blogname');
131
 
132
- $custom_form_data = isset($_POST['custom_form_field']) ? $_POST['custom_form_field'] : array();
133
- if (isset($_REQUEST['name'])) $custom_form_data['name'] = $_REQUEST['name'];
134
 
135
  /**
136
  * Do something before sending download link
5
  global $gp1c, $tbc;
6
 
7
 
8
+ use WPDM\__\__;
9
  use WPDM\__\Crypt;
10
  use WPDM\__\Session;
11
  use WPDM\__\Template;
12
+
13
 
14
  class PackageLocks
15
  {
18
 
19
  }
20
 
 
 
 
 
 
 
 
 
 
 
21
  public static function askPassword($package){
22
  ob_start();
23
  $unqid = uniqid();
120
  $subject = esc_attr__( "Your Download Link", 'download-manager' );
121
  $site = get_option('blogname');
122
 
123
+ $custom_form_data = wpdm_query_var('custom_form_field', 'html');
124
+ if (isset($_REQUEST['name'])) $custom_form_data['name'] = wpdm_query_var('name', 'txt');
125
 
126
  /**
127
  * Do something before sending download link
src/Package/views/download-page-clean.php DELETED
@@ -1,226 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH')) die();
3
- /**
4
- * User: shahnuralam
5
- * Date: 1/26/18
6
- * Time: 12:33 AM
7
- * Updated: 2020-06-19
8
- */
9
-
10
-
11
- ?><!DOCTYPE html>
12
- <html style="background: transparent">
13
- <head>
14
- <title><?php echo $package->post_title; ?></title>
15
- <script>
16
- var wpdm_url = <?php echo json_encode(WPDM()->wpdm_urls) ?>;
17
- </script>
18
- <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/css/bootstrap.css" />
19
- <link rel="stylesheet" href="<?php echo WPDM_BASE_URL; ?>assets/css/front.css" />
20
- <script src="<?php echo includes_url(); ?>/js/jquery/jquery.js"></script>
21
- <script src="<?php echo WPDM_BASE_URL; ?>assets/bootstrap/js/bootstrap.min.js"></script>
22
- <link href="https://fonts.googleapis.com/css?family=Merriweather+Sans:400,700" rel="stylesheet">
23
- <script src="<?php echo WPDM_BASE_URL ?>assets/js/simple-scrollbar.min.js"></script>
24
-
25
- <?php
26
- WPDM()->apply::uiColors();
27
- ?>
28
- <style>
29
- body{
30
- font-family: "Merriweather Sans", sans-serif;
31
- font-weight: 400;
32
- font-size: 10px;
33
- color: #425676;
34
- background: #233459;
35
- }
36
- .w3eden #wpdm-download h1{
37
- font-size: 11pt;
38
- font-weight: 600;
39
- line-height: 1.5;
40
- }
41
- h1,h2,h3{
42
- font-weight: 800;
43
- letter-spacing: 0.4px;
44
- }
45
- .w3eden #wpdm-download h3{
46
- font-size: 9pt;
47
- }
48
- .w3eden p{
49
- font-size: 10px;
50
- margin: 0;
51
- letter-spacing: 0.3px;
52
- line-height: 1.5;
53
- }
54
- #wpdm-download .modal-dialog{
55
- width: 360px;
56
- max-width: 96%;
57
- }
58
- #wpdm-download .modal-content{
59
- border-radius: 4px;
60
- border: 0;
61
- box-shadow: 0 0 15px rgba(0,0,0,0.12);
62
- }
63
- #wpdm-download .modal-footer{
64
- border-top: 1px solid #eeeeee;
65
- background: #fafafa;
66
- padding: 15px;
67
- }
68
- .w3eden #wpdm-download .btn{
69
- padding: 12px;
70
- font-weight: 600 !important;
71
- font-size: 9pt;
72
- letter-spacing: 1.5px;
73
- }
74
- .modal-backdrop{
75
- background: rgba(70, 99, 156, 0.87);
76
- }
77
- .modal-backdrop.show{
78
- opacity: 1;
79
- }
80
- p svg{
81
- width: 12px;
82
- display: inline-block;
83
- margin-right: 3px;
84
- margin-top: -3px;
85
- }
86
- .w3eden .list-group {
87
- border-color: rgba(67, 93, 148, 0.1) !important;
88
- max-height: 120px;
89
- overflow: auto;
90
- border-radius: 0 !important;
91
- }
92
- .w3eden .list-group div.file-item{
93
- padding: 10px;
94
- color: var(--color-muted);
95
- font-size: 10px;
96
- border-color: rgba(67, 93, 148, 0.1) !important;
97
- line-height: 1.5;
98
- border-radius: 0 !important;
99
- }
100
- .w3eden .list-group div.file-item h3{
101
- font-size:10pt;
102
- margin: 0;
103
- font-weight: 600;
104
- color: #4b6286;
105
- }
106
- .w3eden .list-group div.file-item svg{
107
- width: 18px;
108
- margin-top: 5px;
109
- }
110
-
111
- .ss-wrapper {
112
- overflow : hidden;
113
- height : 100%;
114
- position : relative;
115
- z-index : 1;
116
- float: left;
117
- width: 100%;
118
- }
119
-
120
- .ss-content {
121
- height : 100%;
122
- width : 100%;
123
- padding : 0 32px 0 0;
124
- position : relative;
125
- right : -18px;
126
- overflow : auto;
127
- -moz-box-sizing : border-box;
128
- box-sizing : border-box;
129
- }
130
-
131
- .ss-scroll {
132
- position : relative;
133
- background : rgba(0, 0, 0, .1);
134
- width : 9px;
135
- border-radius : 4px;
136
- top : 0;
137
- z-index : 2;
138
- cursor : pointer;
139
- opacity: 0;
140
- transition: opacity 0.25s linear;
141
- }
142
-
143
- .ss-container:hover .ss-scroll {
144
- opacity: 1;
145
- }
146
-
147
- .ss-grabbed {
148
- user-select: none;
149
- -o-user-select: none;
150
- -moz-user-select: none;
151
- -khtml-user-select: none;
152
- -webkit-user-select: none;
153
- }
154
- </style>
155
-
156
- </head>
157
- <body class="w3eden">
158
- <div id="wpdm-download" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="wpdm-download-title" aria-hidden="true">
159
- <div class="modal-dialog modal-dialog-centered" role="document">
160
- <div class="modal-content">
161
- <div class="modal-body">
162
- <div class="media">
163
- <?php if($picon !== ''){ ?>
164
- <div class="mr-3">
165
- <img style="width: 50px" src="<?php echo $picon; ?>" />
166
- </div>
167
- <?php } ?>
168
- <div class="media-body">
169
- <h1><?php echo $package->post_title; ?> <?php if(count($files) == 1) { ?>( <?php echo strtoupper(WPDM()->package->fileTypes($package->ID, false)[0]); ?> )<?php } ?></h1>
170
- <p>
171
- <svg aria-hidden="true" focusable="false" data-prefix="fal" data-icon="alarm-exclamation" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-alarm-exclamation fa-w-16 fa-fw fa-2x"><path fill="var(--color-danger)" d="M256 352a24 24 0 1 0 24 24 24 24 0 0 0-24-24zm-8.5-24h17a8.14 8.14 0 0 0 8-7.5l7-136a8 8 0 0 0-8-8.5h-31a8 8 0 0 0-8 8.5l7 136a8 8 0 0 0 8 7.5zM32 112a80.09 80.09 0 0 1 80-80 79.23 79.23 0 0 1 50 18 253.22 253.22 0 0 1 34.44-10.8C175.89 15.42 145.86 0 112 0A112.14 112.14 0 0 0 0 112c0 25.86 9.17 49.41 24 68.39a255.93 255.93 0 0 1 17.4-31.64A78.94 78.94 0 0 1 32 112zM400 0c-33.86 0-63.89 15.42-84.44 39.25A253.22 253.22 0 0 1 350 50.05a79.23 79.23 0 0 1 50-18 80.09 80.09 0 0 1 80 80 78.94 78.94 0 0 1-9.36 36.75A255.93 255.93 0 0 1 488 180.39c14.79-19 24-42.53 24-68.39A112.14 112.14 0 0 0 400 0zM256 64C132.29 64 32 164.29 32 288a222.89 222.89 0 0 0 54.84 146.54L34.34 487a8 8 0 0 0 0 11.32l11.31 11.31a8 8 0 0 0 11.32 0l52.49-52.5a223.21 223.21 0 0 0 293.08 0L455 509.66a8 8 0 0 0 11.32 0l11.31-11.31a8 8 0 0 0 0-11.32l-52.5-52.49A222.89 222.89 0 0 0 480 288c0-123.71-100.29-224-224-224zm0 416c-105.87 0-192-86.13-192-192S150.13 96 256 96s192 86.13 192 192-86.13 192-192 192z" class=""></path></svg> <?php echo isset($validity['expire']) && $validity['expire'] ? "Expires in {$validity['expire']}": "Expired {$validity['expired']} ago"; ?> &nbsp; <svg aria-hidden="true" focusable="false" data-prefix="fal" data-icon="arrow-circle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-arrow-circle-down fa-w-16 fa-fw fa-2x"><path fill="var(--color-info)" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm216 248c0 118.7-96.1 216-216 216-118.7 0-216-96.1-216-216 0-118.7 96.1-216 216-216 118.7 0 216 96.1 216 216zm-92.5-4.5l-6.9-6.9c-4.7-4.7-12.5-4.7-17.1.2L273 330.3V140c0-6.6-5.4-12-12-12h-10c-6.6 0-12 5.4-12 12v190.3l-82.5-85.6c-4.7-4.8-12.4-4.9-17.1-.2l-6.9 6.9c-4.7 4.7-4.7 12.3 0 17l115 115.1c4.7 4.7 12.3 4.7 17 0l115-115.1c4.7-4.6 4.7-12.2 0-16.9z" class=""></path></svg> <b><?php echo isset($validity['use']) ? $validity['use'] : 0; ?></b> downloads remains<br/>
172
- </p>
173
- </div>
174
- </div>
175
- <?php if(count($files) > 1) {
176
- ?>
177
- <div class="list-group mt-3" data-simplebar ss-container>
178
- <?php
179
- foreach ($files as $fid => $file) {
180
- ?>
181
- <div class="file-item list-group-item">
182
-
183
- <?php if($keyvalid) { ?>
184
- <div class="float-right">
185
- <a href="<?php echo $download_url; ?>&ind=<?php echo $fid; ?><?php if(isset($_GET['subscriber'])) echo '&subscriber='.wpdm_query_var('subscriber'); ?>">
186
- <svg aria-hidden="true" focusable="false" data-prefix="fad" data-icon="arrow-alt-circle-down" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-arrow-alt-circle-down fa-w-16 fa-fw fa-2x"><g class="fa-group"><path fill="rgba(var(--color-success-rgb), 0.15)" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm124.41 268.32L264.52 390.48a12.08 12.08 0 0 1-17 0L131.59 276.32c-7.67-7.49-2.22-20.48 8.57-20.48h71.51V140a12.08 12.08 0 0 1 12.1-12h64.56a12.08 12.08 0 0 1 12.1 12v115.84h71.41c10.79 0 16.24 12.89 8.57 20.48z" class="fa-secondary"></path><path fill="var(--color-success)" d="M223.77 128h64.56a12.08 12.08 0 0 1 12.1 12v115.84h71.41c10.79 0 16.24 12.89 8.57 20.48L264.52 390.48a12.08 12.08 0 0 1-17 0L131.59 276.32c-7.67-7.49-2.22-20.48 8.57-20.48h71.51V140a12.08 12.08 0 0 1 12.1-12z" class="fa-primary"></path></g></svg>
187
- </a>
188
- </div>
189
- <?php } ?>
190
- <h3><?php echo basename($file); ?></h3>
191
- <?php echo wpdm_file_size($file); ?>
192
-
193
- </div>
194
- <?php
195
- }
196
- ?>
197
- </div>
198
- <?php
199
- }
200
- ?>
201
- </div>
202
- <div class="modal-footer">
203
- <?php if($keyvalid) { ?>
204
- <a href="<?php echo $download_url; if(isset($_GET['subscriber'])) echo '&subscriber='.wpdm_query_var('subscriber'); ?>" class="btn btn-primary btn-block">
205
- Download [ <?php echo wpdm_package_size($package->ID); ?> ]
206
- </a>
207
- <?php } else { ?>
208
- <button disabled="disabled" class="btn btn-danger btn-block">
209
- &mdash; Download link is expired &mdash;
210
- </button>
211
- <?php } ?>
212
- </div>
213
- </div>
214
- </div>
215
- <div class="text-center" style="width: 100%;z-index: 999999;position: absolute;bottom: 20px;color: rgba(255,255,255, 0.4);font-size: 10px">
216
- &mdash; &nbsp;<a href="<?php echo home_url('/'); ?>" style="color: rgba(255,255,255, 0.4);">Go to Home</a> &mdash;
217
- <a href="<?php echo get_permalink($package->ID); ?>" style="color: rgba(255,255,255, 0.4);">View Package</a>&nbsp; &mdash;
218
- </div>
219
- </div>
220
- <script>
221
- jQuery(function ($) {
222
- $('#wpdm-download').modal({backdrop: 'static'});
223
- });
224
- </script>
225
- </body>
226
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/__/Apply.php CHANGED
@@ -450,9 +450,7 @@ class Apply
450
  update_post_meta($fileid, '__wpdm_password_usage', $pu);
451
  }
452
 
453
- //$id = uniqid();
454
- //Session::set( '__wpdm_unlocked_'.$_POST['wpdmfileid'] , 1 );
455
- //update_post_meta($fileid, "__wpdmkey_".$id, 8);
456
  $_data['error'] = '';
457
  $_data['downloadurl'] = WPDM()->package->expirableDownloadLink($fileid, $limit);
458
  $_data['downloadurl'] .= "&ind=" . wpdm_query_var('wpdmfile');
@@ -708,36 +706,36 @@ class Apply
708
  <style>
709
 
710
  :root {
711
- --color-primary: <?php echo sanitize_text_field($primary); ?>;
712
- --color-primary-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($primary)); ?>;
713
- --color-primary-hover: <?php echo sanitize_text_field($uicolors['primary'] ?? '#4a8eff' ); ?>;
714
- --color-primary-active: <?php echo sanitize_text_field($uicolors['primary'] ?? '#4a8eff' ); ?>;
715
- --color-secondary: <?php echo sanitize_text_field($secondary); ?>;
716
- --color-secondary-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($secondary)); ?>;
717
- --color-secondary-hover: <?php echo sanitize_text_field($uicolors['secondary'] ?? '#4a8eff'); ?>;
718
- --color-secondary-active: <?php echo sanitize_text_field($uicolors['secondary'] ?? '#4a8eff' ); ?>;
719
- --color-success: <?php echo sanitize_text_field($success); ?>;
720
- --color-success-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($success)); ?>;
721
- --color-success-hover: <?php echo sanitize_text_field($uicolors['success_hover'] ?? '#4a8eff'); ?>;
722
- --color-success-active: <?php echo sanitize_text_field($uicolors['success_active'] ?? '#4a8eff' ); ?>;
723
- --color-info: <?php echo sanitize_text_field($info); ?>;
724
- --color-info-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($info)); ?>;
725
- --color-info-hover: <?php echo sanitize_text_field($uicolors['info_hover'] ?? '#2CA8FF' ); ?>;
726
- --color-info-active: <?php echo sanitize_text_field($uicolors['info_active'] ?? '#2CA8FF'); ?>;
727
- --color-warning: <?php echo sanitize_text_field($warning); ?>;
728
- --color-warning-rgb: <?php echo sanitize_text_field(wpdm_hex2rgb($warning)); ?>;
729
- --color-warning-hover: <?php echo sanitize_text_field($uicolors['warning_hover'] ?? 'orange' ); ?>;
730
- --color-warning-active: <?php echo sanitize_text_field($uicolors['warning_active'] ?? 'orange'); ?>;
731
- --color-danger: <?php echo sanitize_text_field($danger); ?>;
732
- --color-danger-rgb: <?php echo wpdm_hex2rgb($danger); ?>;
733
- --color-danger-hover: <?php echo sanitize_text_field($uicolors['danger_hover'] ?? '#ff5062'); ?>;
734
- --color-danger-active: <?php echo sanitize_text_field($uicolors['danger_active'] ?? '#ff5062'); ?>;
735
- --color-green: <?php echo sanitize_text_field($uicolors['green'] ?? '#30b570'); ?>;
736
- --color-blue: <?php echo sanitize_text_field($uicolors['blue'] ?? '#0073ff'); ?>;
737
- --color-purple: <?php echo sanitize_text_field($uicolors['purple'] ?? '#8557D3'); ?>;
738
- --color-red: <?php echo sanitize_text_field($uicolors['red'] ?? '#ff5062'); ?>;
739
  --color-muted: rgba(69, 89, 122, 0.6);
740
- --wpdm-font: <?php echo sanitize_text_field($font); ?> -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
741
  }
742
 
743
  .wpdm-download-link<?php echo sanitize_text_field($class); ?> {
450
  update_post_meta($fileid, '__wpdm_password_usage', $pu);
451
  }
452
 
453
+
 
 
454
  $_data['error'] = '';
455
  $_data['downloadurl'] = WPDM()->package->expirableDownloadLink($fileid, $limit);
456
  $_data['downloadurl'] .= "&ind=" . wpdm_query_var('wpdmfile');
706
  <style>
707
 
708
  :root {
709
+ --color-primary: <?php echo esc_attr($primary); ?>;
710
+ --color-primary-rgb: <?php echo esc_attr(wpdm_hex2rgb($primary)); ?>;
711
+ --color-primary-hover: <?php echo esc_attr( isset($uicolors['primary'])?$uicolors['primary_hover']:'#4a8eff' ); ?>;
712
+ --color-primary-active: <?php echo esc_attr( isset($uicolors['primary'])?$uicolors['primary_active']:'#4a8eff' ); ?>;
713
+ --color-secondary: <?php echo esc_attr( $secondary ); ?>;
714
+ --color-secondary-rgb: <?php echo esc_attr(wpdm_hex2rgb($secondary)); ?>;
715
+ --color-secondary-hover: <?php echo esc_attr( isset($uicolors['secondary'])?$uicolors['secondary_hover']:'#4a8eff' ); ?>;
716
+ --color-secondary-active: <?php echo esc_attr( isset($uicolors['secondary'])?$uicolors['secondary_active']:'#4a8eff' ); ?>;
717
+ --color-success: <?php echo esc_attr( $success ); ?>;
718
+ --color-success-rgb: <?php echo esc_attr(wpdm_hex2rgb($success)); ?>;
719
+ --color-success-hover: <?php echo esc_attr( isset($uicolors['success_hover'])?$uicolors['success_hover']:'#4a8eff' ); ?>;
720
+ --color-success-active: <?php echo esc_attr( isset($uicolors['success_active'])?$uicolors['success_active']:'#4a8eff' ); ?>;
721
+ --color-info: <?php echo esc_attr( $info ); ?>;
722
+ --color-info-rgb: <?php echo esc_attr(wpdm_hex2rgb($info)); ?>;
723
+ --color-info-hover: <?php echo esc_attr( isset($uicolors['info_hover'])?$uicolors['info_hover']:'#2CA8FF' ); ?>;
724
+ --color-info-active: <?php echo esc_attr( isset($uicolors['info_active'])?$uicolors['info_active']:'#2CA8FF' ); ?>;
725
+ --color-warning: <?php echo esc_attr( $warning ); ?>;
726
+ --color-warning-rgb: <?php echo esc_attr(wpdm_hex2rgb($warning)); ?>;
727
+ --color-warning-hover: <?php echo esc_attr( isset($uicolors['warning_hover'])?$uicolors['warning_hover']:'orange' ); ?>;
728
+ --color-warning-active: <?php echo esc_attr( isset($uicolors['warning_active'])?$uicolors['warning_active']:'orange' ); ?>;
729
+ --color-danger: <?php echo esc_attr( $danger ); ?>;
730
+ --color-danger-rgb: <?php echo esc_attr(wpdm_hex2rgb($danger)); ?>;
731
+ --color-danger-hover: <?php echo esc_attr( isset($uicolors['danger_hover'])?$uicolors['danger_hover']:'#ff5062' ); ?>;
732
+ --color-danger-active: <?php echo esc_attr( isset($uicolors['danger_active'])?$uicolors['danger_active']:'#ff5062' ); ?>;
733
+ --color-green: <?php echo esc_attr( isset($uicolors['green'])?$uicolors['green']:'#30b570' ); ?>;
734
+ --color-blue: <?php echo esc_attr( isset($uicolors['blue'])?$uicolors['blue']:'#0073ff' ); ?>;
735
+ --color-purple: <?php echo esc_attr( isset($uicolors['purple'])?$uicolors['purple']:'#8557D3' ); ?>;
736
+ --color-red: <?php echo esc_attr( isset($uicolors['red'])?$uicolors['red']:'#ff5062' ); ?>;
737
  --color-muted: rgba(69, 89, 122, 0.6);
738
+ --wpdm-font: <?php echo esc_attr( $font ); ?> -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
739
  }
740
 
741
  .wpdm-download-link<?php echo sanitize_text_field($class); ?> {
src/__/FileSystem.php CHANGED
@@ -712,35 +712,35 @@ class FileSystem
712
  $color_rgba = wpdm_hex2rgb($color);
713
  $ext = substr($ext, 0, 3);
714
  ?>
715
- <svg id="Layer_<?php echo $id ?>" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"
716
  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style
717
  type="text/css">
718
- .st_<?php echo $id ?>_0 {
719
  fill: rgba(<?php echo $color_rgba; ?>, 0.3);
720
  }
721
 
722
- .st_<?php echo $id ?>_1 {
723
  fill: rgba(<?php echo $color_rgba; ?>, 0.9);
724
  }
725
 
726
- .st_<?php echo $id ?>_2 {
727
  fill: <?php echo $color; ?>;
728
  }
729
 
730
- .st_<?php echo $id ?>_3 {
731
  fill: #FFFFFF;
732
  }
733
  </style>
734
  <g id="XMLID_168_">
735
  <g id="XMLID_83_">
736
- <polygon class="st_<?php echo $id ?>_0" id="XMLID_87_" points="330.7,6 87.9,6 87.9,506 449.2,506 449.2,122.8 "/>
737
- <polygon class="st_<?php echo $id ?>_1" id="XMLID_86_" points="330.7,6 449.2,122.8 330.7,122.8 "/>
738
- <rect class="st_<?php echo $id ?>_1" height="156.1" id="XMLID_85_" width="329" x="62.8" y="298.8"/>
739
- <polygon class="st_<?php echo $id ?>_2" id="XMLID_84_" points="62.8,454.9 87.9,476.1 87.9,454.9 "/>
740
  </g>
741
  <g xmlns="http://www.w3.org/2000/svg" id="XMLID_3113_">
742
  <text x="20%" fill="white" style="font-family: sans-serif;font-size: 725%;font-weight: bold;"
743
- y="82%"><?php echo $ext; ?></text>
744
  </g>
745
  </g>
746
  </svg>
712
  $color_rgba = wpdm_hex2rgb($color);
713
  $ext = substr($ext, 0, 3);
714
  ?>
715
+ <svg id="Layer_<?php echo esc_attr($id) ?>" style="enable-background:new 0 0 512 512;" version="1.1" viewBox="0 0 512 512"
716
  xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><style
717
  type="text/css">
718
+ .st_<?php echo esc_attr($id) ?>_0 {
719
  fill: rgba(<?php echo $color_rgba; ?>, 0.3);
720
  }
721
 
722
+ .st_<?php echo esc_attr($id) ?>_1 {
723
  fill: rgba(<?php echo $color_rgba; ?>, 0.9);
724
  }
725
 
726
+ .st_<?php echo esc_attr($id) ?>_2 {
727
  fill: <?php echo $color; ?>;
728
  }
729
 
730
+ .st_<?php echo esc_attr($id) ?>_3 {
731
  fill: #FFFFFF;
732
  }
733
  </style>
734
  <g id="XMLID_168_">
735
  <g id="XMLID_83_">
736
+ <polygon class="st_<?php echo esc_attr($id) ?>_0" id="XMLID_87_" points="330.7,6 87.9,6 87.9,506 449.2,506 449.2,122.8 "/>
737
+ <polygon class="st_<?php echo esc_attr($id) ?>_1" id="XMLID_86_" points="330.7,6 449.2,122.8 330.7,122.8 "/>
738
+ <rect class="st_<?php echo esc_attr($id) ?>_1" height="156.1" id="XMLID_85_" width="329" x="62.8" y="298.8"/>
739
+ <polygon class="st_<?php echo esc_attr($id) ?>_2" id="XMLID_84_" points="62.8,454.9 87.9,476.1 87.9,454.9 "/>
740
  </g>
741
  <g xmlns="http://www.w3.org/2000/svg" id="XMLID_3113_">
742
  <text x="20%" fill="white" style="font-family: sans-serif;font-size: 725%;font-weight: bold;"
743
+ y="82%"><?php echo esc_attr($ext); ?></text>
744
  </g>
745
  </g>
746
  </svg>
src/__/Updater.php ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+
4
+ namespace WPDM\__;
5
+
6
+
7
+ class Updater
8
+ {
9
+ function __construct()
10
+ {
11
+
12
+ }
13
+
14
+ function getLatestVersions()
15
+ {
16
+ $latest = get_option('wpdm_latest', []);
17
+ $latest = (array)$latest;
18
+ return $latest;
19
+ }
20
+
21
+
22
+ }
src/__/__.php CHANGED
@@ -179,22 +179,21 @@ class __
179
  static function query_var($var, $params = array(), $default = null)
180
  {
181
  global $wp_query;
182
-
 
183
  $_var = explode("/", $var);
 
184
  if (count($_var) > 1) {
 
185
  foreach ($_var as $key) {
186
- $key = sanitize_text_field($key);
187
- $val = isset($_REQUEST[$key]) ? sanitize_textarea_field($_REQUEST[$key]) : false;
188
  }
189
  } else {
190
  $default = $default ? $default : (isset($params['default']) ? $params['default'] : null);
191
- $var = sanitize_text_field($var);
192
- $val = isset($_REQUEST[$var]) ? sanitize_textarea_field($_REQUEST[$var]) : null;
193
  if(!$val)
194
  $val = $wp_query->query_vars[$var] ?? $default;
195
  }
196
- $validate = is_string($params) ? $params : '';
197
- $validate = is_array($params) && isset($params['validate']) ? $params['validate'] : $validate;
198
 
199
  if (!is_array($val))
200
  $val = __::sanitize_var($val, $validate);
179
  static function query_var($var, $params = array(), $default = null)
180
  {
181
  global $wp_query;
182
+ $validate = is_string($params) ? $params : '';
183
+ $validate = is_array($params) && isset($params['validate']) ? $params['validate'] : $validate;
184
  $_var = explode("/", $var);
185
+
186
  if (count($_var) > 1) {
187
+ $val = self::sanitize_array($_REQUEST, $validate);
188
  foreach ($_var as $key) {
189
+ $val = isset($val[$key]) ? __::sanitize_array($val[$key]) : false;
 
190
  }
191
  } else {
192
  $default = $default ? $default : (isset($params['default']) ? $params['default'] : null);
193
+ $val = isset($_REQUEST[$var]) ? __::sanitize_array($_REQUEST[$var]) : null;
 
194
  if(!$val)
195
  $val = $wp_query->query_vars[$var] ?? $default;
196
  }
 
 
197
 
198
  if (!is_array($val))
199
  $val = __::sanitize_var($val, $validate);
src/wpdm-core.php CHANGED
@@ -187,6 +187,31 @@ foreach ($files as $file) {
187
  include(dirname(__FILE__) . '/Modules/' . $file);
188
  }
189
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  function wpdmpro_required(){
191
  ?>
192
  <div class="panel panel-default" style="position: relative;z-index: 99999999">
187
  include(dirname(__FILE__) . '/Modules/' . $file);
188
  }
189
 
190
+
191
+ function wpdm_plugin_update_email($plugin_name, $version, $update_url)
192
+ {
193
+
194
+ $admin_email = get_option('admin_email');
195
+ $hash = "__wpdm_" . md5($plugin_name . $version);
196
+ $sent = get_option($hash, false);
197
+ if (!$sent) {
198
+
199
+ $message = 'New version available. Please update your copy.<br/><table class="email" style="width: 100%" cellpadding="5px"><tr><th>Plugin Name</th><th>Version</th></tr><tr><td>' . $plugin_name . '</td><td>' . $version . '</td></tr></table><div style="padding-top: 10px;"><a style="display: block;text-align: center" class="button" href="' . $update_url . '">Update Now</a></div>';
200
+
201
+ $params = array(
202
+ 'subject' => sprintf(__("[%s] Update Available"), $plugin_name, 'download-manager'),
203
+ 'to_email' => get_option('admin_email'),
204
+ 'from_name' => 'WordPress Download Manager',
205
+ 'from_email' => 'support@wpdownloadmanager.com',
206
+ 'message' => $message
207
+ );
208
+
209
+ \WPDM\__\Email::send("default", $params);
210
+ update_option($hash, 1, false);
211
+
212
+ }
213
+ }
214
+
215
  function wpdmpro_required(){
216
  ?>
217
  <div class="panel panel-default" style="position: relative;z-index: 99999999">