Download Monitor - Version 1.9.1

Version Description

Download this release

Release Info

Developer barrykooij
Plugin Icon 128x128 Download Monitor
Version 1.9.1
Comparing to
See all releases

Code changes from version 1.9.0 to 1.9.1

assets/css/frontend.css CHANGED
@@ -1 +1 @@
1
- .download-box{width:250px;border:1px solid #ccc;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;text-align:center;position:relative;margin:1em auto;box-shadow:0 2px 4px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.4)}.download-box img.wp-post-image{margin:0;padding:0;display:block;width:100%;-moz-border-radius:0;-webkit-border-radius:0;-moz-border-top-left-radius:3px;-moz-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-radius:0;border-top-left-radius:3px;border-top-right-radius:3px;box-shadow:inset 0 1px 0 rgba(255,255,255,.4)}.download-box .download-box-content{padding:0 1em 1em}.download-box .download-count{-moz-border-radius:1em;-webkit-border-radius:1em;border-radius:1em;color:#777;text-shadow:0 1px 0 rgba(255,255,255,.5);background:#ddd;box-shadow:0 2px 4px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.4);position:absolute;top:0;right:0;padding:.6em;width:auto;min-width:1em;font-size:1em;text-align:center;vertical-align:middle;line-height:1em;border:1px solid #bbb;margin:-.5em -.5em 0 0}.download-button{text-align:center;text-decoration:none;padding:.75em 1em;color:#fff;display:block;font-size:1.2em;line-height:1.5em;background-color:#09c;background-image:-webkit-linear-gradient(#009fd4,#09c,#0086b2);background-image:-moz-linear-gradient(#009fd4,#09c,#0086b2);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;text-shadow:0 -1px 0 rgba(0,0,0,.5);box-shadow:0 2px 4px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.4);border:1px solid #0086b2;cursor:pointer}.download-button:hover{color:#fff;background-color:#09c;background-image:-webkit-linear-gradient(#09c,#0086b2);background-image:-moz-linear-gradient(#09c,#0086b2)}.download-button small{font-size:.8em;opacity:.8;display:block}.filetype-icon{padding-left:19px;background-repeat:no-repeat;background-position:left;background-image:url(../images/filetypes/document.png)}.filetype-pdf{background-image:url(../images/filetypes/document-pdf.png)}.filetype-aif,.filetype-aifc,.filetype-aiff,.filetype-au,.filetype-kar,.filetype-m3u,.filetype-m4r,.filetype-mid,.filetype-midi,.filetype-mp2,.filetype-mp3,.filetype-mpga,.filetype-ra,.filetype-ram,.filetype-rm,.filetype-rpm,.filetype-snd,.filetype-wav,.filetype-wave{background-image:url(../images/filetypes/document-music.png)}.filetype-avi,.filetype-divx,.filetype-mov,.filetype-movie,.filetype-mp4,.filetype-mpe,.filetype-mpeg,.filetype-mpg,.filetype-mxu,.filetype-qt{background-image:url(../images/filetypes/document-film.png)}.filetype-7z,.filetype-gz,.filetype-rar,.filetype-sit,.filetype-tar,.filetype-zip{background-image:url(../images/filetypes/document-zipper.png)}.filetype-csv,.filetype-tsv,.filetype-xls,.filetype-xlsx{background-image:url(../images/filetypes/document-excel.png)}.filetype-doc,.filetype-docx{background-image:url(../images/filetypes/document-word-text.png)}.filetype-ai{background-image:url(../images/filetypes/document-illustrator.png)}.filetype-swf{background-image:url(../images/filetypes/document-flash-movie.png)}.filetype-bmp,.filetype-djv,.filetype-eps,.filetype-gif,.filetype-ief,.filetype-jpe,.filetype-jpeg,.filetype-jpg,.filetype-pbm,.filetype-pgm,.filetype-png,.filetype-pnm,.filetype-ppm,.filetype-ps,.filetype-ras,.filetype-rgb,.filetype-tif,.filetype-tiff,.filetype-wbmp,.filetype-xbm,.filetype-xpm,.filetype-xwd{background-image:url(../images/filetypes/document-image.png)}.filetype-psd{background-image:url(../images/filetypes/document-photoshop.png)}.filetype-ppt,.filetype-pptx{background-image:url(../images/filetypes/document-powerpoint.png)}.filetype-as,.filetype-css,.filetype-htaccess,.filetype-htm,.filetype-html,.filetype-js,.filetype-php,.filetype-sql,.filetype-xml,.filetype-xsl{background-image:url(../images/filetypes/document-code.png)}.filetype-rtf,.filetype-rtx{background-image:url(../images/filetypes/document-text-image.png)}.filetype-txt{background-image:url(../images/filetypes/document-text.png)}#content nav.download-monitor-pagination,nav.download-monitor-pagination{text-align:center}#content nav.download-monitor-pagination ul,nav.download-monitor-pagination ul{display:inline-block;white-space:nowrap;padding:0;clear:both;border:1px solid #eee;border-right:0;margin:1px}#content nav.download-monitor-pagination ul li,nav.download-monitor-pagination ul li{border-right:1px solid #eee;padding:0;margin:0;float:left;display:inline;overflow:hidden}#content nav.download-monitor-pagination ul li a,#content nav.download-monitor-pagination ul li span,nav.download-monitor-pagination ul li a,nav.download-monitor-pagination ul li span{margin:0;text-decoration:none;line-height:1em;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}#content nav.download-monitor-pagination ul li a:focus,#content nav.download-monitor-pagination ul li a:hover,#content nav.download-monitor-pagination ul li span.current,nav.download-monitor-pagination ul li a:focus,nav.download-monitor-pagination ul li a:hover,nav.download-monitor-pagination ul li span.current{background:#eee;color:#888}
1
+ .download-box{width:250px;border:1px solid #ccc;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;text-align:center;position:relative;margin:1em auto;box-shadow:0 2px 4px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.4)}.download-box img.wp-post-image{margin:0;padding:0;display:block;width:100%;-moz-border-radius:0;-webkit-border-radius:0;-moz-border-top-left-radius:3px;-moz-border-top-right-radius:3px;-webkit-border-top-left-radius:3px;-webkit-border-top-right-radius:3px;border-radius:0;border-top-left-radius:3px;border-top-right-radius:3px;box-shadow:inset 0 1px 0 rgba(255,255,255,.4)}.download-box .download-box-content{padding:0 1em 1em}.download-box .download-count{-moz-border-radius:1em;-webkit-border-radius:1em;border-radius:1em;color:#777;text-shadow:0 1px 0 rgba(255,255,255,.5);background:#ddd;box-shadow:0 2px 4px rgba(0,0,0,.1),inset 0 1px 0 rgba(255,255,255,.4);position:absolute;top:0;right:0;padding:.6em;width:auto;min-width:1em;font-size:1em;text-align:center;vertical-align:middle;line-height:1em;border:1px solid #bbb;margin:-.5em -.5em 0 0}.download-button{text-align:center;text-decoration:none;padding:.75em 1em;color:#fff;display:block;font-size:1.2em;line-height:1.5em;background-color:#09c;background-image:-webkit-linear-gradient(#009fd4,#09c,#0086b2);background-image:-moz-linear-gradient(#009fd4,#09c,#0086b2);-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;text-shadow:0 -1px 0 rgba(0,0,0,.5);box-shadow:0 2px 4px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.4);border:1px solid #0086b2;cursor:pointer}.download-button:hover{color:#fff;background-color:#09c;background-image:-webkit-linear-gradient(#09c,#0086b2);background-image:-moz-linear-gradient(#09c,#0086b2)}.download-button small{font-size:.8em;opacity:.8;display:block}.filetype-icon{padding-left:19px;background-repeat:no-repeat;background-position:left;background-image:url(../images/filetypes/document.png)}.filetype-pdf{background-image:url(../images/filetypes/document-pdf.png)}.filetype-aif,.filetype-aifc,.filetype-aiff,.filetype-au,.filetype-kar,.filetype-m3u,.filetype-m4r,.filetype-mid,.filetype-midi,.filetype-mp2,.filetype-mp3,.filetype-mpga,.filetype-ra,.filetype-ram,.filetype-rm,.filetype-rpm,.filetype-snd,.filetype-wav,.filetype-wave{background-image:url(../images/filetypes/document-music.png)}.filetype-avi,.filetype-divx,.filetype-mov,.filetype-movie,.filetype-mp4,.filetype-mpe,.filetype-mpeg,.filetype-mpg,.filetype-mxu,.filetype-qt,.filetype-wmv{background-image:url(../images/filetypes/document-film.png)}.filetype-7z,.filetype-gz,.filetype-rar,.filetype-sit,.filetype-tar,.filetype-zip{background-image:url(../images/filetypes/document-zipper.png)}.filetype-csv,.filetype-tsv,.filetype-xls,.filetype-xlsx{background-image:url(../images/filetypes/document-excel.png)}.filetype-doc,.filetype-docx{background-image:url(../images/filetypes/document-word-text.png)}.filetype-ai{background-image:url(../images/filetypes/document-illustrator.png)}.filetype-swf{background-image:url(../images/filetypes/document-flash-movie.png)}.filetype-bmp,.filetype-djv,.filetype-eps,.filetype-gif,.filetype-ief,.filetype-jpe,.filetype-jpeg,.filetype-jpg,.filetype-pbm,.filetype-pgm,.filetype-png,.filetype-pnm,.filetype-ppm,.filetype-ps,.filetype-ras,.filetype-rgb,.filetype-tif,.filetype-tiff,.filetype-wbmp,.filetype-xbm,.filetype-xpm,.filetype-xwd{background-image:url(../images/filetypes/document-image.png)}.filetype-psd{background-image:url(../images/filetypes/document-photoshop.png)}.filetype-ppt,.filetype-pptx{background-image:url(../images/filetypes/document-powerpoint.png)}.filetype-as,.filetype-css,.filetype-htaccess,.filetype-htm,.filetype-html,.filetype-js,.filetype-php,.filetype-sql,.filetype-xml,.filetype-xsl{background-image:url(../images/filetypes/document-code.png)}.filetype-rtf,.filetype-rtx{background-image:url(../images/filetypes/document-text-image.png)}.filetype-txt{background-image:url(../images/filetypes/document-text.png)}#content nav.download-monitor-pagination,nav.download-monitor-pagination{text-align:center}#content nav.download-monitor-pagination ul,nav.download-monitor-pagination ul{display:inline-block;white-space:nowrap;padding:0;clear:both;border:1px solid #eee;border-right:0;margin:1px}#content nav.download-monitor-pagination ul li,nav.download-monitor-pagination ul li{border-right:1px solid #eee;padding:0;margin:0;float:left;display:inline;overflow:hidden}#content nav.download-monitor-pagination ul li a,#content nav.download-monitor-pagination ul li span,nav.download-monitor-pagination ul li a,nav.download-monitor-pagination ul li span{margin:0;text-decoration:none;line-height:1em;font-size:1em;font-weight:400;padding:.5em;min-width:1em;display:block}#content nav.download-monitor-pagination ul li a:focus,#content nav.download-monitor-pagination ul li a:hover,#content nav.download-monitor-pagination ul li span.current,nav.download-monitor-pagination ul li a:focus,nav.download-monitor-pagination ul li a:hover,nav.download-monitor-pagination ul li span.current{background:#eee;color:#888}
assets/css/frontend.less CHANGED
@@ -101,7 +101,7 @@
101
  background-image: url(../images/filetypes/document-music.png);
102
  }
103
 
104
- .filetype-mpeg, .filetype-mpg, .filetype-mpe, .filetype-qt, .filetype-mov, .filetype-mxu, .filetype-avi, .filetype-movie, .filetype-mp4, .filetype-divx {
105
  background-image: url(../images/filetypes/document-film.png);
106
  }
107
 
101
  background-image: url(../images/filetypes/document-music.png);
102
  }
103
 
104
+ .filetype-mpeg, .filetype-mpg, .filetype-mpe, .filetype-qt, .filetype-mov, .filetype-mxu, .filetype-avi, .filetype-movie, .filetype-mp4, .filetype-divx, .filetype-wmv {
105
  background-image: url(../images/filetypes/document-film.png);
106
  }
107
 
assets/js/overview-download.js ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ( $ ) {
2
+
3
+ // we create a copy of the WP inline edit post function
4
+ var $wp_inline_edit = inlineEditPost.edit;
5
+
6
+ // and then we overwrite the function with our own code
7
+ inlineEditPost.edit = function ( id ) {
8
+
9
+ // "call" the original WP edit function
10
+ // we don't want to leave WordPress hanging
11
+ $wp_inline_edit.apply( this, arguments );
12
+
13
+ // now we take care of our business
14
+
15
+ // get the post ID
16
+ var $post_id = 0;
17
+ if ( typeof( id ) == 'object' ) {
18
+ $post_id = parseInt( this.getId( id ) );
19
+ }
20
+
21
+ if ( $post_id > 0 ) {
22
+
23
+ // define rows
24
+ var $edit_row = $( '#edit-' + $post_id );
25
+ var $post_row = $( '#post-' + $post_id );
26
+
27
+ // get data
28
+ var featured = ('Yes' == $( '.column-featured', $post_row ).text() );
29
+ var members_only = ('Yes' == $( '.column-members_only', $post_row ).text() );
30
+ var redirect_only = ('Yes' == $( '.column-redirect_only', $post_row ).text() );
31
+
32
+ // populate data
33
+ $( ':input[name="_featured"]', $edit_row ).prop( 'checked', featured );
34
+ $( ':input[name="_members_only"]', $edit_row ).prop( 'checked', members_only );
35
+ $( ':input[name="_redirect_only"]', $edit_row ).prop( 'checked', redirect_only );
36
+ }
37
+ };
38
+
39
+ })( jQuery );
assets/js/overview-download.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){var b=inlineEditPost.edit;inlineEditPost.edit=function(c){b.apply(this,arguments);var d=0;if("object"==typeof c&&(d=parseInt(this.getId(c))),d>0){var e=a("#edit-"+d),f=a("#post-"+d),g="Yes"==a(".column-featured",f).text(),h="Yes"==a(".column-members_only",f).text(),i="Yes"==a(".column-redirect_only",f).text();a(':input[name="_featured"]',e).prop("checked",g),a(':input[name="_members_only"]',e).prop("checked",h),a(':input[name="_redirect_only"]',e).prop("checked",i)}}}(jQuery);
assets/js/settings.js CHANGED
@@ -1,11 +1,13 @@
1
  jQuery( function ( $ ) {
 
2
  $( '.nav-tab-wrapper a' ).click( function () {
3
  $( '.settings_panel' ).hide();
4
  $( '.nav-tab-active' ).removeClass( 'nav-tab-active' );
5
  $( $( this ).attr( 'href' ) ).show();
6
  $( this ).addClass( 'nav-tab-active' );
7
- return false;
8
  } );
 
9
  $( '#setting-dlm_default_template' ).change( function () {
10
  if ( $( this ).val() == 'custom' ) {
11
  $( '#setting-dlm_custom_template' ).closest( 'tr' ).show();
@@ -13,15 +15,22 @@ jQuery( function ( $ ) {
13
  $( '#setting-dlm_custom_template' ).closest( 'tr' ).hide();
14
  }
15
  } ).change();
 
16
  $( '#setting-dlm_enable_logging' ).change( function () {
17
- if ( $( this ).is(":checked") === true ) {
18
  $( '#setting-dlm_count_unique_ips' ).closest( 'tr' ).show();
19
  } else {
20
  $( '#setting-dlm_count_unique_ips' ).closest( 'tr' ).hide();
21
  }
22
  } ).change();
23
 
24
- $( '.nav-tab-wrapper a:first' ).click();
 
 
 
 
 
 
25
 
26
  $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
27
  //$( '#dlm-ajax-nonce' ).val()
@@ -36,7 +45,9 @@ jQuery( function ( $ ) {
36
  nonce: notice_nonce,
37
  notice: notice
38
  },
39
- function ( response ) {}
 
40
  )
41
  } );
 
42
  } );
1
  jQuery( function ( $ ) {
2
+
3
  $( '.nav-tab-wrapper a' ).click( function () {
4
  $( '.settings_panel' ).hide();
5
  $( '.nav-tab-active' ).removeClass( 'nav-tab-active' );
6
  $( $( this ).attr( 'href' ) ).show();
7
  $( this ).addClass( 'nav-tab-active' );
8
+ return true;
9
  } );
10
+
11
  $( '#setting-dlm_default_template' ).change( function () {
12
  if ( $( this ).val() == 'custom' ) {
13
  $( '#setting-dlm_custom_template' ).closest( 'tr' ).show();
15
  $( '#setting-dlm_custom_template' ).closest( 'tr' ).hide();
16
  }
17
  } ).change();
18
+
19
  $( '#setting-dlm_enable_logging' ).change( function () {
20
+ if ( $( this ).is( ":checked" ) === true ) {
21
  $( '#setting-dlm_count_unique_ips' ).closest( 'tr' ).show();
22
  } else {
23
  $( '#setting-dlm_count_unique_ips' ).closest( 'tr' ).hide();
24
  }
25
  } ).change();
26
 
27
+ // load tab of hash, if no hash is present load first tab.
28
+ if ( window.location.hash ) {
29
+ var active_tab = window.location.hash.replace( '#', '' );
30
+ $( '.nav-tab-wrapper a#dlm-tab-' + active_tab ).click();
31
+ } else {
32
+ $( '.nav-tab-wrapper a:first' ).click();
33
+ }
34
 
35
  $( '.dlm-notice.is-dismissible' ).on( 'click', '.notice-dismiss', function ( event ) {
36
  //$( '#dlm-ajax-nonce' ).val()
45
  nonce: notice_nonce,
46
  notice: notice
47
  },
48
+ function ( response ) {
49
+ }
50
  )
51
  } );
52
+
53
  } );
assets/js/settings.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){a(".nav-tab-wrapper a").click(function(){return a(".settings_panel").hide(),a(".nav-tab-active").removeClass("nav-tab-active"),a(a(this).attr("href")).show(),a(this).addClass("nav-tab-active"),!1}),a("#setting-dlm_default_template").change(function(){"custom"==a(this).val()?a("#setting-dlm_custom_template").closest("tr").show():a("#setting-dlm_custom_template").closest("tr").hide()}).change(),a("#setting-dlm_enable_logging").change(function(){a(this).is(":checked")===!0?a("#setting-dlm_count_unique_ips").closest("tr").show():a("#setting-dlm_count_unique_ips").closest("tr").hide()}).change(),a(".nav-tab-wrapper a:first").click(),a(".dlm-notice.is-dismissible").on("click",".notice-dismiss",function(){var b=a(this).closest(".dlm-notice"),c=b.attr("id"),d=b.attr("data-nonce");a.post(ajaxurl,{action:"dlm_dismiss_notice",nonce:d,notice:c},function(){})})});
1
+ jQuery(function(a){if(a(".nav-tab-wrapper a").click(function(){return a(".settings_panel").hide(),a(".nav-tab-active").removeClass("nav-tab-active"),a(a(this).attr("href")).show(),a(this).addClass("nav-tab-active"),!0}),a("#setting-dlm_default_template").change(function(){"custom"==a(this).val()?a("#setting-dlm_custom_template").closest("tr").show():a("#setting-dlm_custom_template").closest("tr").hide()}).change(),a("#setting-dlm_enable_logging").change(function(){a(this).is(":checked")===!0?a("#setting-dlm_count_unique_ips").closest("tr").show():a("#setting-dlm_count_unique_ips").closest("tr").hide()}).change(),window.location.hash){var b=window.location.hash.replace("#","");a(".nav-tab-wrapper a#dlm-tab-"+b).click()}else a(".nav-tab-wrapper a:first").click();a(".dlm-notice.is-dismissible").on("click",".notice-dismiss",function(){var b=a(this).closest(".dlm-notice"),c=b.attr("id"),d=b.attr("data-nonce");a.post(ajaxurl,{action:"dlm_dismiss_notice",nonce:d,notice:c},function(){})})});
download-monitor.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
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.9.0
7
  Author: Never5
8
  Author URI: https://www.never5.com
9
  Requires at least: 3.8
10
- Tested up to: 4.3
11
  Text Domain: download-monitor
12
 
13
  License: GPL v3
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
- define( 'DLM_VERSION', '1.9.0' );
37
 
38
  function __download_monitor_main() {
39
 
3
  Plugin Name: Download Monitor
4
  Plugin URI: https://www.download-monitor.com
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.9.1
7
  Author: Never5
8
  Author URI: https://www.never5.com
9
  Requires at least: 3.8
10
+ Tested up to: 4.4
11
  Text Domain: download-monitor
12
 
13
  License: GPL v3
33
  } // Exit if accessed directly
34
 
35
  // Define DLM Version
36
+ define( 'DLM_VERSION', '1.9.1' );
37
 
38
  function __download_monitor_main() {
39
 
includes/admin/class-dlm-admin-scripts.php CHANGED
@@ -50,6 +50,19 @@ class DLM_Admin_Scripts {
50
 
51
  }
52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && ( 'download-monitor-settings' === $_GET['page'] || 'dlm-extensions' === $_GET['page'] ) ) {
54
 
55
  // Enqueue Settings JS
50
 
51
  }
52
 
53
+ if ( 'edit.php' == $pagenow && isset( $_GET['post_type'] ) && 'dlm_download' === $_GET['post_type'] && ! isset( $_GET['page'] ) ) {
54
+
55
+ // Enqueue Settings JS
56
+ wp_enqueue_script(
57
+ 'dlm_download_overview',
58
+ plugins_url( '/assets/js/overview-download' . ( ( ! SCRIPT_DEBUG ) ? '.min' : '' ) . '.js', WP_DLM::get_plugin_file() ),
59
+ array( 'jquery' ),
60
+ DLM_VERSION,
61
+ true
62
+ );
63
+
64
+ }
65
+
66
  if ( 'edit.php' == $pagenow && isset( $_GET['page'] ) && ( 'download-monitor-settings' === $_GET['page'] || 'dlm-extensions' === $_GET['page'] ) ) {
67
 
68
  // Enqueue Settings JS
includes/admin/class-dlm-admin.php CHANGED
@@ -438,7 +438,7 @@ class DLM_Admin {
438
  <h2 class="nav-tab-wrapper">
439
  <?php
440
  foreach ( $this->settings as $key => $section ) {
441
- echo '<a href="#settings-' . sanitize_title( $key ) . '" class="nav-tab">' . esc_html( $section[0] ) . '</a>';
442
  }
443
  ?>
444
  </h2><br/>
438
  <h2 class="nav-tab-wrapper">
439
  <?php
440
  foreach ( $this->settings as $key => $section ) {
441
+ echo '<a href="#settings-' . sanitize_title( $key ) . '" id="dlm-tab-settings-' . sanitize_title( $key ) . '" class="nav-tab">' . esc_html( $section[0] ) . '</a>';
442
  }
443
  ?>
444
  </h2><br/>
includes/class-dlm-download-handler.php CHANGED
@@ -136,19 +136,32 @@ class DLM_Download_Handler {
136
  // get request user agent
137
  $visitor_ua = DLM_Utils::get_visitor_ua();
138
 
139
- // get blacklisted user agents
140
- $blacklisted_uas = preg_split( "/\r?\n/", trim( get_option( 'dlm_user_agent_blacklist', "" ) ) );
141
 
142
- // loop through blacklisted user agents
143
- foreach ( $blacklisted_uas as $blacklisted_ua ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
- // check if blacklisted user agent is found in request user agent
146
- if ( false !== stristr( $visitor_ua, $blacklisted_ua ) ) {
147
- $can_download = false;
148
- break;
149
  }
 
150
  }
151
 
 
152
  }
153
 
154
  return $can_download;
136
  // get request user agent
137
  $visitor_ua = DLM_Utils::get_visitor_ua();
138
 
139
+ // check if $visitor_ua isn't empty
140
+ if ( ! empty( $visitor_ua ) ) {
141
 
142
+ // get blacklisted user agents
143
+ $blacklisted_uas = preg_split( "/\r?\n/", trim( get_option( 'dlm_user_agent_blacklist', "" ) ) );
144
+
145
+ if ( ! empty( $blacklisted_uas ) ) {
146
+
147
+ // loop through blacklisted user agents
148
+ foreach ( $blacklisted_uas as $blacklisted_ua ) {
149
+
150
+ if ( ! empty( $blacklisted_ua ) ) {
151
+ // check if blacklisted user agent is found in request user agent
152
+ if ( false !== stristr( $visitor_ua, $blacklisted_ua ) ) {
153
+ $can_download = false;
154
+ break;
155
+ }
156
+ }
157
+
158
+ }
159
 
 
 
 
 
160
  }
161
+
162
  }
163
 
164
+
165
  }
166
 
167
  return $can_download;
includes/class-dlm-download.php CHANGED
@@ -222,7 +222,7 @@ class DLM_Download {
222
  * get_the_download_link function.
223
  *
224
  * @access public
225
- * @return void
226
  */
227
  public function get_the_download_link() {
228
  $scheme = parse_url( get_option( 'home' ), PHP_URL_SCHEME );
222
  * get_the_download_link function.
223
  *
224
  * @access public
225
+ * @return String
226
  */
227
  public function get_the_download_link() {
228
  $scheme = parse_url( get_option( 'home' ), PHP_URL_SCHEME );
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: never5, barrykooij, mikejolley
3
  Donate link: http://www.barrykooij.com/donate/
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging, AJAX, digital, documents, download category, download manager, download template, downloadmanager, file manager, file tree, grid, hits, ip-address, manager, media, monitor, password, protect downloads, tracker
5
  Requires at least: 3.8
6
- Tested up to: 4.3
7
- Stable tag: 1.9.0
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
@@ -107,6 +107,12 @@ More documentation can be found in our [Knowledge Base](https://www.download-mon
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
110
  = 1.9.0: September 15, 2015 =
111
  * Feature: We added a separate 'No Access' page that includes the following features:
112
  * No Access Page : Added [dlm_no_access] shortcode that displays the no access content.
3
  Donate link: http://www.barrykooij.com/donate/
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging, AJAX, digital, documents, download category, download manager, download template, downloadmanager, file manager, file tree, grid, hits, ip-address, manager, media, monitor, password, protect downloads, tracker
5
  Requires at least: 3.8
6
+ Tested up to: 4.4
7
+ Stable tag: 1.9.1
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
107
 
108
  == Changelog ==
109
 
110
+ = 1.9.1: December 1, 2015 =
111
+ * Tweak: Check if $visitor_ua isn't empty to prevent stristr warnings.
112
+ * Tweak: Added wmv filetype icon support
113
+ * Tweak: Correctly populate data on quick edit of download.
114
+ * Tweak: Settings tab now loads tab of set URL hash.
115
+
116
  = 1.9.0: September 15, 2015 =
117
  * Feature: We added a separate 'No Access' page that includes the following features:
118
  * No Access Page : Added [dlm_no_access] shortcode that displays the no access content.