Advanced noCaptcha & invisible Captcha - Version 7.0.6.1

Version Description

(20220315) =

  • Improvements
    • Ensure migration script to new options table is run where needed.
    • Ensure correct default language is set during update in free edition.
    • Ensure verification does not hinder hook requests where no CAPTCHA is posted.
Download this release

Release Info

Developer WPWhiteSecurity
Plugin Icon 128x128 Advanced noCaptcha & invisible Captcha
Version 7.0.6.1
Comparing to
See all releases

Code changes from version 7.0.6 to 7.0.6.1

admin/settings.php CHANGED
@@ -25,6 +25,7 @@ class C4WP_Settings {
25
  } else {
26
  add_action( 'admin_menu', [ $this, 'menu_page' ] );
27
  }
 
28
  }
29
 
30
  function admin_enqueue_scripts() {
25
  } else {
26
  add_action( 'admin_menu', [ $this, 'menu_page' ] );
27
  }
28
+
29
  }
30
 
31
  function admin_enqueue_scripts() {
advanced-nocaptcha-recaptcha.php CHANGED
@@ -8,7 +8,7 @@
8
  *
9
  * @wordpress-plugin
10
  * Plugin Name: CAPTCHA 4WP
11
- * Version: 7.0.6
12
  * Plugin URI: https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/
13
  * Description: Easily add any type of CAPTCHA (such as noCaptcha or invisible Captcha) on any website form, including login pages, comments and password reset forms, and also forms by third party plugins such as Contact Form 7, WooCommerce & BuddyPress.
14
  * Author: WP White Security
@@ -69,7 +69,7 @@ class C4WP
69
 
70
  private function constants()
71
  {
72
- define( 'C4WP_PLUGIN_VERSION', '7.0.6' );
73
  define( 'C4WP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
74
  define( 'C4WP_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
75
  define( 'C4WP_PLUGIN_FILE', __FILE__ );
8
  *
9
  * @wordpress-plugin
10
  * Plugin Name: CAPTCHA 4WP
11
+ * Version: 7.0.6.1
12
  * Plugin URI: https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/
13
  * Description: Easily add any type of CAPTCHA (such as noCaptcha or invisible Captcha) on any website form, including login pages, comments and password reset forms, and also forms by third party plugins such as Contact Form 7, WooCommerce & BuddyPress.
14
  * Author: WP White Security
69
 
70
  private function constants()
71
  {
72
+ define( 'C4WP_PLUGIN_VERSION', '7.0.6.1' );
73
  define( 'C4WP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
74
  define( 'C4WP_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
75
  define( 'C4WP_PLUGIN_FILE', __FILE__ );
anr-captcha-class.php CHANGED
@@ -448,6 +448,10 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
448
  $errors->add( 'c4wp_error', $this->add_error_to_mgs() );
449
  }
450
 
 
 
 
 
451
  return $errors;
452
  }
453
 
@@ -475,6 +479,10 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
475
  }
476
 
477
  if ( ! $this->verify() ) {
 
 
 
 
478
  $result->add( 'c4wp_error', $this->add_error_to_mgs() );
479
  }
480
 
448
  $errors->add( 'c4wp_error', $this->add_error_to_mgs() );
449
  }
450
 
451
+ // Bail if we have nothign to work with.
452
+ if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
453
+ return $result;
454
+ }
455
  return $errors;
456
  }
457
 
479
  }
480
 
481
  if ( ! $this->verify() ) {
482
+ // Bail if we have nothign to work with.
483
+ if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
484
+ return $result;
485
+ }
486
  $result->add( 'c4wp_error', $this->add_error_to_mgs() );
487
  }
488
 
functions.php CHANGED
@@ -15,6 +15,7 @@ add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_32', 10 );
15
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_51', 20 );
16
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_70', 30 );
17
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_706', 30 );
 
18
 
19
  function c4wp_plugin_update_32( $prev_version ) {
20
  if ( version_compare( $prev_version, '3.2', '<' ) ) {
@@ -77,17 +78,21 @@ function c4wp_plugin_update_51( $prev_version ) {
77
  }
78
 
79
  function c4wp_plugin_update_70( $prev_version ) {
80
- if ( version_compare( $prev_version, '7.0', '<' ) ) {
81
  if ( is_multisite() ) {
82
- $original_options = get_site_option( 'anr_admin_options' );
83
- update_site_option( 'c4wp_admin_options', $original_options );
84
- update_site_option( 'c4wp_70_upgrade_complete', true );
85
- delete_site_option( 'anr_admin_options' );
 
 
86
  } else {
87
- $original_options = get_option( 'anr_admin_options' );
88
- update_option( 'c4wp_admin_options', $original_options );
89
- update_option( 'c4wp_70_upgrade_complete', true );
90
- delete_option( 'anr_admin_options' );
 
 
91
  }
92
  global $wpdb;
93
  $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE post_type = %s", [ 'anr-post' ] ) );
@@ -101,6 +106,19 @@ function c4wp_plugin_update_706( $prev_version ) {
101
  }
102
  }
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  /**
105
  * Handle getting options for our plugin.
106
  */
15
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_51', 20 );
16
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_70', 30 );
17
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_706', 30 );
18
+ add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_7061', 40 );
19
 
20
  function c4wp_plugin_update_32( $prev_version ) {
21
  if ( version_compare( $prev_version, '3.2', '<' ) ) {
78
  }
79
 
80
  function c4wp_plugin_update_70( $prev_version ) {
81
+ if ( version_compare( $prev_version, '7.0.6.1', '<' ) ) {
82
  if ( is_multisite() ) {
83
+ if ( ! get_site_option( 'c4wp_70_upgrade_complete' ) ) {
84
+ $original_options = get_site_option( 'anr_admin_options' );
85
+ update_site_option( 'c4wp_admin_options', $original_options );
86
+ update_site_option( 'c4wp_70_upgrade_complete', true );
87
+ delete_site_option( 'anr_admin_options' );
88
+ }
89
  } else {
90
+ if ( ! get_option( 'c4wp_70_upgrade_complete' ) ) {
91
+ $original_options = get_option( 'anr_admin_options' );
92
+ update_option( 'c4wp_admin_options', $original_options );
93
+ update_option( 'c4wp_70_upgrade_complete', true );
94
+ delete_option( 'anr_admin_options' );
95
+ }
96
  }
97
  global $wpdb;
98
  $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE post_type = %s", [ 'anr-post' ] ) );
106
  }
107
  }
108
 
109
+ /**
110
+ * Update langiage if auto-detect was enabled.
111
+ *
112
+ * @param string $prev_version
113
+ * @return void
114
+ */
115
+ function c4wp_plugin_update_7061( $prev_version ) {
116
+ $current_lang = c4wp_get_option( 'language' );
117
+ if ( version_compare( $prev_version, '7.0.6.1', '<' ) && empty( $current_lang ) ) {
118
+ c4wp_update_option( 'language', 'en' );
119
+ }
120
+ }
121
+
122
  /**
123
  * Handle getting options for our plugin.
124
  */
languages/advanced-nocaptcha-recaptcha.pot CHANGED
@@ -24,7 +24,7 @@ msgstr ""
24
  msgid "ERROR"
25
  msgstr ""
26
 
27
- #: functions.php:29
28
  msgid "<strong>ERROR</strong>: "
29
  msgstr ""
30
 
24
  msgid "ERROR"
25
  msgstr ""
26
 
27
+ #: functions.php:30
28
  msgid "<strong>ERROR</strong>: "
29
  msgstr ""
30
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: WPWhiteSecurity
3
  Tags: recaptcha, nocaptcha, captcha, invisible captcha, spam protection, captcha for WooCommerce, forms captcha
4
  Requires at least: 5.0
5
- Tested up to: 6.0
6
  Stable tag: 7.0.6.1
7
  Requires PHP: 7.0
8
  License: GPLv3
2
  Contributors: WPWhiteSecurity
3
  Tags: recaptcha, nocaptcha, captcha, invisible captcha, spam protection, captcha for WooCommerce, forms captcha
4
  Requires at least: 5.0
5
+ Tested up to: 5.9.1
6
  Stable tag: 7.0.6.1
7
  Requires PHP: 7.0
8
  License: GPLv3