Simple Download Monitor - Version 3.4.6

Version Description

  • Added option to delete plugin's settings, data and tables from database.
  • Added "Login Page URL" option to optionally specify a login page URL when user is required to be logged in to download.
Download this release

Release Info

Developer mra13
Plugin Icon 128x128 Simple Download Monitor
Version 3.4.6
Comparing to
See all releases

Code changes from version 3.4.3 to 3.4.6

css/images/ui-icons_444444_256x240.png ADDED
Binary file
css/images/ui-icons_555555_256x240.png ADDED
Binary file
css/images/ui-icons_777620_256x240.png ADDED
Binary file
css/images/ui-icons_777777_256x240.png ADDED
Binary file
css/images/ui-icons_cc0000_256x240.png ADDED
Binary file
css/images/ui-icons_ffffff_256x240.png ADDED
Binary file
css/jquery.ui.min.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.12.1 - 2017-07-30
2
+ * http://jqueryui.com
3
+ * Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=base&cornerRadiusShadow=8px&offsetLeftShadow=0px&offsetTopShadow=0px&thicknessShadow=5px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=666666&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cc0000&fcError=5f3f3f&borderColorError=f1a899&bgTextureError=flat&bgColorError=fddfdf&iconColorHighlight=777620&fcHighlight=777620&borderColorHighlight=dad55e&bgTextureHighlight=flat&bgColorHighlight=fffa90&iconColorActive=ffffff&fcActive=ffffff&borderColorActive=003eff&bgTextureActive=flat&bgColorActive=007fff&iconColorHover=555555&fcHover=2b2b2b&borderColorHover=cccccc&bgTextureHover=flat&bgColorHover=ededed&iconColorDefault=777777&fcDefault=454545&borderColorDefault=c5c5c5&bgTextureDefault=flat&bgColorDefault=f6f6f6&iconColorContent=444444&fcContent=333333&borderColorContent=dddddd&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=444444&fcHeader=333333&borderColorHeader=dddddd&bgTextureHeader=flat&bgColorHeader=e9e9e9&cornerRadius=3px&fwDefault=normal&fsDefault=1em&ffDefault=Arial%2CHelvetica%2Csans-serif
5
+ * Copyright jQuery Foundation and other contributors; Licensed MIT */
6
+
7
+ .ui-draggable-handle{-ms-touch-action:none;touch-action:none}.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block;-ms-touch-action:none;touch-action:none}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable{-ms-touch-action:none;touch-action:none}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-sortable-handle{-ms-touch-action:none;touch-action:none}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin:2px 0 0 0;padding:.5em .5em .5em .7em;font-size:100%}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0}.ui-button{padding:.4em 1em;display:inline-block;position:relative;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2em;box-sizing:border-box;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-button-icon-only{text-indent:0}.ui-button-icon-only .ui-icon{position:absolute;top:50%;left:50%;margin-top:-8px;margin-left:-8px}.ui-button.ui-icon-notext .ui-icon{padding:0;width:2.1em;height:2.1em;text-indent:-9999px;white-space:nowrap}input.ui-button.ui-icon-notext .ui-icon{width:auto;height:auto;text-indent:0;white-space:normal;padding:.4em 1em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-controlgroup{vertical-align:middle;display:inline-block}.ui-controlgroup > .ui-controlgroup-item{float:left;margin-left:0;margin-right:0}.ui-controlgroup > .ui-controlgroup-item:focus,.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus{z-index:9999}.ui-controlgroup-vertical > .ui-controlgroup-item{display:block;float:none;width:100%;margin-top:0;margin-bottom:0;text-align:left}.ui-controlgroup-vertical .ui-controlgroup-item{box-sizing:border-box}.ui-controlgroup .ui-controlgroup-label{padding:.4em 1em}.ui-controlgroup .ui-controlgroup-label span{font-size:80%}.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item{border-left:none}.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item{border-top:none}.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content{border-right:none}.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content{border-bottom:none}.ui-controlgroup-vertical .ui-spinner-input{width:75%;width:calc( 100% - 2.4em )}.ui-controlgroup-vertical .ui-spinner .ui-spinner-up{border-top-style:solid}.ui-checkboxradio-label .ui-icon-background{box-shadow:inset 1px 1px 1px #ccc;border-radius:.12em;border:none}.ui-checkboxradio-radio-label .ui-icon-background{width:16px;height:16px;border-radius:1em;overflow:visible;border:none}.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon,.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon{background-image:none;width:8px;height:8px;border-width:4px;border-style:solid}.ui-checkboxradio-disabled{pointer-events:none}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:45%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker .ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat;left:.5em;top:.3em}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:20px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-n{height:2px;top:0}.ui-dialog .ui-resizable-e{width:2px;right:0}.ui-dialog .ui-resizable-s{height:2px;bottom:0}.ui-dialog .ui-resizable-w{width:2px;left:0}.ui-dialog .ui-resizable-se,.ui-dialog .ui-resizable-sw,.ui-dialog .ui-resizable-ne,.ui-dialog .ui-resizable-nw{width:7px;height:7px}.ui-dialog .ui-resizable-se{right:0;bottom:0}.ui-dialog .ui-resizable-sw{left:0;bottom:0}.ui-dialog .ui-resizable-ne{right:0;top:0}.ui-dialog .ui-resizable-nw{left:0;top:0}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw==");height:100%;filter:alpha(opacity=25);opacity:0.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-selectmenu-menu{padding:0;margin:0;position:absolute;top:0;left:0;display:none}.ui-selectmenu-menu .ui-menu{overflow:auto;overflow-x:hidden;padding-bottom:1px}.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup{font-size:1em;font-weight:bold;line-height:1.5;padding:2px 0.4em;margin:0.5em 0 0 0;height:auto;border:0}.ui-selectmenu-open{display:block}.ui-selectmenu-text{display:block;margin-right:20px;overflow:hidden;text-overflow:ellipsis}.ui-selectmenu-button.ui-button{text-align:left;white-space:nowrap;width:14em}.ui-selectmenu-icon.ui-icon{float:right;margin-top:0}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default;-ms-touch-action:none;touch-action:none}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;color:inherit;padding:.222em 0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:2em}.ui-spinner-button{width:1.6em;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top-style:none;border-bottom-style:none;border-right-style:none}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav .ui-tabs-anchor{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor,.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor{cursor:text}.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Arial,Helvetica,sans-serif;font-size:1em}.ui-widget.ui-widget-content{border:1px solid #c5c5c5}.ui-widget-content{border:1px solid #ddd;background:#fff;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #ddd;background:#e9e9e9;color:#333;font-weight:bold}.ui-widget-header a{color:#333}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default,.ui-button,html .ui-button.ui-state-disabled:hover,html .ui-button.ui-state-disabled:active{border:1px solid #c5c5c5;background:#f6f6f6;font-weight:normal;color:#454545}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited,a.ui-button,a:link.ui-button,a:visited.ui-button,.ui-button{color:#454545;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus,.ui-button:hover,.ui-button:focus{border:1px solid #ccc;background:#ededed;font-weight:normal;color:#2b2b2b}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited,.ui-state-focus a,.ui-state-focus a:hover,.ui-state-focus a:link,.ui-state-focus a:visited,a.ui-button:hover,a.ui-button:focus{color:#2b2b2b;text-decoration:none}.ui-visual-focus{box-shadow:0 0 3px 1px rgb(94,158,214)}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active,a.ui-button:active,.ui-button:active,.ui-button.ui-state-active:hover{border:1px solid #003eff;background:#007fff;font-weight:normal;color:#fff}.ui-icon-background,.ui-state-active .ui-icon-background{border:#003eff;background-color:#fff}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#fff;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #dad55e;background:#fffa90;color:#777620}.ui-state-checked{border:1px solid #dad55e;background:#fffa90}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#777620}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #f1a899;background:#fddfdf;color:#5f3f3f}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#5f3f3f}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#5f3f3f}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-widget-header .ui-icon{background-image:url("images/ui-icons_444444_256x240.png")}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon,.ui-button:hover .ui-icon,.ui-button:focus .ui-icon{background-image:url("images/ui-icons_555555_256x240.png")}.ui-state-active .ui-icon,.ui-button:active .ui-icon{background-image:url("images/ui-icons_ffffff_256x240.png")}.ui-state-highlight .ui-icon,.ui-button .ui-state-highlight.ui-icon{background-image:url("images/ui-icons_777620_256x240.png")}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url("images/ui-icons_cc0000_256x240.png")}.ui-button .ui-icon{background-image:url("images/ui-icons_777777_256x240.png")}.ui-icon-blank{background-position:16px 16px}.ui-icon-caret-1-n{background-position:0 0}.ui-icon-caret-1-ne{background-position:-16px 0}.ui-icon-caret-1-e{background-position:-32px 0}.ui-icon-caret-1-se{background-position:-48px 0}.ui-icon-caret-1-s{background-position:-65px 0}.ui-icon-caret-1-sw{background-position:-80px 0}.ui-icon-caret-1-w{background-position:-96px 0}.ui-icon-caret-1-nw{background-position:-112px 0}.ui-icon-caret-2-n-s{background-position:-128px 0}.ui-icon-caret-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-65px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-65px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:1px -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:3px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:3px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:3px}.ui-widget-overlay{background:#aaa;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{-webkit-box-shadow:0 0 5px #666;box-shadow:0 0 5px #666}
css/sdm_addons_listing.css ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .sdm_addon_item_canvas{
2
+ font-family:sans-serif,arial;
3
+ font-size:12px;
4
+ border:1px solid #ddd;
5
+ box-sizing: border-box;
6
+ display:block;
7
+ float:left;
8
+ margin:3px 12px 12px 0;
9
+ padding:15px;
10
+ position:relative;
11
+ width:300px;
12
+ height:400px;
13
+ }
14
+ .sdm_addon_item_canvas:hover{border-color:#d6d6d6;}
15
+ .sdm_addon_item_thumb img {padding:5px; border: 1px solid #ddd;}
16
+ .sdm_addon_item_thumb a img {border: 1px solid #ccc;}
17
+ .sdm_addon_item_body{line-height:22px;height:170px;overflow:hidden;}
18
+ .sdm_addon_item_name{font-size:16px;font-weight:bold;text-align: center;margin:10px 10px 10px 0px;}
19
+ .sdm_addon_item_description{margin:10px 10px 5px 0px;text-align:justify;overflow:hidden;height:70px;}
20
+ .sdm_addon_clear{clear:both;}
21
+ .sdm_addon_item_details_link{
22
+ text-align: center;
23
+ }
24
+ .sdm_addon_item_details_link a{
25
+ border: 3px solid #2d3140;
26
+ color: #2d3140;
27
+ display: inline-block;
28
+ padding: 5px 15px;
29
+ text-decoration: none !important;
30
+ }
31
+ .sdm_addon_item_details_link a:hover{
32
+ background-color: #2d3140;
33
+ color: #FFF;
34
+ }
css/sdm_admin_styles.css CHANGED
@@ -1,26 +1,3 @@
1
- /*
2
- ** Used for AJAX Loading overlay
3
- */
4
- .modal {
5
- display: none;
6
- position: fixed;
7
- z-index: 1000;
8
- top: 0;
9
- left: 0;
10
- height: 100%;
11
- width: 100%;
12
- background: rgba( 255, 255, 255, .8 )
13
- url('images/ajax.gif')
14
- 50% 50%
15
- no-repeat;
16
- }
17
- body.loading {
18
- overflow: hidden;
19
- }
20
- body.loading .modal {
21
- display: block;
22
- }
23
-
24
 
25
  /* Download button TinyMCE icon */
26
  i.mce-i-sdm-download::before {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  /* Download button TinyMCE icon */
3
  i.mce-i-sdm-download::before {
images/addons/sdm-allow-uploads-addon-icon.png ADDED
Binary file
images/addons/sdm-amazon-s3-addon-icon.png ADDED
Binary file
images/addons/sdm-hidden-downloads-addon-icon.png ADDED
Binary file
images/addons/sdm-squeeze-form-addon-icon.png ADDED
Binary file
includes/admin-side/sdm-admin-add-ons-page.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $output = '';
3
+ echo '<link type="text/css" rel="stylesheet" href="' . WP_SIMPLE_DL_MONITOR_URL . '/css/sdm_addons_listing.css" />' . "\n";
4
+ ?>
5
+
6
+ <div class="wrap">
7
+ <h1>Add-ons</h1>
8
+
9
+ <div id="poststuff"><div id="post-body">
10
+
11
+ <?php
12
+ $addons_data = array();
13
+
14
+ $addon_1 = array(
15
+ "name" => "Amazon S3 Integration",
16
+ "thumbnail" => WP_SIMPLE_DL_MONITOR_URL . "/images/addons/sdm-amazon-s3-addon-icon.png",
17
+ "description" => "Allows you to securely store and deliver digital downloads using Amazon's Simple Storage Service (S3)",
18
+ "page_url" => "https://simple-download-monitor.com/amazon-s3-integration-addon/",
19
+ );
20
+ array_push($addons_data, $addon_1);
21
+
22
+ $addon_2 = array(
23
+ "name" => "Squeeze Form Addon",
24
+ "thumbnail" => WP_SIMPLE_DL_MONITOR_URL . "/images/addons/sdm-squeeze-form-addon-icon.png",
25
+ "description" => "This addone lets you collect visitor's name and email address in exchange for a downloadable item of your site.",
26
+ "page_url" => "https://simple-download-monitor.com/squeeze-form-addon-for-simple-download-monitor/",
27
+ );
28
+ array_push($addons_data, $addon_2);
29
+
30
+ $addon_3 = array(
31
+ "name" => "Hidden Downloads",
32
+ "thumbnail" => WP_SIMPLE_DL_MONITOR_URL . "/images/addons/sdm-hidden-downloads-addon-icon.png",
33
+ "description" => "Allows you to create hidden download buttons for your downloadable items so the actual location of the file is never revealed.",
34
+ "page_url" => "https://simple-download-monitor.com/hidden-downloads-for-simple-download-monitor/",
35
+ );
36
+ array_push($addons_data, $addon_3);
37
+
38
+ $addon_4 = array(
39
+ "name" => "All File Type Uploads",
40
+ "thumbnail" => WP_SIMPLE_DL_MONITOR_URL . "/images/addons/sdm-allow-uploads-addon-icon.png",
41
+ "description" => "WordPress by default doesn't allow you to upload all file types. This addon will remove the limitation and allow you to upload all file types.",
42
+ "page_url" => "https://simple-download-monitor.com/allow-more-file-types-to-be-uploaded-via-wordpress/",
43
+ );
44
+ array_push($addons_data, $addon_4);
45
+
46
+ /*** Show the addons list ***/
47
+ foreach ($addons_data as $addon) {
48
+ $output .= '<div class="sdm_addon_item_canvas">';
49
+
50
+ $output .= '<div class="sdm_addon_item_thumb">';
51
+ $img_src = $addon['thumbnail'];
52
+ $output .= '<img src="' . $img_src . '" alt="' . $addon['name'] . '">';
53
+ $output .= '</div>'; //end thumbnail
54
+
55
+ $output .='<div class="sdm_addon_item_body">';
56
+ $output .='<div class="sdm_addon_item_name">';
57
+ $output .= '<a href="' . $addon['page_url'] . '" target="_blank">' . $addon['name'] . '</a>';
58
+ $output .='</div>'; //end name
59
+
60
+ $output .='<div class="sdm_addon_item_description">';
61
+ $output .= $addon['description'];
62
+ $output .='</div>'; //end description
63
+
64
+ $output .='<div class="sdm_addon_item_details_link">';
65
+ $output .='<a href="' . $addon['page_url'] . '" class="sdm_addon_view_details" target="_blank">View Details</a>';
66
+ $output .='</div>'; //end detils link
67
+ $output .='</div>'; //end body
68
+
69
+ $output .= '</div>'; //end canvas
70
+ }
71
+
72
+ echo $output;
73
+ ?>
74
+
75
+ </div></div><!-- end of poststuff and post-body -->
76
+ </div><!-- end of .wrap -->
includes/sdm-admin-menu-handler.php CHANGED
@@ -1,21 +1,24 @@
1
  <?php
2
-
3
  /*
4
  * Creates/adds the other admin menu page links to the main SDM custom post type menu
5
  */
 
6
  function sdm_handle_admin_menu() {
7
-
8
- //***** Create the 'logs' and 'settings' submenu pages
9
  $sdm_logs_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Logs', 'simple-download-monitor'), __('Logs', 'simple-download-monitor'), 'manage_options', 'logs', 'sdm_create_logs_page');
 
10
  $sdm_settings_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Settings', 'simple-download-monitor'), __('Settings', 'simple-download-monitor'), 'manage_options', 'settings', 'sdm_create_settings_page');
 
11
  }
12
 
13
  /*
14
  * Settings menu page
15
  */
 
16
  function sdm_create_settings_page() {
17
  echo '<div class="wrap">';
18
- //echo '<div id="poststuff"><div id="post-body">';
19
  ?>
20
  <h1><?php _e('Simple Download Monitor Settings Page', 'simple-download-monitor') ?></h1>
21
 
@@ -36,7 +39,7 @@ function sdm_create_settings_page() {
36
  submit_button();
37
  ?>
38
  <!-- END GENERAL OPTIONS DIV -->
39
-
40
  <!-- BEGIN ADMIN OPTIONS DIV -->
41
  <?php
42
  // This prints out all hidden setting fields
@@ -57,6 +60,57 @@ function sdm_create_settings_page() {
57
  ?>
58
  <!-- END COLORS OPTIONS DIV -->
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  <!-- End of settings page form -->
61
  </form>
62
 
@@ -72,37 +126,37 @@ function sdm_create_settings_page() {
72
  /*
73
  * * Logs menu page
74
  */
 
75
  function sdm_create_logs_page() {
76
  global $wpdb;
77
 
78
  if (isset($_POST['sdm_export_log_entries'])) {
79
- //Export log entries
80
- $log_file_url = sdm_export_download_logs_to_csv();
81
  echo '<div id="message" class="updated"><p>';
82
  _e('Log entries exported! Click on the following link to download the file.', 'simple-download-monitor');
83
- echo '<br /><br /><a href="'.$log_file_url.'">' . __('Download Logs CSV File', 'simple-download-monitor') . '</a>';
84
- echo '</p></div>';
85
  }
86
-
87
  if (isset($_POST['sdm_reset_log_entries'])) {
88
- //reset log entries
89
- $table_name = $wpdb->prefix . 'sdm_downloads';
90
- $query = "TRUNCATE $table_name";
91
- $result = $wpdb->query($query);
92
  echo '<div id="message" class="updated fade"><p>';
93
  _e('Download log entries deleted!', 'simple-download-monitor');
94
- echo '</p></div>';
95
  }
96
-
97
- /*** Display the logs table ***/
98
- //Create an instance of our package class...
99
  $sdmListTable = new sdm_List_Table();
100
- //Fetch, prepare, sort, and filter our data...
101
  $sdmListTable->prepare_items();
102
  ?>
103
  <div class="wrap">
104
-
105
- <div id="icon-users" class="icon32"><br/></div>
106
  <h2><?php _e('Download Logs', 'simple-download-monitor'); ?></h2>
107
 
108
  <div style="background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;">
@@ -110,45 +164,185 @@ function sdm_create_logs_page() {
110
  </div>
111
 
112
  <div id="poststuff"><div id="post-body">
113
-
114
- <!-- Log export button -->
115
- <div class="postbox">
116
- <h3 class="hndle"><label for="title"><?php _e('Export Download Log Entries', 'simple-download-monitor'); ?></label></h3>
117
- <div class="inside">
118
- <form method="post" action="" onSubmit="return confirm('Are you sure you want to export all the log entries?');" >
119
- <div class="submit">
120
- <input type="submit" class="button" name="sdm_export_log_entries" value="<?php _e('Export Log Entries to CSV File', 'simple-download-monitor'); ?>" />
121
- </div>
122
- </form>
123
- </div></div>
124
 
125
- <!-- Log reset button -->
126
- <div class="postbox">
127
- <h3 class="hndle"><label for="title"><?php _e('Reset Download Log Entries', 'simple-download-monitor'); ?></label></h3>
128
- <div class="inside">
129
- <form method="post" action="" onSubmit="return confirm('Are you sure you want to reset all the log entries to a CSV file?');" >
130
- <div class="submit">
131
- <input type="submit" class="button" name="sdm_reset_log_entries" value="<?php _e('Reset Log Entries', 'simple-download-monitor'); ?>" />
132
- </div>
133
- </form>
134
- </div></div>
135
-
136
- </div></div><!-- end of .poststuff and .post-body -->
137
-
 
 
 
 
 
 
 
 
 
 
 
138
  <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->
139
  <form id="sdm_downloads-filter" method="post">
140
  <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']) ?>" />
141
  <!-- Now we can render the completed list table -->
142
  <?php $sdmListTable->display() ?>
143
  </form>
144
-
145
  </div><!-- end of wrap -->
146
  <script type="text/javascript">
147
- jQuery(document).ready(function($) {
148
- $('.fade').click(function() {
149
  $(this).fadeOut('slow');
150
  });
151
  });
152
  </script>
153
  <?php
154
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
 
2
  /*
3
  * Creates/adds the other admin menu page links to the main SDM custom post type menu
4
  */
5
+
6
  function sdm_handle_admin_menu() {
7
+
8
+ //***** Create the 'logs' and 'settings' submenu pages
9
  $sdm_logs_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Logs', 'simple-download-monitor'), __('Logs', 'simple-download-monitor'), 'manage_options', 'logs', 'sdm_create_logs_page');
10
+ $sdm_logs_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Stats', 'simple-download-monitor'), __('Stats', 'simple-download-monitor'), 'manage_options', 'sdm-stats', 'sdm_create_stats_page');
11
  $sdm_settings_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Settings', 'simple-download-monitor'), __('Settings', 'simple-download-monitor'), 'manage_options', 'settings', 'sdm_create_settings_page');
12
+ $sdm_addons_page = add_submenu_page('edit.php?post_type=sdm_downloads', __('Add-ons', 'simple-download-monitor'), __('Add-ons', 'simple-download-monitor'), 'manage_options', 'sdm-addons', 'sdm_create_addons_page');
13
  }
14
 
15
  /*
16
  * Settings menu page
17
  */
18
+
19
  function sdm_create_settings_page() {
20
  echo '<div class="wrap">';
21
+ //echo '<div id="poststuff"><div id="post-body">';
22
  ?>
23
  <h1><?php _e('Simple Download Monitor Settings Page', 'simple-download-monitor') ?></h1>
24
 
39
  submit_button();
40
  ?>
41
  <!-- END GENERAL OPTIONS DIV -->
42
+
43
  <!-- BEGIN ADMIN OPTIONS DIV -->
44
  <?php
45
  // This prints out all hidden setting fields
60
  ?>
61
  <!-- END COLORS OPTIONS DIV -->
62
 
63
+ <!-- BEGIN DEBUG OPTIONS DIV -->
64
+ <?php
65
+ // This prints out all hidden setting fields
66
+ do_settings_sections('sdm_debug_section');
67
+ settings_fields('sdm_downloads_options');
68
+
69
+ submit_button();
70
+ ?>
71
+ <!-- END DEBUG OPTIONS DIV -->
72
+ <!-- BEGIN DELDATA OPTIONS DIV -->
73
+ <?php
74
+ // This prints out all hidden setting fields
75
+ do_settings_sections('sdm_deldata_section');
76
+ settings_fields('sdm_downloads_options');
77
+
78
+ $deldataNonce = wp_create_nonce('sdm_delete_data');
79
+ ?>
80
+ <!-- END DELDATA OPTIONS DIV -->
81
+
82
+ <script>
83
+ jQuery('button#sdmDeleteData').click(function (e) {
84
+ e.preventDefault();
85
+ jQuery(this).attr('disabled', 'disabled');
86
+ if (confirm("<?php echo __("Are you sure want to delete all plugin's data and deactivate plugin?", 'simple-download-monitor'); ?>")) {
87
+ jQuery.post(ajaxurl,
88
+ {'action': 'sdm_delete_data', 'nonce': '<?php echo $deldataNonce; ?>'},
89
+ function (result) {
90
+ if (result === '1') {
91
+ alert('<?php echo __('Data has been deleted and plugin deactivated. Click OK to go to Plugins page.', 'simple-download-monitor'); ?>');
92
+ jQuery(location).attr('href', '<?php echo get_admin_url().'plugins.php'; ?>');
93
+ return true;
94
+ } else {
95
+ alert('<?php echo __('Error occured.', 'simple-download-monitor'); ?>');
96
+ }
97
+ });
98
+ } else {
99
+ jQuery(this).removeAttr('disabled');
100
+ }
101
+ });
102
+ jQuery('a#sdm-reset-log').click(function (e) {
103
+ e.preventDefault();
104
+ jQuery.post(ajaxurl,
105
+ {'action': 'sdm_reset_log'},
106
+ function (result) {
107
+ if (result === '1') {
108
+ alert('Log has been reset.');
109
+ }
110
+ });
111
+ });
112
+ </script>
113
+
114
  <!-- End of settings page form -->
115
  </form>
116
 
126
  /*
127
  * * Logs menu page
128
  */
129
+
130
  function sdm_create_logs_page() {
131
  global $wpdb;
132
 
133
  if (isset($_POST['sdm_export_log_entries'])) {
134
+ //Export log entries
135
+ $log_file_url = sdm_export_download_logs_to_csv();
136
  echo '<div id="message" class="updated"><p>';
137
  _e('Log entries exported! Click on the following link to download the file.', 'simple-download-monitor');
138
+ echo '<br /><br /><a href="' . $log_file_url . '">' . __('Download Logs CSV File', 'simple-download-monitor') . '</a>';
139
+ echo '</p></div>';
140
  }
141
+
142
  if (isset($_POST['sdm_reset_log_entries'])) {
143
+ //reset log entries
144
+ $table_name = $wpdb->prefix . 'sdm_downloads';
145
+ $query = "TRUNCATE $table_name";
146
+ $result = $wpdb->query($query);
147
  echo '<div id="message" class="updated fade"><p>';
148
  _e('Download log entries deleted!', 'simple-download-monitor');
149
+ echo '</p></div>';
150
  }
151
+
152
+ /* * * Display the logs table ** */
153
+ //Create an instance of our package class...
154
  $sdmListTable = new sdm_List_Table();
155
+ //Fetch, prepare, sort, and filter our data...
156
  $sdmListTable->prepare_items();
157
  ?>
158
  <div class="wrap">
159
+
 
160
  <h2><?php _e('Download Logs', 'simple-download-monitor'); ?></h2>
161
 
162
  <div style="background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;">
164
  </div>
165
 
166
  <div id="poststuff"><div id="post-body">
 
 
 
 
 
 
 
 
 
 
 
167
 
168
+ <!-- Log export button -->
169
+ <div class="postbox">
170
+ <h3 class="hndle"><label for="title"><?php _e('Export Download Log Entries', 'simple-download-monitor'); ?></label></h3>
171
+ <div class="inside">
172
+ <form method="post" action="" onSubmit="return confirm('Are you sure you want to export all the log entries?');" >
173
+ <div class="submit">
174
+ <input type="submit" class="button" name="sdm_export_log_entries" value="<?php _e('Export Log Entries to CSV File', 'simple-download-monitor'); ?>" />
175
+ </div>
176
+ </form>
177
+ </div></div>
178
+
179
+ <!-- Log reset button -->
180
+ <div class="postbox">
181
+ <h3 class="hndle"><label for="title"><?php _e('Reset Download Log Entries', 'simple-download-monitor'); ?></label></h3>
182
+ <div class="inside">
183
+ <form method="post" action="" onSubmit="return confirm('Are you sure you want to reset all the log entries to a CSV file?');" >
184
+ <div class="submit">
185
+ <input type="submit" class="button" name="sdm_reset_log_entries" value="<?php _e('Reset Log Entries', 'simple-download-monitor'); ?>" />
186
+ </div>
187
+ </form>
188
+ </div></div>
189
+
190
+ </div></div><!-- end of .poststuff and .post-body -->
191
+
192
  <!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->
193
  <form id="sdm_downloads-filter" method="post">
194
  <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']) ?>" />
195
  <!-- Now we can render the completed list table -->
196
  <?php $sdmListTable->display() ?>
197
  </form>
198
+
199
  </div><!-- end of wrap -->
200
  <script type="text/javascript">
201
+ jQuery(document).ready(function ($) {
202
+ $('.fade').click(function () {
203
  $(this).fadeOut('slow');
204
  });
205
  });
206
  </script>
207
  <?php
208
+ }
209
+
210
+ function sdm_create_stats_page() {
211
+
212
+ $main_opts = get_option('sdm_downloads_options');
213
+
214
+ if (isset($main_opts['admin_no_logs'])) {
215
+ ?>
216
+ <div class="notice notice-warning"><p><b>Download Logs are disabled in <a href="?post_type=sdm_downloads&page=settings">plugin settings</a>. Please enable Download Logs to see current stats.</b></p></div>
217
+ <?php
218
+ }
219
+ wp_enqueue_script('sdm_google_charts');
220
+ wp_enqueue_script('jquery-ui-datepicker');
221
+ wp_enqueue_style('sdm_jquery_ui_style');
222
+
223
+ if (isset($_POST['sdm_stats_start_date'])) {
224
+ $start_date = $_POST['sdm_stats_start_date'];
225
+ } else {
226
+ // default start date is 30 days back
227
+ $start_date = date('Y-m-d', time() - 60 * 60 * 24 * 30);
228
+ }
229
+
230
+ if (isset($_POST['sdm_stats_end_date'])) {
231
+ $end_date = $_POST['sdm_stats_end_date'];
232
+ } else {
233
+ $end_date = date('Y-m-d', time());
234
+ }
235
+ if (isset($_REQUEST['sdm_active_tab']) && !empty($_REQUEST['sdm_active_tab'])) {
236
+ $active_tab = $_REQUEST['sdm_active_tab'];
237
+ } else {
238
+ $active_tab = 'datechart';
239
+ }
240
+ $downloads_by_date = sdm_get_downloads_by_date($start_date, $end_date);
241
+
242
+ $downloads_by_country = sdm_get_downloads_by_country($start_date, $end_date);
243
+ ?>
244
+ <div class="wrap">
245
+ <h2>Stats</h2>
246
+ <div id="poststuff"><div id="post-body">
247
+
248
+ <div class="postbox">
249
+ <h3 class="hndle"><label for="title">Choose Date Range (yyyy-mm-dd)</label></h3>
250
+ <div class="inside">
251
+ <form id="sdm_choose_date" method="post">
252
+ <input type="hidden" name="sdm_active_tab" value="<?php echo $active_tab; ?>">
253
+ Start Date: <input type="text" class="datepicker" name="sdm_stats_start_date" value="<?php echo $start_date; ?>">
254
+ End Date: <input type="text" class="datepicker" name="sdm_stats_end_date" value="<?php echo $end_date; ?>">
255
+ <p id="sdm_date_buttons">
256
+ <button type="button" data-start-date="<?php echo date('Y-m-01'); ?>" data-end-date="<?php echo date('Y-m-d'); ?>">This Month</button>
257
+ <button type="button" data-start-date="<?php echo date('Y-m-d', strtotime('first day of last month')); ?>" data-end-date="<?php echo date('Y-m-d', strtotime('last day of last month')); ?>">Last Month</button>
258
+ <button button type="button" data-start-date="<?php echo date('Y-01-01'); ?>" data-end-date="<?php echo date('Y-m-d'); ?>">This Year</button>
259
+ <button button type="button" data-start-date="<?php echo date("Y-01-01", strtotime("-1 year")); ?>" data-end-date="<?php echo date("Y-12-31", strtotime('last year')); ?>">Last Year</button>
260
+ <button button type="button" data-start-date="<?php echo "1970-01-01"; ?>" data-end-date="<?php echo date('Y-m-d'); ?>">All Time</button>
261
+ </p>
262
+ <div class="submit">
263
+ <input type="submit" class="button-primary" value="View Stats »">
264
+ </div>
265
+ </form>
266
+ </div>
267
+ </div>
268
+ <div class="nav-tab-wrapper sdm-tabs">
269
+ <a href="edit.php?post_type=sdm_downloads&page=stats&sdm_active_tab=datechart" class="nav-tab<?php echo ($active_tab == 'datechart' ? ' nav-tab-active' : ''); ?>" data-tab-name="datechart">Downloads by date</a>
270
+ <a href="edit.php?post_type=sdm_downloads&page=stats&sdm_active_tab=geochart" href="" class="nav-tab<?php echo ($active_tab == 'geochart' ? ' nav-tab-active' : ''); ?>" data-tab-name="geochart">Downloads by country</a>
271
+ </div>
272
+ <div class="sdm-tabs-content-wrapper" style="height: 500px;margin-top: 10px;">
273
+ <div data-tab-name="datechart" class="sdm-tab"<?php echo ($active_tab == 'datechart' ? '' : ' style="display:none;"'); ?>>
274
+ <div id="downloads_chart" style="width: 700px;"></div>
275
+ </div>
276
+ <div data-tab-name="geochart" class="sdm-tab"<?php echo ($active_tab == 'geochart' ? '' : ' style="display:none;"'); ?>>
277
+ <div id="country_chart" style="width: 700px;height:437px;"></div>
278
+ </div>
279
+ </div>
280
+ </div></div>
281
+ </div>
282
+ <script>
283
+ var sdm = [];
284
+ sdm.datechart = false;
285
+ sdm.geochart = false;
286
+ sdm.activeTab = '<?php echo $active_tab; ?>';
287
+ jQuery('#sdm_date_buttons button').click(function (e) {
288
+ jQuery('#sdm_choose_date').find('input[name="sdm_stats_start_date"]').val(jQuery(this).attr('data-start-date'));
289
+ jQuery('#sdm_choose_date').find('input[name="sdm_stats_end_date"]').val(jQuery(this).attr('data-end-date'));
290
+ });
291
+ function sdm_init_chart(tab) {
292
+ if (!sdm.datechart && tab == 'datechart') {
293
+ sdm.datechart = true;
294
+ google.charts.load('current', {'packages': ['corechart']});
295
+ google.charts.setOnLoadCallback(sdm_drawDateChart);
296
+ } else if (!sdm.geochart && tab == 'geochart') {
297
+ sdm.geochart = true;
298
+ google.charts.load('current', {'packages': ['geochart'], 'mapsApiKey': 'AIzaSyAjtHaEc8TX3JbzxWgjS96MiN7p7ePQilM'});
299
+ google.charts.setOnLoadCallback(sdm_drawGeoChart);
300
+ }
301
+ }
302
+ function sdm_drawDateChart() {
303
+ var sdm_dateData = new google.visualization.DataTable();
304
+ sdm_dateData.addColumn('string', 'Date');
305
+ sdm_dateData.addColumn('number', 'Number of downloads');
306
+ sdm_dateData.addRows([<?php echo $downloads_by_date; ?>]);
307
+
308
+ var sdm_dateChart = new google.visualization.AreaChart(document.getElementById('downloads_chart'));
309
+ sdm_dateChart.draw(sdm_dateData, {width: 700, height: 300, title: 'Downloads by Date', colors: ['#3366CC', '#9AA2B4', '#FFE1C9'],
310
+ hAxis: {title: 'Date', titleTextStyle: {color: 'black'}},
311
+ vAxis: {title: 'Downloads', titleTextStyle: {color: 'black'}},
312
+ legend: 'top',
313
+ });
314
+ }
315
+ function sdm_drawGeoChart() {
316
+
317
+ var sdm_countryData = google.visualization.arrayToDataTable([<?php echo $downloads_by_country; ?>]);
318
+
319
+ var sdm_countryOptions = {colorAxis: {colors: ['#ddf', '#00f']}};
320
+
321
+ var sdm_countryChart = new google.visualization.GeoChart(document.getElementById('country_chart'));
322
+
323
+ sdm_countryChart.draw(sdm_countryData, sdm_countryOptions);
324
+
325
+ }
326
+ jQuery(function () {
327
+ sdm_init_chart(sdm.activeTab);
328
+ jQuery('div.sdm-tabs a').click(function (e) {
329
+ e.preventDefault();
330
+ var tab = jQuery(this).attr('data-tab-name');
331
+ jQuery('div.sdm-tabs').find('a').removeClass('nav-tab-active');
332
+ jQuery(this).addClass('nav-tab-active');
333
+ jQuery('div.sdm-tabs-content-wrapper').find('div.sdm-tab').hide();
334
+ jQuery('div.sdm-tabs-content-wrapper').find('div[data-tab-name="' + tab + '"]').fadeIn('fast');
335
+ sdm_init_chart(tab);
336
+ jQuery('#sdm_choose_date').find('input[name="sdm_active_tab"]').val(tab);
337
+ });
338
+ jQuery('.datepicker').datepicker({
339
+ dateFormat: 'yy-mm-dd'
340
+ });
341
+ });
342
+ </script>
343
+ <?php
344
+ }
345
+
346
+ function sdm_create_addons_page() {
347
+ include(WP_SIMPLE_DL_MONITOR_PATH . 'includes/admin-side/sdm-admin-add-ons-page.php');
348
+ }
includes/sdm-debug.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class SDM_Debug {
4
+
5
+ public function __construct() {
6
+
7
+ }
8
+
9
+ static function log($msg, $success = true) {
10
+ $opts = get_option('sdm_downloads_options');
11
+ if (isset($opts['enable_debug']) && $opts['enable_debug'] == 'on') {
12
+ file_put_contents(WP_SDM_LOG_FILE, date('Y-m-d H:i:s', time()) . ': [' . ($success === true ? 'SUCCESS' : 'FAIL') . '] ' . $msg . "\r\n", FILE_APPEND);
13
+ }
14
+ }
15
+
16
+ static function reset_log() {
17
+ file_put_contents(WP_SDM_LOG_FILE, date('Y-m-d H:i:s', time()) . ': Log has been reset.' . "\r\n");
18
+ file_put_contents(WP_SDM_LOG_FILE, '-------------------------------------------------------'. "\r\n", FILE_APPEND);
19
+ }
20
+
21
+ }
includes/sdm-download-request-handler.php CHANGED
@@ -50,8 +50,15 @@ function handle_sdm_download_via_direct_post() {
50
  // Check if we only allow the download for logged-in users
51
  if (isset($main_option['only_logged_in_can_download'])) {
52
  if ($main_option['only_logged_in_can_download'] && $visitor_name === false) {
53
- // User not logged in, let's display the message
54
- wp_die(__('You need to be logged in to download this file.', 'simple-download-monitor'));
 
 
 
 
 
 
 
55
  }
56
  }
57
 
50
  // Check if we only allow the download for logged-in users
51
  if (isset($main_option['only_logged_in_can_download'])) {
52
  if ($main_option['only_logged_in_can_download'] && $visitor_name === false) {
53
+ //User not logged in, let's display the error message.
54
+ //But first let's see if we have login page URL set so we can display it as well
55
+ $loginMsg = '';
56
+ if (isset($main_option['general_login_page_url']) && !empty($main_option['general_login_page_url'])) {
57
+ //We have a login page URL set. Lets use it.
58
+ $tpl = __("__Click here__ to go to login page.", 'simple-download-monitor');
59
+ $loginMsg = preg_replace('/__(.*)__/', ' <a href="' . $main_option['general_login_page_url'] . '">$1</a> $2', $tpl);
60
+ }
61
+ wp_die(__('You need to be logged in to download this file.', 'simple-download-monitor') . $loginMsg);
62
  }
63
  }
64
 
includes/sdm-utility-functions-admin-side.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
 
3
  function sdm_export_download_logs_to_csv() {
4
-
5
  global $wpdb;
6
  $table_name = $wpdb->prefix . 'sdm_downloads';
7
  $resultset = $wpdb->get_results("SELECT * FROM $table_name ORDER BY id DESC", OBJECT);
8
-
9
  $csv_file_path = WP_SIMPLE_DL_MONITOR_PATH . "sdm-download-logs.csv";
10
  $fp = fopen($csv_file_path, 'w');
11
 
12
  $header_names = array("Log ID", "Download ID", "Download Title", "File URL", "Date", "IP Address", "Country", "Name");
13
  fputcsv($fp, $header_names);
14
-
15
  foreach ($resultset as $result) {
16
  if (empty($result->purchase_qty)) {
17
  $result->purchase_qty = 1;
@@ -21,8 +21,50 @@ function sdm_export_download_logs_to_csv() {
21
  fputcsv($fp, $fields);
22
  }
23
 
24
- fclose($fp);
25
 
26
  $file_url = WP_SIMPLE_DL_MONITOR_URL . '/sdm-download-logs.csv';
27
  return $file_url;
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
  function sdm_export_download_logs_to_csv() {
4
+
5
  global $wpdb;
6
  $table_name = $wpdb->prefix . 'sdm_downloads';
7
  $resultset = $wpdb->get_results("SELECT * FROM $table_name ORDER BY id DESC", OBJECT);
8
+
9
  $csv_file_path = WP_SIMPLE_DL_MONITOR_PATH . "sdm-download-logs.csv";
10
  $fp = fopen($csv_file_path, 'w');
11
 
12
  $header_names = array("Log ID", "Download ID", "Download Title", "File URL", "Date", "IP Address", "Country", "Name");
13
  fputcsv($fp, $header_names);
14
+
15
  foreach ($resultset as $result) {
16
  if (empty($result->purchase_qty)) {
17
  $result->purchase_qty = 1;
21
  fputcsv($fp, $fields);
22
  }
23
 
24
+ fclose($fp);
25
 
26
  $file_url = WP_SIMPLE_DL_MONITOR_URL . '/sdm-download-logs.csv';
27
  return $file_url;
28
  }
29
+
30
+ function sdm_get_downloads_by_date($start_date = '', $end_date = '', $returnStr = true) {
31
+ global $wpdb;
32
+
33
+ $q = $wpdb->prepare("SELECT COUNT(id) as cnt, DATE_FORMAT(`date_time`,'%%Y-%%m-%%d') as day
34
+ FROM " . $wpdb->prefix . "sdm_downloads
35
+ WHERE DATE_FORMAT(`date_time`,'%%Y-%%m-%%d')>=%s
36
+ AND DATE_FORMAT(`date_time`,'%%Y-%%m-%%d')<=%s
37
+ GROUP BY DAY(date_time) ORDER BY date_time", $start_date, $end_date);
38
+
39
+ $res = $wpdb->get_results($q, ARRAY_A);
40
+ if ($returnStr) {
41
+ $downloads_by_date_str = '';
42
+ foreach ($res as $item) {
43
+ $downloads_by_date_str .= '["' . $item['day'] . '", ' . $item['cnt'] . '],';
44
+ }
45
+ return $downloads_by_date_str;
46
+ } else {
47
+ return $res;
48
+ }
49
+ }
50
+
51
+ function sdm_get_downloads_by_country($start_date = '', $end_date = '', $returnStr = true) {
52
+ global $wpdb;
53
+
54
+ $q = $wpdb->prepare("SELECT COUNT(id) as cnt, visitor_country as country
55
+ FROM " . $wpdb->prefix . "sdm_downloads
56
+ WHERE DATE_FORMAT(`date_time`,'%%Y-%%m-%%d')>=%s
57
+ AND DATE_FORMAT(`date_time`,'%%Y-%%m-%%d')<=%s
58
+ GROUP BY visitor_country", $start_date, $end_date);
59
+ $res = $wpdb->get_results($q, ARRAY_A);
60
+
61
+ if ($returnStr) {
62
+ $downloads_by_country_str = "['Country', 'Downloads'],";
63
+ foreach ($res as $item) {
64
+ $downloads_by_country_str .= '["' . $item['country'] . '", ' . $item['cnt'] . '],';
65
+ }
66
+ return $downloads_by_country_str;
67
+ } else {
68
+ return $res;
69
+ }
70
+ }
includes/sdm-utility-functions.php CHANGED
@@ -1,27 +1,25 @@
1
  <?php
2
 
3
-
4
  /**
5
  * Get (filtered) list of all download button colors.
6
  * @return array Array of colors: color key => color name.
7
  */
8
  function sdm_get_download_button_colors() {
9
  return apply_filters('sdm_download_button_color_options', array(
10
- 'green' => __('Green', 'simple-download-monitor'),
11
- 'blue' => __('Blue', 'simple-download-monitor'),
12
- 'purple' => __('Purple', 'simple-download-monitor'),
13
- 'teal' => __('Teal', 'simple-download-monitor'),
14
  'darkblue' => __('Dark Blue', 'simple-download-monitor'),
15
- 'black' => __('Black', 'simple-download-monitor'),
16
- 'grey' => __('Grey', 'simple-download-monitor'),
17
- 'pink' => __('Pink', 'simple-download-monitor'),
18
- 'orange' => __('Orange', 'simple-download-monitor'),
19
- 'white' => __('White', 'simple-download-monitor')
20
  ));
21
  }
22
 
23
-
24
- function sdm_get_download_count_for_post($id){
25
  // Get number of downloads by counting db columns matching postID
26
  global $wpdb;
27
  $table = $wpdb->prefix . 'sdm_downloads';
@@ -36,15 +34,15 @@ function sdm_get_download_count_for_post($id){
36
 
37
  $db_count = $db_count + $get_offset;
38
  }
39
-
40
  return $db_count;
41
  }
42
 
43
- function sdm_get_item_description_output($id){
44
  $item_description = get_post_meta($id, 'sdm_description', true);
45
  $isset_item_description = isset($item_description) && !empty($item_description) ? $item_description : '';
46
  //$isset_item_description = apply_filters('the_content', $isset_item_description);
47
-
48
  $isset_item_description = do_shortcode($isset_item_description);
49
  $isset_item_description = wptexturize($isset_item_description);
50
  $isset_item_description = convert_smilies($isset_item_description);
@@ -55,9 +53,9 @@ function sdm_get_item_description_output($id){
55
  return $isset_item_description;
56
  }
57
 
58
- function sdm_get_password_entry_form($id, $args=array()) {
59
  $action_url = WP_SIMPLE_DL_MONITOR_SITE_HOME_URL . '/?smd_process_download=1&download_id=' . $id;
60
-
61
  //Get the download button text
62
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
63
  if (empty($button_text)) {//Use the default text for the button
@@ -65,9 +63,9 @@ function sdm_get_password_entry_form($id, $args=array()) {
65
  } else {//Use the custom text
66
  $button_text_string = $button_text;
67
  }
68
-
69
  $data = __('Enter Password to Download:', 'simple-download-monitor');
70
- $data .= '<form action="'.$action_url.'" method="post" >';
71
  $data .= '<input type="password" name="pass_text" class="sdm_pass_text" value="" /> ';
72
  $data .= '<input type="submit" name="sdm_dl_pass_submit" class="pass_sumbit sdm_pass_protected_download" value="' . $button_text_string . '" />';
73
  $data .= '<input type="hidden" name="download_id" value="' . $id . '" />';
@@ -75,7 +73,6 @@ function sdm_get_password_entry_form($id, $args=array()) {
75
  return $data;
76
  }
77
 
78
-
79
  /**
80
  * Get remote IP address.
81
  * @link http://stackoverflow.com/questions/1634782/what-is-the-most-accurate-way-to-retrieve-a-users-correct-ip-address-in-php
@@ -85,12 +82,12 @@ function sdm_get_password_entry_form($id, $args=array()) {
85
  */
86
  function sdm_get_ip_address($ignore_private_and_reserved = false) {
87
  $flags = $ignore_private_and_reserved ? (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) : 0;
88
- foreach ( array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key ) {
89
- if ( array_key_exists($key, $_SERVER) === true ) {
90
- foreach ( explode(',', $_SERVER[$key]) as $ip ) {
91
  $ip = trim($ip); // just to be safe
92
 
93
- if ( filter_var($ip, FILTER_VALIDATE_IP, $flags) !== false ) {
94
  return $ip;
95
  }
96
  }
@@ -157,14 +154,14 @@ function sdm_ip_info($ip, $purpose = "location") {
157
  /*
158
  * Checks if the string exists in the array key value of the provided array. If it doesn't exist, it returns the first key element from the valid values.
159
  */
160
- function sdm_sanitize_value_by_array($to_check, $valid_values)
161
- {
162
  $keys = array_keys($valid_values);
163
  $keys = array_map('strtolower', $keys);
164
  if (in_array($to_check, $keys)) {
165
  return $to_check;
166
  }
167
- return reset($keys);//Return the first element from the valid values
168
  }
169
 
170
  function sdm_get_logged_in_user() {
@@ -186,4 +183,4 @@ function sdm_get_logged_in_user() {
186
  }
187
 
188
  return $visitor_name;
189
- }
1
  <?php
2
 
 
3
  /**
4
  * Get (filtered) list of all download button colors.
5
  * @return array Array of colors: color key => color name.
6
  */
7
  function sdm_get_download_button_colors() {
8
  return apply_filters('sdm_download_button_color_options', array(
9
+ 'green' => __('Green', 'simple-download-monitor'),
10
+ 'blue' => __('Blue', 'simple-download-monitor'),
11
+ 'purple' => __('Purple', 'simple-download-monitor'),
12
+ 'teal' => __('Teal', 'simple-download-monitor'),
13
  'darkblue' => __('Dark Blue', 'simple-download-monitor'),
14
+ 'black' => __('Black', 'simple-download-monitor'),
15
+ 'grey' => __('Grey', 'simple-download-monitor'),
16
+ 'pink' => __('Pink', 'simple-download-monitor'),
17
+ 'orange' => __('Orange', 'simple-download-monitor'),
18
+ 'white' => __('White', 'simple-download-monitor')
19
  ));
20
  }
21
 
22
+ function sdm_get_download_count_for_post($id) {
 
23
  // Get number of downloads by counting db columns matching postID
24
  global $wpdb;
25
  $table = $wpdb->prefix . 'sdm_downloads';
34
 
35
  $db_count = $db_count + $get_offset;
36
  }
37
+
38
  return $db_count;
39
  }
40
 
41
+ function sdm_get_item_description_output($id) {
42
  $item_description = get_post_meta($id, 'sdm_description', true);
43
  $isset_item_description = isset($item_description) && !empty($item_description) ? $item_description : '';
44
  //$isset_item_description = apply_filters('the_content', $isset_item_description);
45
+
46
  $isset_item_description = do_shortcode($isset_item_description);
47
  $isset_item_description = wptexturize($isset_item_description);
48
  $isset_item_description = convert_smilies($isset_item_description);
53
  return $isset_item_description;
54
  }
55
 
56
+ function sdm_get_password_entry_form($id, $args = array()) {
57
  $action_url = WP_SIMPLE_DL_MONITOR_SITE_HOME_URL . '/?smd_process_download=1&download_id=' . $id;
58
+
59
  //Get the download button text
60
  $button_text = isset($args['button_text']) ? $args['button_text'] : '';
61
  if (empty($button_text)) {//Use the default text for the button
63
  } else {//Use the custom text
64
  $button_text_string = $button_text;
65
  }
66
+
67
  $data = __('Enter Password to Download:', 'simple-download-monitor');
68
+ $data .= '<form action="' . $action_url . '" method="post" >';
69
  $data .= '<input type="password" name="pass_text" class="sdm_pass_text" value="" /> ';
70
  $data .= '<input type="submit" name="sdm_dl_pass_submit" class="pass_sumbit sdm_pass_protected_download" value="' . $button_text_string . '" />';
71
  $data .= '<input type="hidden" name="download_id" value="' . $id . '" />';
73
  return $data;
74
  }
75
 
 
76
  /**
77
  * Get remote IP address.
78
  * @link http://stackoverflow.com/questions/1634782/what-is-the-most-accurate-way-to-retrieve-a-users-correct-ip-address-in-php
82
  */
83
  function sdm_get_ip_address($ignore_private_and_reserved = false) {
84
  $flags = $ignore_private_and_reserved ? (FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) : 0;
85
+ foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR') as $key) {
86
+ if (array_key_exists($key, $_SERVER) === true) {
87
+ foreach (explode(',', $_SERVER[$key]) as $ip) {
88
  $ip = trim($ip); // just to be safe
89
 
90
+ if (filter_var($ip, FILTER_VALIDATE_IP, $flags) !== false) {
91
  return $ip;
92
  }
93
  }
154
  /*
155
  * Checks if the string exists in the array key value of the provided array. If it doesn't exist, it returns the first key element from the valid values.
156
  */
157
+
158
+ function sdm_sanitize_value_by_array($to_check, $valid_values) {
159
  $keys = array_keys($valid_values);
160
  $keys = array_map('strtolower', $keys);
161
  if (in_array($to_check, $keys)) {
162
  return $to_check;
163
  }
164
+ return reset($keys); //Return the first element from the valid values
165
  }
166
 
167
  function sdm_get_logged_in_user() {
183
  }
184
 
185
  return $visitor_name;
186
+ }
main.php CHANGED
@@ -3,26 +3,27 @@
3
  * Plugin Name: Simple Download Monitor
4
  * Plugin URI: https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin
5
  * Description: Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
6
- * Version: 3.4.3
7
  * Author: Tips and Tricks HQ, Ruhul Amin, Josh Lobe
8
  * Author URI: https://www.tipsandtricks-hq.com/development-center
9
  * License: GPL2
10
  */
11
-
12
  if (!defined('ABSPATH')) {
13
  exit;
14
  }
15
 
16
- define('WP_SIMPLE_DL_MONITOR_VERSION', '3.4.3');
17
  define('WP_SIMPLE_DL_MONITOR_DIR_NAME', dirname(plugin_basename(__FILE__)));
18
  define('WP_SIMPLE_DL_MONITOR_URL', plugins_url('', __FILE__));
19
  define('WP_SIMPLE_DL_MONITOR_PATH', plugin_dir_path(__FILE__));
20
  define('WP_SIMPLE_DL_MONITOR_SITE_HOME_URL', home_url());
 
21
 
22
  global $sdm_db_version;
23
  $sdm_db_version = '1.2';
24
 
25
  //File includes
 
26
  include_once('includes/sdm-utility-functions.php');
27
  include_once('includes/sdm-utility-functions-admin-side.php');
28
  include_once('includes/sdm-download-request-handler.php');
@@ -83,10 +84,66 @@ function sdm_plugins_loaded_tasks() {
83
  * * Handle Generic Init tasks
84
  */
85
  add_action('init', 'sdm_init_time_tasks');
 
86
 
87
  function sdm_init_time_tasks() {
88
  //Handle download request if any
89
  handle_sdm_download_via_direct_post();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  }
91
 
92
  /*
@@ -373,12 +430,14 @@ class simpleDownloadManager {
373
  public function display_sdm_shortcode_meta_box($post) { //Shortcode metabox
374
  _e('The following shortcode can be used on posts or pages to embed a download now button for this file. You can also use the shortcode inserter (in the post editor) to add this shortcode to a post or page.', 'simple-download-monitor');
375
  echo '<br />';
376
- echo '[sdm_download id="' . $post->ID . '" fancy="0"]';
377
- echo '<br /><br />';
 
378
 
379
  _e('The following shortcode can be used to show a download counter for this item.', 'simple-download-monitor');
380
  echo '<br />';
381
- echo '[sdm_download_counter id="' . $post->ID . '"]';
 
382
 
383
  echo '<br /><br />';
384
  echo 'Read the full shortcode usage documentation <a href="https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin" target="_blank">here</a>.';
@@ -484,17 +543,22 @@ class simpleDownloadManager {
484
  add_settings_section('general_options', __('General Options', 'simple-download-monitor'), array($this, 'general_options_cb'), 'general_options_section');
485
  add_settings_section('admin_options', __('Admin Options', 'simple-download-monitor'), array($this, 'admin_options_cb'), 'admin_options_section');
486
  add_settings_section('sdm_colors', __('Colors', 'simple-download-monitor'), array($this, 'sdm_colors_cb'), 'sdm_colors_section');
 
 
487
 
488
  //Add all the individual settings fields that goes under the sections
489
  add_settings_field('general_hide_donwload_count', __('Hide Download Count', 'simple-download-monitor'), array($this, 'hide_download_count_cb'), 'general_options_section', 'general_options');
490
  add_settings_field('general_default_dispatch_value', __('PHP Dispatching', 'simple-download-monitor'), array($this, 'general_default_dispatch_value_cb'), 'general_options_section', 'general_options');
491
  add_settings_field('only_logged_in_can_download', __('Only Allow Logged-in Users to Download', 'simple-download-monitor'), array($this, 'general_only_logged_in_can_download_cb'), 'general_options_section', 'general_options');
 
492
 
493
  add_settings_field('admin_tinymce_button', __('Remove Tinymce Button', 'simple-download-monitor'), array($this, 'admin_tinymce_button_cb'), 'admin_options_section', 'admin_options');
494
  add_settings_field('admin_log_unique', __('Log Unique IP', 'simple-download-monitor'), array($this, 'admin_log_unique'), 'admin_options_section', 'admin_options');
495
  add_settings_field('admin_no_logs', __('Disable Download Logs', 'simple-download-monitor'), array($this, 'admin_no_logs_cb'), 'admin_options_section', 'admin_options');
496
 
497
  add_settings_field('download_button_color', __('Download Button Color', 'simple-download-monitor'), array($this, 'download_button_color_cb'), 'sdm_colors_section', 'sdm_colors');
 
 
498
  }
499
 
500
  public function general_options_cb() {
@@ -512,6 +576,18 @@ class simpleDownloadManager {
512
  _e('Front End colors settings', 'simple-download-monitor');
513
  }
514
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  public function hide_download_count_cb() {
516
  $main_opts = get_option('sdm_downloads_options');
517
  echo '<input name="sdm_downloads_options[general_hide_donwload_count]" id="general_hide_download_count" type="checkbox" ' . checked(1, isset($main_opts['general_hide_donwload_count']), false) . ' /> ';
@@ -532,6 +608,13 @@ class simpleDownloadManager {
532
  echo '<label for="only_logged_in_can_download">' . __('Enable this option if you want to allow downloads only for logged-in users. When enabled, anonymous users clicking on the download button will receive an error message.', 'simple-download-monitor') . '</label>';
533
  }
534
 
 
 
 
 
 
 
 
535
  public function admin_tinymce_button_cb() {
536
  $main_opts = get_option('sdm_downloads_options');
537
  echo '<input name="sdm_downloads_options[admin_tinymce_button]" id="admin_tinymce_button" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_tinymce_button']), false) . ' /> ';
@@ -564,6 +647,17 @@ class simpleDownloadManager {
564
  esc_html_e('Adjusts the color of the "Download Now" button.', 'simple-download-monitor');
565
  }
566
 
 
 
 
 
 
 
 
 
 
 
 
567
  }
568
 
569
  //End of simpleDownloadManager class
@@ -603,7 +697,7 @@ function sdm_remove_thumbnail_image_ajax_call() {
603
  exit;
604
  }
605
 
606
- //Go ahead with the thumbnail removal
607
  $post_id = $_POST['post_id_del'];
608
  $success = delete_post_meta($post_id, 'sdm_upload_thumbnail');
609
  if ($success) {
@@ -623,7 +717,7 @@ function sdm_pop_cats_ajax_call() {
623
 
624
  $cat_slug = $_POST['cat_slug']; // Get button cpt slug
625
  $parent_id = $_POST['parent_id']; // Get button cpt id
626
- // Query custom posts based on taxonomy slug
627
  $posts = get_posts(array(
628
  'post_type' => 'sdm_downloads',
629
  'numberposts' => -1,
@@ -641,13 +735,13 @@ function sdm_pop_cats_ajax_call() {
641
 
642
  $final_array = array();
643
 
644
- // Loop results
645
  foreach ($posts as $post) {
646
  // Create array of variables to pass to js
647
  $final_array[] = array('id' => $post->ID, 'permalink' => get_permalink($post->ID), 'title' => $post->post_title);
648
  }
649
 
650
- // Generate ajax response
651
  $response = json_encode(array('final_array' => $final_array));
652
  header('Content-Type: application/json');
653
  echo $response;
@@ -735,7 +829,7 @@ $main_option = get_option('sdm_downloads_options');
735
  $tiny_button_option = isset($main_option['admin_tinymce_button']);
736
  if ($tiny_button_option != true) {
737
 
738
- // Okay.. we're good. Add the button.
739
  add_action('init', 'sdm_downloads_tinymce_button');
740
 
741
  function sdm_downloads_tinymce_button() {
3
  * Plugin Name: Simple Download Monitor
4
  * Plugin URI: https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin
5
  * Description: Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
6
+ * Version: 3.4.6
7
  * Author: Tips and Tricks HQ, Ruhul Amin, Josh Lobe
8
  * Author URI: https://www.tipsandtricks-hq.com/development-center
9
  * License: GPL2
10
  */
 
11
  if (!defined('ABSPATH')) {
12
  exit;
13
  }
14
 
15
+ define('WP_SIMPLE_DL_MONITOR_VERSION', '3.4.6');
16
  define('WP_SIMPLE_DL_MONITOR_DIR_NAME', dirname(plugin_basename(__FILE__)));
17
  define('WP_SIMPLE_DL_MONITOR_URL', plugins_url('', __FILE__));
18
  define('WP_SIMPLE_DL_MONITOR_PATH', plugin_dir_path(__FILE__));
19
  define('WP_SIMPLE_DL_MONITOR_SITE_HOME_URL', home_url());
20
+ define('WP_SDM_LOG_FILE', WP_SIMPLE_DL_MONITOR_PATH . 'sdm-debug-log.txt');
21
 
22
  global $sdm_db_version;
23
  $sdm_db_version = '1.2';
24
 
25
  //File includes
26
+ include_once('includes/sdm-debug.php');
27
  include_once('includes/sdm-utility-functions.php');
28
  include_once('includes/sdm-utility-functions-admin-side.php');
29
  include_once('includes/sdm-download-request-handler.php');
84
  * * Handle Generic Init tasks
85
  */
86
  add_action('init', 'sdm_init_time_tasks');
87
+ add_action('admin_init', 'sdm_admin_init_time_tasks');
88
 
89
  function sdm_init_time_tasks() {
90
  //Handle download request if any
91
  handle_sdm_download_via_direct_post();
92
+ if (is_admin()) {
93
+ //Register Google Charts library
94
+ wp_register_script('sdm_google_charts', 'https://www.gstatic.com/charts/loader.js', array(), null, true);
95
+ wp_register_style('sdm_jquery_ui_style', WP_SIMPLE_DL_MONITOR_URL . '/css/jquery.ui.min.css', array(), null, 'all');
96
+ }
97
+ }
98
+
99
+ function sdm_admin_init_time_tasks() {
100
+ //Register ajax handlers
101
+ add_action('wp_ajax_sdm_reset_log', 'sdm_reset_log_handler');
102
+ add_action('wp_ajax_sdm_delete_data', 'sdm_delete_data_handler');
103
+
104
+ if (is_admin()) {
105
+ if (user_can(wp_get_current_user(), 'administrator')) {
106
+ // user is an admin
107
+ if (isset($_GET['sdm-action'])) {
108
+ if ($_GET['sdm-action'] === 'view_log') {
109
+ $logfile = fopen(WP_SDM_LOG_FILE, 'rb');
110
+ header('Content-Type: text/plain');
111
+ fpassthru($logfile);
112
+ die;
113
+ }
114
+ }
115
+ }
116
+ }
117
+ }
118
+
119
+ function sdm_reset_log_handler() {
120
+ SDM_Debug::reset_log();
121
+ echo '1';
122
+ wp_die();
123
+ }
124
+
125
+ function sdm_delete_data_handler() {
126
+ if (!check_ajax_referer('sdm_delete_data', 'nonce', false)) {
127
+ //nonce check failed
128
+ wp_die(0);
129
+ }
130
+ global $wpdb;
131
+ //let's find and delete smd_download posts and meta
132
+ $posts = $wpdb->get_results('SELECT id FROM ' . $wpdb->prefix . 'posts WHERE post_type="sdm_downloads"', ARRAY_A);
133
+ if (!is_null($posts)) {
134
+ foreach ($posts as $post) {
135
+ wp_delete_post($post['id'], true);
136
+ }
137
+ }
138
+ //let's delete options
139
+ delete_option('sdm_downloads_options');
140
+ delete_option('sdm_db_version');
141
+ //let's delete sdm_downloads table
142
+ $wpdb->query("DROP TABLE " . $wpdb->prefix . "sdm_downloads");
143
+ //deactivate plugin
144
+ deactivate_plugins(plugin_basename(__FILE__));
145
+ echo '1';
146
+ wp_die();
147
  }
148
 
149
  /*
430
  public function display_sdm_shortcode_meta_box($post) { //Shortcode metabox
431
  _e('The following shortcode can be used on posts or pages to embed a download now button for this file. You can also use the shortcode inserter (in the post editor) to add this shortcode to a post or page.', 'simple-download-monitor');
432
  echo '<br />';
433
+ $shortcode_text = '[sdm_download id="' . $post->ID . '" fancy="0"]';
434
+ echo "<input type='text' class='code' onfocus='this.select();' readonly='readonly' value='" . $shortcode_text . "' size='40'>";
435
+ echo "<br /><br />";
436
 
437
  _e('The following shortcode can be used to show a download counter for this item.', 'simple-download-monitor');
438
  echo '<br />';
439
+ $shortcode_text = '[sdm_download_counter id="' . $post->ID . '"]';
440
+ echo "<input type='text' class='code' onfocus='this.select();' readonly='readonly' value='" . $shortcode_text . "' size='40'>";
441
 
442
  echo '<br /><br />';
443
  echo 'Read the full shortcode usage documentation <a href="https://www.tipsandtricks-hq.com/simple-wordpress-download-monitor-plugin" target="_blank">here</a>.';
543
  add_settings_section('general_options', __('General Options', 'simple-download-monitor'), array($this, 'general_options_cb'), 'general_options_section');
544
  add_settings_section('admin_options', __('Admin Options', 'simple-download-monitor'), array($this, 'admin_options_cb'), 'admin_options_section');
545
  add_settings_section('sdm_colors', __('Colors', 'simple-download-monitor'), array($this, 'sdm_colors_cb'), 'sdm_colors_section');
546
+ add_settings_section('sdm_debug', __('Debug', 'simple-download-monitor'), array($this, 'sdm_debug_cb'), 'sdm_debug_section');
547
+ add_settings_section('sdm_deldata', __('Delete Plugin Data', 'simple-download-monitor'), array($this, 'sdm_deldata_cb'), 'sdm_deldata_section');
548
 
549
  //Add all the individual settings fields that goes under the sections
550
  add_settings_field('general_hide_donwload_count', __('Hide Download Count', 'simple-download-monitor'), array($this, 'hide_download_count_cb'), 'general_options_section', 'general_options');
551
  add_settings_field('general_default_dispatch_value', __('PHP Dispatching', 'simple-download-monitor'), array($this, 'general_default_dispatch_value_cb'), 'general_options_section', 'general_options');
552
  add_settings_field('only_logged_in_can_download', __('Only Allow Logged-in Users to Download', 'simple-download-monitor'), array($this, 'general_only_logged_in_can_download_cb'), 'general_options_section', 'general_options');
553
+ add_settings_field('general_login_page_url', __('Login Page URL', 'simple-download-monitor'), array($this, 'general_login_page_url_cb'), 'general_options_section', 'general_options');
554
 
555
  add_settings_field('admin_tinymce_button', __('Remove Tinymce Button', 'simple-download-monitor'), array($this, 'admin_tinymce_button_cb'), 'admin_options_section', 'admin_options');
556
  add_settings_field('admin_log_unique', __('Log Unique IP', 'simple-download-monitor'), array($this, 'admin_log_unique'), 'admin_options_section', 'admin_options');
557
  add_settings_field('admin_no_logs', __('Disable Download Logs', 'simple-download-monitor'), array($this, 'admin_no_logs_cb'), 'admin_options_section', 'admin_options');
558
 
559
  add_settings_field('download_button_color', __('Download Button Color', 'simple-download-monitor'), array($this, 'download_button_color_cb'), 'sdm_colors_section', 'sdm_colors');
560
+
561
+ add_settings_field('enable_debug', __('Enable Debug', 'simple-download-monitor'), array($this, 'enable_debug_cb'), 'sdm_debug_section', 'sdm_debug');
562
  }
563
 
564
  public function general_options_cb() {
576
  _e('Front End colors settings', 'simple-download-monitor');
577
  }
578
 
579
+ public function sdm_debug_cb() {
580
+ //Set the message that will be shown below the debug options settings heading
581
+ _e('Debug settings', 'simple-download-monitor');
582
+ }
583
+
584
+ public function sdm_deldata_cb() {
585
+ //Set the message that will be shown below the debug options settings heading
586
+ _e('You can delete all the data related to this plugin from database using the button below. Useful when you\'re uninstalling the plugin and don\'t want any leftovers remaining.', 'simple-download-monitor');
587
+ echo '<p><b>' . __('Warning', 'simple-download-monitor') . ': </b> ' . __('this can\'t be undone. All settings, download items, download logs will be deleted.', 'simple-download-monitor') . '</p>';
588
+ echo '<p><button id="sdmDeleteData" class="button" style="color:red;">' . __('Delete all data and deactivate plugin', 'simple-download-monitor') . '</button></p>';
589
+ }
590
+
591
  public function hide_download_count_cb() {
592
  $main_opts = get_option('sdm_downloads_options');
593
  echo '<input name="sdm_downloads_options[general_hide_donwload_count]" id="general_hide_download_count" type="checkbox" ' . checked(1, isset($main_opts['general_hide_donwload_count']), false) . ' /> ';
608
  echo '<label for="only_logged_in_can_download">' . __('Enable this option if you want to allow downloads only for logged-in users. When enabled, anonymous users clicking on the download button will receive an error message.', 'simple-download-monitor') . '</label>';
609
  }
610
 
611
+ public function general_login_page_url_cb() {
612
+ $main_opts = get_option('sdm_downloads_options');
613
+ $value = isset($main_opts['general_login_page_url']) ? $main_opts['general_login_page_url'] : '';
614
+ echo '<input size="100" name="sdm_downloads_options[general_login_page_url]" id="general_login_page_url" type="text" value="' . $value . '" />';
615
+ echo '<p class="description">' . __('(Optional) Specify a login page URL where users can login. This is useful if you only allow logged in users to be able to download. This link will be added to the message that is shown to anonymous users.', 'simple-download-monitor') . '</p>';
616
+ }
617
+
618
  public function admin_tinymce_button_cb() {
619
  $main_opts = get_option('sdm_downloads_options');
620
  echo '<input name="sdm_downloads_options[admin_tinymce_button]" id="admin_tinymce_button" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['admin_tinymce_button']), false) . ' /> ';
647
  esc_html_e('Adjusts the color of the "Download Now" button.', 'simple-download-monitor');
648
  }
649
 
650
+ public function enable_debug_cb() {
651
+ $main_opts = get_option('sdm_downloads_options');
652
+ echo '<input name="sdm_downloads_options[enable_debug]" id="enable_debug" type="checkbox" class="sdm_opts_ajax_checkboxes" ' . checked(1, isset($main_opts['enable_debug']), false) . ' /> ';
653
+ echo '<label for="enable_debug">' . __('Check this option to enable debug logging.', 'simple-download-monitor') .
654
+ '<p class="description"><a href="' . get_admin_url() . '?sdm-action=view_log" target="_blank">' .
655
+ __('Click here', 'simple-download-monitor') . '</a>' .
656
+ __(' to view log file.', 'simple-download-monitor') . '<br>' .
657
+ '<a id="sdm-reset-log" href="#0" style="color: red">' . __('Click here', 'simple-download-monitor') . '</a>' .
658
+ __(' to reset log file.', 'simple-download-monitor') . '</p></label>';
659
+ }
660
+
661
  }
662
 
663
  //End of simpleDownloadManager class
697
  exit;
698
  }
699
 
700
+ //Go ahead with the thumbnail removal
701
  $post_id = $_POST['post_id_del'];
702
  $success = delete_post_meta($post_id, 'sdm_upload_thumbnail');
703
  if ($success) {
717
 
718
  $cat_slug = $_POST['cat_slug']; // Get button cpt slug
719
  $parent_id = $_POST['parent_id']; // Get button cpt id
720
+ // Query custom posts based on taxonomy slug
721
  $posts = get_posts(array(
722
  'post_type' => 'sdm_downloads',
723
  'numberposts' => -1,
735
 
736
  $final_array = array();
737
 
738
+ // Loop results
739
  foreach ($posts as $post) {
740
  // Create array of variables to pass to js
741
  $final_array[] = array('id' => $post->ID, 'permalink' => get_permalink($post->ID), 'title' => $post->post_title);
742
  }
743
 
744
+ // Generate ajax response
745
  $response = json_encode(array('final_array' => $final_array));
746
  header('Content-Type: application/json');
747
  echo $response;
829
  $tiny_button_option = isset($main_option['admin_tinymce_button']);
830
  if ($tiny_button_option != true) {
831
 
832
+ // Okay.. we're good. Add the button.
833
  add_action('init', 'sdm_downloads_tinymce_button');
834
 
835
  function sdm_downloads_tinymce_button() {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.tipsandtricks-hq.com
4
  Tags: download, downloads, count, counter, tracker, tracking, hits, logging, monitor, manager, files, media, digital, download monitor, download manager, downloadmanager, file manager, protect downloads, password, download category, file tree, ajax, download template, grid, documents, ip address
5
  Requires at least: 4.1.0
6
  Tested up to: 4.8
7
- Stable tag: 3.4.2
8
  License: GPLv2 or later
9
 
10
  Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
@@ -47,6 +47,7 @@ https://www.youtube.com/watch?v=L-mXbs7kp0s
47
  * Ability to search and sort your downloadable files in the admin dashboard.
48
  * Track the number of downloads for each of your files.
49
  * Track the visitors country.
 
50
  * WordPress Shortcode for embedding a download link for a file.
51
  * Tinymce button in the WordPress post/page editor so you can easily add the shortcode.
52
  * You can customize the "Download Now" button text of an item to anything you want.
@@ -171,6 +172,17 @@ For screenshots please visit the [download monitor plugin page](https://www.tips
171
 
172
  == Changelog ==
173
 
 
 
 
 
 
 
 
 
 
 
 
174
  = 3.4.3 =
175
  - The [sdm_search_form] can take the fancy template as a shortcode argument to display the search result using that template.
176
 
4
  Tags: download, downloads, count, counter, tracker, tracking, hits, logging, monitor, manager, files, media, digital, download monitor, download manager, downloadmanager, file manager, protect downloads, password, download category, file tree, ajax, download template, grid, documents, ip address
5
  Requires at least: 4.1.0
6
  Tested up to: 4.8
7
+ Stable tag: 3.4.6
8
  License: GPLv2 or later
9
 
10
  Easily manage downloadable files and monitor downloads of your digital files from your WordPress site.
47
  * Ability to search and sort your downloadable files in the admin dashboard.
48
  * Track the number of downloads for each of your files.
49
  * Track the visitors country.
50
+ * View the daily download counts of your items in a chart.
51
  * WordPress Shortcode for embedding a download link for a file.
52
  * Tinymce button in the WordPress post/page editor so you can easily add the shortcode.
53
  * You can customize the "Download Now" button text of an item to anything you want.
172
 
173
  == Changelog ==
174
 
175
+ = 3.4.6 =
176
+ - Added option to delete plugin's settings, data and tables from database.
177
+ - Added "Login Page URL" option to optionally specify a login page URL when user is required to be logged in to download.
178
+
179
+ = 3.4.5 =
180
+ - Updated the slug of the new stats menu in this plugin so it doesn't conflict with jetpack's stat menu.
181
+
182
+ = 3.4.4 =
183
+ - Added "Stats" menu in the plugin that shows download count using a chart.
184
+ - Removed the "modal" class definition from the admin CSS file.
185
+
186
  = 3.4.3 =
187
  - The [sdm_search_form] can take the fancy template as a shortcode argument to display the search result using that template.
188
 
sdm-debug-log.txt ADDED
File without changes