Plugin Directory

Changeset 2186034


Ignore:
Timestamp:
11/05/2019 09:55:01 AM (6 years ago)
Author:
wpemaker
Message:

Update to version 1.3.0

Location:
download-sender/trunk
Files:
5 added
19 edited

Legend:

Unmodified
Added
Removed
  • download-sender/trunk/assets/css/admin.css

    r2063329 r2186034  
    150150    margin: 10px 0;
    151151}
     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}
     207ol.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
     217tr:hover > .column-email_verify > .button.checkme {
     218    opacity: 1;
     219}
     220ol.logsfiles-list li:hover .button.resend-download {
     221    opacity: 1;
     222}
     223tr: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}
     263p#confirme_resend_dld {
     264    display: inline-block;
     265    color: #111;
     266    font-size: 14px;
     267    margin-top: 0;
     268}
     269p#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  
    9797.downloadsender .button-primary, .downloadsender .button-secondary {
    9898    min-width: 120px;
     99    text-align: center;
    99100}
    100101.downloadsender_options-tab.singlebutton > div {
     
    281282}
    282283
     284/* Paragraph */
     285
     286
     287
    283288/* Labels */
    284289.downloadsender_options-tab label {
     
    371376    margin: 1px 0;
    372377}
    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*/
    374444/*-------------------------------------------------------------------------*/
    375445/*  tinyMCE
    376446/*-------------------------------------------------------------------------*/
    377447
     448[aria-describedby="downloadsender-mce-dialog"] .ui-dialog-title {
     449    color: #444;
     450}
    378451form#downloadsender-mce-dialog {
    379452    margin-bottom: 60px;
     
    487560    background: #fff;
    488561}
     562
     563.downloadsender_options-tab.premium_require .set-default {
     564    display: none;
     565}
     566
    489567.downloadsender_options-tab.file_url .set-default, .downloadsender_options-tab.file .set-default {
    490568    top: -16px;
  • download-sender/trunk/assets/css/premium.css

    r2063329 r2186034  
    1818.downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) {
    1919    position: relative;
    20     pointer-events: none;
     20    cursor: default;
    2121}
     22
    2223.downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) form,
    2324.downloadsender .premium_require:not(#file_tab):not(#download_btn_tab):not(#send_btn_tab):not(.mce-dialog-tabs):not(.downloadsender-icon-picker) > div,
     
    2526.downloadsender .downloads_allowed.premium_require p {
    2627    opacity: .5;
     28    pointer-events: none;
    2729}
    2830.downloadsender .premium_require.is_hidded, .downloadsender .premium.is_hidded {
     
    3032}
    3133
    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 {
    3335    font-family: Arial,sans-serif;
    34     content: 'Premium';
     36    content: 'Premium version required';
    3537    position: absolute;
    3638    right: 0;
     
    4749    display: inline-block;
    4850    width: auto;
     51    pointer-events: none;
    4952}
    5053.downloadsender .premium_require.inline-tag {
     
    7174    right: unset!important;
    7275}
     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  
    55            access_count = parseInt($(this).attr('data-access-count')),
    66            limit_downloads = parseInt($(this).attr('data-limit-downloads')),
     7            email = $(this).attr('data-email'),
    78            limit_date = $(this).attr('data-limit-date'),
    89            file = $(this).attr('data-file'),
     
    2021            data : {
    2122                action : action,
    22                 file : file,
     23                email  : email,
     24                file   : file,
    2325                access_count : access_count,
    2426                url : url,
     
    187189            warning_icon  = '<i class="'+data.attr('data-warning-icon')+'"></i>',
    188190            success_icon  = '<i class="'+data.attr('data-success-icon')+'"></i>';
    189                
     191       
    190192        response.removeClass('downloadsender-warning downloadsender-success empty-file');
    191193        var cookie_val = email+file_name;           
    192194       
    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;     
    196202       
    197203        var alert_text;
     
    215221                       
    216222            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');
    218240            return false;
    219241        }
     
    247269               
    248270                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                   
    249274                    alert_text = content_align === 'right' ? data.replace('FAILED', '')+warning_icon : warning_icon+data.replace('FAILED', '');
    250275                    response.html(alert_text);
     
    257282                    setCookie({cname: 'downloadsender_check_send', value: cookie_val, time: resend_timer, units: 'M'});
    258283                    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);
    259291                }
    260292            }
     
    322354            }
    323355        }
    324         return "";
     356        return null;
    325357    }
    326358
  • download-sender/trunk/assets/js/settings.js

    r2067522 r2186034  
    11jQuery( function( $ ) {
    22   
     3    $( document.body ).delegate( ".premium_require", "click", function() {
     4        return false;
     5    });
     6   
    37    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 + '&not_verified=true';
     36        }
     37       
     38        if ( $('input[name=checkbox_not_valid_logs]').attr('checked') ) {
     39            url = url + '&not_valid=true';
     40        }
     41        a.attr('href', url);
     42    }
     43   
    544    /*-------------------------------------------------------------------------*/
    645    /*  Update tinyMCE textarea content
     
    118157        downloadSenderDependencyTriggers(elements);
    119158    });
    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   
    121264    /*-------------------------------------------------------------------------*/
    122265    /*  Admin functions
     
    332475function downloadSenderPremiumRequire() {
    333476        if ( jQuery('.mce-dialog-tabs.premium_require').length !== 0 ) {
    334 
     477            var is_hidded_Class = 'is_hidded';
     478            is_hidded_Class = 'noon';
     479           
    335480            var i, op = jQuery(".premium_require #file_type")[0].getElementsByTagName("option");
    336481            for ( i = 0; i < op.length; i++) {
    337482                if ( op[i].value.toLowerCase() !== "file_picker" ) {
    338483                    op[i].disabled = true;
    339                     op[i].classList.add('premium', 'is_hidded');
     484                    op[i].classList.add('premium', is_hidded_Class);
    340485                } else {
    341486                    op[i].disabled = false;
    342                     op[i].classList.remove('premium', 'is_hidded');
     487                    op[i].classList.remove('premium', is_hidded_Class);
    343488                }
    344489            }
     
    348493                if ( op[i].value.toLowerCase() !== "never" && op[i].value.toLowerCase() !== "24"  ) {
    349494                    op[i].disabled = true;
    350                     op[i].classList.add('premium', 'is_hidded');
     495                    op[i].classList.add('premium', is_hidded_Class);
    351496                } else {
    352497                    op[i].disabled = false;
    353                     op[i].classList.remove('premium', 'is_hidded');
     498                    op[i].classList.remove('premium', is_hidded_Class);
    354499                }
    355500            }
     
    359504                if ( op[i].value.toLowerCase() !== "fill-hover" && op[i].value.toLowerCase() !== "outline-hover"  ) {
    360505                    op[i].disabled = true;
    361                     op[i].classList.add('premium', 'is_hidded');
     506                    op[i].classList.add('premium', is_hidded_Class);
    362507                } else {
    363508                    op[i].disabled = false;
    364                     op[i].classList.remove('premium', 'is_hidded');
     509                    op[i].classList.remove('premium', is_hidded_Class);
    365510                }
    366511            }
     
    370515                if ( op[i].value.toLowerCase() !== "fill-hover" && op[i].value.toLowerCase() !== "outline-hover"  ) {
    371516                    op[i].disabled = true;
    372                     op[i].classList.add('premium', 'is_hidded');
     517                    op[i].classList.add('premium', is_hidded_Class);
    373518                } else {
    374519                    op[i].disabled = false;
    375                     op[i].classList.remove('premium', 'is_hidded');
     520                    op[i].classList.remove('premium', is_hidded_Class);
    376521                }
    377522            }   
     
    393538    if ( target !== undefined ) {
    394539        downloadSenderToggleTabs(null, target);
     540    }
     541}
     542
     543// Confirm logs filter action
     544function 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?');
    395556    }
    396557}
  • download-sender/trunk/assets/js/shortcode.js

    r2067320 r2186034  
    66   
    77    $( document.body ).delegate( ".downloadsender-chosen", "change", function() {
    8         console.log('sss');
     8       
    99        var i, x, y, newclass='', classes = $(this)[0].className.split(' ');
    1010        for ( x = 0; x < classes.length; x++) {
  • download-sender/trunk/download-sender.php

    r2184059 r2186034  
    44 * Plugin URI: https://www.mustaphafersaoui.fr/wp-plugins/download-sender/
    55 * 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.8
     6 * Version: 1.3.0
    77 * Author: Mustapha FERSAOUI
    8  * Author URI: https://www.mustaphafersaoui.fr/wp-plugins/
     8 * Author URI: https://www.mustaphafersaoui.fr
    99 * Text Domain: download-sender
    1010 * Domain Path: /languages/
  • download-sender/trunk/includes/admin/class-admin-assets.php

    r2067320 r2186034  
    153153                    'downloadSender',
    154154                    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                    )
    165169            );
    166170            wp_enqueue_script( 'downloadsender-settings' );
     
    187191            wp_enqueue_script( 'chosen' );
    188192            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' );
    190199        }
    191200    }
  • download-sender/trunk/includes/admin/class-ajax-request.php

    r2183997 r2186034  
    1010use \DownloadSender\Post_Meta;
    1111use \DownloadSender\g_recaptcha;
     12use \DownloadSender\VerifyEmail;
    1213
    1314defined( 'ABSPATH' ) || exit;
     
    3738            'downloadsender_action_process'    => 'download_action_process',
    3839            'downloadsender_update_table'      => 'update_table',
     40            'downloadsender_resend_dld_request'=> 'resend_download',
    3941        );
    4042       
     
    4547    }
    4648   
     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   
    4785    /**
    4886     * Run download process
     
    66104        $table   = $wpdb->prefix . DOWNLOAD_SENDER_ENCRYPTED_LINKS_TABLE;
    67105        $file    = sanitize_text_field($_POST['file']);
    68 
     106        $email   = isset($_POST['email']) ? sanitize_email($_POST['email']) : '';
     107           
    69108        $results = $wpdb->get_results("SELECT * FROM $table WHERE download_key = '". $file ."' ");
    70109        foreach( $results as $key => $row) {
     
    86125
    87126        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));           
    89128            echo downloadsender_str_crypt( $download_link, 'd');
    90129        } else {
     
    242281    function send_request($data=array()) {
    243282        global $wpdb, $post;
     283       
    244284        $options = new Options;
    245285        $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');
    246294       
    247295        // To email address
     
    254302       
    255303        // 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']) ) {
    257305            $secret          = $options->get_option('secret_key');
    258306            $response        = $_POST["captcha"];
     
    267315        // return FAILED Error if record insert fails
    268316        if( !checkdnsrr(array_pop(explode("@",$to)),"MX")) {
    269             echo $options->get_option('success_msg');
     317            echo 'FAILED'.$options->get_option('wrong_email');
    270318            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            }
    271330        }
    272331       
     
    290349            }
    291350           
    292             $file       = downloadsender_str_crypt( $data['file_url'], 'e' );
     351            $file = downloadsender_str_crypt( $data['file_url'], 'e' );
    293352        } else {
    294353            $decrypted_link  = downloadsender_str_crypt( sanitize_text_field($_POST['file_url']), 'd' );
     
    344403        // final html link
    345404        $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.'"');
    346440               
     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       
    347451        // 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 
    355452        $shortcode    = array("{file_url}", "{blog_name}", "{blog_domain}", "{from_email}", "{blog_url}", "{expire_time}");
    356453        $shortcode_replace = array($file_url, $blogname, $blog_domain, $from_address, $blog_url, $full_expire_time );
     
    362459        $headers   .= "Content-type: text/html; charset=".get_bloginfo('charset')."" . "\r\n";
    363460        $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        }
    365467        // send message
    366468        $sent_message = wp_mail( $to, $subject, nl2br($message), $headers );
  • download-sender/trunk/includes/admin/class-html-elements.php

    r2183907 r2186034  
    230230        $class         = isset($data['class']) ? ' '.$data['class'] : '';
    231231        $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"' : '';
    232239       
    233240        echo self::Surround($data);
    234241        ?>
    235242            <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 { ?>
    236247                <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>
    238250            </div>
    239251            <?php
     
    486498        ?> 
    487499        <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
    489508            if(isset($data['label_to_value'])){
    490509                $value = 'fa '.$label;
     
    495514            <option class="<?php echo $value;?>" value="<?php echo $value;?>"
    496515            <?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        } ?>
    499524        </select>
    500525        <p class="description"<?php echo $desc_style;?>><?php echo $description;?></p>
     
    521546        </div>
    522547        <?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       
    525564    /**
    526565     * Output : open form
     
    551590        ?>
    552591        <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="">
    553602        <?php
    554603    }
     
    573622        <p class="description"><?php echo $description;?></p>   
    574623        </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>                 
    575644        <?php
    576645    }
  • download-sender/trunk/includes/admin/class-logs-page.php

    r2063329 r2186034  
    4141    public function column_default( $item, $column_name ) {
    4242        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
    5456        }
    5557    }   
     
    6769       
    6870        $actions = [
     71            'edit' => sprintf('<a href="?page=%s&action=%s&id=%s">Edit</a>', $_REQUEST['page'], 'edit', $item['id']),
    6972            '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),
    7073        ];
     
    98101    function get_columns() {
    99102        $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' )         
    106110        );
    107111        return $columns;
     
    115119    public function get_sortable_columns() {
    116120        $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 )
    122127        );
    123128
     
    201206     * Handles data query and filter, sorting, and pagination.
    202207     */
    203     public function prepare_items() {       
     208    public function prepare_items($search ='') {       
    204209        global $wpdb;
     210       
    205211       
    206212        $per_page     = $this->get_items_per_page( 'logs_per_page' );
     
    233239        $orderby_column = $this->order_recorde_by_array(
    234240            $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            );
    242249        $sort_order = $this->order_recorde_by_array(
    243250            $sort_order, array(
     
    247254            );
    248255       
    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       
    250263        $offset = ($current_page - 1) * $per_page;
    251264        $query .=' LIMIT ' . (int) $offset . ',' . (int) $per_page;//Limit to query to only load a limited number of records
     
    254267        //Prepare the array with the correct index names that the table is expecting.
    255268        $data = array();
     269       
     270        //$premium_require = !is_downloadsender_premium_activated() ? ' premium_require' : '';
     271        $premium_require = '';
    256272       
    257273        foreach ($data_results as $data_result) {           
     
    262278                $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>';
    263279            }
    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            }
    265332            $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
    272340            );
    273341        }
     
    281349        ));
    282350    }
     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    }
    283379   
    284380    /**
     
    351447                    'ck'=>'cook islands',
    352448                    'cr'=>'costa rica',
    353                     'ci'=>'cote d ivoire',
     449                    'ci'=>'ivory coast',
    354450                    'hr'=>'croatia',
    355451                    'cu'=>'cuba',
    356452                    'cy'=>'cyprus',
    357                     'cz'=>'czech republic',
     453                    'cz'=>'czechia',
    358454                    'dk'=>'denmark',
    359455                    'dj'=>'djibouti',
     
    400496                    'in'=>'india',
    401497                    'id'=>'indonesia',
    402                     'ir'=>'iran, islamic republic of',
     498                    'ir'=>'iran',
    403499                    'iq'=>'iraq',
    404500                    'ie'=>'ireland',
     
    407503                    'jm'=>'jamaica',
    408504                    'jp'=>'japan',
    409                     'jo'=>'jordan',
    410                     'kz'=>'kazakstan',
     505                    'jo'=>'hashemite kingdom of jordan',
     506                    'kz'=>'kazakhstan',
    411507                    'ke'=>'kenya',
    412508                    'ki'=>'kiribati',
    413509                    'kp'=>'korea, democratic peoples republic of',
    414                     'kr'=>'korea, republic of',
     510                    'kr'=>'republic of korea',
    415511                    'kw'=>'kuwait',
    416512                    'kg'=>'kyrgyzstan',
    417                     'la'=>'lao peoples democratic republic',
     513                    'la'=>'laos',
    418514                    'lv'=>'latvia',
    419515                    'lb'=>'lebanon',
    420516                    'ls'=>'lesotho',
    421517                    'lr'=>'liberia',
    422                     'ly'=>'libyan arab jamahiriya',
     518                    'ly'=>'libya',
    423519                    'li'=>'liechtenstein',
    424520                    'lt'=>'lithuania',
    425521                    'lu'=>'luxembourg',
    426                     'mo'=>'macau',
     522                    'mo'=>'macao',
    427523                    'mk'=>'macedonia, the former yugoslav republic of',
    428524                    'mg'=>'madagascar',
     
    439535                    'mx'=>'mexico',
    440536                    'fm'=>'micronesia, federated states of',
    441                     'md'=>'moldova, republic of',
     537                    'md'=>'republic of moldova',
    442538                    'mc'=>'monaco',
    443539                    'mn'=>'mongolia',
     
    463559                    'pk'=>'pakistan',
    464560                    'pw'=>'palau',
    465                     'ps'=>'palestinian territory, occupied',
     561                    'ps'=>'palestine',
    466562                    'pa'=>'panama',
    467563                    'pg'=>'papua new guinea',
     
    476572                    're'=>'reunion',
    477573                    'ro'=>'romania',
    478                     'ru'=>'russian federation',
     574                    'ru'=>'russia',
    479575                    'rw'=>'rwanda',
    480576                    'sh'=>'saint helena',
     
    509605                    'tw'=>'taiwan',
    510606                    'tj'=>'tajikistan',
    511                     'tz'=>'tanzania, united republic of',
     607                    'tz'=>'tanzania',
    512608                    'th'=>'thailand',
    513609                    'tg'=>'togo',
  • download-sender/trunk/includes/admin/class-options.php

    r2183997 r2186034  
    4646            'sending_failed'     => __("Failed to send the download link.", 'download-sender'),
    4747            '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.'),
    4850            'empty_email'        => __('Please fill out the email field', 'download-sender'),
    4951            '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  
    2222        add_action( 'admin_init', array( $this, 'add_settings_fields') );
    2323        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       
    2528    }
     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   
    26195    /**
    27196     * Validate screen options on update.
     
    45214         
    46215         $logs_obj = new DownloadSender_Logs();
    47 
     216         
    48217         add_screen_option(
    49218             'per_page', array(
     
    116285        ?>
    117286        <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() : ''; ?>       
    119289            <?php echo self::settings_errors(); ?>
    120290            <form method="post" id="downloadsender_settings" action='options.php'>
     
    354524                'type'       => 'Textarea',
    355525                'id'         => 'already_sent',
    356                 'heading'    => __( 'File already sent message', 'download-sender' ),
     526                'heading'    => __( 'File already sent', 'download-sender' ),
    357527                'sub_desc' => __( 'Prevent users from spamming your file sending forms.', 'download-sender' ),
    358528                'default'    => $options->get_default('already_sent'),
     
    361531                ),
    362532           
     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           
    363544            // Custom resend timer         
    364545            array('type' => 'openBlock', 'active' => true, 'class' => $premium_require), // start Premium block
     
    367548                'type'      => 'textfield',
    368549                'id'        => 'resend_timer',
    369                 'heading'    => __( '{timer} - Shortcode', 'download-sender' ),
     550                'heading'    => __( '{timer}', 'download-sender' ),
    370551                '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.',
    373564                ),
    374565           
     
    560751                'display'    => 'inline-block',
    561752                'class'      => 'right-block',
     753                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    562754                ),
    563755           
     
    572764                'display'    => 'inline-block',
    573765                'class'      => 'right-block',
     766                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    574767                ),
    575768
     
    582775                'html-content'  => $g_recaptcha,
    583776                'raw_style'     => 'line-height: 0;min-height: 0;',
     777                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    584778                ),
    585779
     
    593787                'class'         => 'description',
    594788                'raw_style'     => 'font-style: normal;',
     789                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    595790                ),
    596791
     
    601796                'type'       => 'heading',
    602797                'heading'    => 'Options',
     798                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    603799                ),
    604800
     
    611807                'display'    => 'block',
    612808                'raw_style'  => 'margin-bottom: 12px;',
     809                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    613810                ),
    614811           
     
    626823                'default'   => 'light',
    627824                'display'   => 'middle-inline',
     825                "dependency"  => array('element' => "enable_recaptcha", 'value' => array('true')),
    628826                ),
    629827
     
    659857           
    660858            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;',
    667869                ),
    668870
     
    8291031                                '60'   => __( 'Hour(s)', 'download-sender' ),
    8301032                            ),
    831                 'default'   => 'minutes',
     1033                'default'   => '60',
    8321034                'display'   => 'middle-inline',
    8331035                ),
     
    9871189                                '1'    => __( 'Minute(s)', 'download-sender' ),
    9881190                            ),
    989                 'default'    => 'minutes',
     1191                'default'    => '1',
    9901192                'display'    => 'middle-inline',
    9911193                ),
     
    10351237        <div class="wrap">
    10361238            <h2>Download Sender Logs</h2>
     1239            <?php //echo ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? self::get_premium() : ''; ?>
    10371240            <?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']); ?>" />
    10401243            <?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');
    10421254            $logs_obj->display();
    10431255            ?>
     
    10471259            <!-- Logs export button -->
    10481260            <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>
    10511286            </form>
    10521287
     
    10751310       
    10761311        $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
    10791315        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);
    10811352            fputcsv($fopen, $fields);
    10821353        }
     1354       
     1355        if(!isset($fields)){
     1356            fputcsv($fopen, array('No logs found for this request.'));
     1357        }
     1358       
    10831359        fclose($fopen);   
     1360       
    10841361        return DOWNLOAD_SENDER_ABSURL . '/logs.csv';
    10851362    }
     
    10911368        if ( ! current_user_can( 'manage_options' ) )
    10921369            return;
     1370
    10931371        $file_url = $this->generate_csv();
    10941372       
     
    11341412            <li>Admin functions, 9 Buttons Hover Animation Effects, Limit the number of downloads per user option, and more...</li>
    11351413        </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>
    11371415        </div>
    11381416    <?php
  • download-sender/trunk/includes/admin/class-tinymce.php

    r2068480 r2186034  
    4242     */
    4343    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         */
    5144        // Print directly html     
    5245        ?>
    5346        <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               
    5556                <?php echo $this->dialog_contents_tabs();?>
    5657                <div class="downloadsender-submitbox">
     
    6263                </div>
    6364            </form>
     65           
    6466        </div>
    6567        <?php
     
    7779        $premium_require   = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' premium_require' : '';
    7880        $is_hidded_require = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' is_hidded' : '';
    79          
     81        $is_hidded_require = '';
     82       
    8083        $pages = get_pages();
    8184        $page_list = array();
     
    8891        $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>';
    8992
     93        $premium_tag  = ! defined( 'DOWNLOAD_SENDER_PREMIUM' ) ? ' - [premium]' : '';
    9094        $hover_transitions = array(
    9195             'fill-hover'           => 'Fill on hover ',
    9296             'outline-hover'        => 'Outline on hover' ,
     97             'optgroup_in'          => 'Premium Hover Effects',
    9398             'fill-right-left'      => 'Fill from right to left',
    9499             'fill-left-right'      => 'Fill from left to right',
     
    100105             'fill-diagonal-right'  => 'Fill diagonal to right',
    101106             'fill-center'          => 'Fill from center',
     107             'optgroup_out'         => '',
    102108            );
    103109       
     
    291297                'value'       => array(
    292298                        'file_picker' => 'File picker',
    293                         'file_url'    => 'URL',
     299                        'file_url'    => 'Custom URL'.$premium_tag,
    294300                        ),
    295301                'default'     => 'file_picker',
     
    315321            ), 
    316322
     323            array('type' => 'openBlock', 'active' => true, 'unflex' => true, 'class' => $premium_require), // start Premium block
     324           
    317325            array(
    318326                "type"        => 'checkbox',
    319327                "heading"     => __("Direct download link button",  'download-sender'),
    320328                "id"          => "direct_link",
    321                 'class'       => $premium_require . $is_hidded_require,
     329                //'class'         => $premium_require . $is_hidded_require,
    322330                "value"       => 'yes',
    323331                'description' => __( 'This will disable the sending file form and allows the user to start downloading just by clicking the Download button.',  'download-sender' ),
    324332                "default"     => false,
    325333            ),
     334           
     335            array('type' => 'closeBlock'), // end block require premium
    326336
    327337            // Set expiration
     
    337347                'class'       => 'dependency-triggers',
    338348                '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',
    344355                        ),
    345356                'default'     => 'never',
  • download-sender/trunk/includes/class-download-sender.php

    r2183907 r2186034  
    4040        do_action( 'download_sender_loaded' );
    4141    }   
    42    
    4342   
    4443    /**
     
    186185                    recorde_date DATETIME DEFAULT '0000-00-00 00:00:00' NOT NULL,
    187186                    email MEDIUMTEXT NOT NULL,
     187                    status MEDIUMTEXT NOT NULL,
    188188                    file_name MEDIUMTEXT NOT NULL,
    189189                    PRIMARY KEY  (id)
     
    191191            dbDelta($sql);
    192192        }   
     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        }
    193213       
    194214        // Install the Download Links DB
  • download-sender/trunk/includes/class-frontend-scripts.php

    r2068578 r2186034  
    286286                'downloadSender',
    287287                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')
    298302                     )
    299303        );
  • download-sender/trunk/includes/class-shortcodes.php

    r2183907 r2186034  
    207207            $simply_button .= '<input type="hidden"
    208208                               data-post-id="' . get_the_ID() .'"
    209                                data-resend-timer="' . $options->get_option('resend_timer').'"
    210209                               data-form-desc="' . htmlentities($form_desc) .'"
    211210                               data-alert-class="'. $alert_pos.' alert-'.$alerts_style.$alert_shadow.'"
     
    440439            $file       = sanitize_text_field($_REQUEST['file']);
    441440            $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;
    443442           
    444443            if( !$user_email || !checkdnsrr(explode("@", $user_email)[1],"MX")) {
     
    469468               
    470469                // 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) );               
    490477                }   
    491478               
     
    520507                exit;
    521508            }
    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>';
    523510        }
    524511       
  • download-sender/trunk/includes/core-functions.php

    r2183907 r2186034  
    114114    if ( class_exists( 'Download_Sender_Premium' ) ) { return true; } else { return false; }
    115115}
     116
     117/**
     118 * Check if Download Sender Premium is activated
     119*/
     120function 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  
    2525* Disable file sending form for logged in users.
    2626* Ability to enable/disable downloading logs.
     27* Abbilty to resending download link from in the admin logs page with a simple click.
    2728* Export logs to CSV file.
    2829* Configure URL of "Expired Link" page.
     
    4142* Integrates well with **WPBakery Page Builder**.
    4243* 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.
    4346* Manually enter a valid URL with ability to use URLs of files hosted on external web sites.
    4447* Set custom expiration times for your download links (Manually enter the number of hours or days).
     
    99102== Changelog ==
    100103
     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
    101113= 1.2.8 =
    102114* Fix: reCAPTCHA is now working on pages with multiple captchas
Note: See TracChangeset for help on using the changeset viewer.