Changeset 2186034
- Timestamp:
- 11/05/2019 09:55:01 AM (6 years ago)
- Location:
- download-sender/trunk
- Files:
-
- 5 added
- 19 edited
-
assets/css/admin.css (modified) (1 diff)
-
assets/css/form.css (modified) (4 diffs)
-
assets/css/premium.css (modified) (5 diffs)
-
assets/images/logs-email_verify-icons-sprites.png (added)
-
assets/images/spinner.gif (added)
-
assets/js/front-end.js (modified) (7 diffs)
-
assets/js/settings.js (modified) (7 diffs)
-
assets/js/shortcode.js (modified) (1 diff)
-
assets/lib/modaal-master (added)
-
assets/lib/modaal-master/modaal.min.css (added)
-
assets/lib/modaal-master/modaal.min.js (added)
-
download-sender.php (modified) (1 diff)
-
includes/admin/class-admin-assets.php (modified) (2 diffs)
-
includes/admin/class-ajax-request.php (modified) (11 diffs)
-
includes/admin/class-html-elements.php (modified) (6 diffs)
-
includes/admin/class-logs-page.php (modified) (17 diffs)
-
includes/admin/class-options.php (modified) (1 diff)
-
includes/admin/class-settings-page.php (modified) (21 diffs)
-
includes/admin/class-tinymce.php (modified) (8 diffs)
-
includes/class-download-sender.php (modified) (3 diffs)
-
includes/class-frontend-scripts.php (modified) (1 diff)
-
includes/class-shortcodes.php (modified) (4 diffs)
-
includes/core-functions.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
download-sender/trunk/assets/css/admin.css
r2063329 r2186034 150 150 margin: 10px 0; 151 151 } 152 153 /* Logs page */ 154 .email_verify-sprite { 155 display: inline-block; 156 position: relative; 157 top: 4px; 158 margin-right: 7px; 159 width: 20px; 160 height: 20px; 161 background: url('../images/logs-email_verify-icons-sprites.png') no-repeat; 162 } 163 .email_verify-sprite.blank { 164 background: none; 165 } 166 .email_verify-sprite.a-verified { 167 background-position: 0px 0px; 168 } 169 .email_verify-sprite.m-verified { 170 background-position: -20px 0px; 171 } 172 .email_verify-sprite.n-verified { 173 background-position: -40px 0px; 174 } 175 .email_verify-sprite.n-valid { 176 background-position: -60px 0px; 177 } 178 .email_verify-sprite.ds-spinner { 179 background: url('../images/spinner.gif') no-repeat; 180 background-position: 0px 0px; 181 } 182 #downloadsender_logs_filter .email_verify-title { 183 color: #333; 184 font-weight: bolder; 185 } 186 .wp-core-ui .button-primary.checkme[data-status="1"] { 187 background: #e35b32; 188 border-color: #ec633a #d75129 #d75129; 189 box-shadow: 0 1px 0 #c64b26; 190 text-shadow: 0 -1px 1px #c64b26,1px 0 1px #c64b26,0 1px 1px #c64b26,-1px 0 1px #c64b26; 191 } 192 .wp-core-ui .button-primary.checkme[data-status="1"]:focus, .wp-core-ui .button-primary.checkme[data-status="1"]:hover { 193 background: #ee653c; 194 border-color: #c64b26; 195 } 196 .button.checkme, .button.resend-download { 197 display: inline-block; 198 margin-top: 5px; 199 margin-left: 15px; 200 height: auto; 201 width: auto; 202 padding: 0 4px 1px!important; 203 font-size: 11px; 204 line-height: normal; 205 opacity: 0; 206 } 207 ol.logsfiles-list li { 208 position: relative; 209 } 210 .button.resend-download { 211 position: absolute; 212 right: 0; 213 margin: 0; 214 opacity: 0; 215 } 216 217 tr:hover > .column-email_verify > .button.checkme { 218 opacity: 1; 219 } 220 ol.logsfiles-list li:hover .button.resend-download { 221 opacity: 1; 222 } 223 tr:hover > .column-email_verify > .button.checkme.premium_require { 224 opacity: .5; 225 } 226 .logs-email_verify-tooltip { 227 visibility: hidden; 228 opacity: 0; 229 margin-top: 7px; 230 background: #f0f0f0; 231 color: #333; 232 border: 1px solid #d9d9d9; 233 border-radius: 3px; 234 padding: 0 8px; 235 font-size: 12px; 236 text-align: center; 237 } 238 .button.checkme:hover + .logs-email_verify-tooltip { 239 visibility: visible; 240 opacity: 1; 241 } 242 #downloadsender_logs_filter .mail-verif-ribb { 243 display: inline-block; 244 margin-left: 8px; 245 padding: 0 5px; 246 background: #60aa35; 247 color: #fff; 248 font-size: 10px; 249 border-radius: 5px 5px 5px 0; 250 line-height: normal; 251 } 252 #downloadsender_logs_filter ol.logsfiles-list { 253 margin-left: 0; 254 font-size: 11px; 255 color: #666; 256 } 257 .downloadsender_options-tab.flex-block { 258 display: flex; 259 } 260 .modaal-wrapper { 261 z-index: 100009!important; 262 } 263 p#confirme_resend_dld { 264 display: inline-block; 265 color: #111; 266 font-size: 14px; 267 margin-top: 0; 268 } 269 p#confirme_resend_dld strong { 270 color: #000; 271 min-width: 32px; 272 display: inline-block; 273 } -
download-sender/trunk/assets/css/form.css
r2183907 r2186034 97 97 .downloadsender .button-primary, .downloadsender .button-secondary { 98 98 min-width: 120px; 99 text-align: center; 99 100 } 100 101 .downloadsender_options-tab.singlebutton > div { … … 281 282 } 282 283 284 /* Paragraph */ 285 286 287 283 288 /* Labels */ 284 289 .downloadsender_options-tab label { … … 371 376 margin: 1px 0; 372 377 } 373 378 /* Dropdown*/ 379 .downloadsender_options-tab optgroup { 380 font-style: normal; 381 } 382 383 /* Accordion */ 384 .ds-accordion { 385 background-color: #eee; 386 color: #444; 387 cursor: pointer; 388 padding: 12px 18px; 389 width: 100%; 390 border: none; 391 text-align: left; 392 outline: none; 393 font-size: 15px; 394 transition: 0.4s; 395 } 396 397 .ds-accordion.active, .ds-accordion:hover { 398 background-color: #ccc; 399 } 400 401 .ds-panel { 402 padding: 0 18px; 403 display: none; 404 background-color: #eee; 405 border: 1px solid #ccc; 406 overflow: hidden; 407 } 408 /* Modaal */ 409 .modaal-container { 410 border-radius: 3px !important; 411 } 412 .modaal-close:focus, .modaal-close:hover { 413 background: transparent!important; 414 } 415 .modaal-close::after, .modaal-close::before { 416 background: #23282d!important; 417 } 418 .modaal-close:hover:after, .modaal-close:hover:before { 419 background: #0085ba!important; 420 } 421 422 .downloadsender.modaal .footer-group-button { 423 text-align: right; 424 margin-top: 20px; 425 padding-top: 20px; 426 border-top: 1px solid #eaeaea; 427 } 428 .downloadsender.modaal .button-primary { 429 min-width: 0; 430 } 431 /* 432 .downloadsender.modaal .button-primary.ok-modaal { 433 background: #32373c; 434 border-color: #2c3136 #292e33; 435 box-shadow: 0 1px 0 #22272c; 436 text-shadow: none; 437 } 438 .downloadsender.modaal .button-primary.ok-modaal:hover { 439 background: #008ec2; 440 border-color: #0180af #017daa; 441 box-shadow: 0 1px 0 #00749f; 442 } 443 */ 374 444 /*-------------------------------------------------------------------------*/ 375 445 /* tinyMCE 376 446 /*-------------------------------------------------------------------------*/ 377 447 448 [aria-describedby="downloadsender-mce-dialog"] .ui-dialog-title { 449 color: #444; 450 } 378 451 form#downloadsender-mce-dialog { 379 452 margin-bottom: 60px; … … 487 560 background: #fff; 488 561 } 562 563 .downloadsender_options-tab.premium_require .set-default { 564 display: none; 565 } 566 489 567 .downloadsender_options-tab.file_url .set-default, .downloadsender_options-tab.file .set-default { 490 568 top: -16px; -
download-sender/trunk/assets/css/premium.css
r2063329 r2186034 18 18 .downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) { 19 19 position: relative; 20 pointer-events: none;20 cursor: default; 21 21 } 22 22 23 .downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) form, 23 24 .downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) > div, … … 25 26 .downloadsender .downloads_allowed.premium_require p { 26 27 opacity: .5; 28 pointer-events: none; 27 29 } 28 30 .downloadsender .premium_require.is_hidded, .downloadsender .premium.is_hidded { … … 30 32 } 31 33 32 .downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker): :after {34 .downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker):hover:after { 33 35 font-family: Arial,sans-serif; 34 content: 'Premium ';36 content: 'Premium version required'; 35 37 position: absolute; 36 38 right: 0; … … 47 49 display: inline-block; 48 50 width: auto; 51 pointer-events: none; 49 52 } 50 53 .downloadsender .premium_require.inline-tag { … … 71 74 right: unset!important; 72 75 } 76 77 .button.premium_require { 78 pointer-events: none; 79 opacity: 0.5; 80 } 81 .downloadsender option:disabled { 82 color: #777 !important; 83 } -
download-sender/trunk/assets/js/front-end.js
r2184042 r2186034 5 5 access_count = parseInt($(this).attr('data-access-count')), 6 6 limit_downloads = parseInt($(this).attr('data-limit-downloads')), 7 email = $(this).attr('data-email'), 7 8 limit_date = $(this).attr('data-limit-date'), 8 9 file = $(this).attr('data-file'), … … 20 21 data : { 21 22 action : action, 22 file : file, 23 email : email, 24 file : file, 23 25 access_count : access_count, 24 26 url : url, … … 187 189 warning_icon = '<i class="'+data.attr('data-warning-icon')+'"></i>', 188 190 success_icon = '<i class="'+data.attr('data-success-icon')+'"></i>'; 189 191 190 192 response.removeClass('downloadsender-warning downloadsender-success empty-file'); 191 193 var cookie_val = email+file_name; 192 194 193 var empty_email = downloadSender.empty_email, 194 wrong_email = downloadSender.wrong_email, 195 already_sent = downloadSender.already_sent; 195 var empty_email = downloadSender.empty_email, 196 wrong_email = downloadSender.wrong_email, 197 already_sent = downloadSender.already_sent, 198 resend_timer = downloadSender.resend_timer, 199 much_attempts = downloadSender.much_attempts, 200 much_attempts_timer = downloadSender.much_attempts_timer, 201 is_admin = downloadSender.is_admin; 196 202 197 203 var alert_text; … … 215 221 216 222 response.html(alert_text.replace('{email}', '<strong>'+email+'</strong>').replace('{timer}', timer).replace('{help}', tooltip)); 217 response.addClass('downloadsender-warning has-tooltip'); 223 response.addClass('downloadsender-warning has-tooltip'); 224 return false; 225 //} else if ( Number(getCookie('downloadsender_anti_spamming')) > 2 && !is_admin ) { 226 } else if ( Number(getCookie('downloadsender_anti_spamming')) > 2 ) { 227 var current = Date.now(); 228 if(!getCookie('downloadsender_anti_spamming_time')){ 229 setCookie({cname: 'downloadsender_anti_spamming_time', value: current, time: much_attempts_timer, units: 'M'}); 230 } 231 232 var previous = Number(getCookie('downloadsender_anti_spamming_time')), 233 timer = timeDifference(much_attempts_timer, current, previous); 234 235 much_attempts = much_attempts.replace('{timer}', timer); 236 alert_text = content_align === 'right' ? much_attempts+warning_icon : warning_icon+much_attempts; 237 238 response.html(alert_text); 239 response.addClass('downloadsender-warning'); 218 240 return false; 219 241 } … … 247 269 248 270 if(data.indexOf('FAILED') > -1 ) { 271 var spam_counter = getCookie('downloadsender_anti_spamming') ? getCookie('downloadsender_anti_spamming') : 0; 272 setCookie({cname: 'downloadsender_anti_spamming', value: Number(spam_counter)+1, time: resend_timer, units: 'M'}); 273 249 274 alert_text = content_align === 'right' ? data.replace('FAILED', '')+warning_icon : warning_icon+data.replace('FAILED', ''); 250 275 response.html(alert_text); … … 257 282 setCookie({cname: 'downloadsender_check_send', value: cookie_val, time: resend_timer, units: 'M'}); 258 283 setCookie({cname: 'downloadsender_check_send_time', value: Date.now(), time: resend_timer, units: 'M'}); 284 285 setCookie({cname: 'downloadsender_anti_spamming', value: 0, time: resend_timer, units: 'M'}); 286 } 287 try{ 288 grecaptcha.reset(window.widgetId); 289 }catch(e){ 290 //alert(e); 259 291 } 260 292 } … … 322 354 } 323 355 } 324 return "";356 return null; 325 357 } 326 358 -
download-sender/trunk/assets/js/settings.js
r2067522 r2186034 1 1 jQuery( function( $ ) { 2 2 3 $( document.body ).delegate( ".premium_require", "click", function() { 4 return false; 5 }); 6 3 7 downloadSenderPremiumRequire(); 4 8 9 /*-------------------------------------------------------------------------*/ 10 /* Export logs to CSV 11 /*-------------------------------------------------------------------------*/ 12 13 insertParamHref(); 14 15 $( document.body ).delegate( ".ds-export-logs-to-csv-filter input[type=checkbox]", "click, change", function() { 16 insertParamHref(); 17 }); 18 19 function insertParamHref(){ 20 var a = $('a.ds-export-logs-to-csv'); 21 if(a.length === 0){ 22 return false; 23 } 24 var url = a.attr('href').split('?')[0]+'?action=print.csv'; 25 26 if ( $('input[name=checkbox_verified_logs_one]').attr('checked') ) { 27 url = url + '&verified1=true'; 28 } 29 30 if ( $('input[name=checkbox_verified_logs_two]').attr('checked') ) { 31 url = url + '&verified2=true'; 32 } 33 34 if ( $('input[name=checkbox_not_verified_logs]').attr('checked') ) { 35 url = url + '¬_verified=true'; 36 } 37 38 if ( $('input[name=checkbox_not_valid_logs]').attr('checked') ) { 39 url = url + '¬_valid=true'; 40 } 41 a.attr('href', url); 42 } 43 5 44 /*-------------------------------------------------------------------------*/ 6 45 /* Update tinyMCE textarea content … … 118 157 downloadSenderDependencyTriggers(elements); 119 158 }); 120 159 160 /*-------------------------------------------------------------------------*/ 161 /* Verify Log 162 /*-------------------------------------------------------------------------*/ 163 164 $( document.body ).delegate( "#make_log_verified", "click", function() { 165 if (!downloadSender.is_premium_v){ 166 //alert(downloadSender.premium_required_msg); 167 //return false; 168 } 169 }); 170 171 $('#make_log_verified').modaal({ 172 type: 'inline', 173 content_source: '#email_verify_modaal', 174 overlay_close: false, 175 hide_close: true, 176 background_scroll: true, 177 width: 500, 178 }); 179 180 $( document.body ).delegate( "#modaal-close", "click", function() { 181 $('#make_log_verified').modaal('close'); 182 }); 183 184 185 /*-------------------------------------------------------------------------*/ 186 /* Resend download 187 /*-------------------------------------------------------------------------*/ 188 189 $('.resend-download').modaal({ 190 content_source: '#resend_download_modaal', 191 //overlay_opacity: 0, 192 hide_close: true, 193 background_scroll: true, 194 width: 900, 195 before_open: function(e) { 196 var dl_url = e.currentTarget.getAttribute('data-href'), 197 to_email = e.currentTarget.getAttribute('data-email'); 198 $('form#logs_resend_download [name="file_url"]').val(dl_url); 199 $('form#logs_resend_download [name="to_email"]').val(to_email); 200 $('form#logs_resend_download [name="to_email_field"]').val(to_email); 201 202 var baseName = dl_url.substring(dl_url.lastIndexOf('/') + 1); 203 204 $('#confirme_resend_dld').html( 205 downloadSender.confirm_resend_msg.replace('{file}', baseName).replace('{email}', to_email) 206 ); 207 } 208 }); 209 210 $( document.body ).delegate( 'form#logs_resend_download [name="to_email_field"]', "keyup", function() { 211 var dl_url = $('form#logs_resend_download [name="file_url"]').val(), 212 to_email = $(this).val(), 213 baseName = dl_url.substring(dl_url.lastIndexOf('/') + 1); 214 215 $('#confirme_resend_dld').html( 216 downloadSender.confirm_resend_msg.replace('{file}', baseName).replace('{email}', to_email) 217 ); 218 219 }); 220 221 $( document.body ).delegate( "#resend_download_link", "click", function() { 222 var filter = $('#logs_resend_download'), 223 btn = filter.find('div#resend_download_link'), 224 response = filter.find('.ajax__response'), 225 email = filter.find('[name="to_email_field"]').val(); 226 var result = confirm(downloadSender.confirm_resend); 227 if (result) { 228 $.ajax({ 229 type : "POST", 230 url : downloadSender.ajax, 231 data : filter.serialize(), 232 beforeSend:function(xhr) { 233 btn.next().css('visibility', 'visible'); 234 }, 235 success:function(data){ 236 $('.spinner').css('visibility', 'hidden'); 237 if(data.indexOf('FAILED') > -1 ) { 238 239 } else { 240 response.html(downloadSender.download_sent.replace('%s', email)); 241 } 242 243 } 244 }); 245 } 246 return false; 247 }); 248 249 var acc = document.getElementsByClassName("ds-accordion"); 250 var i; 251 252 for (i = 0; i < acc.length; i++) { 253 acc[i].addEventListener("click", function() { 254 this.classList.toggle("active"); 255 var panel = this.nextElementSibling; 256 if (panel.style.display === "block") { 257 panel.style.display = "none"; 258 } else { 259 panel.style.display = "block"; 260 } 261 }); 262 } 263 121 264 /*-------------------------------------------------------------------------*/ 122 265 /* Admin functions … … 332 475 function downloadSenderPremiumRequire() { 333 476 if ( jQuery('.mce-dialog-tabs.premium_require').length !== 0 ) { 334 477 var is_hidded_Class = 'is_hidded'; 478 is_hidded_Class = 'noon'; 479 335 480 var i, op = jQuery(".premium_require #file_type")[0].getElementsByTagName("option"); 336 481 for ( i = 0; i < op.length; i++) { 337 482 if ( op[i].value.toLowerCase() !== "file_picker" ) { 338 483 op[i].disabled = true; 339 op[i].classList.add('premium', 'is_hidded');484 op[i].classList.add('premium', is_hidded_Class); 340 485 } else { 341 486 op[i].disabled = false; 342 op[i].classList.remove('premium', 'is_hidded');487 op[i].classList.remove('premium', is_hidded_Class); 343 488 } 344 489 } … … 348 493 if ( op[i].value.toLowerCase() !== "never" && op[i].value.toLowerCase() !== "24" ) { 349 494 op[i].disabled = true; 350 op[i].classList.add('premium', 'is_hidded');495 op[i].classList.add('premium', is_hidded_Class); 351 496 } else { 352 497 op[i].disabled = false; 353 op[i].classList.remove('premium', 'is_hidded');498 op[i].classList.remove('premium', is_hidded_Class); 354 499 } 355 500 } … … 359 504 if ( op[i].value.toLowerCase() !== "fill-hover" && op[i].value.toLowerCase() !== "outline-hover" ) { 360 505 op[i].disabled = true; 361 op[i].classList.add('premium', 'is_hidded');506 op[i].classList.add('premium', is_hidded_Class); 362 507 } else { 363 508 op[i].disabled = false; 364 op[i].classList.remove('premium', 'is_hidded');509 op[i].classList.remove('premium', is_hidded_Class); 365 510 } 366 511 } … … 370 515 if ( op[i].value.toLowerCase() !== "fill-hover" && op[i].value.toLowerCase() !== "outline-hover" ) { 371 516 op[i].disabled = true; 372 op[i].classList.add('premium', 'is_hidded');517 op[i].classList.add('premium', is_hidded_Class); 373 518 } else { 374 519 op[i].disabled = false; 375 op[i].classList.remove('premium', 'is_hidded');520 op[i].classList.remove('premium', is_hidded_Class); 376 521 } 377 522 } … … 393 538 if ( target !== undefined ) { 394 539 downloadSenderToggleTabs(null, target); 540 } 541 } 542 543 // Confirm logs filter action 544 function validate_logs_filter_action(Form){ 545 var dataArray = $(Form).serializeArray(), 546 dataObj = {}; 547 548 $(dataArray).each(function(i, field){ 549 dataObj[field.name] = field.value; 550 }); 551 552 var action = dataObj['action']; 553 554 if ( action !== '-1' && action !== undefined ){ 555 return confirm('This is irreversible. Are you sure you want to continue?'); 395 556 } 396 557 } -
download-sender/trunk/assets/js/shortcode.js
r2067320 r2186034 6 6 7 7 $( document.body ).delegate( ".downloadsender-chosen", "change", function() { 8 console.log('sss');8 9 9 var i, x, y, newclass='', classes = $(this)[0].className.split(' '); 10 10 for ( x = 0; x < classes.length; x++) { -
download-sender/trunk/download-sender.php
r2184059 r2186034 4 4 * Plugin URI: https://www.mustaphafersaoui.fr/wp-plugins/download-sender/ 5 5 * Description: This plugin allows you to add a download button, which when clicked displays a file sending form requiring users to enter their email address to receive a download link. 6 * Version: 1. 2.86 * Version: 1.3.0 7 7 * Author: Mustapha FERSAOUI 8 * Author URI: https://www.mustaphafersaoui.fr /wp-plugins/8 * Author URI: https://www.mustaphafersaoui.fr 9 9 * Text Domain: download-sender 10 10 * Domain Path: /languages/ -
download-sender/trunk/includes/admin/class-admin-assets.php
r2067320 r2186034 153 153 'downloadSender', 154 154 array( 155 'ajax' => admin_url( 'admin-ajax.php' ), 156 'settings_saved' => __( 'Settings saved.' ), 157 'download_sent' => __( 'Download link were sent to %s', 'download-sender' ), 158 'confirm_reset' => __( 'Are you sure you want to reset all options?', 'download-sender' ), 159 'fill_all_fields' => __( 'Please, fill in correctly all the fields and click SEND.', 'download-sender' ), 160 'confirm_del_older' => __( 'Are you sure you want to delete all links older then %s?', 'download-sender' ), 161 'confirm_del_expired' => __( 'Are you sure you want to delete all expired links?', 'download-sender' ), 162 'greater_value' => __( 'Please enter a value greater than or equal to 1.', 'download-sender' ), 163 'set_default' => __( 'Set Default' ), 164 ) 155 'ajax' => admin_url( 'admin-ajax.php' ), 156 'settings_saved' => __( 'Settings saved.' ), 157 'download_sent' => __( 'Download link were sent to %s', 'download-sender' ), 158 'confirm_reset' => __( 'Are you sure you want to reset all options?', 'download-sender' ), 159 'fill_all_fields' => __( 'Please, fill in correctly all the fields and click SEND.', 'download-sender' ), 160 'confirm_del_older' => __( 'Are you sure you want to delete all links older then %s?', 'download-sender' ), 161 'confirm_del_expired' => __( 'Are you sure you want to delete all expired links?', 'download-sender' ), 162 'greater_value' => __( 'Please enter a value greater than or equal to 1.', 'download-sender' ), 163 'set_default' => __( 'Set Default' ), 164 'is_premium_v' => is_downloadsender_premium_activated(), 165 //'premium_required_msg' => __( 'The premium version is required to use this feature.', 'download-sender' ), 166 'confirm_resend_msg' => __( '<strong>File :</strong> {file}<br><strong>To Email :</strong> {email}', 'download-sender' ), 167 'confirm_resend' => __( 'Are you sure you want to resend file?', 'download-sender' ), 168 ) 165 169 ); 166 170 wp_enqueue_script( 'downloadsender-settings' ); … … 187 191 wp_enqueue_script( 'chosen' ); 188 192 wp_register_style( 'chosen', DOWNLOAD_SENDER_ABSURL . '/assets/lib/chosen/chosen.min.css' ); 189 wp_enqueue_style( 'chosen' ); 193 wp_enqueue_style( 'chosen' ); 194 195 wp_register_style( 'downloadsender-premium-modaal-master', DOWNLOAD_SENDER_ABSURL . '/assets/lib/modaal-master/modaal.min.css'); 196 wp_enqueue_style( 'downloadsender-premium-modaal-master' ); 197 wp_register_script( 'downloadsender-premium-modaal-master', DOWNLOAD_SENDER_ABSURL . '/assets/lib/modaal-master/modaal.min.js', array('jquery')); 198 wp_enqueue_script( 'downloadsender-premium-modaal-master' ); 190 199 } 191 200 } -
download-sender/trunk/includes/admin/class-ajax-request.php
r2183997 r2186034 10 10 use \DownloadSender\Post_Meta; 11 11 use \DownloadSender\g_recaptcha; 12 use \DownloadSender\VerifyEmail; 12 13 13 14 defined( 'ABSPATH' ) || exit; … … 37 38 'downloadsender_action_process' => 'download_action_process', 38 39 'downloadsender_update_table' => 'update_table', 40 'downloadsender_resend_dld_request'=> 'resend_download', 39 41 ); 40 42 … … 45 47 } 46 48 49 50 /** 51 * Re-Send download file from logs page 52 */ 53 function resend_download() { 54 55 $options = new Options; 56 57 if ( is_downloadsender_premium_activated() ) { 58 $to_email = sanitize_email($_POST['to_email_field']); 59 $expiration_time = sanitize_text_field($_POST['expiration_time']); 60 $expiration_timeunits = sanitize_text_field($_POST['expiration_timeunits']); 61 $downloads_allowed = sanitize_text_field($_POST['downloads_allowed']); 62 } else { 63 $to_email = sanitize_email($_POST['to_email']); 64 $expiration_time = 2; 65 $expiration_timeunits = 1440; 66 $downloads_allowed = 5; 67 } 68 69 $data = array( 70 'file_url' => esc_url($_POST['file_url']), 71 'to_email' => $to_email, 72 'expiration_time' => $expiration_time, 73 'expiration_timeunits' => $expiration_timeunits, 74 'downloads_allowed' => $downloads_allowed, 75 'from_name' => $options->get_option('from_name'), 76 'from_address' => $options->get_option('from_address'), 77 'email_subject' => $options->get_option('email_subject'), 78 'email_body' => $options->get_option('email_body'), 79 ); 80 81 $this->send_request($data); 82 die(); 83 } 84 47 85 /** 48 86 * Run download process … … 66 104 $table = $wpdb->prefix . DOWNLOAD_SENDER_ENCRYPTED_LINKS_TABLE; 67 105 $file = sanitize_text_field($_POST['file']); 68 106 $email = isset($_POST['email']) ? sanitize_email($_POST['email']) : ''; 107 69 108 $results = $wpdb->get_results("SELECT * FROM $table WHERE download_key = '". $file ."' "); 70 109 foreach( $results as $key => $row) { … … 86 125 87 126 if ( $time_reached && $downloads_reached && count($results) != 0 ) { 88 $wpdb->update($table, array('access_count'=>$access_count+1),array('download_key'=> $file)); 127 $wpdb->update($table, array('access_count'=>$access_count+1),array('download_key'=> $file)); 89 128 echo downloadsender_str_crypt( $download_link, 'd'); 90 129 } else { … … 242 281 function send_request($data=array()) { 243 282 global $wpdb, $post; 283 244 284 $options = new Options; 245 285 $enable_recaptcha = $options->get_option('enable_recaptcha'); 286 287 // mail 288 $blogname = get_option('blogname'); 289 $blog_url = home_url(); 290 $blog_domain = downloadsender_domain_name(); 291 $from_name = isset($data['from_name']) ? $data['from_name'] : $options->get_option('from_name'); 292 $from_address = isset($data['from_address']) ? $data['from_address'] : $options->get_option('from_address'); 293 $subject = isset($data['email_subject']) ? $data['email_subject'] : $options->get_option('email_subject'); 246 294 247 295 // To email address … … 254 302 255 303 // Check if user was not verified by recaptcha. 256 if ( is_downloadsender_premium_activated() && $enable_recaptcha == true ) {304 if ( is_downloadsender_premium_activated() && $enable_recaptcha == true && !isset($data['to_email']) ) { 257 305 $secret = $options->get_option('secret_key'); 258 306 $response = $_POST["captcha"]; … … 267 315 // return FAILED Error if record insert fails 268 316 if( !checkdnsrr(array_pop(explode("@",$to)),"MX")) { 269 echo $options->get_option('success_msg');317 echo 'FAILED'.$options->get_option('wrong_email'); 270 318 die(); 319 } 320 321 if( is_downloadsender_premium_activated() && !isset($data['to_email']) ) { 322 $ve = new VerifyEmail($to, $from_address); 323 //$ve->verify(); 324 //$ve->get_debug() 325 326 if ( !$ve->verify() ) { 327 echo 'FAILED'.$options->get_option('wrong_email'); 328 die(); 329 } 271 330 } 272 331 … … 290 349 } 291 350 292 $file = downloadsender_str_crypt( $data['file_url'], 'e' );351 $file = downloadsender_str_crypt( $data['file_url'], 'e' ); 293 352 } else { 294 353 $decrypted_link = downloadsender_str_crypt( sanitize_text_field($_POST['file_url']), 'd' ); … … 344 403 // final html link 345 404 $file_url = '<a href="'.$encrypted_link.'">'.$encrypted_link.'</a>'; 405 406 // Record Log 407 if ( !isset($data['to_email'])) { // disable record log when sent from admin (back-end) 408 $recorde_date = current_time('mysql'); 409 $ip = downloadsender_get_ip(); 410 $country = downloadsender_geolocate($ip); 411 412 $check_email = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . DOWNLOAD_SENDER_LOGS_TABLE.' WHERE email="' . $to . '"'); 413 414 //Check if Email is already logged. No need to log it again. 415 if ($check_email) { 416 $logs_add = false; 417 } 418 419 $file_name = downloadsender_str_crypt( strtok( sanitize_file_name($_POST['file_name']), '?'), 'd'); 420 $file_name = $file_name != '' ? $file_name : $strtok; 421 422 // Log email adress. 423 $logs_table = $wpdb->prefix . DOWNLOAD_SENDER_LOGS_TABLE; 424 425 if ( count($check_email) == 0 && !$options->get_option('disable_logs') ) { 426 $row = array( 427 'email' => $to, 428 'email_verify' => 1, 429 'ip' => $ip, 430 'country' => $country, 431 'files' => serialize(array($file)), 432 'recorde_date' => $recorde_date, 433 ); 434 435 $row = array_filter($row); //Remove any null values. 436 $insert_table = $wpdb->insert($logs_table, $row); 437 } else { 438 $file_name = $file; 439 $get = $wpdb->get_row('SELECT * FROM ' . $logs_table . ' WHERE email="'.$to.'"'); 346 440 441 $files = unserialize($get->files); 442 $s_files = !is_array($files) ? array($get->files) : $files; 443 444 if ( !in_array($file_name, $s_files)){ 445 array_push($s_files, $file_name); 446 $wpdb->update( $logs_table, array('files' => serialize($s_files)), array('email' => $to) ); 447 } 448 } 449 } 450 347 451 // Send email 348 $blogname = get_option('blogname');349 $blog_url = home_url();350 $blog_domain = downloadsender_domain_name();351 $from_name = isset($data['from_name']) ? $data['from_name'] : $options->get_option('from_name');352 $from_address = isset($data['from_address']) ? $data['from_address'] : $options->get_option('from_address');353 $subject = isset($data['email_subject']) ? $data['email_subject'] : $options->get_option('email_subject');354 355 452 $shortcode = array("{file_url}", "{blog_name}", "{blog_domain}", "{from_email}", "{blog_url}", "{expire_time}"); 356 453 $shortcode_replace = array($file_url, $blogname, $blog_domain, $from_address, $blog_url, $full_expire_time ); … … 362 459 $headers .= "Content-type: text/html; charset=".get_bloginfo('charset')."" . "\r\n"; 363 460 $headers .= "From: " . $from_name . " <".$from_address.">" . "\r\n"; 364 461 $headers .= "Reply-To: " . $from_name . " <".$from_address.">" . "\r\n"; 462 //$headers .= "Cc: " . $from_name . " <".$from_address.">" . "\r\n"; 463 464 if( current_user_can('editor') || current_user_can('administrator') ) { 465 //die(); 466 } 365 467 // send message 366 468 $sent_message = wp_mail( $to, $subject, nl2br($message), $headers ); -
download-sender/trunk/includes/admin/class-html-elements.php
r2183907 r2186034 230 230 $class = isset($data['class']) ? ' '.$data['class'] : ''; 231 231 $dashicons = isset($data['dashicons']) ? '<span class="dashicons dashicons-'.$data['dashicons'].'"></span>' : ''; 232 $position = isset($data['position']) ? $data['position'] : 'left'; 233 $tag = isset($data['tag']) ? $data['tag'] : 'button'; 234 235 if ($position == 'right'){ 236 $data['raw_style'] = 'text-align: right;'; 237 } 238 $spinner_style = $position == 'right' ? ' style="float:left"' : ''; 232 239 233 240 echo self::Surround($data); 234 241 ?> 235 242 <div> 243 <?php 244 if ($tag == 'div'){ ?> 245 <div id="<?php echo $id; ?>" class="button-<?php echo $button_style.$class; ?>" data-single="1"><?php echo $dashicons . $label; ?></div> 246 <?php } else { ?> 236 247 <button id="<?php echo $id; ?>" class="button-<?php echo $button_style.$class; ?>" data-single="1"><?php echo $dashicons . $label; ?></button> 237 <span class="spinner"></span> 248 <?php } ?> 249 <span class="spinner"<?php echo $spinner_style; ?>></span> 238 250 </div> 239 251 <?php … … 486 498 ?> 487 499 <select id="<?php echo $data['id'];?>" class="<?php echo $chosen.$icon_picker.$class.$current;?>" name="<?php echo $name;?>"<?php echo $data_fa_icon;?> <?php echo $target.$hide_target;?> data-placeholder="Your Favorite Type of Bear"> 488 <?php foreach($data['value'] as $value => $label ) { 500 <?php foreach($data['value'] as $value => $label ) { 501 // Close optgroup 502 if ($value == 'optgroup_in') { 503 ?> 504 <optgroup label="<?php echo $label;?>"> 505 <?php } 506 507 // option 489 508 if(isset($data['label_to_value'])){ 490 509 $value = 'fa '.$label; … … 495 514 <option class="<?php echo $value;?>" value="<?php echo $value;?>" 496 515 <?php if ( $value == self::Current($data, self::$opt_name) ) echo 'selected="selected"'; ?> 497 ><?php echo $label;?></option> 498 <?php } ?> 516 ><?php echo $label;?></option> 517 518 <?php // Close optgroup 519 if ($value == 'optgroup_out') { 520 ?> 521 </optgroup> 522 <?php } 523 } ?> 499 524 </select> 500 525 <p class="description"<?php echo $desc_style;?>><?php echo $description;?></p> … … 521 546 </div> 522 547 <?php 523 } 524 548 } 549 550 /** 551 * Output : close div block container. 552 */ 553 public static function paragraph($data) { 554 $id = isset($data['id']) ? $data['id'] : ''; 555 $content = isset($data['content']) ? $data['content'] : ''; 556 $raw_style = isset($data['raw_style']) ? ' style="'.$data['raw_style'].'"' : ''; 557 558 ?> 559 <p id="<?php echo $id ?>"<?php echo $raw_style;?>><?php echo $content;?></p> 560 <?php 561 } 562 563 525 564 /** 526 565 * Output : open form … … 551 590 ?> 552 591 <input type="hidden" name="action" value="<?php echo $action ?>"> 592 <?php 593 } 594 595 /** 596 * Output : Hidden input field 597 */ 598 public static function hidden($data) { 599 $name = isset($data['name']) ? $data['name'] : ''; 600 ?> 601 <input type="hidden" name="<?php echo $name ?>" value=""> 553 602 <?php 554 603 } … … 573 622 <p class="description"><?php echo $description;?></p> 574 623 </div> <!-- Close Surround --> 624 <?php 625 } 626 627 /** 628 * accordion open 629 */ 630 public static function openAccordion($data) { 631 $heading = isset($data['heading']) ? $data['heading'] : 'Section 1'; 632 ?> 633 <div class="ds-accordion"><?php echo $heading;?></div> 634 <div class="ds-panel"> 635 <?php 636 } 637 638 /** 639 * accordion close 640 */ 641 public static function closeAccordion($data) { 642 ?> 643 </div> 575 644 <?php 576 645 } -
download-sender/trunk/includes/admin/class-logs-page.php
r2063329 r2186034 41 41 public function column_default( $item, $column_name ) { 42 42 switch ( $column_name ) { 43 case 'file_name': 44 return $item[$column_name]; 45 case 'email': 46 return $item[$column_name]; 47 case 'ip'; 48 case 'country': 49 return $item[$column_name]; 50 case 'date': 51 return $item[$column_name]; 52 default: 53 return print_r( $item, true ); //Show the whole array for troubleshooting purposes 43 case 'email': 44 return $item[$column_name]; 45 case 'email_verify': 46 return $item[$column_name]; 47 case 'ip'; 48 case 'country': 49 return $item[$column_name]; 50 case 'files': 51 return $item[$column_name]; 52 case 'date': 53 return $item[$column_name]; 54 default: 55 return print_r( $item, true ); //Show the whole array for troubleshooting purposes 54 56 } 55 57 } … … 67 69 68 70 $actions = [ 71 'edit' => sprintf('<a href="?page=%s&action=%s&id=%s">Edit</a>', $_REQUEST['page'], 'edit', $item['id']), 69 72 'delete' => sprintf('<a href="?page=%s&action=%s&id=%s&_wpnonce=%s" onclick="return confirm(\''.__('Are you sure you want to delete this entry?', 'download-sender').'\')">' . __('Delete', 'download-sender') . '</a>', esc_attr( $_REQUEST['page'] ), 'deletethismail', $item['id'], $delete_nonce), 70 73 ]; … … 98 101 function get_columns() { 99 102 $columns = array( 100 'cb' => '<input type="checkbox" />', 101 'email' => __( 'Email', 'download-sender' ), 102 'ip' => __( 'IP Address', 'download-sender' ), 103 'country' => __( 'Country', 'download-sender' ), 104 'file_name' => __( 'File Name', 'download-sender' ), 105 'date' => __( 'Date', 'download-sender' ) 103 'cb' => '<input type="checkbox" />', 104 'email' => __( 'Email', 'download-sender' ), 105 'email_verify' => __( 'Email Verify', 'download-sender' ), 106 'ip' => __( 'IP Address', 'download-sender' ), 107 'country' => __( 'Country', 'download-sender' ), 108 'files' => __( 'Files', 'download-sender' ), 109 'date' => __( 'Date', 'download-sender' ) 106 110 ); 107 111 return $columns; … … 115 119 public function get_sortable_columns() { 116 120 $sortable_columns = array( 117 'email' => array( 'email', false ), 118 'ip' => array( 'ip', false ), 119 'country' => array( 'country', false ), 120 'file_name' => array( 'file_name', false ), 121 'date' => array( 'recorde_date', false ) 121 'email' => array( 'email', false ), 122 'email_verify' => array( 'email_verify', false ), 123 'ip' => array( 'ip', false ), 124 'country' => array( 'country', false ), 125 'files' => array( 'files', false ), 126 'date' => array( 'recorde_date', false ) 122 127 ); 123 128 … … 201 206 * Handles data query and filter, sorting, and pagination. 202 207 */ 203 public function prepare_items( ) {208 public function prepare_items($search ='') { 204 209 global $wpdb; 210 205 211 206 212 $per_page = $this->get_items_per_page( 'logs_per_page' ); … … 233 239 $orderby_column = $this->order_recorde_by_array( 234 240 $orderby_column, array( 235 'ip' =>'1', 236 'recorde_date' =>'1', 237 'file_name' =>'1', 238 'country' =>'1', 239 'email' =>'1' 240 ) 241 ); 241 'ip' =>'1', 242 'recorde_date' =>'1', 243 'files' =>'1', 244 'country' =>'1', 245 'email' =>'1', 246 'email_verify' =>'1' 247 ) 248 ); 242 249 $sort_order = $this->order_recorde_by_array( 243 250 $sort_order, array( … … 247 254 ); 248 255 249 $query = "SELECT * FROM $table ORDER BY $orderby_column $sort_order"; 256 // Search box 257 $search = ( isset( $_REQUEST['s'] ) ) ? $_REQUEST['s'] : false; 258 $do_search = $search ? $wpdb->prepare(" WHERE email LIKE '%%%s%%' OR ip LIKE '%%%s%%' OR country LIKE '%%%s%%'", $search, $search, $search) : ''; 259 260 // Query 261 $query = "SELECT * FROM $table $do_search ORDER BY $orderby_column $sort_order"; 262 250 263 $offset = ($current_page - 1) * $per_page; 251 264 $query .=' LIMIT ' . (int) $offset . ',' . (int) $per_page;//Limit to query to only load a limited number of records … … 254 267 //Prepare the array with the correct index names that the table is expecting. 255 268 $data = array(); 269 270 //$premium_require = !is_downloadsender_premium_activated() ? ' premium_require' : ''; 271 $premium_require = ''; 256 272 257 273 foreach ($data_results as $data_result) { … … 262 278 $country_flag = '<span class="country-flag"><span src="blank.gif" class="flag flag-'.$country_id.'" alt="" /></span><span class="country-name">'.$data_result->country.'</span></span>'; 263 279 } 264 280 281 // Email Verify Column 282 $t1 = __( 'Verified', 'download-sender' ); 283 $t2 = __( 'Not Verified', 'download-sender' ); 284 $t3 = __( 'Not Valid', 'download-sender' ); 285 $v1 = '✔'; 286 $v2 = '✖'; 287 288 $bt1 = __( 'Cancel Verification', 'download-sender' ); 289 $bt2 = __( 'Verify Email', 'download-sender' ); 290 291 $res_email_verify = ''; 292 293 if ( $data_result->email_verify == 1 || $data_result->email_verify == 0 ) { 294 $res_email_verify = '<span class="email_verify-sprite n-verified"></span><span class="email_verify-title">' . $t2 . '</span><input type="button" id="make_log_verified" data-status="3" data-id="'.$data_result->id.'" data-email="'.$data_result->email.'" class="button button-primary checkme" value="'.$v1.'"><div class="logs-email_verify-tooltip">' . $bt2 . '</div>'; 295 } else if ($data_result->email_verify == 2) { 296 $confirm = __( '(100% Valid)', 'download-sender' ); 297 $res_email_verify = '<span class="email_verify-sprite a-verified"></span><span class="email_verify-title">' . $t1 . '<span class="mail-verif-ribb">' . __( '100% Valid', 'download-sender' ) . '</span></span>'; 298 } else if ($data_result->email_verify == 3) { 299 $res_email_verify = '<span class="email_verify-sprite m-verified"></span><span class="email_verify-title">' . $t1 . '</span><input type="button" id="make_log_verified" data-status="1" data-id="'.$data_result->id.'" data-email="'.$data_result->email.'" class="button button-primary checkme" value="'.$v2.'"><div class="logs-email_verify-tooltip">' . $bt1 . '</div>'; 300 } else if ($data_result->email_verify == 4) { 301 $res_email_verify = '<span class="email_verify-sprite n-valid"></span><span class="email_verify-title">' . $t3 . '</span><input type="button" id="make_log_verified" data-status="1" data-id="'.$data_result->id.'" class="button button-primary checkme" value="'.$v2.'"><div class="logs-email_verify-tooltip">' . $bt1 . '</div>'; 302 } 303 304 // Files names 305 if (strpos($data_result->files, ':{') === false) { 306 $file_name = $data_result->files; 307 } else{ 308 $file_name = unserialize($data_result->files); 309 } 310 311 $files = '<ol class="logsfiles-list">'; 312 if (is_array($file_name)) { 313 foreach($file_name as $value){ 314 $d_url = downloadsender_str_crypt( $value, 'd'); 315 if ($d_url){ 316 $files .= '<li><a href="'.$d_url.'">' . basename($d_url) . '</a><span data-href="'.$d_url.'" data-email="'.$data_result->email.'" class="button button-primary resend-download">'. __( 'Resend File', 'download-sender' ) .'</span></li>'; 317 } else { 318 $files .= '<li>' . $value . '</li>'; 319 } 320 //$file_name = downloadsender_str_crypt( $value, 'd') ? downloadsender_str_crypt( $value, 'd'): $value; 321 } 322 323 } else { 324 $files .= '<li>'.$data_result->files.'</li>'; 325 } 326 $files .= '</ol>'; 327 328 if($data_result->files==''){ 329 $files = ''; 330 331 } 265 332 $data[] = array( 266 'id' => $data_result->id, 267 'email' => $data_result->email, 268 'ip' => $data_result->ip, 269 'country' => $country_flag, 270 'file_name' => $data_result->file_name, 271 'date' => $data_result->recorde_date 333 'id' => $data_result->id, 334 'email' => $data_result->email, 335 'email_verify' => $res_email_verify, 336 'ip' => $data_result->ip, 337 'country' => $country_flag, 338 'files' => $files, 339 'date' => $data_result->recorde_date 272 340 ); 273 341 } … … 281 349 )); 282 350 } 351 352 public function search_box( $text, $input_id ) { 353 if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) { 354 return; 355 } 356 357 $input_id = $input_id . '-search-input'; 358 359 if ( ! empty( $_REQUEST['orderby'] ) ) { 360 echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />'; 361 } 362 if ( ! empty( $_REQUEST['order'] ) ) { 363 echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />'; 364 } 365 if ( ! empty( $_REQUEST['post_mime_type'] ) ) { 366 echo '<input type="hidden" name="post_mime_type" value="' . esc_attr( $_REQUEST['post_mime_type'] ) . '" />'; 367 } 368 if ( ! empty( $_REQUEST['detached'] ) ) { 369 echo '<input type="hidden" name="detached" value="' . esc_attr( $_REQUEST['detached'] ) . '" />'; 370 } 371 ?> 372 <p class="search-box"> 373 <label class="screen-reader-text" for="<?php echo esc_attr( $input_id ); ?>"><?php echo $text; ?>:</label> 374 <input type="search" id="<?php echo esc_attr( $input_id ); ?>" name="s" value="<?php _admin_search_query(); ?>" /> 375 <?php submit_button( $text, '', '', false, array( 'id' => 'search-submit' ) ); ?> 376 </p> 377 <?php 378 } 283 379 284 380 /** … … 351 447 'ck'=>'cook islands', 352 448 'cr'=>'costa rica', 353 'ci'=>' cote d ivoire',449 'ci'=>'ivory coast', 354 450 'hr'=>'croatia', 355 451 'cu'=>'cuba', 356 452 'cy'=>'cyprus', 357 'cz'=>'czech republic',453 'cz'=>'czechia', 358 454 'dk'=>'denmark', 359 455 'dj'=>'djibouti', … … 400 496 'in'=>'india', 401 497 'id'=>'indonesia', 402 'ir'=>'iran , islamic republic of',498 'ir'=>'iran', 403 499 'iq'=>'iraq', 404 500 'ie'=>'ireland', … … 407 503 'jm'=>'jamaica', 408 504 'jp'=>'japan', 409 'jo'=>' jordan',410 'kz'=>'kazak stan',505 'jo'=>'hashemite kingdom of jordan', 506 'kz'=>'kazakhstan', 411 507 'ke'=>'kenya', 412 508 'ki'=>'kiribati', 413 509 'kp'=>'korea, democratic peoples republic of', 414 'kr'=>' korea, republic of',510 'kr'=>'republic of korea', 415 511 'kw'=>'kuwait', 416 512 'kg'=>'kyrgyzstan', 417 'la'=>'lao peoples democratic republic',513 'la'=>'laos', 418 514 'lv'=>'latvia', 419 515 'lb'=>'lebanon', 420 516 'ls'=>'lesotho', 421 517 'lr'=>'liberia', 422 'ly'=>'libya n arab jamahiriya',518 'ly'=>'libya', 423 519 'li'=>'liechtenstein', 424 520 'lt'=>'lithuania', 425 521 'lu'=>'luxembourg', 426 'mo'=>'maca u',522 'mo'=>'macao', 427 523 'mk'=>'macedonia, the former yugoslav republic of', 428 524 'mg'=>'madagascar', … … 439 535 'mx'=>'mexico', 440 536 'fm'=>'micronesia, federated states of', 441 'md'=>' moldova, republic of',537 'md'=>'republic of moldova', 442 538 'mc'=>'monaco', 443 539 'mn'=>'mongolia', … … 463 559 'pk'=>'pakistan', 464 560 'pw'=>'palau', 465 'ps'=>'palestin ian territory, occupied',561 'ps'=>'palestine', 466 562 'pa'=>'panama', 467 563 'pg'=>'papua new guinea', … … 476 572 're'=>'reunion', 477 573 'ro'=>'romania', 478 'ru'=>'russia n federation',574 'ru'=>'russia', 479 575 'rw'=>'rwanda', 480 576 'sh'=>'saint helena', … … 509 605 'tw'=>'taiwan', 510 606 'tj'=>'tajikistan', 511 'tz'=>'tanzania , united republic of',607 'tz'=>'tanzania', 512 608 'th'=>'thailand', 513 609 'tg'=>'togo', -
download-sender/trunk/includes/admin/class-options.php
r2183997 r2186034 46 46 'sending_failed' => __("Failed to send the download link.", 'download-sender'), 47 47 'wrong_email' => __('Please enter a valid email address!', 'download-sender'), 48 //'much_attempts' => __('Too many subscribe attempts for this email address. Please try again in about 5 minutes.'), 49 'much_attempts' => __('Too many attempts, please try again in about {timer} minutes.'), 48 50 'empty_email' => __('Please fill out the email field', 'download-sender'), 49 51 'already_sent' => __('This file has already been sent to {email}, wait up to {timer} and retry. {help}', 'download-sender'), -
download-sender/trunk/includes/admin/class-settings-page.php
r2183907 r2186034 22 22 add_action( 'admin_init', array( $this, 'add_settings_fields') ); 23 23 add_action( 'admin_post_print.csv', array( $this, 'print_csv') ); 24 add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 ); 24 add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 ); 25 26 add_action( 'admin_head', array( $this, 'logs_page_modals' ) ); 27 25 28 } 29 30 /** 31 * Edit Element UI-Panel. 32 * 33 * @return string 34 */ 35 public function logs_page_modals() { 36 if ( !isset($_GET['page']) || sanitize_html_class( $_GET['page'] ) != 'downloadsender-logs' ) { 37 return false; 38 } 39 $options = new Options; 40 $premium_require = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' premium_require' : ''; 41 42 $track_attr = [ 43 'meta_name' => null, 44 45 // +--------------------+ 46 // | Email Template tab | 47 // *--------------------+ 48 49 // Open form 50 array( 51 'type' => 'openForm', 52 'id' => 'logs_resend_download', 53 ), 54 55 array( 56 'type' => 'paragraph', 57 'id' => 'confirme_resend_dld', 58 'content' => '', 59 //'raw_style' => 'font-size: 14px; color: #e1401b;', 60 ), 61 62 // Open Accordion 63 array( 64 'type' => 'openAccordion', 65 'heading' => 'Options :', 66 ), 67 68 array('type' => 'openBlock', 'active' => true, 'unflex' => true, 'class' => $premium_require), // start Premium block 69 70 array( 71 'type' => 'ExtraLabel', 72 'title' => __( 'Expiration time', 'download-sender' ), 73 'for' => 'expiration_time', 74 ), 75 76 array('type' => 'openBlock'), 77 78 array( 79 'type' => 'textfield', 80 'id' => 'expiration_time', 81 'description' => __( 'Set for how long, the download link will be active. Leave blank for unlimited time.', 'download-sender' ), 82 'display' => 'inline-block', 83 'default' => '2', 84 ), 85 86 // Time Units 87 array( 88 'type' => 'dropdown', 89 'id' => 'expiration_timeunits', 90 'class' => 'auto_width', 91 'value' => array( 92 '1440' => __( 'Day(s)', 'download-sender' ), 93 '60' => __( 'Hour(s)', 'download-sender' ), 94 ), 95 'default' => '1440', 96 'display' => 'inline', 97 ), 98 99 array('type' => 'closeBlock'), 100 101 array( 102 'type' => 'textfield', 103 'id' => 'downloads_allowed', 104 'heading' => __( 'Downloads allowed', 'download-sender' ), 105 'default' => '5', 106 'display' => 'inline-block', 107 'max_width' => '100%', 108 'raw_style' => 'min-width: 200px;', 109 'description'=> __( 'Sets the maximum number of downloads. Leave blank for unlimited.', 'download-sender' ), 110 ), 111 112 array( 113 'type' => 'textfield', 114 'id' => 'to_email_field', 115 'heading' => __( 'To Email', 'download-sender' ), 116 'display' => 'inline-block', 117 'raw_style' => 'min-width: 200px;', 118 'required' => true, 119 'class' => 'right-block', 120 ), 121 122 array('type' => 'closeBlock'), // end block require premium 123 124 // Close Accordion 125 array( 126 'type' => 'closeAccordion', 127 ), 128 129 array( 'type' => 'Separator', 'height' => 'thin', 'style' => 'no_line' ), 130 131 array( 132 'type' => 'SingleButton', 133 'tag' => 'div', 134 'id' => 'resend_download_link', 135 'heading' => __( 'Re-Send', 'download-sender' ), 136 //'position' => 'right', 137 'ajax_response' => true, 138 ), 139 140 // Form filter 141 array( 142 'type' => 'ajaxAction', 143 'action' => 'downloadsender_resend_dld_request', 144 ), 145 146 // Hidden input 147 array( 148 'type' => 'hidden', 149 'name' => 'file_url', 150 ), 151 152 // Close form 153 array( 154 'type' => 'closeForm', 155 ), 156 ]; 157 ?> 158 <div id="email_verify_modaal" style="display:none;"> 159 <div class="downloadsender modaal"> 160 <div class="modaal-content"> 161 <p>You have free version. <strong>Buy Premium Version</strong> to access this feature.</p> 162 <h2>About:</h2> 163 <p> 164 The Email Verify option is a very useful way to take a raw email list and check it for bad and invalid emails. This feature verifies the email address at sending file time to minimize the sending of emails to non-working email addresses and receiving too many bounced and returned emails. 165 <br> 166 <br> 167 168 The Verify Emails feature uses a multi-stage checking process which checks numerous attributes such as the validity of the domain, DNS and MX records to determine which addresses are working and which are able to receive an email. 169 <br> 170 <br> 171 172 <strong>Note:</strong> The email verifier works with a high accuracy to clean email lists. However it’s impossible to verify emails with 100% accuracy without sending a physical email with tracking, and waiting for a real person to read the email. 173 </p> 174 </div> 175 <div class="footer-group-button"> 176 <div class="button-primary ok-modaal" id="modaal-close">OK</div> 177 <?php echo getPremiumButton() ?> 178 </div> 179 </div> 180 </div> 181 <div id="resend_download_modaal" style="display:none;"> 182 <button type="button" class="modaal-close" id="modaal-close" style="position: absolute;top: -5px;right: -5px;"> 183 <span>Close</span> 184 </button> 185 <div class="downloadsender modaal"> 186 <?php 187 $form = new Form($track_attr); 188 $form->render(); 189 ?> 190 </div> 191 </div> 192 <?php 193 } 194 26 195 /** 27 196 * Validate screen options on update. … … 45 214 46 215 $logs_obj = new DownloadSender_Logs(); 47 216 48 217 add_screen_option( 49 218 'per_page', array( … … 116 285 ?> 117 286 <div class="wrap downloadsender"> 118 <h2 style="margin-left: 10px;">Download Sender Settings</h2> 287 <h2 style="margin-left: 10px;">Download Sender Settings</h2> 288 <?php echo ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? self::get_premium() : ''; ?> 119 289 <?php echo self::settings_errors(); ?> 120 290 <form method="post" id="downloadsender_settings" action='options.php'> … … 354 524 'type' => 'Textarea', 355 525 'id' => 'already_sent', 356 'heading' => __( 'File already sent message', 'download-sender' ),526 'heading' => __( 'File already sent', 'download-sender' ), 357 527 'sub_desc' => __( 'Prevent users from spamming your file sending forms.', 'download-sender' ), 358 528 'default' => $options->get_default('already_sent'), … … 361 531 ), 362 532 533 array( 534 'type' => 'Textarea', 535 'id' => 'much_attempts', 536 'heading' => __( 'Max wrong send attempts reached', 'download-sender' ), 537 'sub_desc' => __( 'Prevent the maximum number of wrong sending attempts exceeded.', 'download-sender' ), 538 'default' => $options->get_default('much_attempts'), 539 'display' => 'inline-block', 540 'class' => 'right-block', 541 'description'=> 'Shortcodes: {timer}', 542 ), 543 363 544 // Custom resend timer 364 545 array('type' => 'openBlock', 'active' => true, 'class' => $premium_require), // start Premium block … … 367 548 'type' => 'textfield', 368 549 'id' => 'resend_timer', 369 'heading' => __( '{timer} - Shortcode', 'download-sender' ),550 'heading' => __( '{timer}', 'download-sender' ), 370 551 'default' => '5', 371 'display' => 'inline', 372 'description'=> 'Increase / Decrease the timer value (in munutes).', 552 'display' => 'inline-block', 553 'description'=> 'Timer value (in munutes) of the "File already sent" option.', 554 ), 555 556 array( 557 'type' => 'textfield', 558 'id' => 'much_attempts_timer', 559 'heading' => __( '{timer}', 'download-sender' ), 560 'default' => '5', 561 'display' => 'inline-block', 562 'class' => 'right-block', 563 'description'=> 'Timer value (in munutes) of the "Max wrong send attempts reached" option.', 373 564 ), 374 565 … … 560 751 'display' => 'inline-block', 561 752 'class' => 'right-block', 753 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 562 754 ), 563 755 … … 572 764 'display' => 'inline-block', 573 765 'class' => 'right-block', 766 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 574 767 ), 575 768 … … 582 775 'html-content' => $g_recaptcha, 583 776 'raw_style' => 'line-height: 0;min-height: 0;', 777 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 584 778 ), 585 779 … … 593 787 'class' => 'description', 594 788 'raw_style' => 'font-style: normal;', 789 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 595 790 ), 596 791 … … 601 796 'type' => 'heading', 602 797 'heading' => 'Options', 798 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 603 799 ), 604 800 … … 611 807 'display' => 'block', 612 808 'raw_style' => 'margin-bottom: 12px;', 809 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 613 810 ), 614 811 … … 626 823 'default' => 'light', 627 824 'display' => 'middle-inline', 825 "dependency" => array('element' => "enable_recaptcha", 'value' => array('true')), 628 826 ), 629 827 … … 659 857 660 858 array( 661 'type' => 'textfield', 662 'id' => 'from_address', 663 'heading' => __( 'From Address', 'download-sender' ), 664 'default' => 'wordpress@'.downloadsender_domain_name(), 665 'display' => 'inline-block', 666 'raw_style' => 'min-width: 200px;', 859 'type' => 'textfield', 860 'id' => 'from_address', 861 'heading' => __( 'From Address', 'download-sender' ), 862 'description' => sprintf( 863 __( 'This email needs to be valid and from your domain name (e.g. %s). To make sure your server is not treated as a spam or gets blacklisted.', 'download-sender' ), 864 'downloads@'.downloadsender_domain_name() 865 ), 866 'default' => 'wordpress@'.downloadsender_domain_name(), 867 'display' => 'inline-block', 868 'raw_style' => 'min-width: 200px;', 667 869 ), 668 870 … … 829 1031 '60' => __( 'Hour(s)', 'download-sender' ), 830 1032 ), 831 'default' => ' minutes',1033 'default' => '60', 832 1034 'display' => 'middle-inline', 833 1035 ), … … 987 1189 '1' => __( 'Minute(s)', 'download-sender' ), 988 1190 ), 989 'default' => ' minutes',1191 'default' => '1', 990 1192 'display' => 'middle-inline', 991 1193 ), … … 1035 1237 <div class="wrap"> 1036 1238 <h2>Download Sender Logs</h2> 1239 <?php //echo ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? self::get_premium() : ''; ?> 1037 1240 <?php settings_errors(); ?> 1038 <form id="downloadsender_logs_filter" method="post" onsubmit="return confirm('This is irreversible. Are you sure you want to continue?');">1039 <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']) ?>" />1241 <form id="downloadsender_logs_filter" method="post" onsubmit="return validate_logs_filter_action(this)"> 1242 <input type="hidden" name="page" value="<?php echo esc_attr($_REQUEST['page']); ?>" /> 1040 1243 <?php 1041 $logs_obj->prepare_items(); 1244 1245 //Fetch, prepare, sort, and filter our data... 1246 if( isset($_POST['s']) ){ 1247 $logs_obj->prepare_items($_POST['s']); 1248 } else { 1249 $logs_obj->prepare_items(); 1250 } 1251 1252 //$logs_obj->prepare_items(); 1253 $logs_obj->search_box('Search', 'search'); 1042 1254 $logs_obj->display(); 1043 1255 ?> … … 1047 1259 <!-- Logs export button --> 1048 1260 <form method="post" class="logs-utilities" action="<?php echo $_SERVER["REQUEST_URI"]; ?>" onSubmit="return confirm('<?php echo __( 'Are you sure you want to export all the log entries?', 'download-sender' )?>');" > 1049 <a href="<?php echo admin_url( 'admin-post.php?action=print.csv' ) ?>"><input type="button" class="button-primary" value="<?php _e('Export Logs to CSV File', 'download-sender'); ?>" /></a> 1050 <span style="margin-left: 10px; cursor:default;"> <?php echo __( 'Use this to export all the log entries to a CSV file (comma separated).', 'download-sender' )?></span> 1261 1262 <div class="downloadsender_options-tab heading" style="margin: 0;">Export Logs Filter</div> 1263 <div style="padding-left: 25px;" class="ds-export-logs-to-csv-filter"> 1264 <div class="downloadsender_options-tab checkbox"> 1265 <input type="checkbox" id="checkbox_verified_logs_one" name="checkbox_verified_logs_one" value="checkbox_verified_logs_one" checked="checked"> 1266 <label for="checkbox_verified_logs_one">100% valid logs</label> 1267 </div> 1268 <div class="downloadsender_options-tab checkbox"> 1269 <input type="checkbox" id="checkbox_verified_logs_two" name="checkbox_verified_logs_two" value="checkbox_verified_logs_two" checked="checked"> 1270 <label for="checkbox_verified_logs_two">Verified logs</label> 1271 </div> 1272 <div class="downloadsender_options-tab checkbox"> 1273 <input type="checkbox" id="checkbox_not_verified_logs" name="checkbox_not_verified_logs" value="checkbox_not_verified_logs" checked="checked"> 1274 <label for="checkbox_not_verified_logs">Not verified logs</label> 1275 </div> 1276 <div class="downloadsender_options-tab checkbox"> 1277 <input type="checkbox" id="checkbox_not_valid_logs" name="checkbox_not_valid_logs" value="checkbox_not_valid_logs" checked="checked"> 1278 <label for="checkbox_not_valid_logs">Not valid logs</label> 1279 </div> 1280 </div> 1281 <div class="downloadsender_options-tab separator thinnest no_line"> 1282 <div class="downloadsender_separator no_line" data-width="" data-height="thinnest"></div> 1283 </div> 1284 <a href="<?php echo admin_url( 'admin-post.php?action=print.csv' ) ?>" class="ds-export-logs-to-csv"><input type="button" class="button-primary" value="<?php _e('Export Logs to CSV File', 'download-sender'); ?>" /></a> 1285 <span style="margin-left: 10px; cursor:default;"> <?php echo __( 'Use this to export log entries to a CSV file (comma separated).', 'download-sender' )?></span> 1051 1286 </form> 1052 1287 … … 1075 1310 1076 1311 $fopen = fopen($file_path, 'w'); 1077 $header_names = array("ID", "Email", "IP Address", "Country", "Date"); 1078 fputcsv($fopen, $header_names); 1312 $header_names = array("ID", "Email", "Email Verify", "IP Address", "Country", "Date"); 1313 fputcsv($fopen, $header_names); 1314 1079 1315 foreach ($resultset as $result) { 1080 $fields = array($result->id, $result->email, $result->ip, $result->country, $result->recorde_date); 1316 1317 if ( !isset($_GET['not_verified']) && ( $result->email_verify == 0 || $result->email_verify == 1 ) ){ 1318 continue; 1319 } 1320 1321 if ( !isset($_GET['verified1']) && $result->email_verify == 2 ){ 1322 continue; 1323 } 1324 1325 if ( !isset($_GET['verified2']) && $result->email_verify == 3 ){ 1326 continue; 1327 } 1328 1329 if ( !isset($_GET['not_valid']) && $result->email_verify == 4 ){ 1330 continue; 1331 } 1332 1333 switch ($result->email_verify) { 1334 case 0: 1335 case 1: 1336 $email_verify = 'Not Verified'; 1337 break; 1338 case 2: 1339 $email_verify = 'Verified - 100% Valid'; 1340 break; 1341 case 3: 1342 $email_verify = 'Verified'; 1343 break; 1344 case 4: 1345 $email_verify = 'Not Valid'; 1346 break; 1347 default: 1348 $email_verify = ''; 1349 } 1350 1351 $fields = array($result->id, $result->email, $email_verify, $result->ip, $result->country, $result->recorde_date); 1081 1352 fputcsv($fopen, $fields); 1082 1353 } 1354 1355 if(!isset($fields)){ 1356 fputcsv($fopen, array('No logs found for this request.')); 1357 } 1358 1083 1359 fclose($fopen); 1360 1084 1361 return DOWNLOAD_SENDER_ABSURL . '/logs.csv'; 1085 1362 } … … 1091 1368 if ( ! current_user_can( 'manage_options' ) ) 1092 1369 return; 1370 1093 1371 $file_url = $this->generate_csv(); 1094 1372 … … 1134 1412 <li>Admin functions, 9 Buttons Hover Animation Effects, Limit the number of downloads per user option, and more...</li> 1135 1413 </ul> 1136 <p>< a href="https://www.mustaphafersaoui.fr/wp-plugins/download-sender/download-sender-premium/" class="button button-primary get-premium-btn" target="_blank"><?php echo __( 'Get Premium', 'download-sender' ) ?></a></p>1414 <p><?php echo getPremiumButton() ?></p> 1137 1415 </div> 1138 1416 <?php -
download-sender/trunk/includes/admin/class-tinymce.php
r2068480 r2186034 42 42 */ 43 43 function dialog_contents() { 44 /*45 if ( function_exists( 'get_current_screen' ) ) {46 $pt = get_current_screen()->post_type;47 if ( $pt != 'post' && $pt != 'page' )48 return;49 }50 */51 44 // Print directly html 52 45 ?> 53 46 <div style="display: none"> 54 <form id="downloadsender-mce-dialog" tabindex="-1"> 47 <form id="downloadsender-mce-dialog" tabindex="-1"> 48 49 <?php if ( !defined( 'DOWNLOAD_SENDER_PREMIUM' ) ) { 50 ?> 51 <div style="display: block; text-align: right;padding-top: 10px;"> 52 <?php echo getPremiumButton() ?> 53 </div> 54 <?php }?> 55 55 56 <?php echo $this->dialog_contents_tabs();?> 56 57 <div class="downloadsender-submitbox"> … … 62 63 </div> 63 64 </form> 65 64 66 </div> 65 67 <?php … … 77 79 $premium_require = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' premium_require' : ''; 78 80 $is_hidded_require = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' is_hidded' : ''; 79 81 $is_hidded_require = ''; 82 80 83 $pages = get_pages(); 81 84 $page_list = array(); … … 88 91 $color_scheme_desc = __( 'Choose a color from your', 'download-sender') . ' <a target="_blank" href="'. esc_url(admin_url()) .'/admin.php?page=downloadsender-settings&tab_id=theme_tab"> ' . esc_html__('globally defined color scheme', 'download-sender') . '</a>'; 89 92 93 $premium_tag = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' - [premium]' : ''; 90 94 $hover_transitions = array( 91 95 'fill-hover' => 'Fill on hover ', 92 96 'outline-hover' => 'Outline on hover' , 97 'optgroup_in' => 'Premium Hover Effects', 93 98 'fill-right-left' => 'Fill from right to left', 94 99 'fill-left-right' => 'Fill from left to right', … … 100 105 'fill-diagonal-right' => 'Fill diagonal to right', 101 106 'fill-center' => 'Fill from center', 107 'optgroup_out' => '', 102 108 ); 103 109 … … 291 297 'value' => array( 292 298 'file_picker' => 'File picker', 293 'file_url' => ' URL',299 'file_url' => 'Custom URL'.$premium_tag, 294 300 ), 295 301 'default' => 'file_picker', … … 315 321 ), 316 322 323 array('type' => 'openBlock', 'active' => true, 'unflex' => true, 'class' => $premium_require), // start Premium block 324 317 325 array( 318 326 "type" => 'checkbox', 319 327 "heading" => __("Direct download link button", 'download-sender'), 320 328 "id" => "direct_link", 321 'class' => $premium_require . $is_hidded_require,329 //'class' => $premium_require . $is_hidded_require, 322 330 "value" => 'yes', 323 331 'description' => __( 'This will disable the sending file form and allows the user to start downloading just by clicking the Download button.', 'download-sender' ), 324 332 "default" => false, 325 333 ), 334 335 array('type' => 'closeBlock'), // end block require premium 326 336 327 337 // Set expiration … … 337 347 'class' => 'dependency-triggers', 338 348 'value' => array( 339 'never' => 'Never', 340 '24' => '1 Day', 341 '48' => '48 Hours', 342 '720' => '30 Days', 343 'custom' => 'Custom', 349 'never' => 'Never', 350 '24' => '1 Day', 351 'optgroup_in' => 'Premium Options', 352 '48' => '48 Hours', 353 '720' => '30 Days', 354 'custom' => 'Custom', 344 355 ), 345 356 'default' => 'never', -
download-sender/trunk/includes/class-download-sender.php
r2183907 r2186034 40 40 do_action( 'download_sender_loaded' ); 41 41 } 42 43 42 44 43 /** … … 186 185 recorde_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL, 187 186 email MEDIUMTEXT NOT NULL, 187 status MEDIUMTEXT NOT NULL, 188 188 file_name MEDIUMTEXT NOT NULL, 189 189 PRIMARY KEY (id) … … 191 191 dbDelta($sql); 192 192 } 193 194 // Alter email_verify column if not exist 195 $email_verify_column = $wpdb->get_results( $wpdb->prepare( 196 "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ", 197 DB_NAME, $logs_table, 'email_verify' 198 ) ); 199 200 if ( empty( $email_verify_column ) ) { 201 $wpdb->query("ALTER TABLE $logs_table ADD email_verify MEDIUMTEXT NOT NULL AFTER email"); 202 } 203 204 // Change file_name column name 205 $file_name_column = $wpdb->get_results( $wpdb->prepare( 206 "SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ", 207 DB_NAME, $logs_table, 'file_name' 208 ) ); 209 210 if ( !empty( $file_name_column ) ) { 211 $wpdb->query("ALTER TABLE $logs_table CHANGE file_name files MEDIUMTEXT"); 212 } 193 213 194 214 // Install the Download Links DB -
download-sender/trunk/includes/class-frontend-scripts.php
r2068578 r2186034 286 286 'downloadSender', 287 287 array( 288 'ajax' => admin_url( 'admin-ajax.php' ), 289 'dl_date_msg' => __( 'This link will expire after %s clicks or after %s.', 'download-sender' ), 290 'date_msg' => __( 'This link will expire in %s.', 'download-sender' ), 291 'dl_msg' => __( 'This link will expire after %s clicks.', 'download-sender' ), 292 'limit_reached' => __( 'This file has expired.', 'download-sender' ), 293 'wrong_file' => $options->get_option('wrong_file'), 294 'empty_email' => $options->get_option('empty_email'), 295 'wrong_email' => $options->get_option('wrong_email'), 296 'already_sent' => $options->get_option('already_sent'), 297 'troubleshooting' => $options->get_option('troubleshooting') 288 'ajax' => admin_url( 'admin-ajax.php' ), 289 'dl_date_msg' => __( 'This link will expire after %s clicks or after %s.', 'download-sender' ), 290 'date_msg' => __( 'This link will expire in %s.', 'download-sender' ), 291 'dl_msg' => __( 'This link will expire after %s clicks.', 'download-sender' ), 292 'limit_reached' => __( 'This file has expired.', 'download-sender' ), 293 'wrong_file' => $options->get_option('wrong_file'), 294 'empty_email' => $options->get_option('empty_email'), 295 'wrong_email' => $options->get_option('wrong_email'), 296 'already_sent' => $options->get_option('already_sent'), 297 'resend_timer' => $options->get_option('resend_timer'), 298 'much_attempts' => $options->get_option('much_attempts'), 299 'much_attempts_timer' => $options->get_option('much_attempts_timer'), 300 'troubleshooting' => $options->get_option('troubleshooting'), 301 'is_admin' => current_user_can('editor') || current_user_can('administrator') 298 302 ) 299 303 ); -
download-sender/trunk/includes/class-shortcodes.php
r2183907 r2186034 207 207 $simply_button .= '<input type="hidden" 208 208 data-post-id="' . get_the_ID() .'" 209 data-resend-timer="' . $options->get_option('resend_timer').'"210 209 data-form-desc="' . htmlentities($form_desc) .'" 211 210 data-alert-class="'. $alert_pos.' alert-'.$alerts_style.$alert_shadow.'" … … 440 439 $file = sanitize_text_field($_REQUEST['file']); 441 440 $to = isset($_REQUEST['to']) ? downloadsender_str_crypt( $_REQUEST['to'], 'd') : null; 442 $user_email = sanitize_email($to) ? $to: null;441 $user_email = $to ? sanitize_email($to) : null; 443 442 444 443 if( !$user_email || !checkdnsrr(explode("@", $user_email)[1],"MX")) { … … 469 468 470 469 // Record Log 471 $ip = downloadsender_get_ip(); 472 $country = downloadsender_geolocate($ip); 473 474 $check_email = $wpdb->get_results('SELECT * FROM ' . $wpdb->prefix . DOWNLOAD_SENDER_LOGS_TABLE.' WHERE email="' . $to . '"'); 475 476 // Log email adress. 477 if ( count($check_email) == 0 && !$options->get_option('disable_logs') ) { 478 $logs_table = $wpdb->prefix . DOWNLOAD_SENDER_LOGS_TABLE; 479 480 $row = array( 481 'ip' => $ip, 482 'country' => $country, 483 'recorde_date' => $cur_time, 484 'email' => $to, 485 'file_name' => $filename 486 ); 487 488 $row = array_filter($row); //Remove any null values. 489 $insert_table = $wpdb->insert($logs_table, $row); 470 $logs_table = $wpdb->prefix . DOWNLOAD_SENDER_LOGS_TABLE; 471 472 $check_email = $wpdb->get_results('SELECT * FROM ' . $logs_table . ' WHERE email="' . $to . '"'); 473 474 // Set email status to Verified 475 if ( count($check_email) != 0 ) { 476 $wpdb->update( $logs_table, array('email_verify' => 2), array('email' => $to) ); 490 477 } 491 478 … … 520 507 exit; 521 508 } 522 $file_url = '<a class="downloadsender-href" data-action="downloadsender_action_process" data- href="'.$download_link.'" data-file="'.$file.'" data-access-count="'.$access_count.'" data-message="'.$message.'" data-limit-date="'.$ajax->to_hours_days($expire_time/60).'" data-limit-downloads="'.$limit_downloads.'">'.$filename.'</a>';509 $file_url = '<a class="downloadsender-href" data-action="downloadsender_action_process" data-email="'.$to.'" data-href="'.$download_link.'" data-file="'.$file.'" data-access-count="'.$access_count.'" data-message="'.$message.'" data-limit-date="'.$ajax->to_hours_days($expire_time/60).'" data-limit-downloads="'.$limit_downloads.'">'.$filename.'</a>'; 523 510 } 524 511 -
download-sender/trunk/includes/core-functions.php
r2183907 r2186034 114 114 if ( class_exists( 'Download_Sender_Premium' ) ) { return true; } else { return false; } 115 115 } 116 117 /** 118 * Check if Download Sender Premium is activated 119 */ 120 function getPremiumButton() { 121 return '<a href="https://www.mustaphafersaoui.fr/wp-plugins/download-sender/download-sender-premium/" class="button button-primary get-premium-btn" target="_blank">'. __( 'Get Premium', 'download-sender' ).'</a>'; 122 } -
download-sender/trunk/readme.txt
r2184059 r2186034 25 25 * Disable file sending form for logged in users. 26 26 * Ability to enable/disable downloading logs. 27 * Abbilty to resending download link from in the admin logs page with a simple click. 27 28 * Export logs to CSV file. 28 29 * Configure URL of "Expired Link" page. … … 41 42 * Integrates well with **WPBakery Page Builder**. 42 43 * Add Google Captcha (reCAPTCHA) to the file sending form. 44 * Feature to verifies the email address at sending file time to minimize the sending of emails to non-working email addresses and receiving too many bounced and returned emails. 45 * Ability to verify emails manually from the logs page. 43 46 * Manually enter a valid URL with ability to use URLs of files hosted on external web sites. 44 47 * Set custom expiration times for your download links (Manually enter the number of hours or days). … … 99 102 == Changelog == 100 103 104 = 1.3.0 = 105 * New premium feature to verifies the email address at sending file time to minimize the sending of emails to non-working email addresses and receiving too many bounced and returned emails. 106 * Ability to verify emails manually from the admin logs page. 107 * Added feature to re-sending download link from in the logs page with a simple click. 108 * Added Notifications option : Max wrong send attempts reached - To prevent the maximum number of wrong sending attempts exceeded. 109 * Added logs search box. 110 * Added export logs filter. 111 * Fixed flag display on the logs page. 112 101 113 = 1.2.8 = 102 114 * Fix: reCAPTCHA is now working on pages with multiple captchas
Note: See TracChangeset
for help on using the changeset viewer.