WordPress Download Manager - Version 3.2.57

Version Description

  • 2022.09.22 =
  • Fixed an issue with the view count function
Download this release

Release Info

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

Code changes from version 3.2.56 to 3.2.57

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.56
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.56');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
@@ -510,8 +510,8 @@ final class WordPressDownloadManager{
510
 
511
  <?php if(is_singular('wpdmpro') && $view_count){ ?>
512
  setTimeout(function (){
513
- $.get('<?php echo home_url('/?__wpdm_view_count='.wp_create_nonce(NONCE_KEY).'&id='.get_the_ID()); ?>');
514
- }, 2000)
515
  <?php } ?>
516
 
517
  });
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
 
40
  global $WPDM;
41
 
42
+ define('WPDM_VERSION','3.2.57');
43
 
44
  define('WPDM_TEXT_DOMAIN','download-manager');
45
 
510
 
511
  <?php if(is_singular('wpdmpro') && $view_count){ ?>
512
  setTimeout(function (){
513
+ $.post(wpdm_url.ajax, { action: 'wpdm_view_count', __wpdm_view_count:'<?= wp_create_nonce(NONCE_KEY) ?>', id: '<?= get_the_ID() ?>' });
514
+ }, 2000);
515
  <?php } ?>
516
 
517
  });
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.56
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.56 - 2022.09.08 =
185
  * Fixed case sensitive file extension issue
186
 
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
 
182
  == Changelog ==
183
 
184
+ = 3.2.57 - 2022.09.22 =
185
+ * Fixed an issue with the view count function
186
+
187
  = 3.2.56 - 2022.09.08 =
188
  * Fixed case sensitive file extension issue
189
 
src/Admin/views/welcome.php CHANGED
@@ -218,7 +218,15 @@
218
  }
219
 
220
  #modalcontents .wrap h2{ display: none; }
221
-
 
 
 
 
 
 
 
 
222
  </style>
223
 
224
  <div class="wrap w3eden">
@@ -350,10 +358,33 @@
350
  </div>
351
  </div>
352
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
353
  <div class="col-md-12 lead">
354
  <hr/>
355
  <h3>What's New?</h3>
356
- What new with WordPress Download Manager v3.1.x:
357
  <hr/>
358
  </div>
359
 
218
  }
219
 
220
  #modalcontents .wrap h2{ display: none; }
221
+ .cpgpanel .panel-heading{
222
+ font-family: Overpass, sans-serif;
223
+ font-size: 12pt !important;
224
+ }
225
+ .cpgpanel td{
226
+ font-family: Overpass, sans-serif;
227
+ font-size: 11pt;
228
+ line-height: 32px !important;
229
+ }
230
  </style>
231
 
232
  <div class="wrap w3eden">
358
  </div>
359
  </div>
360
 
361
+ <!-- div class="col-md-12">
362
+ <br/>
363
+ <div class="panel panel-default cpgpanel">
364
+ <div class="panel-heading">
365
+ Create Pages:
366
+ </div>
367
+ <table class="table table-striped">
368
+ <tr>
369
+ <td>Login Page [wpdm_login_form]</td>
370
+ <td class="text-right"><button class="btn btn-primary btn-sm btn-cpg" data-shortcode="[wpdm_login_form]">Create</button></td>
371
+ </tr>
372
+ <tr>
373
+ <td>Signup Page [wpdm_reg_form]</td>
374
+ <td class="text-right"><button class="btn btn-primary btn-sm btn-cpg" data-shortcode="[wpdm_reg_form]">Create</button></td>
375
+ </tr>
376
+ <tr>
377
+ <td>User Dashboard Page [wpdm_user_dashboard]</td>
378
+ <td class="text-right"><button class="btn btn-primary btn-sm btn-cpg" data-shortcode="[wpdm_user_dashboard]">Create</button></td>
379
+ </tr>
380
+ </table>
381
+ </div>
382
+ </div -->
383
+
384
  <div class="col-md-12 lead">
385
  <hr/>
386
  <h3>What's New?</h3>
387
+ What new with WordPress Download Manager v3.2.x:
388
  <hr/>
389
  </div>
390
 
src/Package/Hooks.php CHANGED
@@ -27,7 +27,6 @@ class Hooks
27
  {
28
  $this->wpdmIframe();
29
  $this->shortcodeIframe();
30
- WPDM()->package->addViewCount();
31
  }
32
 
33
  function wpdmIframe()
27
  {
28
  $this->wpdmIframe();
29
  $this->shortcodeIframe();
 
30
  }
31
 
32
  function wpdmIframe()
src/Package/PackageController.php CHANGED
@@ -32,6 +32,8 @@ class PackageController extends PackageTemplate {
32
 
33
  new RestAPI();
34
 
 
 
35
  global $post;
36
  if ( ! $ID && is_object( $post ) && $post->post_type == 'wpdmpro' ) {
37
  $ID = $post->ID;
@@ -2429,13 +2431,13 @@ class PackageController extends PackageTemplate {
2429
  }
2430
 
2431
  function addViewCount() {
2432
- if ( isset( $_REQUEST['__wpdm_view_count'] ) && wp_verify_nonce( $_REQUEST['__wpdm_view_count'], NONCE_KEY ) ) {
2433
 
2434
- $id = (int) ( $_REQUEST['id'] );
2435
- $views = (int) get_post_meta( $id, '__wpdm_view_count', true );
2436
- update_post_meta( $id, '__wpdm_view_count', $views + 1 );
2437
- wp_send_json( [ 'views' => $views + 1 ] );
2438
- }
 
2439
  }
2440
 
2441
 
32
 
33
  new RestAPI();
34
 
35
+ add_action("wp_ajax_wpdm_view_count", [$this, 'addViewCount']);
36
+
37
  global $post;
38
  if ( ! $ID && is_object( $post ) && $post->post_type == 'wpdmpro' ) {
39
  $ID = $post->ID;
2431
  }
2432
 
2433
  function addViewCount() {
 
2434
 
2435
+ //__::isAuthentic( '__wpdm_view_count', NONCE_KEY, 'read', false );
2436
+
2437
+ $id = (int) ( $_REQUEST['id'] );
2438
+ $views = (int) get_post_meta( $id, '__wpdm_view_count', true );
2439
+ update_post_meta( $id, '__wpdm_view_count', $views + 1 );
2440
+ wp_send_json( [ 'views' => $views + 1 ] );
2441
  }
2442
 
2443
 
src/Package/RestAPI.php CHANGED
@@ -39,5 +39,11 @@ class RestAPI
39
  'permission_callback' => '__return_true'
40
  ));
41
 
 
 
 
 
 
 
42
  }
43
  }
39
  'permission_callback' => '__return_true'
40
  ));
41
 
42
+ register_rest_route('wpdm', '/view-count', array(
43
+ 'methods' => 'POST',
44
+ 'callback' => [new PackageController(), 'addViewCount'],
45
+ 'permission_callback' => '__return_true'
46
+ ));
47
+
48
  }
49
  }
src/__/__.php CHANGED
@@ -561,6 +561,13 @@ class __
561
  if(!current_user_can($access_level)) wp_send_json(['success' => false, 'message' => __( "You are not allowed to execute this action!", "download-manager" )]);
562
  }
563
 
 
 
 
 
 
 
 
564
  static function p(...$args)
565
  {
566
  foreach ($args as $arg) {
561
  if(!current_user_can($access_level)) wp_send_json(['success' => false, 'message' => __( "You are not allowed to execute this action!", "download-manager" )]);
562
  }
563
 
564
+ function requestURI()
565
+ {
566
+ $uri = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
567
+ $uri = esc_url_raw($uri);
568
+ return $uri;
569
+ }
570
+
571
  static function p(...$args)
572
  {
573
  foreach ($args as $arg) {
src/wpdm-start-download.php CHANGED
@@ -93,26 +93,11 @@ else {
93
  }
94
 
95
 
96
- /*$tmp = explode("wp-content", $indfile);
97
- $tmp = end($tmp);
98
- if ($indfile != '' && file_exists(UPLOAD_DIR . $indfile))
99
- $filepath = UPLOAD_DIR . $indfile;
100
- else if ($indfile != '' && file_exists($user_upload_dir.$indfile))
101
- $filepath = $user_upload_dir.$indfile;
102
- else if ($indfile != '' && file_exists($indfile))
103
- $filepath = $indfile;
104
- else if ($indfile != '' && file_exists(WP_CONTENT_DIR . $tmp)) //path fix on site move
105
- $filepath = WP_CONTENT_DIR . $tmp;
106
- else if ($indfile != '' && file_exists($_old_up_dir . $indfile)) //path fix on site move
107
- $filepath = $_old_up_dir . $indfile;
108
- else {
109
- $filepath = $firstfile;
110
- }*/
111
 
112
  $filepath = WPDM()->fileSystem->absPath($indfile, $package['ID']);
113
 
114
  if(!$filepath)
115
- Messages::fullPage('Error!', "<div class='card bg-danger text-white p-4'>" . __("Sorry! File not found!", "download-manager") . "</div>", 'error');
116
  //$plock = get_wpdm_meta($file['id'],'password_lock',true);
117
  //$fileinfo = get_wpdm_meta($package['id'],'fileinfo');
118
 
93
  }
94
 
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
 
97
  $filepath = WPDM()->fileSystem->absPath($indfile, $package['ID']);
98
 
99
  if(!$filepath)
100
+ Messages::fullPage('Error!', "<div class='card bg-danger text-white p-4' style='max-width: 500px;margin: 0 auto;text-align: center'>" . __("Sorry! File not found!", "download-manager") . "</div>", 'error');
101
  //$plock = get_wpdm_meta($file['id'],'password_lock',true);
102
  //$fileinfo = get_wpdm_meta($package['id'],'fileinfo');
103