Skip to content

Commit

Permalink
Some fix and WGG 1.6 RC2
Browse files Browse the repository at this point in the history
- Fixed an issue that breaks the signup forms (Domain not Allowed) in
some installations.
- Fixed an issue with security questions that are not showed in some
installation.
- Fixed a bug related to non Multisite websites.
- Fixed some translation problems
- Added CSS style for Whitelisted Users
  • Loading branch information
joseconti committed May 15, 2014
1 parent 2e6899e commit d1bd0ae
Show file tree
Hide file tree
Showing 8 changed files with 2,717 additions and 118 deletions.
5 changes: 5 additions & 0 deletions css/wangguard.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ a.wangguard-recheck {
color: #d54e21;
}

.wangguard-status-whitelisted {
color: #00a000;
font-weight: bold;
text-decoration:underline;
}
.wangguard-rollback {
color: #d54e21;
}
Expand Down
Binary file added languages/wangguard-nl_NL.mo
Binary file not shown.
2,604 changes: 2,604 additions & 0 deletions languages/wangguard-nl_NL.po

Large diffs are not rendered by default.

41 changes: 38 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Author URI: http://wangguard.com
Tags: wangguard, wgg, sploggers, splog, anti-splog, user spam, anti spam users, anti-spam, spam blog, spam blogs, wordpress, buddypress, wpmu, wordpress mu, wordpress multisite, standard WordPress, registration, security, security questions, plugin, sign up, signup, spam, wp-login.php, wp-signup.php, wp-register.php, register, registration, protect, protect registration, block agents, block ip, blog secure, bots, secure blog, secure wordpress, secure wp, website security, wp secure, wp security, block users, block user, block, block emails, block e-mails, block domains, block bots, block bot, bp, captcha, no captcha, recaptcha, unwanted users, block unwanted users, block splog, black hat, blackhat, bbpress, clean, clean database, clean splog, clean users, untrusted, untrusted users, ip, ip information, user admin, user management, advanced user management, ip info, appthemes, user registration spam, users registration spam, user registration spam prevention, users registration spam prevention, woocommerce
Requires at least: 3.0
Tested up to: 3.9
Stable tag: 1.6-RC1
Stable tag: 1.6-RC2
License: GPLv2

The most advanced protection against sploggers and spam users registration, is fully WordPress,WordPress MU ,BuddyPress and bbPress 2.0 compatible
Expand All @@ -14,6 +14,15 @@ The most advanced protection against sploggers and spam users registration, is f

= Welcome to WangGuard, Welcome to the revolution =

= WangGuard Add-ons =

* [WangGuard - MailPoet Connector](http://wordpress.org/plugins/wangguard-wysija-newsletter-connector/)
* [WangGuard Blacklisted Words](http://wordpress.org/plugins/wangguard-blacklisted-words-add-on/)
* [WangGuard Limited Registration Domain](http://wordpress.org/plugins/wangguard-limited-registration-domain-add-on/)
* [WangGuard Registration Notice](http://wordpress.org/plugins/wangguard-registration-notice-add-on/)

And more to come!

[Please, read the WangGuard's philosophy](http://wangguard.org/2011/12/26/welcome-to-wangguard-welcome-to-the-revolution/)

WangGuard works by incorporating an antivirus philosophy.
Expand All @@ -22,7 +31,25 @@ WangGuard works by incorporating an antivirus philosophy.

WangGuard Always will be free for personal use, this means that whenever you have less than 500 daily registrations or you make less than $200/month, you never have to pay anything for WangGuard.

Over 43.500.000+ Splogger/unwanted users blocked in just 2 years and half.
Over 57.000.000+ Splogger/unwanted users blocked

But now, WangGuard is free for every one for limited time.

One time we believe that we've added all the necessary tools, we will begin to charge for WangGuard to users that have more than 500 queries a day, making more than $200/month or are companies.

= These are preliminary prices =

* From 0 to 500 queries day FREE (only personal use. Companies and webmasters making more than $200/month, see next level).

* From 501 to 5.000 queries day, 4€/month. (this will be the basic level for Companies and webmasters making more than $200/month).

* From 5.001 to 15.000 queries day, 8€/month.

* From 15.001 to 30.000 queries day, 15€/month.

* From 30.001 to 60.000 queries day, 50€/month

* +60.000 queries day, contact with us.

WangGuard already is blocking 99.90% of sploggers and unwanted users.

Expand Down Expand Up @@ -172,7 +199,7 @@ No need to put any kind of filter in the user registration page (eg captcha). Th
= Requirements/Restrictions =


* Works with Wordpress 2.8+, WPMU 2.8+, BuddyPress 1.0.3+, bbPress 2.0+ (Wordpress 3.5+ is highly recommended)
* Works with Wordpress 3.8+, WPMU 3.8+, BuddyPress 1.0.3+, bbPress 2.0+ (Wordpress 3.9+ is highly recommended)
* PHP 4.3 or above. (PHP 5+ is highly recommended)


Expand Down Expand Up @@ -291,6 +318,14 @@ It is free for personal use. If you earn more than $200/month with your site or

== Changelog ==

= 1.6 RC2 - 14 May 2014 =

- Fixed an issue that breaks the signup forms (Domain not Allowed) in some installations.
- Fixed an issue with security questions that are not showed in some installation.
- Fixed a bug related to non Multisite websites.
- Fixed some translation problems
- Added CSS style for Whitelisted Users

= 1.6 RC1 - 23 April 2014 =

- Added compatibility with WordPress 3.9.
Expand Down
4 changes: 2 additions & 2 deletions wangguard-about.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ function wangguard_contributors() {

if ( $contributor->login != 'joseconti') {
$contributor_list .= '<li class="wp-person">';
$contributor_list .= sprintf( '<a href="%s" title="%s">',esc_url( 'https://github.com/' . $contributor->login ),esc_html( sprintf( __( 'View %s', 'woocommerce' ), $contributor->login ) ));
$contributor_list .= sprintf( '<a href="%s" title="%s">',esc_url( 'https://github.com/' . $contributor->login ),esc_html( sprintf( __( 'View %s', 'wangguard' ), $contributor->login ) ));
$contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
$contributor_list .= '</a>';
$contributor_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
Expand Down Expand Up @@ -167,7 +167,7 @@ function wangguard_commits() {
$commit_list .= '<div>';
$commit_list .= '<ul class="wp-people-group">';
$commit_list .= '<li class="wp-person">';
$commit_list .= sprintf( '<a href="%s" title="%s">',esc_url( $commit->author->html_url ),esc_html( sprintf( __( 'View %s', 'woocommerce' ), $commit->commit->author->name ) ));
$commit_list .= sprintf( '<a href="%s" title="%s">',esc_url( $commit->author->html_url ),esc_html( sprintf( __( 'View %s', 'wangguard' ), $commit->commit->author->name ) ));
$commit_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $commit->author->avatar_url ), esc_html( $commit->author->login ) );
$commit_list .= '</a>';
$commit_list .= sprintf( '<a class="web" href="%s">%s</a>', esc_url( 'https://github.com/' . $commit->commit->author->name ), esc_html( $commit->commit->author->name ) );
Expand Down
103 changes: 20 additions & 83 deletions wangguard-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: WangGuard
Plugin URI: http://www.wangguard.com
Description: <strong>Stop Sploggers</strong>. It is very important to use <a href="http://www.wangguard.com" target="_new">WangGuard</a> at least for a week, reporting your site's unwanted users as sploggers from the Users panel. WangGuard will learn at that time to protect your site from sploggers in a much more effective way. WangGuard protects each web site in a personalized way using information provided by Administrators who report sploggers world-wide, that's why it's very important that you report your sploggers to WangGuard. The longer you use WangGuard, the more effective it will become.
Version: 1.6-RC1
Version: 1.6-RC2
Author: WangGuard
Author URI: http://www.wangguard.com
License: GPL2
Expand All @@ -23,7 +23,7 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

define('WANGGUARD_VERSION', '1.6-RC1');
define('WANGGUARD_VERSION', '1.6-RC2');
define('WANGGUARD_PLUGIN_FILE', 'wangguard/wangguard-admin.php');
define('WANGGUARD_README_URL', 'http://plugins.trac.wordpress.org/browser/wangguard/trunk/readme.txt?format=txt');
define('WANGGUARD_API_HOST', 'rest.wangguard.com');
Expand Down Expand Up @@ -61,13 +61,6 @@
/*** CONFIG ENDS ***/
/********************************************************************/

// We are working here arround BuddyPress. Will be live in future version.

function wangguard_buddypress_init() {
require( dirname( __FILE__ ) . '/wangguard-buddypress.php' );
}
add_action( 'bp_include', 'wangguard_buddypress_init' );

/********************************************************************/
/*** ADD & VALIDATE SECURITY QUESTIONS ON REGISTER BEGINS ***/
/********************************************************************/
Expand All @@ -84,32 +77,14 @@ function wangguard_buddypress_init() {
add_action('register_post','wangguard_signup_validate',10,3);

// for WooCommerce
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );

if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
add_action('woocommerce_after_checkout_validation','wangguard_plugin_woocommerce_checkout_signup');
}

$wangguard_add_mu_filter_actions = true;

if (defined('BP_VERSION')) {

if (version_compare(BP_VERSION, '1.1') >= 0) {
$wangguard_add_mu_filter_actions = false;
$wangguard_bp_hook = "bp_after_account_details_fields";
// for buddypress 1.1 only
if ( get_site_option("wangguard-add-honeypot")=='1') {
add_action($wangguard_bp_hook,'wangguard_add_hfield_1' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_2' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_3' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_4' , rand(1,10));
}
add_action('bp_before_registration_submit_buttons', 'wangguard_register_add_question_bp11');
add_action('bp_signup_validate', 'wangguard_signup_validate_bp11' );
}

}


}
if(has_action('bp_include')) {
$wangguard_add_mu_filter_actions = false;
}else{$wangguard_add_mu_filter_actions = true;}
if ($wangguard_add_mu_filter_actions) {
// for wpmu and (buddypress versions before 1.1)
if ( get_site_option("wangguard-add-honeypot")=='1') {
Expand All @@ -122,6 +97,11 @@ function wangguard_buddypress_init() {
add_filter('wpmu_validate_user_signup', 'wangguard_wpmu_signup_validate_mu', 90);
}

//Calling to functions for BuddyPress
function wangguard_buddypress_init() {
require( dirname( __FILE__ ) . '/wangguard-buddypress.php' );
}
add_action( 'bp_include', 'wangguard_buddypress_init' );
/**
* Checks MX record for an email domain's
*
Expand Down Expand Up @@ -201,7 +181,6 @@ function wangguard_email_aliases_exists($email) {

return false;
}

$wangguard_NonceHName = 'wangguard-hidden-field-check';
$wangguard_NonceFName = 'wangguard-hidden-display-check';
$wangguard_NoncePName = 'wangguard-hidden-position-check';
Expand All @@ -224,7 +203,6 @@ function wangguard_randomstring($rndLen) {
return $str;
}


function wangguard_add_hfield_1() {
global $wangguard_NonceHName , $wangguard_HPrefix;
$nonceAct = $wangguard_NonceHName;
Expand All @@ -234,7 +212,6 @@ function wangguard_add_hfield_1() {
echo $nonce_field;
}


function wangguard_add_hfield_2() {
global $wangguard_NonceFName , $wangguard_FPrefix;
$style = wangguard_randomstring(mt_rand(6,10));
Expand All @@ -246,7 +223,6 @@ function wangguard_add_hfield_2() {
echo $nonce_field;
}


function wangguard_add_hfield_3() {
global $wangguard_NoncePName;
$style = wangguard_randomstring(mt_rand(6,10));
Expand All @@ -259,7 +235,6 @@ function wangguard_add_hfield_3() {
echo $nonce_field;
}


function wangguard_add_hfield_4() {
global $wangguard_NonceCName;
$style = wangguard_randomstring(mt_rand(6,10));
Expand Down Expand Up @@ -357,8 +332,9 @@ function wangguard_wpmu_signup_validate_mu($result) {
if ( strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false ) {
return $result;
}
if(!$user_email){$user_email = $_POST['user_email'];}else{$user_email=$user_email;}
$user_email = $_POST['user_email'];
if ($_POST['signup_email']) return;
if(!$user_email){$user_email = $_POST['user_email'];}else{$user_email=$user_email;}
//$user_email = $_POST['user_email'];

//BP1.1+ calls the new BP filter first (wangguard_signup_validate_bp11) and then the legacy MU filters (this one), if the BP new 1.1+ filter has been already called, silently return

Expand Down Expand Up @@ -436,46 +412,6 @@ function wangguard_fix_bp_slashes_maybe($str) {
return $str;
} else return $str;
}

/**
* Validates security question
*
* @global type $bp
* @global boolean $wangguard_bp_validated
*/
function wangguard_signup_validate_bp11() {
global $bp;
global $wangguard_bp_validated;
$wangguard_bp_validated = true;

if (!wangguard_validate_hfields($_POST['signup_email'])) {
$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
return;
}

$answerOK = wangguard_question_repliedOK();
//If at least a question exists on the questions table, then check the provided answer

if (!$answerOK)$bp->signup->errors['wangguardquestansw'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard')); else {
//check domain against the list of selected blocked domains
$blocked = wangguard_is_domain_blocked($_REQUEST['signup_email']);

if ($blocked) {
$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe( __("<strong>ERROR</strong>: Domain not allowed.", 'wangguard'));
} else {
$reported = wangguard_is_email_reported_as_sp($_REQUEST['signup_email'] , wangguard_getRemoteIP() , wangguard_getRemoteProxyIP());

if ($reported)$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard')); else
if (wangguard_email_aliases_exists($_REQUEST['signup_email']))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard')); else
if (!wangguard_mx_record_is_ok($_REQUEST['signup_email']))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe( __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
}

}


if (isset ($bp->signup->errors['signup_email']))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe($bp->signup->errors['signup_email']);
}

//*********** BP1.1+ ***********
//*********** WP REGULAR ***********
/**
Expand Down Expand Up @@ -547,7 +483,6 @@ function wangguard_register_add_question(){
}

}

/**
* Validates security question
*
Expand All @@ -556,7 +491,7 @@ function wangguard_register_add_question(){
* @param type $errors
*/

if ( ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) && (get_option('woocommerce_enable_myaccount_registration')=='yes') ) {
if ( ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) && (get_option('woocommerce_enable_myaccount_registration')=='yes') ) {
function wangguard_signup_validate($user_name, $email, $errors){

if (!wangguard_validate_hfields($_POST['email'])) {
Expand Down Expand Up @@ -587,6 +522,8 @@ function wangguard_signup_validate($user_name, $email, $errors){

} else {
function wangguard_signup_validate($user_name, $user_email, $errors){

if ($_POST['user_email']){ $user_email = $_POST['user_email']; }else{ $user_email = $user_email; }

if (!wangguard_validate_hfields($user_email)) {
$errors->add('user_login',__('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
Expand Down Expand Up @@ -779,7 +716,7 @@ function wangguard_plugin_bp_complete_signup() {
/**
WooCommerce
*/
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
function wangguard_plugin_woocommerce_checkout_signup() {
global $wpdb, $current_user;
global $wangguard_user_check_status;
Expand Down
47 changes: 47 additions & 0 deletions wangguard-buddypress.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<?php
$wangguard_bp_hook = "bp_after_account_details_fields";

// for buddypress 1.1 only
add_action($wangguard_bp_hook,'wangguard_add_hfield_1' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_2' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_3' , rand(1,10));
add_action($wangguard_bp_hook,'wangguard_add_hfield_4' , rand(1,10));
add_action('bp_before_registration_submit_buttons', 'wangguard_register_add_question_bp11');

function wangguard_bp_core_process_spammer_status( $user_id, $status, $do_wp_cleanup = true ) {
global $wpdb, $bp;

Expand Down Expand Up @@ -112,5 +121,43 @@ function wangguard_spam_all_data( $user_id ) {
return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->groups->table_name_members} WHERE user_id = %d", $user_id ) );
BP_Groups_Member::delete_all_for_user( $user_id );
}
/**
* Validates security question
*
* @global type $bp
* @global boolean $wangguard_bp_validated
*/
function wangguard_signup_validate_bp11() {
global $bp;
global $wangguard_bp_validated;
$wangguard_bp_validated = true;
$signup_email = $_POST['signup_email'];

if (!wangguard_validate_hfields($signup_email)) {
$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard'));
return;
}
$answerOK = wangguard_question_repliedOK();
//If at least a question exists on the questions table, then check the provided answer
if (!$answerOK)$bp->signup->errors['wangguardquestansw'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: The answer to the security question is invalid.', 'wangguard')); else {
//check domain against the list of selected blocked domains
$blocked = wangguard_is_domain_blocked($signup_email);

if ($blocked) {
$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe( __("<strong>ERROR</strong>: Domain not allowed.", 'wangguard'));
} else {
$reported = wangguard_is_email_reported_as_sp($signup_email , wangguard_getRemoteIP() , wangguard_getRemoteProxyIP());

if ($reported)$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Banned by WangGuard <a href="http://www.wangguard.com/faq" target="_new">Is it an error?</a> Perhaps you tried to register many times.', 'wangguard')); else
if (wangguard_email_aliases_exists($signup_email))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe (__('<strong>ERROR</strong>: Duplicate alias email found by WangGuard.', 'wangguard')); else
if (!wangguard_mx_record_is_ok($signup_email))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe( __("<strong>ERROR</strong>: WangGuard couldn't find an MX record associated with your email domain.", 'wangguard'));
}

}


if (isset ($bp->signup->errors['signup_email']))$bp->signup->errors['signup_email'] = wangguard_fix_bp_slashes_maybe($bp->signup->errors['signup_email']);
}
add_action( 'wangguard_bp_make_spam_user', 'wangguard_spam_all_data' );
add_action('bp_signup_validate', 'wangguard_signup_validate_bp11' );
?>
Loading

0 comments on commit d1bd0ae

Please sign in to comment.