Download Monitor - Version 1.6.4

Version Description

  • Removed unused library jqueryFileTree.
  • dlm_shortcode_download_content filter now also includes $atts.
  • Fixed small parse file parse error because of whitespace.
  • Changed some admin menu hook priorities.
Download this release

Release Info

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

Code changes from version 1.6.3 to 1.6.4

Files changed (35) hide show
  1. assets/js/jqueryFileTree/connectors/jqueryFileTree.php +0 -66
  2. assets/js/jqueryFileTree/connectors/jqueryFileTreeDir.php +0 -60
  3. assets/js/jqueryFileTree/images/application.png +0 -0
  4. assets/js/jqueryFileTree/images/code.png +0 -0
  5. assets/js/jqueryFileTree/images/css.png +0 -0
  6. assets/js/jqueryFileTree/images/db.png +0 -0
  7. assets/js/jqueryFileTree/images/directory.png +0 -0
  8. assets/js/jqueryFileTree/images/doc.png +0 -0
  9. assets/js/jqueryFileTree/images/file.png +0 -0
  10. assets/js/jqueryFileTree/images/film.png +0 -0
  11. assets/js/jqueryFileTree/images/flash.png +0 -0
  12. assets/js/jqueryFileTree/images/folder_open.png +0 -0
  13. assets/js/jqueryFileTree/images/html.png +0 -0
  14. assets/js/jqueryFileTree/images/java.png +0 -0
  15. assets/js/jqueryFileTree/images/linux.png +0 -0
  16. assets/js/jqueryFileTree/images/music.png +0 -0
  17. assets/js/jqueryFileTree/images/pdf.png +0 -0
  18. assets/js/jqueryFileTree/images/php.png +0 -0
  19. assets/js/jqueryFileTree/images/picture.png +0 -0
  20. assets/js/jqueryFileTree/images/ppt.png +0 -0
  21. assets/js/jqueryFileTree/images/psd.png +0 -0
  22. assets/js/jqueryFileTree/images/ruby.png +0 -0
  23. assets/js/jqueryFileTree/images/script.png +0 -0
  24. assets/js/jqueryFileTree/images/spinner.gif +0 -0
  25. assets/js/jqueryFileTree/images/txt.png +0 -0
  26. assets/js/jqueryFileTree/images/xls.png +0 -0
  27. assets/js/jqueryFileTree/images/zip.png +0 -0
  28. assets/js/jqueryFileTree/jqueryFileTree.css +0 -101
  29. assets/js/jqueryFileTree/jqueryFileTree.js +0 -95
  30. download-monitor.php +2 -2
  31. includes/admin/class-dlm-admin.php +14 -5
  32. includes/class-dlm-download-handler.php +1 -1
  33. includes/class-dlm-file-manager.php +2 -1
  34. includes/class-dlm-shortcodes.php +1 -1
  35. readme.txt +30 -18
assets/js/jqueryFileTree/connectors/jqueryFileTree.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- //
3
- // jQuery File Tree PHP Connector - modified for php4/wordpress compatibility
4
- //
5
-
6
- if(file_exists('../../../../../../wp-load.php')) {
7
- require_once("../../../../../../wp-load.php");
8
- } else if(file_exists('../../../../../../../wp-load.php')) {
9
- require_once("../../../../../../../wp-load.php");
10
- } else {
11
- if(file_exists('../../../../../../wp-config.php')) {
12
- require_once("../../../../../../wp-config.php");
13
- } else if(file_exists('../../../../../../../wp-config.php')) {
14
- require_once("../../../../../../../wp-config.php");
15
- } else {
16
- exit;
17
- }
18
- }
19
-
20
- if (!function_exists('php4_scandir') && !function_exists('scandir')) {
21
- function php4_scandir($dir,$listDirectories=true) {
22
- $dirArray = array();
23
- if ($handle = opendir($dir)) {
24
- while (false !== ($file = readdir($handle))) {
25
- if($listDirectories == false) { if(is_dir($file)) { continue; } }
26
- array_push($dirArray,basename($file));
27
- }
28
- closedir($handle);
29
- }
30
- return $dirArray;
31
- }
32
- }
33
-
34
- require_once(ABSPATH.'wp-admin/admin.php');
35
-
36
- $_POST['dir'] = urldecode($_POST['dir']);
37
-
38
- $root_dir = '';
39
-
40
- if( file_exists($root_dir . $_POST['dir']) ) {
41
- if (function_exists('scandir')) {
42
- $files = scandir($root_dir . $_POST['dir']);
43
- } else {
44
- $files = php4_scandir($root_dir . $_POST['dir']);
45
- }
46
- natcasesort($files);
47
- if( count($files) > 2 ) {
48
- echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
49
- // All dirs
50
- foreach( $files as $file ) {
51
- if( file_exists($root_dir . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root_dir . $_POST['dir'] . $file) ) {
52
- echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
53
- }
54
- }
55
- // All files
56
- foreach( $files as $file ) {
57
- if( file_exists($root_dir . $_POST['dir'] . $file) && $file != '.' && $file != '..' && !is_dir($root_dir . $_POST['dir'] . $file) ) {
58
- $ext = preg_replace('/^.*\./', '', $file);
59
- echo "<li class=\"file ext_$ext\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "\">" . htmlentities($file) . "</a></li>";
60
- }
61
- }
62
- echo "</ul>";
63
- }
64
- }
65
-
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/jqueryFileTree/connectors/jqueryFileTreeDir.php DELETED
@@ -1,60 +0,0 @@
1
- <?php
2
- //
3
- // jQuery File Tree PHP Connector - modified for php4/wordpress compatibility
4
- //
5
-
6
- if(file_exists('../../../../../../wp-load.php')) {
7
- require_once("../../../../../../wp-load.php");
8
- } else if(file_exists('../../../../../../../wp-load.php')) {
9
- require_once("../../../../../../../wp-load.php");
10
- } else {
11
- if(file_exists('../../../../../../wp-config.php')) {
12
- require_once("../../../../../../wp-config.php");
13
- } else if(file_exists('../../../../../../../wp-config.php')) {
14
- require_once("../../../../../../../wp-config.php");
15
- } else {
16
- exit;
17
- }
18
- }
19
-
20
- if (!function_exists('php4_scandir') && !function_exists('scandir')) {
21
- function php4_scandir($dir,$listDirectories=true) {
22
- $dirArray = array();
23
- if ($handle = opendir($dir)) {
24
- while (false !== ($file = readdir($handle))) {
25
- if($listDirectories == false) { if(is_dir($file)) { continue; } }
26
- array_push($dirArray,basename($file));
27
- }
28
- closedir($handle);
29
- }
30
- return $dirArray;
31
- }
32
- }
33
-
34
- require_once(ABSPATH.'wp-admin/admin.php');
35
-
36
- $_POST['dir'] = urldecode($_POST['dir']);
37
-
38
- $root_dir = '';
39
-
40
- if( file_exists($root_dir . $_POST['dir']) ) {
41
- if (function_exists('scandir')) {
42
- $files = scandir($root_dir . $_POST['dir']);
43
- } else {
44
- $files = php4_scandir($root_dir . $_POST['dir']);
45
- }
46
- natcasesort($files);
47
- if( count($files) > 2 ) {
48
- echo "<ul class=\"jqueryFileTree\" style=\"display: none;\">";
49
- echo "<li class=\"file\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir']) . "\">&lt;Select this directory&gt;</a></li>";
50
- // All dirs
51
- foreach( $files as $file ) {
52
- if( file_exists($root_dir . $_POST['dir'] . $file) && $file != '.' && $file != '..' && is_dir($root_dir . $_POST['dir'] . $file) ) {
53
- echo "<li class=\"directory collapsed\"><a href=\"#\" rel=\"" . htmlentities($_POST['dir'] . $file) . "/\">" . htmlentities($file) . "</a></li>";
54
- }
55
- }
56
- echo "</ul>";
57
- }
58
- }
59
-
60
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/jqueryFileTree/images/application.png DELETED
Binary file
assets/js/jqueryFileTree/images/code.png DELETED
Binary file
assets/js/jqueryFileTree/images/css.png DELETED
Binary file
assets/js/jqueryFileTree/images/db.png DELETED
Binary file
assets/js/jqueryFileTree/images/directory.png DELETED
Binary file
assets/js/jqueryFileTree/images/doc.png DELETED
Binary file
assets/js/jqueryFileTree/images/file.png DELETED
Binary file
assets/js/jqueryFileTree/images/film.png DELETED
Binary file
assets/js/jqueryFileTree/images/flash.png DELETED
Binary file
assets/js/jqueryFileTree/images/folder_open.png DELETED
Binary file
assets/js/jqueryFileTree/images/html.png DELETED
Binary file
assets/js/jqueryFileTree/images/java.png DELETED
Binary file
assets/js/jqueryFileTree/images/linux.png DELETED
Binary file
assets/js/jqueryFileTree/images/music.png DELETED
Binary file
assets/js/jqueryFileTree/images/pdf.png DELETED
Binary file
assets/js/jqueryFileTree/images/php.png DELETED
Binary file
assets/js/jqueryFileTree/images/picture.png DELETED
Binary file
assets/js/jqueryFileTree/images/ppt.png DELETED
Binary file
assets/js/jqueryFileTree/images/psd.png DELETED
Binary file
assets/js/jqueryFileTree/images/ruby.png DELETED
Binary file
assets/js/jqueryFileTree/images/script.png DELETED
Binary file
assets/js/jqueryFileTree/images/spinner.gif DELETED
Binary file
assets/js/jqueryFileTree/images/txt.png DELETED
Binary file
assets/js/jqueryFileTree/images/xls.png DELETED
Binary file
assets/js/jqueryFileTree/images/zip.png DELETED
Binary file
assets/js/jqueryFileTree/jqueryFileTree.css DELETED
@@ -1,101 +0,0 @@
1
- #file_browser, #file_browser2, #file_browser_thumbnail {
2
- border: 1px solid #DFDFDF;
3
- height: 250px;
4
- overflow: auto;
5
- padding: 4px 8px;
6
- background: #fff;
7
- margin: 4px 0;
8
- width: 342px;
9
- }
10
-
11
- UL.jqueryFileTree {
12
- font-family: Verdana, sans-serif;
13
- font-size: 11px;
14
- line-height: 18px;
15
- padding: 0px;
16
- margin: 0px;
17
- }
18
-
19
- UL.jqueryFileTree LI {
20
- list-style: none;
21
- padding: 2px 0px;
22
- padding-left: 20px;
23
- margin: 0px;
24
- white-space: nowrap;
25
- }
26
-
27
- UL.jqueryFileTree A {
28
- color: #333;
29
- text-decoration: none;
30
- display: block;
31
- padding: 0px 2px;
32
- }
33
-
34
- UL.jqueryFileTree A:hover {
35
- background: #BDF;
36
- }
37
-
38
- /* Core Styles */
39
- .jqueryFileTree LI.directory { background: url(images/directory.png) left top no-repeat; }
40
- .jqueryFileTree LI.expanded { background: url(images/folder_open.png) left top no-repeat; }
41
- .jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }
42
- .jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }
43
- /* File Extensions*/
44
- .jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }
45
- .jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }
46
- .jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }
47
- .jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }
48
- .jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }
49
- .jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }
50
- .jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }
51
- .jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }
52
- .jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }
53
- .jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }
54
- .jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }
55
- .jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }
56
- .jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }
57
- .jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }
58
- .jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }
59
- .jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }
60
- .jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }
61
- .jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }
62
- .jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }
63
- .jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }
64
- .jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }
65
- .jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }
66
- .jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }
67
- .jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
68
- .jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }
69
- .jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }
70
- .jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }
71
- .jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }
72
- .jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }
73
- .jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }
74
- .jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }
75
- .jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }
76
- .jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }
77
- .jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }
78
- .jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }
79
- .jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
80
- .jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }
81
- .jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }
82
- .jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }
83
- .jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }
84
- .jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }
85
- .jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }
86
- .jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }
87
- .jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }
88
- .jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }
89
- .jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }
90
- .jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }
91
- .jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }
92
- .jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }
93
- .jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }
94
- .jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }
95
- .jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }
96
- .jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }
97
- .jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }
98
- .jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }
99
- .jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }
100
- .jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }
101
- .jqueryFileTree LI.ext_zip { background: url(images/zip.png) left top no-repeat; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/jqueryFileTree/jqueryFileTree.js DELETED
@@ -1,95 +0,0 @@
1
- // jQuery File Tree Plugin
2
- //
3
- // Version 1.01
4
- //
5
- // Cory S.N. LaViska
6
- // A Beautiful Site (http://abeautifulsite.net/)
7
- // 24 March 2008
8
- //
9
- // Visit http://abeautifulsite.net/notebook.php?article=58 for more information
10
- //
11
- // Usage: $('.fileTreeDemo').fileTree( options, callback )
12
- //
13
- // Options: root - root folder to display; default = /
14
- // script - location of the serverside AJAX file to use; default = jqueryFileTree.php
15
- // folderEvent - event to trigger expand/collapse; default = click
16
- // expandSpeed - default = 500 (ms); use -1 for no animation
17
- // collapseSpeed - default = 500 (ms); use -1 for no animation
18
- // expandEasing - easing function to use on expand (optional)
19
- // collapseEasing - easing function to use on collapse (optional)
20
- // multiFolder - whether or not to limit the browser to one subfolder at a time
21
- // loadMessage - Message to display while initial tree loads (can be HTML)
22
- //
23
- // History:
24
- //
25
- // 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
26
- // 1.00 - released (24 March 2008)
27
- //
28
- // TERMS OF USE
29
- //
30
- // This plugin is dual-licensed under the GNU General Public License and the MIT License and
31
- // is copyright 2008 A Beautiful Site, LLC.
32
- //
33
- if(jQuery) (function($){
34
-
35
- $.extend($.fn, {
36
- fileTree: function(o, h) {
37
- // Defaults
38
- if( !o ) var o = {};
39
- if( o.root == undefined ) o.root = '/';
40
- if( o.script == undefined ) o.script = 'jqueryFileTree.php';
41
- if( o.folderEvent == undefined ) o.folderEvent = 'click';
42
- if( o.expandSpeed == undefined ) o.expandSpeed= 500;
43
- if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
44
- if( o.expandEasing == undefined ) o.expandEasing = null;
45
- if( o.collapseEasing == undefined ) o.collapseEasing = null;
46
- if( o.multiFolder == undefined ) o.multiFolder = true;
47
- if( o.loadMessage == undefined ) o.loadMessage = 'Loading...';
48
-
49
- $(this).each( function() {
50
-
51
- function showTree(c, t) {
52
- $(c).addClass('wait');
53
- $(".jqueryFileTree.start").remove();
54
- $.post(o.script, { dir: t }, function(data) {
55
- $(c).find('.start').html('');
56
- $(c).removeClass('wait').append(data);
57
- if( o.root == t ) $(c).find('UL:hidden').show(); else $(c).find('UL:hidden').slideDown({ duration: o.expandSpeed, easing: o.expandEasing });
58
- bindTree(c);
59
- });
60
- }
61
-
62
- function bindTree(t) {
63
- $(t).find('LI A').bind(o.folderEvent, function() {
64
- if( $(this).parent().hasClass('directory') ) {
65
- if( $(this).parent().hasClass('collapsed') ) {
66
- // Expand
67
- if( !o.multiFolder ) {
68
- $(this).parent().parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
69
- $(this).parent().parent().find('LI.directory').removeClass('expanded').addClass('collapsed');
70
- }
71
- $(this).parent().find('UL').remove(); // cleanup
72
- showTree( $(this).parent(), escape($(this).attr('rel').match( /.*\// )) );
73
- $(this).parent().removeClass('collapsed').addClass('expanded');
74
- } else {
75
- // Collapse
76
- $(this).parent().find('UL').slideUp({ duration: o.collapseSpeed, easing: o.collapseEasing });
77
- $(this).parent().removeClass('expanded').addClass('collapsed');
78
- }
79
- } else {
80
- h($(this).attr('rel'));
81
- }
82
- return false;
83
- });
84
- // Prevent A from triggering the # on non-click events
85
- if( o.folderEvent.toLowerCase != 'click' ) $(t).find('LI A').bind('click', function() { return false; });
86
- }
87
- // Loading message
88
- $(this).html('<ul class="jqueryFileTree start"><li class="wait">' + o.loadMessage + '<li></ul>');
89
- // Get the initial file list
90
- showTree( $(this), escape(o.root) );
91
- });
92
- }
93
- });
94
-
95
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
download-monitor.php CHANGED
@@ -3,7 +3,7 @@
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.6.3
7
  Author: Barry Kooij & Mike Jolley
8
  Author URI: http://www.download-monitor.com
9
  Requires at least: 3.8
@@ -33,7 +33,7 @@ if ( ! defined( 'ABSPATH' ) ) {
33
  function __download_monitor_main() {
34
 
35
  // Define DLM Version
36
- define( 'DLM_VERSION', '1.6.3' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
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.6.4
7
  Author: Barry Kooij & Mike Jolley
8
  Author URI: http://www.download-monitor.com
9
  Requires at least: 3.8
33
  function __download_monitor_main() {
34
 
35
  // Define DLM Version
36
+ define( 'DLM_VERSION', '1.6.4' );
37
 
38
  // Define DLM FILE
39
  define( 'DLM_PLUGIN_FILE', __FILE__ );
includes/admin/class-dlm-admin.php CHANGED
@@ -20,7 +20,11 @@ class DLM_Admin {
20
  add_filter( 'upload_dir', array( $this, 'upload_dir' ) );
21
 
22
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
 
 
23
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
 
 
24
  add_action( 'admin_init', array( $this, 'register_settings' ) );
25
  add_action( 'admin_init', array( $this, 'export_logs' ) );
26
  add_action( 'admin_init', array( $this, 'delete_logs' ) );
@@ -294,16 +298,21 @@ class DLM_Admin {
294
 
295
  // Settings page
296
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Settings', 'download-monitor' ), __( 'Settings', 'download-monitor' ), 'manage_options', 'download-monitor-settings', array(
297
- $this,
298
- 'settings_page'
299
- ) );
300
 
 
 
 
 
 
 
301
  // Extensions page
302
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Download Monitor Extensions', 'download-monitor' ), __( 'Extensions', 'download-monitor' ), 'manage_options', 'dlm-extensions', array(
303
  $this,
304
  'extensions_page'
305
  ) );
306
-
307
  }
308
 
309
  /**
@@ -427,7 +436,7 @@ class DLM_Admin {
427
  </p>
428
  </form>
429
  </div>
430
- <?php
431
  }
432
 
433
  /**
20
  add_filter( 'upload_dir', array( $this, 'upload_dir' ) );
21
 
22
  add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
23
+
24
+ // Admin menus
25
  add_action( 'admin_menu', array( $this, 'admin_menu' ), 12 );
26
+ add_action( 'admin_menu', array( $this, 'admin_menu_extensions' ), 20 );
27
+
28
  add_action( 'admin_init', array( $this, 'register_settings' ) );
29
  add_action( 'admin_init', array( $this, 'export_logs' ) );
30
  add_action( 'admin_init', array( $this, 'delete_logs' ) );
298
 
299
  // Settings page
300
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Settings', 'download-monitor' ), __( 'Settings', 'download-monitor' ), 'manage_options', 'download-monitor-settings', array(
301
+ $this,
302
+ 'settings_page'
303
+ ) );
304
 
305
+ }
306
+
307
+ /**
308
+ * Add the admin menu on later hook so extensions can be add before this menu item
309
+ */
310
+ public function admin_menu_extensions() {
311
  // Extensions page
312
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Download Monitor Extensions', 'download-monitor' ), __( 'Extensions', 'download-monitor' ), 'manage_options', 'dlm-extensions', array(
313
  $this,
314
  'extensions_page'
315
  ) );
 
316
  }
317
 
318
  /**
436
  </p>
437
  </form>
438
  </div>
439
+ <?php
440
  }
441
 
442
  /**
includes/class-dlm-download-handler.php CHANGED
@@ -27,7 +27,7 @@ class DLM_Download_Handler {
27
  add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );
28
  add_action( 'init', array( $this, 'add_endpoint' ), 0 );
29
  add_action( 'parse_request', array( $this, 'handler' ), 0 );
30
- add_action( 'dlm_can_download', array( $this, 'check_access' ), 10, 2 );
31
  }
32
 
33
 
27
  add_filter( 'query_vars', array( $this, 'add_query_vars' ), 0 );
28
  add_action( 'init', array( $this, 'add_endpoint' ), 0 );
29
  add_action( 'parse_request', array( $this, 'handler' ), 0 );
30
+ add_action( 'dlm_can_download', array( $this, 'check_access' ), 10, 2 ); /** @todo change to filter */
31
  }
32
 
33
 
includes/class-dlm-file-manager.php CHANGED
@@ -58,6 +58,7 @@ class DLM_File_Manager {
58
  * @return array
59
  */
60
  public function parse_file_path( $file_path ) {
 
61
  $remote_file = true;
62
  $parsed_file_path = parse_url( $file_path );
63
 
@@ -79,7 +80,7 @@ class DLM_File_Manager {
79
 
80
  /** This is a local file given by URL so we need to figure out the path */
81
  $remote_file = false;
82
- $file_path = str_replace( $wp_uploads_url, $wp_uploads_dir, $file_path );
83
  $file_path = realpath( $file_path );
84
 
85
  } elseif ( is_multisite() && ( strpos( $file_path, network_site_url( '/', 'http' ) ) !== false || strpos( $file_path, network_site_url( '/', 'https' ) ) !== false ) ) {
58
  * @return array
59
  */
60
  public function parse_file_path( $file_path ) {
61
+
62
  $remote_file = true;
63
  $parsed_file_path = parse_url( $file_path );
64
 
80
 
81
  /** This is a local file given by URL so we need to figure out the path */
82
  $remote_file = false;
83
+ $file_path = trim( str_replace( $wp_uploads_url, $wp_uploads_dir, $file_path ) );
84
  $file_path = realpath( $file_path );
85
 
86
  } elseif ( is_multisite() && ( strpos( $file_path, network_site_url( '/', 'http' ) ) !== false || strpos( $file_path, network_site_url( '/', 'https' ) ) !== false ) ) {
includes/class-dlm-shortcodes.php CHANGED
@@ -79,7 +79,7 @@ class DLM_Shortcodes {
79
  }
80
 
81
  // Allow third party extensions to hijack shortcode
82
- $hijacked_content = apply_filters( 'dlm_shortcode_download_content', '', $id );
83
 
84
  // If there's hijacked content, return it and be done with it
85
  if( '' !== $hijacked_content ) {
79
  }
80
 
81
  // Allow third party extensions to hijack shortcode
82
+ $hijacked_content = apply_filters( 'dlm_shortcode_download_content', '', $id, $atts );
83
 
84
  // If there's hijacked content, return it and be done with it
85
  if( '' !== $hijacked_content ) {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=barry@ca
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
5
  Requires at least: 3.8
6
  Tested up to: 4.1.1
7
- Stable tag: 1.6.3
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
@@ -23,21 +23,18 @@ Download Monitor provides an interface for uploading and managing downloadable f
23
  * Display download links on the frontend using shortcodes.
24
  * Change the way download links get displayed via template files.
25
  * Track downloads counts and log user download attempts.
26
- * Member only downloads, requires users to be logged in to download your files.
27
  * Customisable endpoints for showing pretty download links.
28
 
29
  [Read more about Download Monitor](https://www.download-monitor.com).
30
 
31
- > #### Download Monitor Extensions
32
- > Extend the core Download Monitor plugin with it's powerful extensions. All extensions come with one year of updates and support.<br />
33
- >
34
- > Some of our popular extensions include: [Page Addon](https://www.download-monitor.com/extensions/page-addon/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-block-page-addon), [Email Lock](https://www.download-monitor.com/extensions/email-lock/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-block-email-lock), [CSV Importer](https://www.download-monitor.com/extensions/csv-importer/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-block-csv-importer) and [Gravity Forms Lock](https://www.download-monitor.com/extensions/gravity-forms/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-block-gravity-forms-lock).
35
- >
36
- > Want to see more? [Browse All Extensions](https://www.download-monitor.com/extensions/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-block-browse-all)
37
-
38
  = Documentation =
39
 
40
- Documentation can be found on the [Download Monitor website](https://www.download-monitor.com/documentation/?utm_source=wp-plugin-repo&utm_medium=link&utm_campaign=description-documentation).
 
 
 
 
41
 
42
  = Contributing and reporting bugs =
43
 
@@ -49,7 +46,7 @@ You can contribute localizations via Transifex [https://www.transifex.com/projec
49
 
50
  Use the WordPress.org forums for community support. If you spot a bug, you can of course log it on [Github](https://github.com/download-monitor/download-monitor) instead where we can act upon it more efficiently.
51
 
52
- Unfortunately we can't offer you help with a customisation. Please consider hiring a developer for your website's customizations.
53
 
54
  == Installation ==
55
 
@@ -69,6 +66,18 @@ The manual installation method involves downloading the plugin and uploading it
69
 
70
  == Frequently Asked Questions ==
71
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  = Can I upload .xxx filetype using the uploader? =
73
 
74
  Download Monitor uses the WordPress uploader for uploading files. By default these formats are supported:
@@ -92,12 +101,6 @@ Download links are powered by endpoints. If you find them 404'ing, go to Setting
92
 
93
  Admin hits are not counted, log out and try!
94
 
95
- = I used this before, so why is this version 1? =
96
-
97
- Version 1.0.0 is a fresh start/complete rewrite of the legacy 3.0 version using modern best-practices such as custom post types and endpoints. Because of this, data from the legacy plugin won't work without migration using [the legacy importer](https://www.download-monitor.com/extensions/dlm-legacy-importer/). Since this upgrade process isn't straightforward nor automated I've reverted the version to 1.0.0 to prevent automatic updates.
98
-
99
- Legacy versions can still be [found here](http://wordpress.org/plugins/download-monitor/developers/).
100
-
101
  == Screenshots ==
102
 
103
  1. The main admin screen lists your downloads using familiar WordPress UI.
@@ -107,6 +110,12 @@ Legacy versions can still be [found here](http://wordpress.org/plugins/download-
107
 
108
  == Changelog ==
109
 
 
 
 
 
 
 
110
  = 1.6.3 =
111
  * Fixed an undefined method call 'get_filesize'.
112
  * Allow third party extensions to hijack [downloads] shortcode with filter dlm_shortcode_download_content.
@@ -276,4 +285,7 @@ Legacy versions can still be [found here](http://wordpress.org/plugins/download-
276
  = 1.0.0 =
277
  * Complete rewrite of the plugin making use of custom post types and other best practices. Fresh start version '1' to prevent auto-updates (legacy importer needs to be used to migrate from old versions).
278
 
279
- == Upgrade Notice ==
 
 
 
4
  Tags: download, downloads, monitor, hits, download monitor, tracking, admin, count, counter, files, versions, download count, logging
5
  Requires at least: 3.8
6
  Tested up to: 4.1.1
7
+ Stable tag: 1.6.4
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
23
  * Display download links on the frontend using shortcodes.
24
  * Change the way download links get displayed via template files.
25
  * Track downloads counts and log user download attempts.
26
+ * Member only downloads.
27
  * Customisable endpoints for showing pretty download links.
28
 
29
  [Read more about Download Monitor](https://www.download-monitor.com).
30
 
 
 
 
 
 
 
 
31
  = Documentation =
32
 
33
+ Documentation will be maintained on the [GitHub Wiki here](https://github.com/download-monitor/download-monitor/wiki).
34
+
35
+ = Extensions =
36
+
37
+ Extensions, such as the __legacy importer__ and __page addon__ can be [found here](https://www.download-monitor.com/extensions/). Take a look!
38
 
39
  = Contributing and reporting bugs =
40
 
46
 
47
  Use the WordPress.org forums for community support. If you spot a bug, you can of course log it on [Github](https://github.com/download-monitor/download-monitor) instead where we can act upon it more efficiently.
48
 
49
+ If you want help with a customisation, hire a developer!
50
 
51
  == Installation ==
52
 
66
 
67
  == Frequently Asked Questions ==
68
 
69
+ = I used this before, so why is this version 1? =
70
+
71
+ Version 1.0.0 is a fresh start/complete rewrite of the legacy 3.0 version using modern best-practices such as custom post types and endpoints. Because of this, data from the legacy plugin won't work without migration using [the legacy importer](https://www.download-monitor.com/extensions/dlm-legacy-importer/). Since this upgrade process isn't straightforward nor automated I've reverted the version to 1.0.0 to prevent automatic updates.
72
+
73
+ Legacy versions can still be [found here](http://wordpress.org/plugins/download-monitor/developers/).
74
+
75
+ = X feature/shortcode is missing from the legacy version; why? =
76
+
77
+ The rewrite has trimmed the fat and only kept the best, most useful features. If something is missing, you can always code it yourself - the new system is very flexible and its easy to query files using [get_posts](http://codex.wordpress.org/Template_Tags/get_posts).
78
+
79
+ If you are missing the "Page Addon", this is now a separate plugin found here: [Download Monitor Page Addon](https://www.download-monitor.com/extensions/page-addon/).
80
+
81
  = Can I upload .xxx filetype using the uploader? =
82
 
83
  Download Monitor uses the WordPress uploader for uploading files. By default these formats are supported:
101
 
102
  Admin hits are not counted, log out and try!
103
 
 
 
 
 
 
 
104
  == Screenshots ==
105
 
106
  1. The main admin screen lists your downloads using familiar WordPress UI.
110
 
111
  == Changelog ==
112
 
113
+ = 1.6.4 =
114
+ * Removed unused library jqueryFileTree.
115
+ * dlm_shortcode_download_content filter now also includes $atts.
116
+ * Fixed small parse file parse error because of whitespace.
117
+ * Changed some admin menu hook priorities.
118
+
119
  = 1.6.3 =
120
  * Fixed an undefined method call 'get_filesize'.
121
  * Allow third party extensions to hijack [downloads] shortcode with filter dlm_shortcode_download_content.
285
  = 1.0.0 =
286
  * Complete rewrite of the plugin making use of custom post types and other best practices. Fresh start version '1' to prevent auto-updates (legacy importer needs to be used to migrate from old versions).
287
 
288
+ == Upgrade Notice ==
289
+
290
+ = 1.6.0 =
291
+ If you're using the Page Addon or Amazon S3 extension you must update these extensions too. Visit https://www.download-monitor.com/ for more information.