Download Monitor - Version 1.3.2

Version Description

  • Cleaned up log table queries
  • Tweaked download handler headers
  • Tweaked logging
  • Limit UA to 200
  • Setcookie to prevent double logging
  • Addons page (disable using add_filter( 'dlm_show_addons_page', '__return_false' ); )
Download this release

Release Info

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

Code changes from version 1.3.1 to 1.3.2

assets/css/admin.css CHANGED
@@ -1 +1 @@
1
- #dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .column-status{width:4em}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:normal;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:16px;line-height:16px;width:16px;display:inline-block}#dlm_logs td.column-status .failed{background-color:#df9d1d}#dlm_logs td.column-status .redirected{background-color:#74a721}#dlm_logs td.column-status .completed{background-color:#1c769b}#dlm_logs td.column-user_ip,#dlm_logs td.column-user_agent{font-family:monospace;font-weight:normal}#dlm_logs span.description{font-weight:normal}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-user_ip,#dlm_logs .column-date{width:6%!important}.icon32-posts-dlm_download{background:url(../images/downloads-icon.gif) no-repeat scroll -7px -5px!important}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 28px;background:#fff url(../images/filetype_icons/document.png) no-repeat 4px center;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a.folder{background-image:url(../images/folder-horizontal.png)}ul.download_monitor_file_browser li a.folder_open{background-image:url(../images/folder-horizontal-open.png)}ul.download_monitor_file_browser li a.filetype-html,ul.download_monitor_file_browser li a.filetype-js,ul.download_monitor_file_browser li a.filetype-htm,ul.download_monitor_file_browser li a.filetype-php,ul.download_monitor_file_browser li a.filetype-asp,ul.download_monitor_file_browser li a.filetype-css{background-image:url(../images/filetype_icons/document-code.png)}ul.download_monitor_file_browser li a.filetype-xlsx,ul.download_monitor_file_browser li a.filetype-xlsm,ul.download_monitor_file_browser li a.filetype-xlsb,ul.download_monitor_file_browser li a.filetype-xltx,ul.download_monitor_file_browser li a.filetype-xltm,ul.download_monitor_file_browser li a.filetype-xls,ul.download_monitor_file_browser li a.filetype-xlt{background-image:url(../images/filetype_icons/document-excel.png)}ul.download_monitor_file_browser li a.filetype-mov,ul.download_monitor_file_browser li a.filetype-avi,ul.download_monitor_file_browser li a.filetype-3g2,ul.download_monitor_file_browser li a.filetype-3gp,ul.download_monitor_file_browser li a.filetype-asf,ul.download_monitor_file_browser li a.filetype-asx,ul.download_monitor_file_browser li a.filetype-mp4,ul.download_monitor_file_browser li a.filetype-mpg,ul.download_monitor_file_browser li a.filetype-rm,ul.download_monitor_file_browser li a.filetype-srt,ul.download_monitor_file_browser li a.filetype-vob,ul.download_monitor_file_browser li a.filetype-wmv{background-image:url(../images/filetype_icons/document-film.png)}ul.download_monitor_file_browser li a.filetype-flv,ul.download_monitor_file_browser li a.filetype-swf{background-image:url(../images/filetype_icons/document-flash-movie.png)}ul.download_monitor_file_browser li a.filetype-ai,ul.download_monitor_file_browser li a.filetype-eps,ul.download_monitor_file_browser li a.filetype-ps,ul.download_monitor_file_browser li a.filetype-svg{background-image:url(../images/filetype_icons/document-illustrator.png)}ul.download_monitor_file_browser li a.filetype-bmp,ul.download_monitor_file_browser li a.filetype-dds,ul.download_monitor_file_browser li a.filetype-gif,ul.download_monitor_file_browser li a.filetype-jpg,ul.download_monitor_file_browser li a.filetype-jpeg,ul.download_monitor_file_browser li a.filetype-png,ul.download_monitor_file_browser li a.filetype-pspimage,ul.download_monitor_file_browser li a.filetype-tga,ul.download_monitor_file_browser li a.filetype-thm,ul.download_monitor_file_browser li a.filetype-tif,ul.download_monitor_file_browser li a.filetype-yuv,ul.download_monitor_file_browser li a.filetype-ico{background-image:url(../images/filetype_icons/document-image.png)}ul.download_monitor_file_browser li a.filetype-mp3,ul.download_monitor_file_browser li a.filetype-aif,ul.download_monitor_file_browser li a.filetype-iff,ul.download_monitor_file_browser li a.filetype-m3u,ul.download_monitor_file_browser li a.filetype-m4a,ul.download_monitor_file_browser li a.filetype-mid,ul.download_monitor_file_browser li a.filetype-midi,ul.download_monitor_file_browser li a.filetype-mpa,ul.download_monitor_file_browser li a.filetype-ra,ul.download_monitor_file_browser li a.filetype-wav,ul.download_monitor_file_browser li a.filetype-wma{background-image:url(../images/filetype_icons/document-music.png)}ul.download_monitor_file_browser li a.filetype-pdf{background-image:url(../images/filetype_icons/document-pdf.png)}ul.download_monitor_file_browser li a.filetype-psd{background-image:url(../images/filetype_icons/document-photoshop.png)}ul.download_monitor_file_browser li a.filetype-pps,ul.download_monitor_file_browser li a.filetype-ppt,ul.download_monitor_file_browser li a.filetype-pptx{background-image:url(../images/filetype_icons/document-powerpoint.png)}ul.download_monitor_file_browser li a.filetype-rtf,ul.download_monitor_file_browser li a.filetype-wpd,ul.download_monitor_file_browser li a.filetype-wps,ul.download_monitor_file_browser li a.filetype-odt,ul.download_monitor_file_browser li a.filetype-pages{background-image:url(../images/filetype_icons/document-text-image.png)}ul.download_monitor_file_browser li a.filetype-txt,ul.download_monitor_file_browser li a.filetype-tex,ul.download_monitor_file_browser li a.filetype-wps,ul.download_monitor_file_browser li a.filetype-odt,ul.download_monitor_file_browser li a.filetype-log,ul.download_monitor_file_browser li a.filetype-csv,ul.download_monitor_file_browser li a.filetype-xml{background-image:url(../images/filetype_icons/document-text.png)}ul.download_monitor_file_browser li a.filetype-doc,ul.download_monitor_file_browser li a.filetype-docx{background-image:url(../images/filetype_icons/document-word-text.png)}ul.download_monitor_file_browser li a.filetype-7z,ul.download_monitor_file_browser li a.filetype-zip,ul.download_monitor_file_browser li a.filetype-rar,ul.download_monitor_file_browser li a.filetype-zipx,ul.download_monitor_file_browser li a.filetype-sit,ul.download_monitor_file_browser li a.filetype-sitx,ul.download_monitor_file_browser li a.filetype-gz,ul.download_monitor_file_browser li a.filetype-tax-gz{background-image:url(../images/filetype_icons/document-zipper.png)}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:52px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:6%}table.wp-list-table td.column-members_only,table.wp-list-table td.column-redirect_only,table.wp-list-table td.column-featured{width:46px;text-align:left;padding-left:11px}table.wp-list-table td.column-download_count{width:6%;text-align:left;padding-left:11px}table.wp-list-table th.column-members_only,table.wp-list-table th.column-redirect_only,table.wp-list-table th.column-featured{width:46px}table.wp-list-table th.column-members_only img,table.wp-list-table th.column-redirect_only img,table.wp-list-table th.column-featured img{padding-top:3px!important}table.wp-list-table th.column-download_count{width:6%}table.wp-list-table th.column-download_count img{padding-top:3px!important}table.wp-list-table img{margin:1px 2px}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}table.wp-list-table span.na{color:#999}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .expand_all,#download-monitor-file .dlm-metaboxes-wrapper .close_all{float:right;margin-left:9px;line-height:22px}#download-monitor-file .dlm-metaboxes-wrapper .expand_all{padding-left:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAI0lEQVQYV2PcvXv3fwY8gJEoBa6urozYDAFpBpswGBTg8yYA3kYtiYVhDhIAAAAASUVORK5CYII=) no-repeat left}#download-monitor-file .dlm-metaboxes-wrapper .close_all{padding-left:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAHUlEQVQYV2NkIAAYd+/e/R+fGsIKCFpBUAHt3QAASf0MyQbFJwoAAAAASUVORK5CYII=) no-repeat left}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper .fr{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{font-weight:normal;line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background:#eaf2fa;background-image:linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-o-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-moz-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-webkit-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-ms-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#dae6f2),color-stop(1,#eaf2fa));border-color:#d3deea;color:#21759b}#download-monitor-file .dlm-metaboxes-wrapper .plus{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARklEQVQYGWP8//8/AzGACV3Rnj17/oMwujiGQnQFMD7RChlBbsRmFcwkEO3i4sJImonIumGmg0xBFifaRKIVgj2DbAUuNgCfThpracSKqwAAAABJRU5ErkJggg==) no-repeat 7px 5px}#download-monitor-file .dlm-metaboxes-wrapper .minus{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAKUlEQVQYlWP8//8/Az7AhFeWGAUsDAwMDHv27MFqj4uLCyNBExhp70gAohwKC5KJ+HQAAAAASUVORK5CYII=) no-repeat 7px 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAMklEQVQYV2NkQAK7d+/+D+K6uroywoThDJgkTAKmCKwAXRJZESMuSQwrkE3C6gbaKQAAYS4fOXZlROQAAAAASUVORK5CYII=) no-repeat 7px 5px}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAK0lEQVQYV2NkIAAYd+/e/R+mxtXVlRFdPYoCbIaBFWDTCVIMkqOXAnw+BQCbpycpLX4gIQAAAABJRU5ErkJggg==) no-repeat 7px 5px}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#insert-download{padding:20px 20px}#insert-download .updated,#insert-download .error{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download select.input,#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}
1
+ #dlm_logs td{padding:7px 7px;vertical-align:middle}#dlm_logs .column-status{width:4em}#dlm_logs td.column-status{font-size:10px;vertical-align:middle;text-align:center}#dlm_logs td.column-status span{color:#fff;font-weight:normal;-moz-border-radius:50%;-webkit-border-radius:50%;border-radius:50%;height:16px;line-height:16px;width:16px;display:inline-block}#dlm_logs td.column-status .failed{background-color:#df9d1d}#dlm_logs td.column-status .redirected{background-color:#74a721}#dlm_logs td.column-status .completed{background-color:#1c769b}#dlm_logs td.column-user_ip,#dlm_logs td.column-user_agent{font-family:monospace;font-weight:normal}#dlm_logs span.description{font-weight:normal}#dlm_logs .column-download,#dlm_logs .column-file,#dlm_logs .column-user,#dlm_logs .column-user_ua{width:16%!important}#dlm_logs .column-user_ip,#dlm_logs .column-date{width:6%!important}.icon32-posts-dlm_download{background:url(../images/downloads-icon.gif) no-repeat scroll -7px -5px!important}ul.download_monitor_file_browser{list-style:none outside;margin:0;border:1px solid #ddd;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;background:#f9f9f9;padding:5px 5px;-moz-box-shadow:inset 0 0 0 1px #fff;-webkit-box-shadow:inset 0 0 0 1px #fff;box-shadow:inset 0 0 0 1px #fff}ul.download_monitor_file_browser li{padding:0;margin:0}ul.download_monitor_file_browser li a{color:#21759b;display:block;padding:4px 0 4px 28px;background:#fff url(../images/filetype_icons/document.png) no-repeat 4px center;text-decoration:none}ul.download_monitor_file_browser li a:hover{background-color:#eaf2fa}ul.download_monitor_file_browser li a.folder{background-image:url(../images/folder-horizontal.png)}ul.download_monitor_file_browser li a.folder_open{background-image:url(../images/folder-horizontal-open.png)}ul.download_monitor_file_browser li a.filetype-html,ul.download_monitor_file_browser li a.filetype-js,ul.download_monitor_file_browser li a.filetype-htm,ul.download_monitor_file_browser li a.filetype-php,ul.download_monitor_file_browser li a.filetype-asp,ul.download_monitor_file_browser li a.filetype-css{background-image:url(../images/filetype_icons/document-code.png)}ul.download_monitor_file_browser li a.filetype-xlsx,ul.download_monitor_file_browser li a.filetype-xlsm,ul.download_monitor_file_browser li a.filetype-xlsb,ul.download_monitor_file_browser li a.filetype-xltx,ul.download_monitor_file_browser li a.filetype-xltm,ul.download_monitor_file_browser li a.filetype-xls,ul.download_monitor_file_browser li a.filetype-xlt{background-image:url(../images/filetype_icons/document-excel.png)}ul.download_monitor_file_browser li a.filetype-mov,ul.download_monitor_file_browser li a.filetype-avi,ul.download_monitor_file_browser li a.filetype-3g2,ul.download_monitor_file_browser li a.filetype-3gp,ul.download_monitor_file_browser li a.filetype-asf,ul.download_monitor_file_browser li a.filetype-asx,ul.download_monitor_file_browser li a.filetype-mp4,ul.download_monitor_file_browser li a.filetype-mpg,ul.download_monitor_file_browser li a.filetype-rm,ul.download_monitor_file_browser li a.filetype-srt,ul.download_monitor_file_browser li a.filetype-vob,ul.download_monitor_file_browser li a.filetype-wmv{background-image:url(../images/filetype_icons/document-film.png)}ul.download_monitor_file_browser li a.filetype-flv,ul.download_monitor_file_browser li a.filetype-swf{background-image:url(../images/filetype_icons/document-flash-movie.png)}ul.download_monitor_file_browser li a.filetype-ai,ul.download_monitor_file_browser li a.filetype-eps,ul.download_monitor_file_browser li a.filetype-ps,ul.download_monitor_file_browser li a.filetype-svg{background-image:url(../images/filetype_icons/document-illustrator.png)}ul.download_monitor_file_browser li a.filetype-bmp,ul.download_monitor_file_browser li a.filetype-dds,ul.download_monitor_file_browser li a.filetype-gif,ul.download_monitor_file_browser li a.filetype-jpg,ul.download_monitor_file_browser li a.filetype-jpeg,ul.download_monitor_file_browser li a.filetype-png,ul.download_monitor_file_browser li a.filetype-pspimage,ul.download_monitor_file_browser li a.filetype-tga,ul.download_monitor_file_browser li a.filetype-thm,ul.download_monitor_file_browser li a.filetype-tif,ul.download_monitor_file_browser li a.filetype-yuv,ul.download_monitor_file_browser li a.filetype-ico{background-image:url(../images/filetype_icons/document-image.png)}ul.download_monitor_file_browser li a.filetype-mp3,ul.download_monitor_file_browser li a.filetype-aif,ul.download_monitor_file_browser li a.filetype-iff,ul.download_monitor_file_browser li a.filetype-m3u,ul.download_monitor_file_browser li a.filetype-m4a,ul.download_monitor_file_browser li a.filetype-mid,ul.download_monitor_file_browser li a.filetype-midi,ul.download_monitor_file_browser li a.filetype-mpa,ul.download_monitor_file_browser li a.filetype-ra,ul.download_monitor_file_browser li a.filetype-wav,ul.download_monitor_file_browser li a.filetype-wma{background-image:url(../images/filetype_icons/document-music.png)}ul.download_monitor_file_browser li a.filetype-pdf{background-image:url(../images/filetype_icons/document-pdf.png)}ul.download_monitor_file_browser li a.filetype-psd{background-image:url(../images/filetype_icons/document-photoshop.png)}ul.download_monitor_file_browser li a.filetype-pps,ul.download_monitor_file_browser li a.filetype-ppt,ul.download_monitor_file_browser li a.filetype-pptx{background-image:url(../images/filetype_icons/document-powerpoint.png)}ul.download_monitor_file_browser li a.filetype-rtf,ul.download_monitor_file_browser li a.filetype-wpd,ul.download_monitor_file_browser li a.filetype-wps,ul.download_monitor_file_browser li a.filetype-odt,ul.download_monitor_file_browser li a.filetype-pages{background-image:url(../images/filetype_icons/document-text-image.png)}ul.download_monitor_file_browser li a.filetype-txt,ul.download_monitor_file_browser li a.filetype-tex,ul.download_monitor_file_browser li a.filetype-wps,ul.download_monitor_file_browser li a.filetype-odt,ul.download_monitor_file_browser li a.filetype-log,ul.download_monitor_file_browser li a.filetype-csv,ul.download_monitor_file_browser li a.filetype-xml{background-image:url(../images/filetype_icons/document-text.png)}ul.download_monitor_file_browser li a.filetype-doc,ul.download_monitor_file_browser li a.filetype-docx{background-image:url(../images/filetype_icons/document-word-text.png)}ul.download_monitor_file_browser li a.filetype-7z,ul.download_monitor_file_browser li a.filetype-zip,ul.download_monitor_file_browser li a.filetype-rar,ul.download_monitor_file_browser li a.filetype-zipx,ul.download_monitor_file_browser li a.filetype-sit,ul.download_monitor_file_browser li a.filetype-sitx,ul.download_monitor_file_browser li a.filetype-gz,ul.download_monitor_file_browser li a.filetype-tax-gz{background-image:url(../images/filetype_icons/document-zipper.png)}ul.download_monitor_file_browser li.nofiles{color:#999;font-style:italic;padding:4px 0}ul.download_monitor_file_browser li ul{list-style:none outside;margin:0;padding:0 0 0 28px}ul.download_monitor_file_browser li ul.loading{background:url(../images/ajax-loader.gif) no-repeat 24px 0;height:32px}table.wp-list-table .column-thumb{width:52px;text-align:center;white-space:nowrap}table.wp-list-table .column-dlm_download_cat,table.wp-list-table .column-dlm_download_tag,table.wp-list-table .column-file{width:11%!important}table.wp-list-table .column-download_id,table.wp-list-table .column-version{width:6%}table.wp-list-table td.column-members_only,table.wp-list-table td.column-redirect_only,table.wp-list-table td.column-featured{width:46px;text-align:left;padding-left:11px}table.wp-list-table td.column-download_count{width:6%;text-align:left;padding-left:11px}table.wp-list-table th.column-members_only,table.wp-list-table th.column-redirect_only,table.wp-list-table th.column-featured{width:46px}table.wp-list-table th.column-members_only img,table.wp-list-table th.column-redirect_only img,table.wp-list-table th.column-featured img{padding-top:3px!important}table.wp-list-table th.column-download_count{width:6%}table.wp-list-table th.column-download_count img{padding-top:3px!important}table.wp-list-table img{margin:1px 2px}table.wp-list-table .column-thumb img{padding:2px;margin:0;border:1px solid #dfdfdf;vertical-align:middle;width:32px;height:32px}table.wp-list-table span.na{color:#999}#download-monitor-file .inside{padding:0;margin:0}#download-monitor-file .dlm-metaboxes-wrapper .expand_all,#download-monitor-file .dlm-metaboxes-wrapper .close_all{float:right;margin-left:9px;line-height:22px}#download-monitor-file .dlm-metaboxes-wrapper .expand_all{padding-left:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAI0lEQVQYV2PcvXv3fwY8gJEoBa6urozYDAFpBpswGBTg8yYA3kYtiYVhDhIAAAAASUVORK5CYII=) no-repeat left}#download-monitor-file .dlm-metaboxes-wrapper .close_all{padding-left:14px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAHUlEQVQYV2NkIAAYd+/e/R+fGsIKCFpBUAHt3QAASf0MyQbFJwoAAAAASUVORK5CYII=) no-repeat left}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-file .dlm-metaboxes-wrapper p.toolbar a.button{float:left;margin:0}#download-monitor-file .dlm-metaboxes-wrapper select.attribute_taxonomy,#download-monitor-file .dlm-metaboxes-wrapper button.add_attribute,#download-monitor-file .dlm-metaboxes-wrapper button.add_variable_attribute,#download-monitor-file .dlm-metaboxes-wrapper .fr{float:right;margin:0 0 0 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metaboxes{padding:0 12px 0}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox-sortable-placeholder{border-color:#bbb;background-color:#f5f5f5;margin:9px 0;border-width:1px;border-style:dashed}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox{background:#ececec;border:1px solid #ececec;margin:9px 0!important}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3{margin:0!important;padding:6px!important;font-size:1em!important;overflow:hidden;zoom:1;cursor:move}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 button{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 strong{font-weight:normal;line-height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 select{font-family:sans-serif}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox h3 .handlediv{background-position:6px 5px!important;display:none;height:24px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:hover h3 .handlediv{display:block}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table{width:100%;position:relative;background:#fff;padding:3px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td{text-align:left;padding:6px 6px;vertical-align:top;border:0;line-height:26px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td label{text-align:left;display:block;line-height:21px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input{float:left;min-width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{width:100%;margin:0;display:block;font-size:14px;padding:4px;color:#555}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td textarea{height:7.5em}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td select{width:100%}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.short{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.checkbox{width:auto;min-width:inherit;vertical-align:middle;display:inline;float:none}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.date-picker-field{width:50%;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.minute,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td input.hour{width:2em;min-width:inherit;float:none;display:inline}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table td.attribute_name{width:200px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .plus,#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .minus{margin-top:6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fl{float:left}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox table .fr{float:right}#download-monitor-file .dlm-metaboxes-wrapper .dlm-metabox:first-child h3{background:#eaf2fa;background-image:linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-o-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-moz-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-webkit-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-ms-linear-gradient(bottom,#dae6f2 0,#eaf2fa 100%);background-image:-webkit-gradient(linear,left bottom,left top,color-stop(0,#dae6f2),color-stop(1,#eaf2fa));border-color:#d3deea;color:#21759b}#download-monitor-file .dlm-metaboxes-wrapper .plus{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAARklEQVQYGWP8//8/AzGACV3Rnj17/oMwujiGQnQFMD7RChlBbsRmFcwkEO3i4sJImonIumGmg0xBFifaRKIVgj2DbAUuNgCfThpracSKqwAAAABJRU5ErkJggg==) no-repeat 7px 5px}#download-monitor-file .dlm-metaboxes-wrapper .minus{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAKUlEQVQYlWP8//8/Az7AhFeWGAUsDAwMDHv27MFqj4uLCyNBExhp70gAohwKC5KJ+HQAAAAASUVORK5CYII=) no-repeat 7px 6px}#download-monitor-file .dlm-metaboxes-wrapper .dlm_upload_file{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAMklEQVQYV2NkQAK7d+/+D+K6uroywoThDJgkTAKmCKwAXRJZESMuSQwrkE3C6gbaKQAAYS4fOXZlROQAAAAASUVORK5CYII=) no-repeat 7px 5px}#download-monitor-file .dlm-metaboxes-wrapper .dlm_browse_for_file{padding-left:20px;background:#fefefe url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAK0lEQVQYV2NkIAAYd+/e/R+mxtXVlRFdPYoCbIaBFWDTCVIMkqOXAnw+BQCbpycpLX4gIQAAAABJRU5ErkJggg==) no-repeat 7px 5px}#download-monitor-options .inside{padding:0;margin:0}#download-monitor-options .form-field-checkbox label{display:inline;padding:0 0 4px}#download-monitor-options .form-field-checkbox input{display:inline;width:auto;vertical-align:middle}#download-monitor-options .form-field-checkbox .description{padding:4px 0 0 0;display:block}#download-monitor-options .access_permissions{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#download-monitor-options .access_permissions h4{margin-bottom:.5em;margin:0 0 .5em}#download-monitor-options .access_permissions ul{background:#fff;border:1px solid #dfdfdf;height:110px;overflow:auto;padding:.5em .9em;margin:0}#download-monitor-options p{margin:0!important;border-top:1px solid white;border-bottom:1px solid #dfdfdf;padding:7px 12px!important;overflow:hidden;zoom:1}#insert-download{padding:20px 20px}#insert-download .updated,#insert-download .error{margin-left:0;margin-right:0}#insert-download h2{margin-top:0}#insert-download label{margin:0 0 .25em 0;display:block;font-size:1.1em}#insert-download span.description{display:block}#insert-download select.input,#insert-download input.input{margin:0 0 .25em 0;display:block;width:100%;font-size:1.1em}#insert-download .add_link{float:right}.dlm_addons_wrap .items{overflow:hidden}.dlm_addons_wrap .items li{display:inline-block;margin:0 10px 10px 0!important;padding:0;vertical-align:top;width:250px;border:1px solid #ddd;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),inset 0 -1px 0 rgba(0,0,0,0.1);overflow:hidden;position:relative}.dlm_addons_wrap .items li a{color:inherit;text-decoration:none}.dlm_addons_wrap .items li img{max-width:100%;height:auto;display:block;margin:0;background:#fff}.dlm_addons_wrap .items li h2{margin:0!important;padding:10px 20px!important;line-height:1;background:rgba(255,255,255,0.8);color:#000;position:absolute;max-width:280px;top:20px;left:0;font-size:18px;text-shadow:none}.dlm_addons_wrap .items li .third_party{display:none}.dlm_addons_wrap .items li p{padding:20px!important;margin:0!important;border-top:1px solid #f1f1f1}.dlm_addons_wrap .items li .cost{display:none}
assets/css/admin.less CHANGED
@@ -450,4 +450,62 @@ table.wp-list-table {
450
  .add_link {
451
  float: right;
452
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
450
  .add_link {
451
  float: right;
452
  }
453
+ }
454
+
455
+ /* Addons */
456
+ .dlm_addons_wrap {
457
+ .items {
458
+ overflow: hidden;
459
+ li {
460
+ display: inline-block;
461
+ margin: 0 10px 10px 0 !important;
462
+ padding: 0;
463
+ vertical-align: top;
464
+ width: 250px;
465
+ border: 1px solid #ddd;
466
+ -webkit-box-shadow:
467
+ inset 0 1px 0 rgba(255,255,255,0.2),
468
+ inset 0 -1px 0 rgba(0,0,0,0.1);
469
+ box-shadow:
470
+ inset 0 1px 0 rgba(255,255,255,0.2),
471
+ inset 0 -1px 0 rgba(0,0,0,0.1);
472
+ overflow: hidden;
473
+ position: relative;
474
+ a {
475
+ color: inherit;
476
+ text-decoration: none;
477
+ }
478
+ img {
479
+ max-width: 100%;
480
+ height: auto;
481
+ display: block;
482
+ margin: 0;
483
+ background: #fff;
484
+ }
485
+ h2 {
486
+ margin: 0 !important;
487
+ padding: 10px 20px !important;
488
+ line-height: 1;
489
+ background: rgba(255,255,255,0.8);
490
+ color: #000;
491
+ position: absolute;
492
+ max-width: 280px;
493
+ top: 20px;
494
+ left: 0;
495
+ font-size: 18px;
496
+ text-shadow: none;
497
+ }
498
+ .third_party {
499
+ display: none;
500
+ }
501
+ p {
502
+ padding: 20px !important;
503
+ margin: 0 !important;
504
+ border-top: 1px solid #f1f1f1;
505
+ }
506
+ .cost {
507
+ display: none;
508
+ }
509
+ }
510
+ }
511
  }
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.3.1
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.3.1' );
43
 
44
  // Table for logs
45
  $wpdb->download_log = $wpdb->prefix . 'download_log';
@@ -299,19 +299,20 @@ class WP_DLM {
299
  register_post_type( "dlm_download",
300
  apply_filters( 'dlm_cpt_dlm_download_args', array(
301
  'labels' => array(
302
- 'name' => __( 'Downloads', 'download_monitor' ),
303
- 'singular_name' => __( 'Download', 'download_monitor' ),
304
- 'add_new' => __( 'Add New', 'download_monitor' ),
305
- 'add_new_item' => __( 'Add Download', 'download_monitor' ),
306
- 'edit' => __( 'Edit', 'download_monitor' ),
307
- 'edit_item' => __( 'Edit Download', 'download_monitor' ),
308
- 'new_item' => __( 'New Download', 'download_monitor' ),
309
- 'view' => __( 'View Download', 'download_monitor' ),
310
- 'view_item' => __( 'View Download', 'download_monitor' ),
311
- 'search_items' => __( 'Search Downloads', 'download_monitor' ),
312
- 'not_found' => __( 'No Downloads found', 'download_monitor' ),
313
- 'not_found_in_trash' => __( 'No Downloads found in trash', 'download_monitor' ),
314
- 'parent' => __( 'Parent Download', 'download_monitor' )
 
315
  ),
316
  'description' => __( 'This is where you can create and manage downloads for your site.', 'download_monitor' ),
317
  'public' => false,
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.3.2
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.3.2' );
43
 
44
  // Table for logs
45
  $wpdb->download_log = $wpdb->prefix . 'download_log';
299
  register_post_type( "dlm_download",
300
  apply_filters( 'dlm_cpt_dlm_download_args', array(
301
  'labels' => array(
302
+ 'all_items' => __( 'All Downloads', 'download_monitor' ),
303
+ 'name' => __( 'Downloads', 'download_monitor' ),
304
+ 'singular_name' => __( 'Download', 'download_monitor' ),
305
+ 'add_new' => __( 'Add New', 'download_monitor' ),
306
+ 'add_new_item' => __( 'Add Download', 'download_monitor' ),
307
+ 'edit' => __( 'Edit', 'download_monitor' ),
308
+ 'edit_item' => __( 'Edit Download', 'download_monitor' ),
309
+ 'new_item' => __( 'New Download', 'download_monitor' ),
310
+ 'view' => __( 'View Download', 'download_monitor' ),
311
+ 'view_item' => __( 'View Download', 'download_monitor' ),
312
+ 'search_items' => __( 'Search Downloads', 'download_monitor' ),
313
+ 'not_found' => __( 'No Downloads found', 'download_monitor' ),
314
+ 'not_found_in_trash' => __( 'No Downloads found in trash', 'download_monitor' ),
315
+ 'parent' => __( 'Parent Download', 'download_monitor' )
316
  ),
317
  'description' => __( 'This is where you can create and manage downloads for your site.', 'download_monitor' ),
318
  'public' => false,
includes/admin/class-dlm-addons.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Addons Page
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
7
+
8
+ if ( ! class_exists( 'DLM_Addons' ) ) :
9
+
10
+ /**
11
+ * DLM_Addons Class
12
+ */
13
+ class DLM_Addons {
14
+
15
+ /**
16
+ * Handles output of the reports page in admin.
17
+ */
18
+ public function output() {
19
+
20
+ if ( false === ( $addons = get_transient( 'download_monitor_addons_html' ) ) ) {
21
+
22
+ $raw_addons = wp_remote_get( 'http://mikejolley.com/projects/download-monitor/add-ons/' );
23
+
24
+ if ( ! is_wp_error( $raw_addons ) ) {
25
+
26
+ $raw_addons = wp_remote_retrieve_body( $raw_addons );
27
+
28
+ // Get Products
29
+ $dom = new DOMDocument();
30
+ libxml_use_internal_errors(true);
31
+ $dom->loadHTML( $raw_addons );
32
+
33
+ $xpath = new DOMXPath( $dom );
34
+ $tags = $xpath->query('//ul[@class="items"]');
35
+ foreach ( $tags as $tag ) {
36
+ $addons = $tag->ownerDocument->saveXML( $tag );
37
+ break;
38
+ }
39
+
40
+ $addons = wp_kses_post( $addons );
41
+
42
+ if ( $addons )
43
+ set_transient( 'download_monitor_addons_html', $addons, 60*60*24*7 ); // Cached for a week
44
+ }
45
+ }
46
+
47
+ ?>
48
+ <div class="wrap dlm_addons_wrap">
49
+ <div class="icon32 icon32-posts-dlm_download" id="icon-edit"><br /></div>
50
+ <h2><?php _e( 'Download Monitor Add-ons', 'download_monitor' ); ?></h2>
51
+ <?php echo $addons; ?>
52
+ </div>
53
+ <?php
54
+ }
55
+ }
56
+
57
+ endif;
58
+
59
+ return new DLM_Addons();
includes/admin/class-dlm-admin.php CHANGED
@@ -247,6 +247,17 @@ class DLM_Admin {
247
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Logs', 'download_monitor' ), __( 'Logs', 'download_monitor' ), 'manage_options', 'download-monitor-logs', array( $this, 'log_viewer' ) );
248
 
249
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Settings', 'download_monitor' ), __( 'Settings', 'download_monitor' ), 'manage_options', 'download-monitor-settings', array( $this, 'settings_page' ) );
 
 
 
 
 
 
 
 
 
 
 
250
  }
251
 
252
  /**
247
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Logs', 'download_monitor' ), __( 'Logs', 'download_monitor' ), 'manage_options', 'download-monitor-logs', array( $this, 'log_viewer' ) );
248
 
249
  add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Settings', 'download_monitor' ), __( 'Settings', 'download_monitor' ), 'manage_options', 'download-monitor-settings', array( $this, 'settings_page' ) );
250
+
251
+ if ( apply_filters( 'dlm_show_addons_page', true ) )
252
+ add_submenu_page( 'edit.php?post_type=dlm_download', __( 'Download Monitor Add-ons', 'download_monitor' ), __( 'Add-ons', 'download_monitor' ) , 'manage_options', 'dlm-addons', array( $this, 'addons_page' ) );
253
+ }
254
+
255
+ /**
256
+ * Output addons page
257
+ */
258
+ public function addons_page() {
259
+ $addons = include( 'class-dlm-addons.php' );
260
+ $addons->output();
261
  }
262
 
263
  /**
includes/admin/class-dlm-logging-list-table.php CHANGED
@@ -210,39 +210,33 @@ class DLM_Logging_List_Table extends WP_List_Table {
210
  function prepare_items() {
211
  global $wpdb;
212
 
213
- $per_page = $this->logs_per_page;
214
- $current_page = $this->get_pagenum();
215
  $filter_status = $this->filter_status;
216
- $filter_month = date("m", strtotime( $this->filter_month ) );
217
- $filter_year = date("Y", strtotime( $this->filter_month ) );
218
 
219
  // Init headers
220
  $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );
221
 
 
 
 
 
 
 
 
 
 
 
 
222
  // Total Count of Logs
223
- $total_items = $wpdb->get_results(
224
- "SELECT * FROM {$wpdb->download_log}
225
- WHERE type = 'download'
226
- " . ( $this->filter_status ? "AND download_status = '{$filter_status}'" : "" ) . "
227
- " . ( $this->filter_month ? "AND MONTH(download_date) = {$filter_month}" : "" ) . "
228
- " . ( $this->filter_month ? "AND YEAR(download_date) = {$filter_year}" : "" ) . "
229
- "
230
- );
231
- $total_items = count( $total_items );
232
 
233
  // Get Logs
234
  $this->items = $wpdb->get_results(
235
  $wpdb->prepare(
236
- "SELECT * FROM {$wpdb->download_log}
237
- WHERE type = 'download'
238
- " . ( $this->filter_status ? "AND download_status = '%s'" : "%s" ) . "
239
- " . ( $this->filter_month ? "AND download_date >= '%s'" : "%s" ) . "
240
- " . ( $this->filter_month ? "AND download_date <= '%s'" : "%s" ) . "
241
- ORDER BY download_date DESC
242
- LIMIT %d, %d",
243
- ( $this->filter_status ? $this->filter_status : "" ),
244
- ( $this->filter_month ? date( 'Y-m-01', strtotime( $this->filter_month ) ) : "" ),
245
- ( $this->filter_month ? date( 'Y-m-t', strtotime( $this->filter_month ) ) : "" ),
246
  ( $current_page - 1 ) * $per_page,
247
  $per_page
248
  )
210
  function prepare_items() {
211
  global $wpdb;
212
 
213
+ $per_page = $this->logs_per_page;
214
+ $current_page = $this->get_pagenum();
215
  $filter_status = $this->filter_status;
216
+ $filter_month = date( "m", strtotime( $this->filter_month ) );
217
+ $filter_year = date( "Y", strtotime( $this->filter_month ) );
218
 
219
  // Init headers
220
  $this->_column_headers = array( $this->get_columns(), array(), $this->get_sortable_columns() );
221
 
222
+ $query_where = " type = 'download' ";
223
+
224
+ if ( $this->filter_status )
225
+ $query_where .= " AND download_status = '{$filter_status}' ";
226
+
227
+ if ( $this->filter_month )
228
+ $query_where .= " AND download_date >= '" . date( 'Y-m-01', strtotime( $this->filter_month ) ) . "' ";
229
+
230
+ if ( $this->filter_month )
231
+ $query_where .= " AND download_date <= '" . date( 'Y-m-t', strtotime( $this->filter_month ) ) . "' ";
232
+
233
  // Total Count of Logs
234
+ $total_items = $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->download_log} WHERE {$query_where};" );
 
 
 
 
 
 
 
 
235
 
236
  // Get Logs
237
  $this->items = $wpdb->get_results(
238
  $wpdb->prepare(
239
+ "SELECT * FROM {$wpdb->download_log} WHERE {$query_where} ORDER BY download_date DESC LIMIT %d, %d;",
 
 
 
 
 
 
 
 
 
240
  ( $current_page - 1 ) * $per_page,
241
  $per_page
242
  )
includes/class-dlm-download-handler.php CHANGED
@@ -160,15 +160,25 @@ class DLM_Download_Handler {
160
  exit;
161
  }
162
 
163
- // Log Hit
164
- $version->increase_download_count();
 
165
 
166
- // Trigger Download Action
167
- do_action( 'dlm_downloading', $download, $version, $file_path );
 
 
 
 
 
 
 
 
 
168
 
169
  // Redirect to the file...
170
  if ( $download->redirect_only() || apply_filters( 'dlm_do_not_force', false, $download, $version ) ) {
171
- if ( function_exists( 'dlm_create_log' ) )
172
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
173
 
174
  $file_path = str_replace( ABSPATH, site_url( '/', 'http' ), $file_path );
@@ -226,7 +236,7 @@ class DLM_Download_Handler {
226
  if ( strstr( $file_name, '?' ) )
227
  $file_name = current( explode( '?', $file_name ) );
228
 
229
- // Environment
230
  if ( ! ini_get('safe_mode') )
231
  @set_time_limit(0);
232
 
@@ -239,9 +249,8 @@ class DLM_Download_Handler {
239
  @session_write_close();
240
  @ini_set( 'zlib.output_compression', 'Off' );
241
  @error_reporting(0);
242
- while ( ob_get_level() > 0 ) @ob_end_clean(); // http://stackoverflow.com/questions/5441784/why-does-ob-startob-gzhandler-break-this-website
243
 
244
- // Headers
245
  if ( $is_IE && is_ssl() ) {
246
  // IE bug prevents download via SSL when Cache Control and Pragma no-cache headers set.
247
  header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
@@ -250,8 +259,9 @@ class DLM_Download_Handler {
250
  nocache_headers();
251
  }
252
 
253
- header( "Robots: none" );
254
  header( "Content-Type: " . $mime_type );
 
255
  header( "Content-Disposition: attachment; filename=\"" . $file_name . "\";" );
256
  header( "Content-Transfer-Encoding: binary" );
257
 
@@ -262,11 +272,11 @@ class DLM_Download_Handler {
262
 
263
  if ( get_option( 'dlm_xsendfile_enabled' ) ) {
264
  if ( getcwd() )
265
- $file_path = trim( preg_replace( '`^' . getcwd() . '`' , '', $file_path ), '/' );
266
 
267
  if ( function_exists( 'apache_get_modules' ) && in_array( 'mod_xsendfile', apache_get_modules() ) ) {
268
 
269
- if ( function_exists( 'dlm_create_log' ) )
270
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
271
 
272
  header("X-Sendfile: $file_path");
@@ -274,7 +284,7 @@ class DLM_Download_Handler {
274
 
275
  } elseif ( stristr( getenv( 'SERVER_SOFTWARE' ), 'lighttpd' ) ) {
276
 
277
- if ( function_exists( 'dlm_create_log' ) )
278
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
279
 
280
  header( "X-LIGHTTPD-send-file: $file_path" );
@@ -282,7 +292,7 @@ class DLM_Download_Handler {
282
 
283
  } elseif ( stristr( getenv( 'SERVER_SOFTWARE' ), 'nginx' ) || stristr( getenv( 'SERVER_SOFTWARE' ), 'cherokee' ) ) {
284
 
285
- if ( function_exists( 'dlm_create_log' ) )
286
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
287
 
288
  header( "X-Accel-Redirect: /$file_path" );
@@ -315,19 +325,19 @@ class DLM_Download_Handler {
315
  if ( $this->readfile_chunked( $file_path, $range ) ) {
316
 
317
  // Complete!
318
- if ( function_exists( 'dlm_create_log' ) )
319
  dlm_create_log( 'download', 'completed', '', $download, $version );
320
 
321
  } elseif ( $remote_file ) {
322
 
323
  // Redirect - we can't track if this completes or not
324
- if ( function_exists( 'dlm_create_log' ) )
325
  dlm_create_log( 'download', 'redirected', __( 'Redirected to remote file.', 'download_monitor' ), $download, $version );
326
 
327
  header( 'Location: ' . $file_path );
328
 
329
  } else {
330
- if ( function_exists( 'dlm_create_log' ) )
331
  dlm_create_log( 'download', 'failed', __( 'File not found', 'download_monitor' ), $download, $version );
332
 
333
  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 ) );
160
  exit;
161
  }
162
 
163
+ if ( empty( $_COOKIE['wp_dlm_downloading'] ) || $download->id != $_COOKIE['wp_dlm_downloading'] ) {
164
+ // Increase download count
165
+ $version->increase_download_count();
166
 
167
+ // Trigger Download Action
168
+ do_action( 'dlm_downloading', $download, $version, $file_path );
169
+
170
+ // Set cookie to prevent double logging
171
+ setcookie( 'wp_dlm_downloading', $download->id, time()+60, COOKIEPATH, COOKIE_DOMAIN, false );
172
+
173
+ // Logging
174
+ $this->log = function_exists( 'dlm_create_log' );
175
+ } else {
176
+ $this->log = false;
177
+ }
178
 
179
  // Redirect to the file...
180
  if ( $download->redirect_only() || apply_filters( 'dlm_do_not_force', false, $download, $version ) ) {
181
+ if ( $this->log )
182
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
183
 
184
  $file_path = str_replace( ABSPATH, site_url( '/', 'http' ), $file_path );
236
  if ( strstr( $file_name, '?' ) )
237
  $file_name = current( explode( '?', $file_name ) );
238
 
239
+ // Environment + headers
240
  if ( ! ini_get('safe_mode') )
241
  @set_time_limit(0);
242
 
249
  @session_write_close();
250
  @ini_set( 'zlib.output_compression', 'Off' );
251
  @error_reporting(0);
252
+ @ob_clean(); // Clear the output buffer
253
 
 
254
  if ( $is_IE && is_ssl() ) {
255
  // IE bug prevents download via SSL when Cache Control and Pragma no-cache headers set.
256
  header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
259
  nocache_headers();
260
  }
261
 
262
+ header( "X-Robots-Tag: noindex, nofollow", true );
263
  header( "Content-Type: " . $mime_type );
264
+ header( "Content-Description: File Transfer" );
265
  header( "Content-Disposition: attachment; filename=\"" . $file_name . "\";" );
266
  header( "Content-Transfer-Encoding: binary" );
267
 
272
 
273
  if ( get_option( 'dlm_xsendfile_enabled' ) ) {
274
  if ( getcwd() )
275
+ $file_path = trim( preg_replace( '`^' . str_replace( '\\', '/', getcwd() ) . '`' , '', $file_path ), '/' );
276
 
277
  if ( function_exists( 'apache_get_modules' ) && in_array( 'mod_xsendfile', apache_get_modules() ) ) {
278
 
279
+ if ( $this->log )
280
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
281
 
282
  header("X-Sendfile: $file_path");
284
 
285
  } elseif ( stristr( getenv( 'SERVER_SOFTWARE' ), 'lighttpd' ) ) {
286
 
287
+ if ( $this->log )
288
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
289
 
290
  header( "X-LIGHTTPD-send-file: $file_path" );
292
 
293
  } elseif ( stristr( getenv( 'SERVER_SOFTWARE' ), 'nginx' ) || stristr( getenv( 'SERVER_SOFTWARE' ), 'cherokee' ) ) {
294
 
295
+ if ( $this->log )
296
  dlm_create_log( 'download', 'redirected', __( 'Redirected to file', 'download_monitor' ), $download, $version );
297
 
298
  header( "X-Accel-Redirect: /$file_path" );
325
  if ( $this->readfile_chunked( $file_path, $range ) ) {
326
 
327
  // Complete!
328
+ if ( $this->log )
329
  dlm_create_log( 'download', 'completed', '', $download, $version );
330
 
331
  } elseif ( $remote_file ) {
332
 
333
  // Redirect - we can't track if this completes or not
334
+ if ( $this->log )
335
  dlm_create_log( 'download', 'redirected', __( 'Redirected to remote file.', 'download_monitor' ), $download, $version );
336
 
337
  header( 'Location: ' . $file_path );
338
 
339
  } else {
340
+ if ( $this->log )
341
  dlm_create_log( 'download', 'failed', __( 'File not found', 'download_monitor' ), $download, $version );
342
 
343
  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 ) );
includes/class-dlm-logging.php CHANGED
@@ -16,6 +16,8 @@ class DLM_Logging {
16
  public function create_log( $type, $status, $message, $download, $version ) {
17
  global $wpdb;
18
 
 
 
19
  $wpdb->insert(
20
  $wpdb->download_log,
21
  array(
@@ -36,7 +38,7 @@ class DLM_Logging {
36
  '%s',
37
  '%s',
38
  '%d',
39
- '%s',
40
  '%s',
41
  '%s',
42
  '%s'
@@ -63,7 +65,12 @@ class DLM_Logging {
63
  * @return void
64
  */
65
  private function get_user_ua() {
66
- return sanitize_text_field( isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '' );
 
 
 
 
 
67
  }
68
  }
69
 
16
  public function create_log( $type, $status, $message, $download, $version ) {
17
  global $wpdb;
18
 
19
+ $wpdb->hide_errors();
20
+
21
  $wpdb->insert(
22
  $wpdb->download_log,
23
  array(
38
  '%s',
39
  '%s',
40
  '%d',
41
+ '%d',
42
  '%s',
43
  '%s',
44
  '%s'
65
  * @return void
66
  */
67
  private function get_user_ua() {
68
+ $ua = sanitize_text_field( isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '' );
69
+
70
+ if ( strlen( $ua ) > 200 )
71
+ $ua = substr( $ua, 0, 199 );
72
+
73
+ return $ua;
74
  }
75
  }
76
 
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.7
7
- Stable tag: 1.3.1
8
  License: GPLv3
9
 
10
  Download Monitor is a plugin for uploading and managing downloads, tracking downloads, and displaying links.
@@ -108,6 +108,14 @@ Admin hits are not counted, log out and try!
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
111
  = 1.3.1 =
112
  * Added some new hooks
113
  * FR and SR_RS updates
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.7
7
+ Stable tag: 1.3.2
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.3.2 =
112
+ * Cleaned up log table queries
113
+ * Tweaked download handler headers
114
+ * Tweaked logging
115
+ * Limit UA to 200
116
+ * Setcookie to prevent double logging
117
+ * Addons page (disable using add_filter( 'dlm_show_addons_page', '__return_false' ); )
118
+
119
  = 1.3.1 =
120
  * Added some new hooks
121
  * FR and SR_RS updates