Download Monitor - Version 1.1.1

Version Description

  • Specify error statuses on wp_die messages e.g. 404 for missing files.
  • Moved DONOTCACHEPAGE
Download this release

Release Info

Developer mikejolley
Plugin Icon 128x128 Download Monitor
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.1.0 to 1.1.1

download-monitor.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Download Monitor
4
  Plugin URI: http://mikejolley.com/projects/download-monitor/
5
  Description: A full solution for managing downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
- Version: 1.1.0
7
  Author: Mike Jolley
8
  Author URI: http://mikejolley.com
9
  Requires at least: 3.5
@@ -39,7 +39,7 @@ class WP_DLM {
39
  global $wpdb;
40
 
41
  // Define constants
42
- define( 'DLM_VERSION', '1.1.0' );
43
 
44
  // Table for logs
45
  $wpdb->download_log = $wpdb->prefix . 'download_log';
3
  Plugin Name: Download Monitor
4
  Plugin URI: http://mikejolley.com/projects/download-monitor/
5
  Description: A full solution for managing downloadable files, monitoring downloads and outputting download links and file information on your WordPress powered site.
6
+ Version: 1.1.1
7
  Author: Mike Jolley
8
  Author URI: http://mikejolley.com
9
  Requires at least: 3.5
39
  global $wpdb;
40
 
41
  // Define constants
42
+ define( 'DLM_VERSION', '1.1.1' );
43
 
44
  // Table for logs
45
  $wpdb->download_log = $wpdb->prefix . 'download_log';
includes/class-dlm-download-handler.php CHANGED
@@ -72,14 +72,14 @@ class DLM_Download_Handler {
72
  public function handler() {
73
  global $wp, $wpdb;
74
 
75
- // Prevent conflict with WP Super Cache
76
- define( 'DONOTCACHEPAGE', true );
77
-
78
  if ( ! empty( $_GET[ $this->endpoint ] ) )
79
  $wp->query_vars[ $this->endpoint ] = $_GET[ $this->endpoint ];
80
 
81
  if ( ! empty( $wp->query_vars[ $this->endpoint ] ) ) {
82
 
 
 
 
83
  // Get ID of download
84
  $raw_id = sanitize_title( stripslashes( $wp->query_vars[ $this->endpoint ] ) );
85
 
@@ -121,7 +121,7 @@ class DLM_Download_Handler {
121
  wp_redirect( $redirect );
122
 
123
  else
124
- wp_die( __( 'Download does not exist.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ) );
125
 
126
  die('1');
127
  }
@@ -154,7 +154,7 @@ class DLM_Download_Handler {
154
  wp_redirect( $redirect );
155
 
156
  else
157
- wp_die( __( 'You do not have permission to access this download.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ) );
158
 
159
  exit;
160
  }
@@ -295,7 +295,7 @@ class DLM_Download_Handler {
295
  if ( function_exists( 'dlm_create_log' ) )
296
  dlm_create_log( 'download', 'failed', __( 'File not found', 'download_monitor' ), $download, $version );
297
 
298
- wp_die( __( 'File not found.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ) );
299
  }
300
 
301
  exit;
72
  public function handler() {
73
  global $wp, $wpdb;
74
 
 
 
 
75
  if ( ! empty( $_GET[ $this->endpoint ] ) )
76
  $wp->query_vars[ $this->endpoint ] = $_GET[ $this->endpoint ];
77
 
78
  if ( ! empty( $wp->query_vars[ $this->endpoint ] ) ) {
79
 
80
+ // Prevent caching when endpoint is set
81
+ define( 'DONOTCACHEPAGE', true );
82
+
83
  // Get ID of download
84
  $raw_id = sanitize_title( stripslashes( $wp->query_vars[ $this->endpoint ] ) );
85
 
121
  wp_redirect( $redirect );
122
 
123
  else
124
+ wp_die( __( 'Download does not exist.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ), array( 'response' => 404 ) );
125
 
126
  die('1');
127
  }
154
  wp_redirect( $redirect );
155
 
156
  else
157
+ wp_die( __( 'You do not have permission to access this download.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ), array( 'response' => 200 ) );
158
 
159
  exit;
160
  }
295
  if ( function_exists( 'dlm_create_log' ) )
296
  dlm_create_log( 'download', 'failed', __( 'File not found', 'download_monitor' ), $download, $version );
297
 
298
+ wp_die( __( 'File not found.', 'download_monitor' ) . ' <a href="' . home_url() . '">' . __( 'Go to homepage &rarr;', 'download_monitor' ) . '</a>', __( 'Download Error', 'download_monitor' ), array( 'response' => 404 ) );
299
  }
300
 
301
  exit;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mike.jol
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
- Stable tag: 1.1.0
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
@@ -108,6 +108,10 @@ Admin hits are not counted, log out and try!
108
 
109
  == Changelog ==
110
 
 
 
 
 
111
  = 1.1.0 =
112
  * Fixed admin notices
113
  * Added download link to admin 'file' column for copying and pasting
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
+ Stable tag: 1.1.1
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
108
 
109
  == Changelog ==
110
 
111
+ = 1.1.1 =
112
+ * Specify error statuses on wp_die messages e.g. 404 for missing files.
113
+ * Moved DONOTCACHEPAGE
114
+
115
  = 1.1.0 =
116
  * Fixed admin notices
117
  * Added download link to admin 'file' column for copying and pasting