WPBruiser {no- Captcha anti-Spam} - Version 3.1.7

Version Description

  • Refreshed Incapsula, Amazon and Cloudflare trusted IPs ranges
Download this release

Release Info

Developer mihche
Plugin Icon 128x128 WPBruiser {no- Captcha anti-Spam}
Version 3.1.7
Comparing to
See all releases

Code changes from version 3.1.5 to 3.1.7

engine/GdbcModulesController.php CHANGED
@@ -44,6 +44,9 @@ final class GdbcModulesController
44
 
45
 
46
  CONST MODULE_ULTIMATE_MEMBER = 'UltimateMember';
 
 
 
47
  CONST MODULE_USER_PRO = 'UserPro';
48
  CONST MODULE_UPME = 'UPME';
49
  CONST MODULE_BUDDY_PRESS = 'BuddyPress';
@@ -437,6 +440,28 @@ final class GdbcModulesController
437
  )
438
  ),
439
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  );
441
 
442
 
44
 
45
 
46
  CONST MODULE_ULTIMATE_MEMBER = 'UltimateMember';
47
+ CONST MODULE_ULTRA_COMMUNITY = 'UltraCommunity';
48
+ CONST MODULE_WP_MEMBERS = 'WPMembers';
49
+
50
  CONST MODULE_USER_PRO = 'UserPro';
51
  CONST MODULE_UPME = 'UPME';
52
  CONST MODULE_BUDDY_PRESS = 'BuddyPress';
440
  )
441
  ),
442
 
443
+ self::MODULE_WP_MEMBERS => array(
444
+ 'info' => array(
445
+ 'ModuleId' => 34,
446
+ 'IsLicensed' => false,
447
+ ),
448
+ 'classes' => array(
449
+ 'GdbcWPMembersAdminModule' => '/modules/wp-members/GdbcWPMembersAdminModule.php',
450
+ 'GdbcWPMembersPublicModule' => '/modules/wp-members/GdbcWPMembersPublicModule.php',
451
+ )
452
+ ),
453
+
454
+ self::MODULE_ULTRA_COMMUNITY => array(
455
+ 'info' => array(
456
+ 'ModuleId' => 35,
457
+ 'IsLicensed' => false,
458
+ ),
459
+ 'classes' => array(
460
+ 'GdbcUltraCommunityAdminModule' => '/modules/ultra-community/GdbcUltraCommunityAdminModule.php',
461
+ 'GdbcUltraCommunityPublicModule' => '/modules/ultra-community/GdbcUltraCommunityPublicModule.php',
462
+ )
463
+ ),
464
+
465
  );
466
 
467
 
engine/GoodByeCaptchaUtils.php CHANGED
@@ -513,12 +513,12 @@ final class GoodByeCaptchaUtils
513
  );
514
  }
515
 
516
-
517
  public static function isPostRequestForWPStandardLogin()
518
  {
519
  return !empty($_POST) && function_exists('login_header') && !MchGdbcWpUtils::isAjaxRequest();
520
  }
521
-
522
  public static function isLoginAttemptEntity(GdbcAttemptEntity $attemptEntity)
523
  {
524
  foreach(self::getAllPossibleLoginAttemptEntities() as $loginAttemptEntity)
@@ -551,6 +551,14 @@ final class GoodByeCaptchaUtils
551
  $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcUltimateMemberAdminModule::OPTION_ULTIMATE_MEMBER_LOGIN_FORM);
552
  break;
553
 
 
 
 
 
 
 
 
 
554
  case GdbcModulesController::MODULE_WOOCOMMERCE :
555
  $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcWooCommerceAdminModule::WOOCOMMERCE_LOGIN_FORM);
556
  break;
513
  );
514
  }
515
 
516
+
517
  public static function isPostRequestForWPStandardLogin()
518
  {
519
  return !empty($_POST) && function_exists('login_header') && !MchGdbcWpUtils::isAjaxRequest();
520
  }
521
+
522
  public static function isLoginAttemptEntity(GdbcAttemptEntity $attemptEntity)
523
  {
524
  foreach(self::getAllPossibleLoginAttemptEntities() as $loginAttemptEntity)
551
  $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcUltimateMemberAdminModule::OPTION_ULTIMATE_MEMBER_LOGIN_FORM);
552
  break;
553
 
554
+ case GdbcModulesController::MODULE_ULTRA_COMMUNITY :
555
+ $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcUltraCommunityAdminModule::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED);
556
+ break;
557
+
558
+ case GdbcModulesController::MODULE_WP_MEMBERS :
559
+ $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcWPMembersAdminModule::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED);
560
+ break;
561
+
562
  case GdbcModulesController::MODULE_WOOCOMMERCE :
563
  $loginEntitiesList[] = new GdbcAttemptEntity(GdbcModulesController::getModuleIdByName($moduleName), GdbcWooCommerceAdminModule::WOOCOMMERCE_LOGIN_FORM);
564
  break;
engine/admin/pages/GdbcMembershipAdminPage.php CHANGED
@@ -25,8 +25,14 @@ class GdbcMembershipAdminPage extends GdbcBaseAdminPage
25
 
26
  $arrModules = array();
27
 
28
- // if(GdbcModulesController::isModuleRegistered(GdbcModulesController::MODULE_BB_PRESS))
29
- // $arrModules[] = GdbcBbPressAdminModule::getInstance();
 
 
 
 
 
 
30
 
31
  if(GdbcModulesController::isModuleRegistered(GdbcModulesController::MODULE_USER_PRO))
32
  $arrModules[] = GdbcUserProAdminModule::getInstance();
25
 
26
  $arrModules = array();
27
 
28
+ if(GdbcModulesController::isModuleRegistered(GdbcModulesController::MODULE_WP_MEMBERS))
29
+ $arrModules[] = GdbcWPMembersAdminModule::getInstance();
30
+
31
+
32
+ if(GdbcModulesController::isModuleRegistered(GdbcModulesController::MODULE_ULTRA_COMMUNITY))
33
+ $arrModules[] = GdbcUltraCommunityAdminModule::getInstance();
34
+
35
+
36
 
37
  if(GdbcModulesController::isModuleRegistered(GdbcModulesController::MODULE_USER_PRO))
38
  $arrModules[] = GdbcUserProAdminModule::getInstance();
engine/modules/ultra-community/GdbcUltraCommunityAdminModule.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Copyright (C) 2014 Mihai Chelaru
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU General Public License
8
+ * as published by the Free Software Foundation; either version 2
9
+ * of the License, or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ */
20
+
21
+ final class GdbcUltraCommunityAdminModule extends GdbcBaseAdminModule
22
+ {
23
+
24
+ CONST OPTION_LOGIN_FORM_PROTECTION_ACTIVATED = 'IsLoginActivated';
25
+ CONST OPTION_REGISTER_FORM_PROTECTION_ACTIVATED = 'IsRegisterActivated';
26
+ // CONST OPTION_LOST_PASS_FORM_PROTECTION_ACTIVATED = 'IsLostPasswordActivated';
27
+ // CONST OPTION_CHANGE_PASS_FORM_PROTECTION_ACTIVATED = 'IsChangePasswordActivated';
28
+
29
+ protected function __construct()
30
+ {
31
+ parent::__construct();
32
+ }
33
+
34
+ public function getDefaultOptions()
35
+ {
36
+ static $arrDefaultSettingOptions = null;
37
+ if(null !== $arrDefaultSettingOptions)
38
+ return $arrDefaultSettingOptions;
39
+
40
+ $arrDefaultSettingOptions = array(
41
+
42
+ self::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED => array(
43
+ 'Id' => 1,
44
+ 'Value' => NULL,
45
+ 'LabelText' => __('Protect UltraCommunity Login Form', GoodByeCaptcha::PLUGIN_SLUG),
46
+ 'DisplayText' => __('Login', GoodByeCaptcha::PLUGIN_SLUG),
47
+ 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
48
+ ),
49
+
50
+ self::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED => array(
51
+ 'Id' => 2,
52
+ 'Value' => NULL,
53
+ 'LabelText' => __('Protect UltraCommunity Registration Form', GoodByeCaptcha::PLUGIN_SLUG),
54
+ 'DisplayText' => __('Registration', GoodByeCaptcha::PLUGIN_SLUG),
55
+ 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
56
+ ),
57
+
58
+ // self::OPTION_LOST_PASS_FORM_PROTECTION_ACTIVATED => array(
59
+ // 'Id' => 3,
60
+ // 'Value' => NULL,
61
+ // 'LabelText' => __('Protect Lost Password Form', GoodByeCaptcha::PLUGIN_SLUG),
62
+ // 'DisplayText' => __('LostPassword', GoodByeCaptcha::PLUGIN_SLUG),
63
+ // 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
64
+ // ),
65
+ //
66
+ // self::OPTION_CHANGE_PASS_FORM_PROTECTION_ACTIVATED => array(
67
+ // 'Id' => 4,
68
+ // 'Value' => NULL,
69
+ // 'LabelText' => __('Protect Change Password Form', GoodByeCaptcha::PLUGIN_SLUG),
70
+ // 'DisplayText' => __('ChangePassword', GoodByeCaptcha::PLUGIN_SLUG),
71
+ // 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
72
+ // ),
73
+
74
+ );
75
+
76
+ return $arrDefaultSettingOptions;
77
+
78
+ }
79
+
80
+ public function validateModuleSettingsFields($arrSettingOptions)
81
+ {
82
+ $this->registerSuccessMessage(__('Your changes were successfully saved!', GoodByeCaptcha::PLUGIN_SLUG));
83
+ return $arrSettingOptions;
84
+ }
85
+
86
+ public function renderModuleSettingsSectionHeader(array $arrSectionInfo)
87
+ {
88
+ echo '<h3>' . __('<a href="https://wordpress.org/plugins/ultra-community/" style="text-decoration: none;" target="_blank">UltraCommunity Membership</a> General Settings', GoodByeCaptcha::PLUGIN_SLUG) . '</h3><hr />';
89
+ }
90
+
91
+ public static function getInstance()
92
+ {
93
+ static $adminInstance = null;
94
+ return null !== $adminInstance ? $adminInstance : $adminInstance = new self();
95
+ }
96
+
97
+ public function getFormattedBlockedContent(GdbcAttemptEntity $attemptEntity)
98
+ {
99
+ $optionName = $this->getOptionDisplayTextByOptionId($attemptEntity->SectionId);
100
+
101
+ $attemptEntity->Notes = (array)maybe_unserialize($attemptEntity->Notes);
102
+
103
+ $arrContent = array('table-head-rows' => '', 'table-body-rows' => '');
104
+
105
+ if(null === $optionName)
106
+ return $arrContent;
107
+
108
+ $tableHeadRows = '';
109
+ $tableBodyRows = '';
110
+
111
+ $tableHeadRows .= '<tr>';
112
+ $tableHeadRows .= '<th colspan="2">' . sprintf(__("UltraCommunity Blocked %s Attempt", GoodByeCaptcha::PLUGIN_SLUG), $optionName) . '</th>';
113
+ $tableHeadRows .= '</tr>';
114
+
115
+ $tableHeadRows .= '<tr>';
116
+ $tableHeadRows .= '<th>' . __('Field', GoodByeCaptcha::PLUGIN_SLUG) . '</th>';
117
+ $tableHeadRows .= '<th>' . __('Value', GoodByeCaptcha::PLUGIN_SLUG) . '</th>';
118
+ $tableHeadRows .= '</tr>';
119
+
120
+
121
+ foreach($attemptEntity->Notes as $key => $value)
122
+ {
123
+ $tableBodyRows .='<tr>';
124
+ $tableBodyRows .= '<td>' . self::getBlockedContentDisplayableKey($key) . '</td>';
125
+ $tableBodyRows .= '<td>' . wp_filter_kses(print_r($value, true)) . '</td>';
126
+ $tableBodyRows .='</tr>';
127
+ }
128
+
129
+ $arrContent['table-head-rows'] = $tableHeadRows;
130
+ $arrContent['table-body-rows'] = $tableBodyRows;
131
+
132
+ return $arrContent;
133
+
134
+ }
135
+
136
+ }
engine/modules/ultra-community/GdbcUltraCommunityPublicModule.php ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Copyright (C) 2014 Mihai Chelaru
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU General Public License
8
+ * as published by the Free Software Foundation; either version 2
9
+ * of the License, or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ */
20
+
21
+ final class GdbcUltraCommunityPublicModule extends GdbcBasePublicModule
22
+ {
23
+
24
+ protected function __construct()
25
+ {
26
+ parent::__construct();
27
+
28
+ if (version_compare(PHP_VERSION, '5.3.0', '<')) {
29
+ return;
30
+ }
31
+
32
+ if(!class_exists('\UltraCommunity\UltraCommHooks')) {
33
+ return;
34
+ }
35
+
36
+ if($this->getOption(GdbcUltraCommunityAdminModule::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED))
37
+ {
38
+ $this->registerLoginHooks();
39
+ }
40
+
41
+ if($this->getOption(GdbcUltraCommunityAdminModule::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED))
42
+ {
43
+ $this->registerRegistrationHooks();
44
+ }
45
+
46
+ // if($this->getOption(GdbcUserProAdminModule::OPTION_LOST_PASS_FORM_PROTECTION_ACTIVATED))
47
+ // {
48
+ // $this->registerLostPasswordHooks();
49
+ // }
50
+ //
51
+ //
52
+ // if($this->getOption(GdbcUserProAdminModule::OPTION_CHANGE_PASS_FORM_PROTECTION_ACTIVATED))
53
+ // {
54
+ // $this->registerChangePasswordHooks();
55
+ // }
56
+ }
57
+
58
+ private function registerLoginHooks()
59
+ {
60
+ add_action('uc_action_login_form_bottom', array($this, 'renderTokenFieldIntoForm'));
61
+ add_action('uc_action_before_user_log_in', array($this, 'validateLogin'), 10, 1);
62
+
63
+ }
64
+
65
+
66
+ private function registerRegistrationHooks()
67
+ {
68
+ add_action('uc_action_registration_form_bottom', array($this, 'renderTokenFieldIntoForm'));
69
+ add_filter('uc_action_before_user_registration', array($this, 'validateRegistration'));
70
+ }
71
+
72
+
73
+ public function validateLogin($userName)
74
+ {
75
+
76
+ $this->attemptEntity->SectionId = $this->getOptionIdByOptionName(GdbcUltraCommunityAdminModule::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED);
77
+ $this->attemptEntity->Notes = array('username' => $userName);
78
+ $this->attemptEntity->Notes = array_map( is_email($this->attemptEntity->Notes['username']) ? 'sanitize_email' : 'sanitize_user' , $this->attemptEntity->Notes);
79
+
80
+ if(GdbcRequestController::isValid($this->attemptEntity))
81
+ return;
82
+
83
+ throw new Exception(__('Invalid Username or Password!', GoodByeCaptcha::PLUGIN_SLUG));
84
+
85
+ }
86
+
87
+ public function validateRegistration($userEntity)
88
+ {
89
+
90
+ $this->attemptEntity->SectionId = $this->getOptionIdByOptionName(GdbcUltraCommunityAdminModule::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED);
91
+
92
+ if(GdbcRequestController::isValid($this->attemptEntity))
93
+ return;
94
+
95
+ throw new Exception(__('We\'ve encountered an error while processing your request!', GoodByeCaptcha::PLUGIN_SLUG));
96
+
97
+ }
98
+
99
+ /**
100
+ * @return int
101
+ */
102
+ protected function getModuleId()
103
+ {
104
+ return GdbcModulesController::getModuleIdByName(GdbcModulesController::MODULE_ULTRA_COMMUNITY);
105
+ }
106
+
107
+
108
+ public static function getInstance()
109
+ {
110
+ static $publicInstance = null;
111
+ return null !== $publicInstance ? $publicInstance : $publicInstance = new self();
112
+ }
113
+
114
+ }
engine/modules/wp-members/GdbcWPMembersAdminModule.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Copyright (C) 2014 Mihai Chelaru
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU General Public License
8
+ * as published by the Free Software Foundation; either version 2
9
+ * of the License, or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ */
20
+
21
+ final class GdbcWPMembersAdminModule extends GdbcBaseAdminModule
22
+ {
23
+
24
+ CONST OPTION_LOGIN_FORM_PROTECTION_ACTIVATED = 'IsLoginActivated';
25
+ CONST OPTION_REGISTER_FORM_PROTECTION_ACTIVATED = 'IsRegisterActivated';
26
+ // CONST OPTION_LOST_PASS_FORM_PROTECTION_ACTIVATED = 'IsLostPasswordActivated';
27
+ // CONST OPTION_CHANGE_PASS_FORM_PROTECTION_ACTIVATED = 'IsChangePasswordActivated';
28
+
29
+ protected function __construct()
30
+ {
31
+ parent::__construct();
32
+ }
33
+
34
+ public function getDefaultOptions()
35
+ {
36
+ static $arrDefaultSettingOptions = null;
37
+ if(null !== $arrDefaultSettingOptions)
38
+ return $arrDefaultSettingOptions;
39
+
40
+ $arrDefaultSettingOptions = array(
41
+
42
+ self::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED => array(
43
+ 'Id' => 1,
44
+ 'Value' => NULL,
45
+ 'LabelText' => __('Protect Login Form', GoodByeCaptcha::PLUGIN_SLUG),
46
+ 'DisplayText' => __('Login', GoodByeCaptcha::PLUGIN_SLUG),
47
+ 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
48
+ ),
49
+
50
+ self::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED => array(
51
+ 'Id' => 2,
52
+ 'Value' => NULL,
53
+ 'LabelText' => __('Protect Registration Form', GoodByeCaptcha::PLUGIN_SLUG),
54
+ 'DisplayText' => __('Registration', GoodByeCaptcha::PLUGIN_SLUG),
55
+ 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
56
+ ),
57
+
58
+ // self::OPTION_LOST_PASS_FORM_PROTECTION_ACTIVATED => array(
59
+ // 'Id' => 3,
60
+ // 'Value' => NULL,
61
+ // 'LabelText' => __('Protect Lost Password Form', GoodByeCaptcha::PLUGIN_SLUG),
62
+ // 'DisplayText' => __('LostPassword', GoodByeCaptcha::PLUGIN_SLUG),
63
+ // 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
64
+ // ),
65
+ //
66
+ // self::OPTION_CHANGE_PASS_FORM_PROTECTION_ACTIVATED => array(
67
+ // 'Id' => 4,
68
+ // 'Value' => NULL,
69
+ // 'LabelText' => __('Protect Change Password Form', GoodByeCaptcha::PLUGIN_SLUG),
70
+ // 'DisplayText' => __('ChangePassword', GoodByeCaptcha::PLUGIN_SLUG),
71
+ // 'InputType' => MchGdbcHtmlUtils::FORM_ELEMENT_INPUT_CHECKBOX
72
+ // ),
73
+
74
+ );
75
+
76
+ return $arrDefaultSettingOptions;
77
+
78
+ }
79
+
80
+ public function validateModuleSettingsFields($arrSettingOptions)
81
+ {
82
+ $this->registerSuccessMessage(__('Your changes were successfully saved!', GoodByeCaptcha::PLUGIN_SLUG));
83
+ return $arrSettingOptions;
84
+ }
85
+
86
+ public function renderModuleSettingsSectionHeader(array $arrSectionInfo)
87
+ {
88
+ echo '<h3>' . __('WP Members General Settings', GoodByeCaptcha::PLUGIN_SLUG) . '</h3><hr />';
89
+ }
90
+
91
+ public static function getInstance()
92
+ {
93
+ static $adminInstance = null;
94
+ return null !== $adminInstance ? $adminInstance : $adminInstance = new self();
95
+ }
96
+
97
+ public function getFormattedBlockedContent(GdbcAttemptEntity $attemptEntity)
98
+ {
99
+ $optionName = $this->getOptionDisplayTextByOptionId($attemptEntity->SectionId);
100
+
101
+ $attemptEntity->Notes = (array)maybe_unserialize($attemptEntity->Notes);
102
+
103
+ $arrContent = array('table-head-rows' => '', 'table-body-rows' => '');
104
+
105
+ if(null === $optionName)
106
+ return $arrContent;
107
+
108
+ $tableHeadRows = '';
109
+ $tableBodyRows = '';
110
+
111
+ $tableHeadRows .= '<tr>';
112
+ $tableHeadRows .= '<th colspan="2">' . sprintf(__("WPMembers Blocked %s Attempt", GoodByeCaptcha::PLUGIN_SLUG), $optionName) . '</th>';
113
+ $tableHeadRows .= '</tr>';
114
+
115
+ $tableHeadRows .= '<tr>';
116
+ $tableHeadRows .= '<th>' . __('Field', GoodByeCaptcha::PLUGIN_SLUG) . '</th>';
117
+ $tableHeadRows .= '<th>' . __('Value', GoodByeCaptcha::PLUGIN_SLUG) . '</th>';
118
+ $tableHeadRows .= '</tr>';
119
+
120
+
121
+ foreach($attemptEntity->Notes as $key => $value)
122
+ {
123
+ $tableBodyRows .='<tr>';
124
+ $tableBodyRows .= '<td>' . self::getBlockedContentDisplayableKey($key) . '</td>';
125
+ $tableBodyRows .= '<td>' . wp_filter_kses(print_r($value, true)) . '</td>';
126
+ $tableBodyRows .='</tr>';
127
+ }
128
+
129
+ $arrContent['table-head-rows'] = $tableHeadRows;
130
+ $arrContent['table-body-rows'] = $tableBodyRows;
131
+
132
+ return $arrContent;
133
+
134
+ }
135
+
136
+ }
engine/modules/wp-members/GdbcWPMembersPublicModule.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * Copyright (C) 2014 Mihai Chelaru
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of the GNU General Public License
8
+ * as published by the Free Software Foundation; either version 2
9
+ * of the License, or (at your option) any later version.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU General Public License
17
+ * along with this program; if not, write to the Free Software
18
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ */
20
+
21
+ final class GdbcWPMembersPublicModule extends GdbcBasePublicModule
22
+ {
23
+
24
+ protected function __construct()
25
+ {
26
+ parent::__construct();
27
+
28
+ if($this->getOption(GdbcWPMembersAdminModule::OPTION_LOGIN_FORM_PROTECTION_ACTIVATED))
29
+ {
30
+ $this->registerLoginHooks();
31
+ }
32
+
33
+ if($this->getOption(GdbcWPMembersAdminModule::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED))
34
+ {
35
+ $this->registerRegistrationHooks();
36
+ }
37
+
38
+ }
39
+
40
+ private function registerLoginHooks()
41
+ {
42
+ add_filter('wpmem_login_hidden_fields', array($this, 'renderTokenField'), 10, 2);
43
+ add_filter('authenticate', array(GdbcWordPressPublicModule::getInstance(), 'validateLoginAuthentication'), 95, 3);
44
+ }
45
+
46
+
47
+ private function registerRegistrationHooks()
48
+ {
49
+ add_action('wpmem_register_hidden_fields', array($this, 'renderTokenField'), 10, 2);
50
+ add_action('wpmem_pre_register_data', array($this, 'validateRegistration'), 10, 1);
51
+ }
52
+
53
+
54
+ public function validateRegistration($submittedForm)
55
+ {
56
+
57
+ $this->attemptEntity->SectionId = $this->getOptionIdByOptionName(GdbcWPMembersAdminModule::OPTION_REGISTER_FORM_PROTECTION_ACTIVATED);
58
+ $this->attemptEntity->Notes = array(
59
+ 'username' => !empty($submittedForm['username']) ? sanitize_user($submittedForm['username']) : null,
60
+ 'email' => !empty($submittedForm['user_email']) ? sanitize_email($submittedForm['user_email']): null,
61
+ );
62
+
63
+ if(GdbcRequestController::isValid($this->attemptEntity))
64
+ return;
65
+
66
+ global $wpmem_themsg;
67
+
68
+ $wpmem_themsg = __('An error occurred while processing your request!', GoodByeCaptcha::PLUGIN_SLUG);
69
+
70
+ }
71
+
72
+
73
+
74
+ public function renderTokenField($hiddenFields, $action)
75
+ {
76
+
77
+ if(!in_array($action, array('login', 'new'))) // login for login form and new for registration
78
+ return $hiddenFields;
79
+
80
+ if('login' === $action)
81
+ {
82
+ if(GdbcWordPressPublicModule::getInstance()->getOption(GdbcWordPressAdminModule::WORDPRESS_LOGIN_FORM))
83
+ return $hiddenFields;
84
+ }
85
+
86
+
87
+ return $hiddenFields . $this->getTokenFieldHtml();
88
+
89
+ }
90
+
91
+
92
+ /**
93
+ * @return int
94
+ */
95
+ protected function getModuleId()
96
+ {
97
+ return GdbcModulesController::getModuleIdByName(GdbcModulesController::MODULE_WP_MEMBERS);
98
+ }
99
+
100
+
101
+ public static function getInstance()
102
+ {
103
+ static $publicInstance = null;
104
+ return null !== $publicInstance ? $publicInstance : $publicInstance = new self();
105
+ }
106
+
107
+ }
goodbye-captcha.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WPBruiser
11
  * Plugin URI: http://www.wpbruiser.com
12
  * Description: An extremely powerful anti-spam plugin that blocks spambots without annoying captcha images.
13
- * Version: 3.1.5
14
  * Author: Mihai Chelaru
15
  * Author URI: http://www.wpbruiser.com
16
  * Text Domain: wp-bruiser
@@ -23,7 +23,7 @@ if(!class_exists('GoodByeCaptcha', false))
23
  {
24
  class GoodByeCaptcha
25
  {
26
- CONST PLUGIN_VERSION = '3.1.5';
27
  CONST PLUGIN_SLUG = 'wp-bruiser';
28
  CONST PLUGIN_NAME = 'WPBruiser';
29
  CONST PLUGIN_SITE_URL = 'http://www.wpbruiser.com';
10
  * Plugin Name: WPBruiser
11
  * Plugin URI: http://www.wpbruiser.com
12
  * Description: An extremely powerful anti-spam plugin that blocks spambots without annoying captcha images.
13
+ * Version: 3.1.7
14
  * Author: Mihai Chelaru
15
  * Author URI: http://www.wpbruiser.com
16
  * Text Domain: wp-bruiser
23
  {
24
  class GoodByeCaptcha
25
  {
26
+ CONST PLUGIN_VERSION = '3.1.7';
27
  CONST PLUGIN_SLUG = 'wp-bruiser';
28
  CONST PLUGIN_NAME = 'WPBruiser';
29
  CONST PLUGIN_SITE_URL = 'http://www.wpbruiser.com';
includes/vendor/MchHttp/MchGdbcTrustedIPRanges.php CHANGED
@@ -31,7 +31,7 @@ final class MchGdbcTrustedIPRanges
31
 
32
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
33
  ?
34
- self::isIPInRanges($ipAddress, $ipVersion, array(759185408=>759186431,1729951744=>1729952767,1805286912=>1805287167,2508081152=>2508083199,3104537600=>3104538623,3236315136=>3236331519,3331268608=>3331276799,3344138240=>3344140287,))
35
  :
36
  self::isIPInRanges($ipAddress, $ipVersion, array('2a02:e980::/29'=>1,));
37
 
@@ -42,7 +42,7 @@ final class MchGdbcTrustedIPRanges
42
 
43
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
44
  ?
45
- self::isIPInRanges($ipAddress, $ipVersion, array(220200960=>220332031,875429888=>875446271,877920256=>878051327,886996992=>887029759,917897216=>917962751,918552576=>918618111,921042944=>921108479,921665536=>921690111,921731072=>921747455,3438715904=>3438717951,3438718464=>3438723071,3455827968=>3455836159,3455842560=>3455844095,3632865280=>3632873471,))
46
  :
47
  self::isIPInRanges($ipAddress, $ipVersion, array());
48
 
@@ -53,7 +53,7 @@ final class MchGdbcTrustedIPRanges
53
 
54
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
55
  ?
56
- self::isIPInRanges($ipAddress, $ipVersion, array(221642752=>221773823,387186688=>387448831,583008256=>584056831,597295104=>597360639,597426176=>598212607,775127040=>775147519,775149568=>775159807,780730368=>780795903,839909376=>840171519,846200832=>846266367,872415232=>875429887,875560960=>876412927,876478464=>877330431,877395968=>877723647,878051328=>878444543,878702592=>878706175,878706432=>878706591,884998144=>885129215,885260288=>886571007,886833152=>886996991,910163968=>912261119,915406848=>917766143,917962752=>918552575,918618112=>920518655,920551424=>921042943,921174016=>921632767,921763840=>922746879,1137311744=>1137328127,1210851328=>1210859519,1264943104=>1264975871,1333592064=>1333624831,1618935808=>1618968575,1728317440=>1728319487,1796472832=>1796734975,2063122432=>2063138815,2927689728=>2927755263,2938732544=>2938765311,2954903552=>2954911743,2955018240=>2955083775,2974253056=>2974285823,3091726336=>3091857407,3098116096=>3098148863,3106961408=>3106962431,3438051328=>3438084095,3635863552=>3635867647,))
57
  :
58
  self::isIPInRanges($ipAddress, $ipVersion, array());
59
 
@@ -66,7 +66,7 @@ final class MchGdbcTrustedIPRanges
66
  ?
67
  self::isIPInRanges($ipAddress, $ipVersion, array(1076022784=>1076023039,1279981696=>1279981823,1279983360=>1279983487,3221241856=>3221258239,3333780480=>3333781503,))
68
  :
69
- self::isIPInRanges($ipAddress, $ipVersion, array('2620:115:c000::/44'=>1,));
70
 
71
  }
72
 
31
 
32
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
33
  ?
34
+ self::isIPInRanges($ipAddress, $ipVersion, array(758906880=>758972415,759185408=>759186431,769589248=>769654783,1729951744=>1729952767,1805254656=>1805320191,2508081152=>2508083199,3104537600=>3104538623,3236315136=>3236331519,3331268608=>3331276799,3344138240=>3344140287,))
35
  :
36
  self::isIPInRanges($ipAddress, $ipVersion, array('2a02:e980::/29'=>1,));
37
 
42
 
43
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
44
  ?
45
+ self::isIPInRanges($ipAddress, $ipVersion, array(220200960=>220332031,221659008=>221659071,222034432=>222034495,583269376=>583269631,597835712=>597835775,598196096=>598196159,873430912=>873430975,875429888=>875446271,875872128=>875872191,876117760=>876117887,876215808=>876216063,876790400=>876790463,877590400=>877590463,877920256=>878051327,885489600=>885489663,886372352=>886372415,886882048=>886882111,886996992=>887029759,917897216=>917962751,918552576=>918618111,921042944=>921108479,921304960=>921305023,921665536=>921690111,921731072=>921747455,3438715904=>3438717951,3438718464=>3438723071,3455827968=>3455836159,3455842560=>3455844095,3632865280=>3632873471,))
46
  :
47
  self::isIPInRanges($ipAddress, $ipVersion, array());
48
 
53
 
54
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
55
  ?
56
+ self::isIPInRanges($ipAddress, $ipVersion, array(221642752=>221839359,221904896=>222035967,225443840=>225705983,226230272=>226295807,226361344=>226492415,231866368=>231997439,233046016=>233177087,317128704=>317194239,387186688=>387448831,583008256=>586153983,586678272=>587202559,597295104=>597360639,597426176=>598212607,598736896=>598867967,599130112=>599261183,775127040=>775147519,775149568=>775159807,780730368=>780795903,839909376=>840171519,846200832=>846266367,872415232=>875429887,875495424=>877330431,877395968=>877723647,877854720=>877920255,878051328=>878444543,878702592=>878706591,884998144=>885129215,885260288=>886571007,886833152=>886996991,910163968=>912261119,915406848=>917766143,917962752=>918552575,918618112=>920518655,920551424=>921042943,921174016=>921632767,921763840=>922746879,1137311744=>1137328127,1210851328=>1210859519,1264943104=>1264975871,1333592064=>1333624831,1618935808=>1618968575,1728317440=>1728319487,1796472832=>1796734975,2063122432=>2063138815,2927689728=>2927755263,2938732544=>2938765311,2954903552=>2954911743,2955018240=>2955083775,2974253056=>2974285823,3091726336=>3091857407,3098116096=>3098148863,3106961408=>3106962431,3438051328=>3438084095,3635863552=>3635867647,))
57
  :
58
  self::isIPInRanges($ipAddress, $ipVersion, array());
59
 
66
  ?
67
  self::isIPInRanges($ipAddress, $ipVersion, array(1076022784=>1076023039,1279981696=>1279981823,1279983360=>1279983487,3221241856=>3221258239,3333780480=>3333781503,))
68
  :
69
+ self::isIPInRanges($ipAddress, $ipVersion, array('2620:115:c000::/40'=>1,));
70
 
71
  }
72
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: captcha, antispam, anti-spam, spam, mailpoet, antispambot, brute force, comment spam, jetpack contact form, contact form 7, ninja forms, formidable forms, wp bruiser
5
  Requires at least: 3.5
6
  Tested up to: 4.7
7
- Stable tag: 3.1.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -218,18 +218,17 @@ Studies shown that visual CAPTCHAs take around 5-10 seconds to complete and audi
218
 
219
 
220
  == Upgrade Notice ==
221
- A plugin vulnerability reported by Wordfence team. This update is highly recommended!
222
-
223
- Refreshed Country IPs, WebAttackers IPs and Proxy IPs
224
 
225
  == Changelog ==
 
226
 
227
- = 3.1.5 =
228
- **Improvements**
229
- - Refreshed Country IPs
230
- - Refreshed WebAttackers IPs
231
- - Refreshed Proxy IPs
232
 
 
 
 
233
 
234
 
235
  **Fixes**
4
  Tags: captcha, antispam, anti-spam, spam, mailpoet, antispambot, brute force, comment spam, jetpack contact form, contact form 7, ninja forms, formidable forms, wp bruiser
5
  Requires at least: 3.5
6
  Tested up to: 4.7
7
+ Stable tag: 3.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
218
 
219
 
220
  == Upgrade Notice ==
221
+ * Refreshed Incapsula, Amazon and Cloudflare trusted IPs ranges
 
 
222
 
223
  == Changelog ==
224
+ * Added integration with [Ultra Community](https://wordpress.org/plugins/ultra-community/) Membership plugin
225
 
226
+ = 3.1.7 =
227
+ * Refreshed Incapsula, Amazon and Cloudflare trusted IPs ranges
 
 
 
228
 
229
+ = 3.1.6 =
230
+ **Improvements**
231
+ * Added integration with [Ultra Community](https://wordpress.org/plugins/ultra-community/) Membership plugin
232
 
233
 
234
  **Fixes**