WordPress Download Manager - Version 3.2.22

Version Description

Download this release

Release Info

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

Code changes from version 3.2.19 to 3.2.22

assets/css/admin-styles.css CHANGED
@@ -1,6 +1,8 @@
1
- :root{
2
- --admin-color: #0e68ff
 
3
  }
 
4
  .w3eden h3 {
5
  margin: 0;
6
  font-size: 10pt;
@@ -97,13 +99,16 @@ a:focus, a:active {
97
  }
98
 
99
  .wpdm-settings-fields > h3 {
100
- font-size: 12pt;
101
- font-weight: 800;
102
- background: #eeeeee;
103
- padding: 8px 20px;
 
 
 
 
104
  }
105
 
106
-
107
  .wpdm-settings-fields .form-group label {
108
  display: block;
109
  clear: both;
@@ -132,6 +137,7 @@ a:focus, a:active {
132
  box-shadow: none;
133
  background: #ffffff;
134
  }
 
135
  .w3eden .alert.alert-info {
136
  position: relative;
137
  border: 1px solid var(--color-info) !important;
@@ -170,6 +176,7 @@ a:focus, a:active {
170
  .w3eden .alert.alert-warning, .alert.alert-warning * {
171
  color: var(--color-warning) !important;
172
  }
 
173
  .w3eden .alert.alert-success {
174
  border: 1px solid var(--color-success) !important;
175
  position: relative;
@@ -407,10 +414,6 @@ a:focus, a:active {
407
  border-bottom: 1px solid #999999;
408
  }
409
 
410
- #wpdm-wrapper-panel #tabs.nav-pills a {
411
- border-radius: 8px !important;
412
- color: var(--admin-color);
413
- }
414
 
415
  .w3eden code {
416
  color: #306139 !important;
@@ -418,10 +421,10 @@ a:focus, a:active {
418
  font-family: Courier, monospace !important;
419
  }
420
 
421
- .wrap.w3eden input[type="checkbox"], .w3eden input[type="radio"] {
422
  line-height: normal;
423
  margin: 0 2px 2px 0;
424
- position: relative;
425
  }
426
 
427
  #plugin-updates-nav a {
@@ -496,80 +499,6 @@ a:focus, a:active {
496
 
497
  }*/
498
 
499
- #wpdm-wrapper-panel .nav-wrapper-tabs {
500
- padding-top: 80px;
501
- background: #F5F5F5;
502
- }
503
-
504
- #wpdm-wrapper-panel > .settings-panel-body {
505
- padding-top: 80px;
506
- border-radius: 0px;
507
- background: transparent none repeat scroll 0% 0%;
508
- max-width: 1000px;
509
- }
510
-
511
- #wpdm-wrapper-panel > .settings-panel-body #tabs:hover{
512
- overflow: auto;
513
- }
514
-
515
- #wpdm-wrapper-panel .settings-tabs a {
516
- background: #ffffff;
517
- border: 1px solid #ddd;
518
- }
519
- .settings-tabs a i {
520
- display: inline-block;
521
- width: 16px;
522
- }
523
- #wpdm-wrapper-panel .settings-tabs li.active a {
524
- color: #fff !important;
525
- background: var(--admin-color) linear-gradient(rgba(14, 104, 255, 0.5), rgba(71, 140, 255, 0.5)) !important;
526
- box-shadow: 0 0 10px rgba(0, 88, 255, 0.55) !important;
527
- border: 1px solid rgba(255, 255, 255, 0.07);
528
- }
529
-
530
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fas,
531
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a .far,
532
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fab,
533
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fa {
534
- color: var(--color-primary);
535
- }
536
-
537
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fas.fa-user-shield {
538
- color: var(--color-danger);
539
- }
540
-
541
- #wpdm-wrapper-panel .settings-tabs li:not(.active) a#privacy {
542
- color: var(--color-danger);
543
- }
544
-
545
- .w3eden #wpdm-wrapper-panel .nav-pills li:not(.active) a#privacy:hover {
546
- border: 1px solid var(--color-danger);
547
- background: rgba(var(--color-danger-rgb),0.1) !important;
548
- }
549
- .w3eden #wpdm-wrapper-panel .nav-pills li.active a#privacy {
550
- border: 1px solid var(--color-danger);
551
- background: var(--color-danger) linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)) !important;
552
- box-shadow: 0 0 10px rgba(var(--color-danger-rgb), 0.4) !important;
553
- }
554
-
555
- .w3eden .panel.panel-danger {
556
- border: 1px solid var(--color-danger);
557
- }
558
-
559
- .w3eden .panel.panel-danger .panel-heading {
560
- background-color: var(--color-danger) !important;
561
- border-bottom: 1px solid var(--color-danger);
562
- color: #ffffff;
563
- }
564
-
565
- #wpdm-wrapper-panel .settings-tabs a:hover {
566
- background: rgba(145, 183, 255, 0.09);
567
- border: 1px solid rgba(var(--color-primary-rgb), 0.5);
568
- }
569
-
570
- #wpdm-wrapper-panel .nav-wrapper-tabs li.active a {
571
- background: #f1f1f1;
572
- }
573
 
574
  #wpdm-wrapper-panel > .panel-heading b {
575
  font-size: 12pt !important;
@@ -1941,11 +1870,13 @@ body.wpdm-iframe-modal-open {
1941
  z-index: 999999;
1942
  max-width: 400px;
1943
  }
 
1944
  #wpdm-notify-top-center .wpdm-notify {
1945
  float: none;
1946
  margin-left: -50%;
1947
  text-align: center;
1948
  }
 
1949
  .wpdm-hide-right {
1950
  display: none;
1951
  position: absolute;
@@ -2000,6 +1931,7 @@ body.wpdm-iframe-modal-open {
2000
  background-image: none;
2001
  border-bottom-color: #e7e7e7 !important;
2002
  }
 
2003
  .w3eden .txtsc:focus,
2004
  .w3eden .txtsc {
2005
  display: inline-block !important;
@@ -2114,6 +2046,7 @@ body.wpdm-iframe-modal-open {
2114
  .w3eden input[type="checkbox"]:focus {
2115
  outline: none !important;
2116
  }
 
2117
  .w3eden input[type="checkbox"]:checked {
2118
  border: 1px solid var(--color-primary);
2119
  transition: all ease-in-out 400ms;
@@ -2185,13 +2118,6 @@ body.wpdm-iframe-modal-open {
2185
  width: 275px;
2186
  }
2187
 
2188
- .short-code-wpdm .form-control {
2189
- font-family: monospace;
2190
- font-size: 12px;
2191
- text-align: center;
2192
- }
2193
-
2194
-
2195
  body.rtl #wpdm-admin-page-body {
2196
  margin-right: 250px !important;
2197
  }
@@ -2212,7 +2138,7 @@ body.rtl #wpdm-admin-page-container {
2212
  }
2213
  body.rtl .w3eden .chosen-container .chosen-drop,
2214
  body.rtl .w3eden .chosen-container-single-nosearch .chosen-search input[type="text"]{
2215
- display: none;
2216
  }
2217
  body.rtl .w3eden .chosen-container.chosen-with-drop .chosen-drop {
2218
  display: block;
1
+ :root {
2
+ --admin-color: #0e68ff;
3
+ --admin-color-rgb: 14, 104, 255;
4
  }
5
+
6
  .w3eden h3 {
7
  margin: 0;
8
  font-size: 10pt;
99
  }
100
 
101
  .wpdm-settings-fields > h3 {
102
+ font-size: 10pt;
103
+ font-weight: 700;
104
+ background: var(--color-secondary);
105
+ padding: 12px 14px;
106
+ margin: 20px 0 12px;
107
+ color: #fff;
108
+ border-radius: 3px;
109
+ letter-spacing: 0.6px;
110
  }
111
 
 
112
  .wpdm-settings-fields .form-group label {
113
  display: block;
114
  clear: both;
137
  box-shadow: none;
138
  background: #ffffff;
139
  }
140
+
141
  .w3eden .alert.alert-info {
142
  position: relative;
143
  border: 1px solid var(--color-info) !important;
176
  .w3eden .alert.alert-warning, .alert.alert-warning * {
177
  color: var(--color-warning) !important;
178
  }
179
+
180
  .w3eden .alert.alert-success {
181
  border: 1px solid var(--color-success) !important;
182
  position: relative;
414
  border-bottom: 1px solid #999999;
415
  }
416
 
 
 
 
 
417
 
418
  .w3eden code {
419
  color: #306139 !important;
421
  font-family: Courier, monospace !important;
422
  }
423
 
424
+ .w3eden input[type="checkbox"], .w3eden input[type="radio"] {
425
  line-height: normal;
426
  margin: 0 2px 2px 0;
427
+ position: relative !important;
428
  }
429
 
430
  #plugin-updates-nav a {
499
 
500
  }*/
501
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
502
 
503
  #wpdm-wrapper-panel > .panel-heading b {
504
  font-size: 12pt !important;
1870
  z-index: 999999;
1871
  max-width: 400px;
1872
  }
1873
+
1874
  #wpdm-notify-top-center .wpdm-notify {
1875
  float: none;
1876
  margin-left: -50%;
1877
  text-align: center;
1878
  }
1879
+
1880
  .wpdm-hide-right {
1881
  display: none;
1882
  position: absolute;
1931
  background-image: none;
1932
  border-bottom-color: #e7e7e7 !important;
1933
  }
1934
+
1935
  .w3eden .txtsc:focus,
1936
  .w3eden .txtsc {
1937
  display: inline-block !important;
2046
  .w3eden input[type="checkbox"]:focus {
2047
  outline: none !important;
2048
  }
2049
+
2050
  .w3eden input[type="checkbox"]:checked {
2051
  border: 1px solid var(--color-primary);
2052
  transition: all ease-in-out 400ms;
2118
  width: 275px;
2119
  }
2120
 
 
 
 
 
 
 
 
2121
  body.rtl #wpdm-admin-page-body {
2122
  margin-right: 250px !important;
2123
  }
2138
  }
2139
  body.rtl .w3eden .chosen-container .chosen-drop,
2140
  body.rtl .w3eden .chosen-container-single-nosearch .chosen-search input[type="text"]{
2141
+ display: none;
2142
  }
2143
  body.rtl .w3eden .chosen-container.chosen-with-drop .chosen-drop {
2144
  display: block;
assets/css/settings-ui.css CHANGED
@@ -13,7 +13,8 @@
13
  border-bottom: 1px solid #e1e3ee;
14
  position: relative;
15
  z-index: 991;
16
- box-shadow: 0 2px 4px rgba(var(--color-primary-rgb), 0.1);
 
17
  }
18
  .pr-0{ padding-right: 0 !important; }
19
  #wpdm-admin-main-header .btn-full-height{
@@ -22,6 +23,8 @@
22
  border-radius: 0;
23
  font-size: 10pt;
24
  margin-top: -1px;
 
 
25
  }
26
  #wpdm-admin-main-header .btn-full-height i{
27
  margin-right: 4px;
@@ -108,3 +111,114 @@
108
  .wpdm-admin-page-content .table {
109
  background: #fff;
110
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  border-bottom: 1px solid #e1e3ee;
14
  position: relative;
15
  z-index: 991;
16
+ box-shadow: 0 2px 4px rgba(var(--admin-color-rgb), 0.1);
17
+ margin-top: -1px;
18
  }
19
  .pr-0{ padding-right: 0 !important; }
20
  #wpdm-admin-main-header .btn-full-height{
23
  border-radius: 0;
24
  font-size: 10pt;
25
  margin-top: -1px;
26
+ background-color: var(--admin-color);
27
+ font-weight: 700;
28
  }
29
  #wpdm-admin-main-header .btn-full-height i{
30
  margin-right: 4px;
111
  .wpdm-admin-page-content .table {
112
  background: #fff;
113
  }
114
+
115
+ #wpdm-admin-page-container {
116
+ display: flex;
117
+ padding-left: 280px;
118
+ padding-top: 64px;
119
+ }
120
+
121
+ #wpdm-admin-page-sidebar {
122
+ width: 240px;
123
+ height: 1000px;
124
+ background: #f8fbfd;
125
+ border-right: 1px solid rgba(158, 163, 179, 0.37);
126
+ padding: 20px;
127
+ position: fixed;
128
+ margin-left: -261px;
129
+ overflow: auto;
130
+ }
131
+
132
+ #wpdm-admin-page-body {
133
+ padding: 30px;
134
+ width: 800px;
135
+ max-width: 100%;
136
+ }
137
+
138
+
139
+ #wpdm-wrapper-panel #tabs.nav-pills li {
140
+ margin: 0 !important;
141
+ }
142
+ #wpdm-wrapper-panel #tabs.nav-pills a {
143
+ border-radius: 3px !important;
144
+ color: #213e5b;
145
+ font-size: 10pt !important;
146
+ }
147
+
148
+ #wpdm-wrapper-panel #tabs.nav-pills a i{
149
+ margin-right: 10px !important;
150
+ }
151
+
152
+ #wpdm-wrapper-panel .nav-wrapper-tabs {
153
+ padding-top: 80px;
154
+ background: #F5F5F5;
155
+ }
156
+
157
+ #wpdm-wrapper-panel > .settings-panel-body {
158
+ padding-top: 80px;
159
+ border-radius: 0px;
160
+ background: transparent none repeat scroll 0% 0%;
161
+ max-width: 1000px;
162
+ }
163
+
164
+ #wpdm-wrapper-panel > .settings-panel-body #tabs:hover {
165
+ overflow: auto;
166
+ }
167
+
168
+ #wpdm-wrapper-panel .settings-tabs a {
169
+ background: transparent;
170
+ border: 0;
171
+ }
172
+
173
+ .settings-tabs a i {
174
+ display: inline-block;
175
+ width: 16px;
176
+ }
177
+
178
+ #wpdm-wrapper-panel .settings-tabs li.active a {
179
+ color: #fff !important;
180
+ background: var(--admin-color) !important;
181
+ box-shadow: 0 0 10px rgba(var(--admin-color-rgb), 0.55) !important;
182
+ }
183
+
184
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fas,
185
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a .far,
186
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fab,
187
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fa {
188
+ color: var(--admin-color);
189
+ }
190
+
191
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a .fas.fa-user-shield {
192
+ color: var(--color-danger);
193
+ }
194
+
195
+ #wpdm-wrapper-panel .settings-tabs li:not(.active) a#privacy {
196
+ color: var(--color-danger);
197
+ }
198
+
199
+ .w3eden #wpdm-wrapper-panel .nav-pills li:not(.active) a#privacy:hover {
200
+ background: rgba(var(--color-danger-rgb), 0.1) !important;
201
+ }
202
+
203
+ .w3eden #wpdm-wrapper-panel .nav-pills li.active a#privacy {
204
+ background: var(--color-danger) linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1)) !important;
205
+ box-shadow: 0 0 10px rgba(var(--color-danger-rgb), 0.4) !important;
206
+ }
207
+
208
+ .w3eden .panel.panel-danger {
209
+ border: 1px solid var(--color-danger);
210
+ }
211
+
212
+ .w3eden .panel.panel-danger .panel-heading {
213
+ background-color: var(--color-danger) !important;
214
+ border-bottom: 1px solid var(--color-danger);
215
+ color: #ffffff;
216
+ }
217
+
218
+ #wpdm-wrapper-panel .settings-tabs a:hover {
219
+ background: rgba(var(--admin-color-rgb), 0.09);
220
+ }
221
+
222
+ #wpdm-wrapper-panel .nav-wrapper-tabs li.active a {
223
+ background: #f1f1f1;
224
+ }
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.19
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.19');
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.21
9
  Text Domain: download-manager
10
  Domain Path: /languages
11
  */
39
 
40
  global $WPDM;
41
 
42
+ define('WPDM_VERSION','3.2.21');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
readme.txt CHANGED
@@ -181,6 +181,15 @@ Check download stats and get a push notification when someone downloads, install
181
 
182
  == Changelog ==
183
 
 
 
 
 
 
 
 
 
 
184
  = 3.2.19 - 2021.10.21 =
185
  * Fixed an issue with cache storage setting
186
 
181
 
182
  == Changelog ==
183
 
184
+ = 3.2.21 - 2021.11.23 =
185
+ * Added option to delete file from server
186
+ * Improved admin UI
187
+ * Fixed an issue with temp storage option
188
+
189
+ = 3.2.20 - 2021.10.24 =
190
+ * Added function to clear temp storage and clear session data with `Clear All Cache` Button
191
+ * Improved ui options
192
+
193
  = 3.2.19 - 2021.10.21 =
194
  * Fixed an issue with cache storage setting
195
 
src/Admin/Menu/Packages.php CHANGED
@@ -27,6 +27,7 @@ class Packages
27
 
28
  add_action('wp_ajax_wpdm_admin_upload_file', array($this, 'uploadFile'));
29
  add_action('save_post', array($this, 'savePackage'));
 
30
 
31
  add_action('manage_wpdmpro_posts_columns', array($this, 'columnsTH'));
32
  add_action('manage_wpdmpro_posts_custom_column', array($this, 'columnsTD'), 10, 2);
@@ -88,6 +89,15 @@ class Packages
88
  do_action('wpdm_admin_update_package',$post, $_POST['file']);
89
  }
90
 
 
 
 
 
 
 
 
 
 
91
  function duplicate()
92
  {
93
  if(wpdm_query_var('wpdm_duplicate', 'int') > 0 && get_post_type(wpdm_query_var('wpdm_duplicate')) === 'wpdmpro') {
27
 
28
  add_action('wp_ajax_wpdm_admin_upload_file', array($this, 'uploadFile'));
29
  add_action('save_post', array($this, 'savePackage'));
30
+ add_action('before_delete_post', array($this, 'deleteFiles'), 10, 2);
31
 
32
  add_action('manage_wpdmpro_posts_columns', array($this, 'columnsTH'));
33
  add_action('manage_wpdmpro_posts_custom_column', array($this, 'columnsTD'), 10, 2);
89
  do_action('wpdm_admin_update_package',$post, $_POST['file']);
90
  }
91
 
92
+ function deleteFiles($post_id, $post)
93
+ {
94
+ $files = WPDM()->package->getFiles($post_id, false);
95
+ foreach ($files as $file) {
96
+ $file = WPDM()->fileSystem->locateFile($file);
97
+ @unlink($file);
98
+ }
99
+ }
100
+
101
  function duplicate()
102
  {
103
  if(wpdm_query_var('wpdm_duplicate', 'int') > 0 && get_post_type(wpdm_query_var('wpdm_duplicate')) === 'wpdmpro') {
src/AssetManager/AssetManager.php CHANGED
@@ -110,7 +110,7 @@ class AssetManager
110
  {
111
  global $wp_query;
112
  $url = parse_url($_SERVER['REQUEST_URI']);
113
- if (preg_match('/wpdm\-asset\/([^\/]+)/', $url['path'], $matches)) {
114
  $asset = new Asset();
115
  $asset->resolveKey($matches[1]);
116
  http_response_code(200);
110
  {
111
  global $wp_query;
112
  $url = parse_url($_SERVER['REQUEST_URI']);
113
+ if (preg_match('/wpdm\-asset\/([^\/]+)/', wpdm_valueof($url, 'path'), $matches)) {
114
  $asset = new Asset();
115
  $asset->resolveKey($matches[1]);
116
  http_response_code(200);
src/Package/Hooks.php CHANGED
@@ -51,7 +51,7 @@ class Hooks
51
  {
52
  global $wp_query;
53
  $url = parse_url($_SERVER['REQUEST_URI']);
54
- if (preg_match('/wpdm\-download\/([^\/]+)/', $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);
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);
src/Package/PackageController.php CHANGED
@@ -67,7 +67,7 @@ class PackageController extends PackageTemplate
67
  if (!has_shortcode($post_vars['description'], 'wpdm_package'))
68
  $post_vars['description'] = do_shortcode(stripslashes($post_vars['description']));
69
 
70
- $post_vars['excerpt'] = stripcslashes(strip_tags($post_vars['post_excerpt']));
71
  $author = get_user_by('id', $post_vars['post_author']);
72
  if (is_object($author)) $post_vars['author_name'] = $author->display_name;
73
  $post_vars['author_profile_url'] = get_author_posts_url($post_vars['post_author']);
67
  if (!has_shortcode($post_vars['description'], 'wpdm_package'))
68
  $post_vars['description'] = do_shortcode(stripslashes($post_vars['description']));
69
 
70
+ $post_vars['excerpt'] = wpautop(stripcslashes(wpdm_escs($post_vars['post_excerpt'])));
71
  $author = get_user_by('id', $post_vars['post_author']);
72
  if (is_object($author)) $post_vars['author_name'] = $author->display_name;
73
  $post_vars['author_profile_url'] = get_author_posts_url($post_vars['post_author']);
src/__/Apply.php CHANGED
@@ -515,6 +515,9 @@ class Apply
515
  if (!current_user_can('manage_options')) die('You are not authorized!');
516
  FileSystem::deleteFiles(WPDM_CACHE_DIR, false);
517
  FileSystem::deleteFiles(WPDM_CACHE_DIR . 'pdfthumbs/', false);
 
 
 
518
  die('ok');
519
  }
520
 
515
  if (!current_user_can('manage_options')) die('You are not authorized!');
516
  FileSystem::deleteFiles(WPDM_CACHE_DIR, false);
517
  FileSystem::deleteFiles(WPDM_CACHE_DIR . 'pdfthumbs/', false);
518
+ global $wpdb;
519
+ Session::reset();
520
+ TempStorage::clear();
521
  die('ok');
522
  }
523
 
src/__/Installer.php CHANGED
@@ -139,6 +139,9 @@ class Installer
139
  $ach[] = time();
140
  update_option("__wpdm_activation_history", $ach, false);
141
  update_option('__wpdm_db_version', $installer->dbVersion, false);
 
 
 
142
 
143
  }
144
 
139
  $ach[] = time();
140
  update_option("__wpdm_activation_history", $ach, false);
141
  update_option('__wpdm_db_version', $installer->dbVersion, false);
142
+ $__wpdm_ui_colors = get_option('__wpdm_ui_colors', false);
143
+ if(!$__wpdm_ui_colors)
144
+ update_option('__wpdm_ui_colors', 'a:18:{s:7:"primary";s:7:"#4a8eff";s:13:"primary_hover";s:7:"#5998ff";s:14:"primary_active";s:7:"#3281ff";s:9:"secondary";s:7:"#6c757d";s:15:"secondary_hover";s:7:"#6c757d";s:16:"secondary_active";s:7:"#6c757d";s:4:"info";s:7:"#2CA8FF";s:10:"info_hover";s:7:"#2CA8FF";s:11:"info_active";s:7:"#2CA8FF";s:7:"success";s:7:"#018e11";s:13:"success_hover";s:7:"#0aad01";s:14:"success_active";s:7:"#0c8c01";s:7:"warning";s:7:"#FFB236";s:13:"warning_hover";s:7:"#FFB236";s:14:"warning_active";s:7:"#FFB236";s:6:"danger";s:7:"#ff5062";s:12:"danger_hover";s:7:"#ff5062";s:13:"danger_active";s:7:"#ff5062";}', false);
145
 
146
  }
147
 
src/__/Session.php CHANGED
@@ -111,6 +111,12 @@ class Session
111
  }
112
  }
113
 
 
 
 
 
 
 
114
  static function show()
115
  {
116
  wpdmprecho(self::$data);
111
  }
112
  }
113
 
114
+ static function reset()
115
+ {
116
+ global $wpdb;
117
+ $wpdb->query("delete from {$wpdb->prefix}ahm_sessions where deviceID != 'alldevice'");
118
+ }
119
+
120
  static function show()
121
  {
122
  wpdmprecho(self::$data);
src/__/TempStorage.php CHANGED
@@ -61,7 +61,8 @@ class TempStorage
61
 
62
  static function clear()
63
  {
64
- file_put_contents(WPDM_CACHE_DIR . '/temp-storage.txt', '');
 
65
  }
66
 
67
  function __destruct()
61
 
62
  static function clear()
63
  {
64
+ global $wpdb;
65
+ $wpdb->query("delete from {$wpdb->prefix}ahm_sessions where deviceID = 'alldevice'");
66
  }
67
 
68
  function __destruct()
src/wpdm-functions.php CHANGED
@@ -102,220 +102,6 @@ function wpdm_verify_email($email)
102
  }
103
 
104
 
105
- /**
106
- * return download link after verifying password
107
- * data format: json
108
- */
109
- /*
110
- function wpdm_getlink()
111
- {
112
- global $wpdb;
113
- if (!isset($_POST['__wpdm_ID'])) return;
114
- $id = (int)$_POST['__wpdm_ID'];
115
- $password = isset($_POST['password']) ? stripslashes($_POST['password']) : '';
116
-
117
-
118
- $key = uniqid();
119
-
120
- $plock = isset($file['password_lock']) ? $file['password_lock'] : 0;
121
-
122
- $data = array('error' => '', 'downloadurl' => '');
123
-
124
- $limit = get_option('__wpdm_private_link_usage_limit', 3);
125
- $xpire_period = ((int)get_option('__wpdm_private_link_expiration_period', 3)) * ((int)get_option('__wpdm_private_link_expiration_period_unit', 60));
126
- $xpire_period = $xpire_period > 0 ? $xpire_period : 3600;
127
-
128
- if (isset($_POST['reCaptchaVerify'])) {
129
- $ret = wpdm_remote_post('https://www.google.com/recaptcha/api/siteverify', array('secret' => get_option('_wpdm_recaptcha_secret_key'), 'response' => $_POST['reCaptchaVerify'], 'remoteip' => $_SERVER['REMOTE_ADDR']));
130
- $ret = json_decode($ret);
131
- if ($ret->success == 1) {
132
- $download_url = WPDM()->package->expirableDownloadLink($id, $limit, $xpire_period);
133
- $data['downloadurl'] = $download_url;
134
- } else {
135
- $data['error'] = __("Captcha Verification Failed!", "wpmdpro");
136
- }
137
-
138
- wp_send_json($data);
139
- die();
140
- }
141
-
142
- // Email Lock Verification
143
- if (isset($_POST['verify']) && $_POST['verify'] == 'email' && $file['email_lock'] == 1) {
144
- if (wpdm_verify_email($_POST['email'])) {
145
- $subject = "Your Download Link";
146
- $site = get_option('blogname');
147
-
148
- $custom_form_data = isset($_POST['custom_form_field']) ? $_POST['custom_form_field'] : array();
149
- if (isset($_REQUEST['name'])) $custom_form_data['name'] = $_REQUEST['name'];
150
-
151
- //do something before sending download link
152
- do_action("wpdm_before_email_download_link", $_POST, $file);
153
-
154
- $idl = isset($file['email_lock_idl']) ? (int)$file['email_lock_idl'] : 3;
155
- $idle = isset($file['email_lock_idl_email']) ? (int)$file['email_lock_idl_email'] : 0;
156
-
157
- $request_status = $idl === 0 ? 3 : $idl; //($idl === 2)?$idl:1;
158
- $wpdb->insert("{$wpdb->prefix}ahm_emails", array('email' => $_POST['email'], 'pid' => $file['ID'], 'date' => time(), 'custom_data' => serialize($custom_form_data), 'request_status' => $request_status));
159
- $subscriberID = $wpdb->insert_id;
160
-
161
- $download_url = add_query_arg(['subscriber' => Crypt::encrypt($subscriberID)], WPDM()->package->expirableDownloadLink($id, $limit, $xpire_period));
162
- $download_page_url = add_query_arg(['subscriber' => Crypt::encrypt($subscriberID)], WPDM()->package->expirableDownloadPage($id, $limit, $xpire_period));
163
-
164
- if ($idl === 0 || ($idl == 1 && $idle == 0)) {
165
- $name = isset($cff['name']) ? $cff['name'] : '';
166
- $email_params = array('to_email' => $_POST['email'], 'name' => $name, 'download_count' => $limit, 'package_name' => $file['post_title'], 'package_url' => get_permalink($id), 'download_url' => $download_url, 'download_page_url' => $download_page_url);
167
- $email_params = apply_filters("wpdm_email_lock_mail_params", $email_params, $file);
168
- Email::send("email-lock", $email_params);
169
-
170
- }
171
- $elmsg = sanitize_textarea_field(get_post_meta($id, '__wpdm_email_lock_msg', true));
172
- if ($idl === 0) {
173
- $data['downloadurl'] = "";
174
- $data['msg'] = ($elmsg != '' ? $elmsg : __("Download link sent to your email!", "download-manager"));
175
- $data['type'] = 'success';
176
- } else if ($idl === 2) {
177
- $data['downloadurl'] = "";
178
- $data['msg'] = ($elmsg != '' ? $elmsg : __("Admin will review your request soon!", "download-manager"));
179
- $data['type'] = 'success';
180
- } else {
181
- $data['downloadurl'] = $download_url;
182
- if ($idle == 0)
183
- $data['msg'] = ($elmsg != '' ? $elmsg : __("Download link also sent to your email!", "download-manager"));
184
- else
185
- $data['msg'] = ($elmsg != '' ? $elmsg : __("Download will be started shortly!", "download-manager"));
186
- }
187
-
188
- $data = apply_filters("wpdm_email_lock_response_data", $data);
189
-
190
- if (!wpdm_is_ajax()) {
191
-
192
- @setcookie("wpdm_getlink_data_" . $key, json_encode($data));
193
-
194
- if (isset($data['downloadurl']) && $data['downloadurl'] != '') {
195
- header("location: " . $data['downloadurl']);
196
- die();
197
- }
198
-
199
- header("location: " . $_SERVER['HTTP_REFERER'] . "#nojs_popup|ckid:" . $key);
200
- die();
201
- }
202
-
203
- $_pdata = $_POST;
204
- $_pdata['pid'] = $file['ID'];
205
- $_pdata['time'] = time();
206
- Session::set("__wpdm_email_lock_verified", $_pdata, 604800);
207
- wp_send_json($data);
208
- die();
209
- } else {
210
- $data['downloadurl'] = "";
211
- $data['msg'] = get_option('__wpdm_blocked_domain_msg');
212
- if (trim($data['msg']) === '') $data['msg'] = __("Invalid Email Address!", "download-manager");
213
- $data['type'] = 'error';
214
-
215
- if (!wpdm_is_ajax()) {
216
-
217
- @setcookie("wpdm_getlink_data_" . $key, json_encode($data));
218
-
219
- if (isset($data['downloadurl']) && $data['downloadurl'] != '') {
220
- header("location: " . $data['downloadurl']);
221
- die();
222
- }
223
-
224
- header("location: " . $_SERVER['HTTP_REFERER'] . "#nojs_popup|ckid:" . $key);
225
- die();
226
- }
227
-
228
- wp_send_json($data);
229
- die();
230
- }
231
- }
232
-
233
- if (isset($_POST['force']) && $_POST['force'] != '') {
234
- $vr = explode('|', base64_decode($_POST['force']));
235
- if ($vr[0] == 'unlocked') {
236
- $social = array('f' => 'wpdm_fb_likes', 'g' => 'wpdm_gplus1s', 't' => 'wpdm_tweets', 'l' => 'wpdm_lishare');
237
- if ($_POST['social'] && isset($social[$_POST['social']]))
238
- update_option($social[$_POST['social']], (int)get_option($social[$_POST['social']]) + 1, false);
239
-
240
- $download_url = WPDM()->package->expirableDownloadLink($id, $limit, $xpire_period);
241
- $data['downloadurl'] = $download_url;
242
- $adata = apply_filters("wpdmgetlink", $data, $file);
243
- $data = is_array($adata) ? $adata : $data;
244
-
245
- if (!wpdm_is_ajax()) {
246
-
247
- @setcookie("wpdm_getlink_data_" . $key, json_encode($data));
248
-
249
- if (isset($data['downloadurl']) && $data['downloadurl'] != '') {
250
- header("location: " . $data['downloadurl']);
251
- die();
252
- }
253
-
254
- header("location: " . $_SERVER['HTTP_REFERER'] . "#nojs_popup|ckid:" . $key);
255
- die();
256
- }
257
-
258
- header("Content-type: application/json");
259
- die(json_encode($data));
260
- }
261
-
262
- }
263
-
264
- if ($plock == 1 && $password != $file['password'] && !strpos("__" . $file['password'], "[$password]")) {
265
- $data['error'] = __("Wrong Password!", "download-manager") . " &nbsp; <span><i class='fas fa-redo'></i> " . __("Try Again", "download-manager") . " </span>";
266
- $file = array();
267
- }
268
- if ($plock == 1 && $password == '') {
269
- $data['error'] = __("Wrong Password!", "download-manager") . " &nbsp; <span class='color-blue'><i class='fas fa-redo'></i> " . __("Try Again", "download-manager") . " </span>";
270
- $file = array();
271
- }
272
- $ux = "";
273
-
274
- if (isset($file['ID']) && $file['ID'] != '') {
275
- $pu = isset($file['password_usage']) && is_array($file['password_usage']) ? $file['password_usage'] : array();
276
-
277
- $pul = (int)$file['password_usage_limit'];
278
-
279
- if (is_array($pu) && isset($pu[$password]) && $pu[$password] >= $pul && $pul > 0)
280
- $data['error'] = __("Password usages limit exceeded", "download-manager");
281
- else {
282
-
283
- if (!is_array($pu)) $pu = array();
284
- $pu[$password] = isset($pu[$password]) ? $pu[$password] + 1 : 1;
285
- \WPDM\__\Session::set("pass_verified_" . $file['ID'], 1);
286
- update_post_meta($file['ID'], '__wpdm_password_usage', $pu);
287
- }
288
- }
289
-
290
- if (isset($_COOKIE['unlocked_' . $file1['ID']]) && $_COOKIE['unlocked_' . $file1['ID']] == 1) {
291
- $data['error'] = '';
292
- $file = $file1;
293
- }
294
-
295
- if ($data['error'] == '') {
296
-
297
- $data['downloadurl'] = WPDM()->package->expirableDownloadLink($id, $limit);
298
- } // home_url('/?downloadkey='.md5($file['files']).'&file='.$id.$ux);
299
- $adata = apply_filters("wpdmgetlink", $data, $file);
300
- $data = is_array($adata) ? $adata : $data;
301
-
302
- if (!wpdm_is_ajax()) {
303
-
304
- @setcookie("wpdm_getlink_data_" . $key, json_encode($data));
305
-
306
- if (isset($data['downloadurl']) && $data['downloadurl'] != '') {
307
- header("location: " . $data['downloadurl']);
308
- die();
309
- }
310
-
311
- header("location: " . $_SERVER['HTTP_REFERER'] . "#nojs_popup|ckid:" . $key);
312
- die();
313
- }
314
-
315
- wp_send_json($data);
316
- die();
317
- }
318
- */
319
  /**
320
  * @usage Count files in a package
321
  * @param $id
102
  }
103
 
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * @usage Count files in a package
107
  * @param $id