Plugin Directory

Changeset 1671400


Ignore:
Timestamp:
06/06/2017 03:00:59 AM (8 years ago)
Author:
Sanskritforum
Message:

version 3.5.0 release

Location:
skt-nurcaptcha
Files:
27 added
3 edited

Legend:

Unmodified
Added
Removed
  • skt-nurcaptcha/trunk/languages/skt-nurcaptcha.pot

    r1323591 r1671400  
    44"Project-Id-Version: Skt_nurcaptcha 1.0\n"
    55"Report-Msgid-Bugs-To: \n"
    6 "POT-Creation-Date: 2016-01-02 21:20-0200\n"
     6"POT-Creation-Date: 2017-05-31 21:47-0300\n"
    77"PO-Revision-Date: \n"
    88"Last-Translator: Carlos Eduardo G. Barbosa <carlos.eduardo@mais.com>\n"
     
    1717"X-Textdomain-Support: yes\n"
    1818"X-Poedit-Basepath: ..\n"
    19 "X-Generator: Poedit 1.8.6\n"
     19"X-Generator: Poedit 2.0.2\n"
    2020"X-Poedit-SearchPath-0: .\n"
    2121
     
    7272msgstr ""
    7373
    74 #: skt-nurc-admin.php:210 skt-nurcaptcha.php:245
     74#: skt-nurc-admin.php:210 skt-nurcaptcha.php:246
    7575msgid "Skt NURCaptcha Settings"
    7676msgstr ""
     
    431431msgstr ""
    432432
    433 #: skt-nurcaptcha.php:213 skt-nurcaptcha.php:559 skt-nurcaptcha.php:602
     433#: skt-nurcaptcha.php:214 skt-nurcaptcha.php:578 skt-nurcaptcha.php:621
    434434msgid "Fill the Captcha below"
    435435msgstr ""
    436436
    437 #: skt-nurcaptcha.php:241
     437#: skt-nurcaptcha.php:242
    438438msgid "Skt NURCaptcha Warning"
    439439msgstr ""
    440440
    441 #: skt-nurcaptcha.php:243
     441#: skt-nurcaptcha.php:244
    442442msgid ""
    443443"You must register your reCAPTCHA keys to have Skt NURCaptcha protection "
     
    445445msgstr ""
    446446
    447 #: skt-nurcaptcha.php:245
     447#: skt-nurcaptcha.php:246
    448448msgid "Go to"
    449449msgstr ""
    450450
    451 #: skt-nurcaptcha.php:245
     451#: skt-nurcaptcha.php:246
    452452msgid "and save your keys to the appropriate fields"
    453453msgstr ""
    454454
    455 #: skt-nurcaptcha.php:247
     455#: skt-nurcaptcha.php:248
    456456msgid "Be sure your keys are saved to the appropriate fields down here"
    457457msgstr ""
    458458
    459 #: skt-nurcaptcha.php:269
     459#: skt-nurcaptcha.php:270
    460460msgid "reCaptcha ERROR"
    461461msgstr ""
    462462
    463 #: skt-nurcaptcha.php:353
    464 msgid "username or email missing"
    465 msgstr ""
    466 
    467 #: skt-nurcaptcha.php:398
     463#: skt-nurcaptcha.php:363
     464msgid "username missing"
     465msgstr ""
     466
     467#: skt-nurcaptcha.php:367
     468msgid "email missing"
     469msgstr ""
     470
     471#: skt-nurcaptcha.php:412
    468472msgid "Registration Form"
    469473msgstr ""
    470474
    471 #: skt-nurcaptcha.php:398
     475#: skt-nurcaptcha.php:412
    472476msgid "Register For This Site"
    473477msgstr ""
    474478
    475 #: skt-nurcaptcha.php:407
     479#: skt-nurcaptcha.php:421
    476480#, php-format
    477481msgid "There is a problem with your response: %s"
    478482msgstr ""
    479483
    480 #: skt-nurcaptcha.php:419
     484#: skt-nurcaptcha.php:433
    481485msgid "Username"
    482486msgstr ""
    483487
    484 #: skt-nurcaptcha.php:424
    485 msgid "E-mail"
    486 msgstr ""
    487 
    488 #: skt-nurcaptcha.php:434
    489 msgid "A password will be e-mailed to you."
    490 msgstr ""
    491 
    492 #: skt-nurcaptcha.php:446
     488#: skt-nurcaptcha.php:438
     489msgid "Email"
     490msgstr ""
     491
     492#: skt-nurcaptcha.php:453
     493msgid "Registration confirmation will be emailed to you."
     494msgstr ""
     495
     496#: skt-nurcaptcha.php:465
    493497msgid "Log in"
    494498msgstr ""
    495499
    496 #: skt-nurcaptcha.php:447
     500#: skt-nurcaptcha.php:466
    497501msgid "Lost your password?"
    498502msgstr ""
    499503
    500 #: skt-nurcaptcha.php:518
     504#: skt-nurcaptcha.php:537
    501505msgid ""
    502506"Use only non-accented alphanumeric characters plus these: _ [underscore], "
     
    504508msgstr ""
    505509
    506 #: skt-nurcaptcha.php:525
     510#: skt-nurcaptcha.php:544
    507511msgid ""
    508512"Use a functional email address, as your temporary password will be sent to "
     
    510514msgstr ""
    511515
    512 #: skt-nurcaptcha.php:533
     516#: skt-nurcaptcha.php:552
    513517msgid ""
    514518"To get registered, just transcribe both the words, numbers and signs you see "
     
    518522msgstr ""
    519523
    520 #: skt-nurcaptcha.php:538
     524#: skt-nurcaptcha.php:557
    521525msgid ""
    522526"To get registered, just click on the box below to confirm you're not a spam "
     
    528532msgstr ""
    529533
    530 #: skt-nurcaptcha.php:707
     534#: skt-nurcaptcha.php:727
    531535msgid "Could not open socket - server communication failed - try again later."
    532536msgstr ""
    533537
    534 #: skt-nurcaptcha.php:760
     538#: skt-nurcaptcha.php:780
    535539#, php-format
    536540msgid "To use reCAPTCHA you must get an API key from %s"
    537541msgstr ""
    538542
    539 #: skt-nurcaptcha.php:765
     543#: skt-nurcaptcha.php:785
    540544msgid "For security reasons, you must pass the remote ip to reCAPTCHA"
    541545msgstr ""
    542546
    543 #: skt-nurcaptcha.php:770
     547#: skt-nurcaptcha.php:790
    544548msgid "Inconsistency detected - try again later."
    545549msgstr ""
    546550
    547 #: skt-nurcaptcha.php:774
     551#: skt-nurcaptcha.php:794
    548552msgid "Response field was empty!"
    549553msgstr ""
    550554
    551 #: skt-nurcaptcha.php:800
     555#: skt-nurcaptcha.php:820
    552556msgid "Incorrect Captcha solution - please try again."
    553557msgstr ""
    554558
    555 #: skt-nurcaptcha.php:837
     559#: skt-nurcaptcha.php:872
    556560msgid "error: No return data from query. Try again later."
    557561msgstr ""
    558562
    559 #: skt-nurcaptcha.php:841
     563#: skt-nurcaptcha.php:877
    560564msgid ""
    561565"says: 'Spammer signature found!' Registration will not be allowed for this "
     
    563567msgstr ""
    564568
    565 #: skt-nurcaptcha.php:844
     569#: skt-nurcaptcha.php:878
    566570msgid "is suspect"
    567571msgstr ""
    568572
    569 #: skt-nurcaptcha.php:845
    570 msgid "occurrences found"
    571 msgstr ""
    572 
    573 #: skt-nurcaptcha.php:881
     573#: skt-nurcaptcha.php:883
     574msgid "says: data checked - no spammer! "
     575msgstr ""
     576
     577#: skt-nurcaptcha.php:915
    574578msgid "error: No return data from API query."
    575579msgstr ""
    576580
    577 #: skt-nurcaptcha.php:888
     581#: skt-nurcaptcha.php:922
    578582#, php-format
    579583msgid "error: %s"
    580584msgstr ""
    581585
    582 #: skt-nurcaptcha.php:904
     586#: skt-nurcaptcha.php:938
    583587msgid ""
    584588"says: 'Bot signature found!' Registration will not be allowed for this user."
    585589msgstr ""
    586590
    587 #: skt-nurcaptcha.php:1007
     591#: skt-nurcaptcha.php:1041
    588592msgid "Log table successfully deleted."
    589593msgstr ""
  • skt-nurcaptcha/trunk/readme.txt

    r1578191 r1671400  
    44Tags: security, login form, new user, captcha, spambots, reCAPTCHA, register form, bots, spam, register, anti-spam
    55Requires at least: 4.0
    6 Tested up to: 4.7
    7 Stable tag: 3.4.90
     6Tested up to: 4.8
     7Stable tag: 3.5.0
    88
    99NURCaptcha inserts a reCAPTCHA on the Register Form of your site to protect it against spambots.
     
    8585== Changelog ==
    8686
     87= 3.5.0 =
     88* Upgrade in antispam databases querying routines and a few other small fixes
    8789= 3.4.90 =
    8890* Small adjustments to PHP7 affecting BuddyPress installs
     
    163165== Upgrade Notice ==
    164166
     167= 3.5.0 =
     168* Upgrade in antispam databases querying routines
    165169= 3.4.90 =
    166170* Small adjustments to PHP7 affecting BuddyPress installs
  • skt-nurcaptcha/trunk/skt-nurcaptcha.php

    r1578191 r1671400  
    44    Plugin URI: https://skt-nurcaptcha.sanskritforum.org/
    55    Description: If your Blog allows new subscribers to register via the registration option at the Login page, this plugin may be useful to you. It includes a reCaptcha block to the register form, so you get rid of spambots. To use it you have to sign up for (free) public and private keys at <a href="https://www.google.com/recaptcha/admin#createsite" target="_blank">reCAPTCHA API Signup Page</a>. Version 3 added extra security by querying antispam databases for known ip and email of spammers, so you get rid of them even if they break the reCaptcha challenge by solving it as real persons.
    6     Version: 3.4.90
     6    Version: 3.5.0
    77    Author: Carlos E. G. Barbosa
    88    Author URI: http://www.yogaforum.org
     
    324324* Main routine - non-multisite ***
    325325* This code overrides entirely the 'register' case on main switch @ wp_login.php
    326 * we fetch the 'login-form-register' hook
     326* we fetch the 'login_form_register' hook
    327327* You may experience some problems if you install another plugin that needs to customize those lines.
    328328*
     
    331331
    332332    $http_post = ('POST' == $_SERVER['REQUEST_METHOD']);
     333   
    333334    if ( is_multisite() ) {
    334         // Multisite uses wp-signup.php
    335         wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) );
    336         exit();
    337     }
    338    
    339     if ( !get_site_option('users_can_register') ) {
     335        /**
     336         * Filters the Multisite sign up URL.
     337         *
     338         * @since 3.0.0
     339         *
     340         * @param string $sign_up_url The sign up URL.
     341         */
     342        wp_redirect( apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ) );
     343        exit;
     344    }
     345
     346    if ( !get_option('users_can_register') ) {
    340347        wp_redirect( site_url('wp-login.php?registration=disabled') );
    341348        exit();
     
    350357    $errors = NULL;
    351358    if ( $http_post ) { // if we have a response, let's check it
    352         $user_login = $_POST['user_login'];
    353         $user_email = $_POST['user_email'];
    354         if (($user_login =='')||($user_email=='')){
     359        $user_login = isset( $_POST['user_login'] ) ? $_POST['user_login'] : '';
     360        $user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : '';
     361        if ($user_login ==''){
    355362            $result->is_valid = false;
    356             $result->error = __("username or email missing", 'skt-nurcaptcha');
     363            $result->error = __("username missing", 'skt-nurcaptcha');
     364        }
     365        if ($user_email==''){
     366            $result->is_valid = false;
     367            $result->error = __("email missing", 'skt-nurcaptcha');
    357368        }
    358369        if ($result->is_valid) {
     
    418429    <?php }else{ ?>
    419430        style="width:300px;"
    420     <?php } ?> novalidate="novalidate">
     431    <?php } ?> novalidate>
    421432    <p>
    422         <label><?php _e('Username', 'skt-nurcaptcha'); ?><?php nurc_username_help(); ?>
     433        <label for="user_login"><?php _e('Username'); ?><?php nurc_username_help(); ?>
    423434        <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" />
    424435        </label>
    425436    </p>
    426437    <p>
    427         <label><?php _e('E-mail', 'skt-nurcaptcha'); ?><?php nurc_email_help(); ?>
     438        <label for="user_email"><?php _e('Email'); ?><?php nurc_email_help(); ?>
    428439        <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" />
    429440        </label>
     
    432443    <?php
    433444    nurc_recaptcha_challenge();
     445    /**
     446     * Fires following the 'Email' field in the user registration form.
     447     *
     448     * @since 2.1.0
     449     */
    434450    do_action('register_form');
    435451    ?>
    436452   
    437     <p id="reg_passmail"><?php _e('A password will be e-mailed to you.', 'skt-nurcaptcha'); ?></p>
     453    <p id="reg_passmail"><?php _e( 'Registration confirmation will be emailed to you.' ); ?></p>
    438454    <br class="clear" />
    439455    <input type="hidden" name="redirect_to" value="<?php echo esc_attr( $redirect_to ); ?>" />
     
    447463
    448464<p id="nav">
    449 <a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e('Log in', 'skt-nurcaptcha'); ?></a> |
    450 <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>" title="<?php esc_attr_e('Password Lost and Found', 'skt-nurcaptcha'); ?>"><?php _e('Lost your password?', 'skt-nurcaptcha'); ?></a>
     465<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a> |
     466<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
    451467</p>
    452468<?php
     
    662678       
    663679        if (defined('SKTNURC_BP_ACTIVE')) {
    664             $ue = $_POST['signup_email'];
    665             $ul = $_POST['signup_username'];
     680            $ue = (isset($_POST['signup_email']))? $_POST['signup_email']: '';
     681            $ul = (isset($_POST['signup_username']))? $_POST['signup_username']: '';
    666682        }else{
    667             $ue = $_POST['user_email'];
     683            $ue = (isset($_POST['user_email']))? $_POST['user_email']: '';
    668684            if ( is_multisite() ) {     
    669                 $ul = $_POST['user_name'];
     685                $ul = (isset($_POST['user_name']))? $_POST['user_name']: '';
    670686            }else{
    671                 $ul = $_POST['user_login'];
     687                $ul = (isset($_POST['user_login']))? $_POST['user_login']: '';
    672688            }
    673689        }
     
    827843*
    828844****/
    829 function skt_nurc_check_stopforumspam($XMAIL = '', $XIP = '', $XNAME = '') {
     845function skt_nurc_check_stopforumspam($email='', $ip='', $username =''){
    830846    $stopforumspam_response = new nurc_ReCaptchaResponse();
    831     $returned_data=''; $botdata='';
    832    
    833     $XMAIL = urlencode($XMAIL); // make url compliant with urlencode()
    834     $test_string = "http://www.stopforumspam.com/api?ip=$XIP&email=$XMAIL&username=$XNAME";
    835    
    836     $xmlstr = skt_nurc_get_page($test_string);
    837     $xml = simplexml_load_string($xmlstr);
    838    
    839     if($xml->appears[0] == '' || $xml->appears[1] == '' || $xml->appears[2] == ''){
    840         $stopforumspam_response->is_valid = false;
    841         $stopforumspam_response->error = 'StopForumSpam '. __("error: No return data from query. Try again later.", 'skt-nurcaptcha').'<strong>';
    842     }
    843     if($xml->appears[0] == 'yes' || $xml->appears[1] == 'yes' || $xml->appears[2] == 'yes'){
    844         $stopforumspam_response->is_valid = false;
    845         $stopforumspam_response->error = 'StopForumSpam '. __("says: 'Spammer signature found!' Registration will not be allowed for this user ", 'skt-nurcaptcha').'<strong>';
    846         for ($i = 0; $i < 3; $i++) {
    847             if($xml->appears[$i] == 'yes'){
    848                 $stopforumspam_response->error .= ':: '. $xml->type[$i] . ' ' . __("is suspect", 'skt-nurcaptcha') . ' ';
    849                 $stopforumspam_response->error .= '[' . $xml->frequency[$i] . ' ' . __("occurrences found", 'skt-nurcaptcha') .'] ';
    850             }
    851         }
    852         $stopforumspam_response->error .= '</strong>';
    853     } else {
    854         $stopforumspam_response->is_valid = true;
     847    $url = 'http://api.stopforumspam.org/api';
     848    $data = array();
     849    if($email!='') $data['email']=$email;
     850    if($ip!='') $data['ip']=$ip;
     851    if($username!='') $data['username']=$username;
     852    $data = http_build_query($data);
     853
     854    // init the request, set some info, send it and finally close it
     855    $ch = curl_init($url);
     856    curl_setopt($ch, CURLOPT_POST, 1);
     857    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
     858    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     859    $result = curl_exec($ch);
     860    curl_close($ch);
     861
     862    $xml = simplexml_load_string($result);
     863    $rnum = count($xml->appears);
     864    if(isset($xml->error)){
     865            $stopforumspam_response->is_valid = false;
     866            $stopforumspam_response->error = 'StopForumSpam '. $xml->error[0];
     867            return $stopforumspam_response;
     868    }
     869    for($i=0;$i<$rnum;$i++){
     870        if($xml->appears[$i] == ''){
     871            $stopforumspam_response->is_valid = false;
     872            $stopforumspam_response->error = 'StopForumSpam '. __("error: No return data from query. Try again later.", 'skt-nurcaptcha').'<strong>';
     873            break;
     874        }
     875        if($xml->appears[$i] == 'yes'){
     876            $stopforumspam_response->is_valid = false;
     877            $stopforumspam_response->error = 'StopForumSpam '. __("says: 'Spammer signature found!' Registration will not be allowed for this user ", 'skt-nurcaptcha').'<strong>';
     878            $stopforumspam_response->error .= ':: '. $xml->type[$i] . ' ' . __("is suspect", 'skt-nurcaptcha') . ' ';
     879            $stopforumspam_response->error .= '</strong>';
     880            break;
     881        } else {
     882            $stopforumspam_response->is_valid = true;
     883            $stopforumspam_response->error = 'StopForumSpam '. __("says: data checked - no spammer! ", 'skt-nurcaptcha');
     884        }
    855885    }
    856886    return $stopforumspam_response;
    857        
     887
    858888} // here ends: function skt_nurc_check_stopforumspam()
    859889
     
    867897    $returned_data=''; $botdata='';
    868898    $APIKEY = get_site_option('sktnurc_botscoutKey');
    869    
    870     $XMAIL = urlencode($XMAIL); // make url compliant with urlencode()
    871     if ($XNAME == ''){
    872         $test_string = "http://botscout.com/test/?multi&mail=$XMAIL";
    873     }else{
    874         $test_string = "http://botscout.com/test/?multi&name=$XNAME&mail=$XMAIL";
    875     }
    876     if(get_site_option('sktnurc_botscoutTestMode')==false){$test_string .= "&ip=$XIP";}
    877     if($APIKEY != ''){   // append API key.
    878         $test_string .= "&key=$APIKEY";
    879     }
    880    
     899
     900    $test_string = "http://botscout.com/test/?";
     901    $data = array();
     902    if($email!='') $data['mail']=$email;
     903    if(($ip!='')&&(get_site_option('sktnurc_botscoutTestMode')=='false')) $data['ip']=$ip;
     904    if($username!='') $data['name']=$username;
     905    if($APIKEY != '') $data['key']= $APIKEY;
     906    $query = http_build_query($data);
     907    $query = (count($data)>1)? 'multi&'.$query:$query;
     908    $test_string .= $query;
     909
     910
    881911    $returned_data = skt_nurc_get_page($test_string);
    882912
    883913    if($returned_data==''){
    884         $botscout_response->is_valid = false;
     914        $botscout_response->is_valid = true; // no answer from botscout - so, drop the test
    885915        $botscout_response->error = 'BotScout ' . __("error: No return data from API query.", 'skt-nurcaptcha');
    886916        return $botscout_response;
     
    889919    if(substr($returned_data, 0,1) == '!'){
    890920        // the first character is an exclamation mark, an error occurred! 
    891         $botscout_response->is_valid = false;
     921        $botscout_response->is_valid = true; // botscout site failed to answer, so, drop the test
    892922        $botscout_response->error = 'BotScout ' . sprintf(__("error: %s", 'skt-nurcaptcha'),$returned_data);
    893923        return $botscout_response;
     
    10121042    }
    10131043}
    1014 /************
    1015 * This method solves the problem of server restrictions on getting external url contents
    1016 * such as the responses given by antispam databases
    1017 * Thanks to Greg on (http://www.bugz.com.br/2011/09/file_get_contents/) [pt_BR]
    1018 *************/
    1019 function skt_nurc_get_page($url, $referer='', $timeout=30, $header=''){
    1020         if ($referer=='') $referer='http://'.$_SERVER['HTTP_HOST'];
    1021         if(!isset($timeout)) $timeout=30;
    1022         $curl = curl_init();
    1023         if(strstr($referer,"://")){
    1024             curl_setopt ($curl, CURLOPT_REFERER, $referer);
    1025         }
    1026         curl_setopt ($curl, CURLOPT_URL, $url);
    1027         curl_setopt ($curl, CURLOPT_TIMEOUT, $timeout);
    1028         curl_setopt ($curl, CURLOPT_USERAGENT, sprintf("Mozilla/%d.0",rand(4,5)));
    1029         curl_setopt ($curl, CURLOPT_HEADER, (int)$header);
    1030         curl_setopt ($curl, CURLOPT_RETURNTRANSFER, 1);
    1031         curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, 0);
    1032         $html = curl_exec ($curl);
    1033         curl_close ($curl);
    1034         return $html;
    1035     }
     1044/**
     1045* Send a GET request using cURL
     1046* @param string $url to request
     1047* @param array $get values to send
     1048* @param array $options for cURL
     1049* @return string
     1050*/
     1051function skt_nurc_get_page($url, array $get = null, array $options = array()){
     1052    if($get !== null) $url = $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get);
     1053    $protocol = ($_SERVER['HTTPS'])? 'https':'http';
     1054    $referer= $protocol.'://'.$_SERVER['HTTP_HOST'];
     1055    $defaults = array(
     1056        CURLOPT_URL => $url,
     1057        CURLOPT_USERAGENT => 'Mozilla/5.0',
     1058        CURLOPT_HEADER => 0,
     1059        CURLOPT_RETURNTRANSFER => TRUE,
     1060        CURLOPT_TIMEOUT => 30,
     1061        CURLOPT_SSL_VERIFYPEER => false,
     1062        CURLOPT_REFERER => $referer
     1063    );
     1064    $ch = curl_init();
     1065    curl_setopt_array($ch, ($options + $defaults));
     1066    if( ! $result = curl_exec($ch)) $result ='';
     1067    curl_close($ch);
     1068    return $result;
     1069}
    10361070/***************
    10371071* This method derived from one published by Manish Zope, as a comment at:
Note: See TracChangeset for help on using the changeset viewer.