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

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.29
Comparing to
See all releases

Code changes from version 3.1.28 to 3.1.29

engine/modules/licenses/GdbcLicensesAdminModule.php CHANGED
@@ -120,33 +120,54 @@ class GdbcLicensesAdminModule extends GdbcBaseAdminModule
120
  $arrSettingOptions = array_map('trim', (array)$arrSettingOptions);
121
  $arrSettingOptions = array_filter((array)$arrSettingOptions);
122
 
123
- $errorEncountered = false;
124
  foreach($arrSettingOptions as $moduleName => $licenseKey)
125
  {
126
- if(!GdbcModulesController::isModuleRegistered($moduleName))
127
- continue;
128
-
129
- if( ! $this->activateLicense($moduleName, $licenseKey) )
130
  {
131
- $errorEncountered = true;
132
- //unset($arrSettingOptions[$moduleName]);
 
133
  }
134
 
135
  }
136
-
137
- set_site_transient( 'update_plugins', null );
138
-
139
- if($errorEncountered || empty($arrSettingOptions))
140
- {
141
- $this->registerErrorMessage(__('There was an error while activating your license!', GoodByeCaptcha::PLUGIN_SLUG));
142
- }
143
- else
144
- {
145
  $this->registerSuccessMessage(__('Your license was successfully activated!', GoodByeCaptcha::PLUGIN_SLUG));
146
  }
147
 
 
148
 
149
  return $arrSettingOptions;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  }
151
 
152
 
@@ -160,15 +181,57 @@ class GdbcLicensesAdminModule extends GdbcBaseAdminModule
160
  'url' => home_url()
161
  );
162
 
163
- $response = wp_remote_post( GoodByeCaptcha::PLUGIN_SITE_URL, array('timeout' => 15, 'sslverify' => false, 'body' => $licenseRequestParams));
164
 
165
- if ( is_wp_error( $response ) ) {
166
- return false;
167
  }
168
 
169
  $licenseInfo = @json_decode( @wp_remote_retrieve_body( $response ) );
170
 
171
- return !empty($licenseInfo->success) && !empty($licenseInfo->license) && $licenseInfo->license === 'valid';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
  }
174
 
120
  $arrSettingOptions = array_map('trim', (array)$arrSettingOptions);
121
  $arrSettingOptions = array_filter((array)$arrSettingOptions);
122
 
123
+ $activateLicenseResult = null;
124
  foreach($arrSettingOptions as $moduleName => $licenseKey)
125
  {
126
+ $activateLicenseResult = $this->activateLicense($moduleName, $licenseKey);
127
+ if(true !== $activateLicenseResult)
 
 
128
  {
129
+ $this->registerErrorMessage($activateLicenseResult);
130
+ break;
131
+ //return $this->getAllSavedOptions();
132
  }
133
 
134
  }
135
+ if(true === $activateLicenseResult) {
 
 
 
 
 
 
 
 
136
  $this->registerSuccessMessage(__('Your license was successfully activated!', GoodByeCaptcha::PLUGIN_SLUG));
137
  }
138
 
139
+ set_site_transient( 'update_plugins', null );
140
 
141
  return $arrSettingOptions;
142
+
143
+
144
+ // $errorEncountered = false;
145
+ // foreach($arrSettingOptions as $moduleName => $licenseKey)
146
+ // {
147
+ // if(!GdbcModulesController::isModuleRegistered($moduleName))
148
+ // continue;
149
+ //
150
+ // if( ! $this->activateLicense($moduleName, $licenseKey) )
151
+ // {
152
+ // $errorEncountered = true;
153
+ // //unset($arrSettingOptions[$moduleName]);
154
+ // }
155
+ //
156
+ // }
157
+ //
158
+ // set_site_transient( 'update_plugins', null );
159
+ //
160
+ // if($errorEncountered || empty($arrSettingOptions))
161
+ // {
162
+ // $this->registerErrorMessage(__('There was an error while activating your license!', GoodByeCaptcha::PLUGIN_SLUG));
163
+ // }
164
+ // else
165
+ // {
166
+ // $this->registerSuccessMessage(__('Your license was successfully activated!', GoodByeCaptcha::PLUGIN_SLUG));
167
+ // }
168
+ //
169
+ //
170
+ // return $arrSettingOptions;
171
  }
172
 
173
 
181
  'url' => home_url()
182
  );
183
 
184
+ $response = @wp_remote_post( GoodByeCaptcha::PLUGIN_SITE_URL, array('timeout' => 15, 'sslverify' => false, 'body' => $licenseRequestParams));
185
 
186
+ if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) {
187
+ return ( is_wp_error( $response ) && ! empty( $response->get_error_message() ) ) ? $response->get_error_message() : __( 'An error occurred, please try again.', 'gdbc' );
188
  }
189
 
190
  $licenseInfo = @json_decode( @wp_remote_retrieve_body( $response ) );
191
 
192
+ if(empty($licenseInfo->error) && !empty($licenseInfo->success) && !empty($licenseInfo->license) && $licenseInfo->license === 'valid')
193
+ {
194
+ return true;
195
+ }
196
+
197
+ $message = null;
198
+
199
+ switch( $licenseInfo->error )
200
+ {
201
+ case 'expired' :
202
+ $message = sprintf(
203
+ __( 'Your license key expired on %s.' ),
204
+ date_i18n( get_option( 'date_format' ), strtotime( $licenseInfo->expires, current_time( 'timestamp' ) ) )
205
+ );
206
+ break;
207
+ case 'revoked' :
208
+ $message = __( 'Your license key has been disabled.' );
209
+ break;
210
+ case 'missing' :
211
+ $message = __( 'Invalid license.' );
212
+ break;
213
+ case 'invalid' :
214
+ case 'site_inactive' :
215
+ $message = __( 'Your license is not active for this URL.' );
216
+ break;
217
+ case 'item_name_mismatch' :
218
+ $message = sprintf( __( 'This appears to be an invalid license key for %s.' ), $moduleName );
219
+ break;
220
+ case 'no_activations_left':
221
+ $message = __( 'Your license key has reached its activation limit.' );
222
+ break;
223
+ default :
224
+ $message = __( 'An error occurred, please try again.' );
225
+ break;
226
+ }
227
+
228
+
229
+ return $message;
230
+
231
+
232
+
233
+
234
+
235
 
236
  }
237
 
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.28
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.28';
27
  CONST PLUGIN_SLUG = 'wp-bruiser';
28
  CONST PLUGIN_NAME = 'WPBruiser';
29
  CONST PLUGIN_SITE_URL = 'https://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.29
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.29';
27
  CONST PLUGIN_SLUG = 'wp-bruiser';
28
  CONST PLUGIN_NAME = 'WPBruiser';
29
  CONST PLUGIN_SITE_URL = 'https://www.wpbruiser.com';
includes/vendor/MchHttp/MchGdbcTrustedIPRanges.php CHANGED
@@ -53,7 +53,7 @@ final class MchGdbcTrustedIPRanges
53
 
54
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
55
  ?
56
- self::isIPInRanges($ipAddress, $ipVersion, array(50331648=>50462719,50692096=>50693631,50855936=>51118079,51249152=>51642367,55574528=>56623103,57147392=>57409535,57671680=>57933823,58195968=>58720255,63963136=>66060287,221249536=>221380607,221511680=>222035967,225443840=>225705983,226230272=>226492415,231735296=>231997439,233046016=>233832447,234487808=>234618879,262406144=>262537215,263258112=>263274495,310509568=>310575103,310902784=>310968319,311033856=>311164927,311427072=>311558143,312016896=>312082431,313458688=>313524223,313720832=>313786367,313917440=>313982975,314048512=>314179583,314310656=>314572799,314703872=>314966015,315097088=>317063167,317128704=>317587455,318111744=>318177279,318570496=>318636031,387186688=>387448831,583008256=>587202559,597229568=>599261183,775127040=>775147519,775149568=>775159807,780730368=>780795903,839909376=>840171519,846200832=>846266367,872415232=>875429887,875475968=>875478015,875495424=>877821951,877831168=>877832447,877834240=>877836799,877854720=>877920255,878051328=>878444543,878605312=>878606335,878639104=>878639343,878639360=>878639407,878639424=>878639503,878698752=>878699007,878699264=>878699775,878702336=>878706591,880266496=>880266751,884998144=>886571007,886833152=>886996991,910163968=>912261119,915406848=>917897215,917962752=>918552575,918618112=>920518655,920526848=>920528895,920531968=>920532991,920533760=>920534015,920535040=>920535551,920551424=>921042943,921174016=>921632767,921763840=>922746879,1059061760=>1059323903,1137311744=>1137328127,1210851328=>1210859519,1264943104=>1264975871,1333592064=>1333624831,1618935808=>1618968575,1666121728=>1666318335,1679032320=>1679818751,1728317440=>1728319487,1796472832=>1796734975,1820327936=>1820852223,2063122432=>2063138815,2360541184=>2360606719,2645491712=>2645557247,2684420096=>2684485631,2731927552=>2731927807,2734353408=>2734353663,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
 
53
 
54
  return ( $ipVersion === MchGdbcIPUtils::IP_VERSION_4 )
55
  ?
56
+ self::isIPInRanges($ipAddress, $ipVersion, array(50331648=>50462719,50692096=>50693631,50855936=>51118079,51183616=>51642367,51904512=>52166655,55574528=>56623103,57147392=>57409535,57671680=>57933823,58195968=>58720255,58851328=>58916863,63963136=>66060287,66584576=>67108863,221249536=>221380607,221511680=>222035967,225443840=>225705983,226230272=>226492415,231735296=>231997439,233046016=>233832447,234094592=>234225663,234487808=>234618879,262406144=>262537215,263258112=>263274495,263782400=>263847935,263979008=>264044543,264765440=>264830975,265158656=>265289727,310509568=>310575103,310902784=>310968319,311033856=>311558143,312016896=>312082431,312606720=>312737791,313458688=>313655295,313720832=>313786367,313917440=>313982975,314048512=>314179583,314310656=>314572799,314703872=>314966015,315097088=>317063167,317128704=>317587455,318111744=>318177279,318570496=>318636031,387186688=>387448831,583008256=>587202559,597229568=>599261183,775127040=>775147519,775149568=>775159807,780730368=>780795903,839909376=>840171519,846200832=>846266367,872415232=>875429887,875475968=>875478015,875495424=>877821951,877831168=>877832447,877834240=>877836799,877854720=>877920255,878051328=>878444543,878605312=>878606335,878639104=>878639343,878639360=>878639407,878639424=>878639519,878639536=>878639551,878698752=>878700031,878702336=>878706591,880266496=>880266751,884998144=>886571007,886833152=>886996991,910163968=>912261119,915406848=>917897215,917962752=>918552575,918618112=>920518655,920526848=>920528895,920531968=>920532991,920533760=>920534015,920535040=>920535551,920551424=>921042943,921174016=>921632767,921763840=>922746879,1059061760=>1059323903,1137311744=>1137328127,1210851328=>1210859519,1264943104=>1264975871,1333592064=>1333624831,1618935808=>1618968575,1666121728=>1666318335,1679032320=>1679818751,1728317440=>1728319487,1796472832=>1796734975,1820327936=>1820852223,2063122432=>2063138815,2360541184=>2360606719,2645491712=>2645557247,2684420096=>2684485631,2713518080=>2713583615,2731927552=>2731927807,2731928064=>2731928575,2734353408=>2734353663,2734353920=>2734354431,2927689728=>2927755263,2938732544=>2938765311,2954903552=>2954911743,2955018240=>2955083775,2974253056=>2974285823,3091726336=>3091857407,3098116096=>3098148863,3106961408=>3106962431,3438051328=>3438084095,3495319552=>3495320575,3635863552=>3635867647,))
57
  :
58
  self::isIPInRanges($ipAddress, $ipVersion, array());
59
 
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mihche
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XVC3TSGEJQP2U
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: 4.0
6
- Tested up to: 5.1
7
- Stable tag: 3.1.28
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -222,6 +222,9 @@ Studies shown that visual CAPTCHAs take around 5-10 seconds to complete and audi
222
 
223
  == Changelog ==
224
 
 
 
 
225
  = 3.1.28 =
226
  **Fixes**
227
  - Fixed ajax compatibility with [Ultra Community - User Profiles & Membership Plugin](https://wordpress.org/plugins/ultra-community/)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XVC3TSGEJQP2U
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: 4.0
6
+ Tested up to: 5.2
7
+ Stable tag: 3.1.29
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
222
 
223
  == Changelog ==
224
 
225
+ = 3.1.29 =
226
+ Refreshed Incapsula, Amazon and Cloudflare trusted IPs ranges
227
+
228
  = 3.1.28 =
229
  **Fixes**
230
  - Fixed ajax compatibility with [Ultra Community - User Profiles & Membership Plugin](https://wordpress.org/plugins/ultra-community/)