Advanced noCaptcha & invisible Captcha - Version 7.1.0

Version Description

(20220629) =

Release notes: Support for WPForms & Gravity Forms plugins

  • New features

    • Added support for Gravity Forms.
    • Added support for WPForms.
    • New setting to show the CAPTCHA logo on the lower left rather than the default, right.
  • Security fix

    • Local File Inclusion reported by ZhongFu Su (JrXnm) of WuHan University.
  • Improvements

    • Improved JS handling within the WooCommerce checkout to ensure a more robust field during checkout changes.
    • Improved settings inline help text.
    • The action c4wp_captcha_form_field is now exclusive to premium editon.
    • Ensure applicable settings only accessible based on the current license.
    • Support for [c4wp-captcha] shortcode is now exclusive to the premium edition.
    • Streamlined plugins internal build process.
    • Improved Coding Standards throughout plugin.
  • Bug fixes

    • Fixed logic issue which could cause an error during new user registration.
    • Ensure only specific internal files can be loaded within the help area.
    • Ensure applicable functions return first argument where needed.
    • Allow for variants in variables caused by server operating system.
Download this release

Release Info

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

Code changes from version 7.0.6.1 to 7.1.0

admin/settings.php CHANGED
@@ -1,9 +1,26 @@
1
- <?php
2
 
 
 
 
 
 
 
 
3
  class C4WP_Settings {
4
 
 
 
 
 
 
5
  private static $instance;
6
 
 
 
 
 
 
7
  public static function init() {
8
  if ( ! self::$instance instanceof self ) {
9
  self::$instance = new self();
@@ -11,33 +28,48 @@ class C4WP_Settings {
11
  return self::$instance;
12
  }
13
 
14
- function actions_filters() {
15
- add_action( 'admin_init', [ $this, 'admin_init' ] );
16
- add_action( 'admin_init', [ $this, 'settings_save' ], 99 );
17
- add_filter( 'plugin_action_links_' . plugin_basename( C4WP_PLUGIN_FILE ), [ $this, 'add_settings_link' ] );
18
- add_action( 'admin_enqueue_scripts', [ $this, 'admin_enqueue_scripts' ] );
19
-
 
 
 
 
 
20
  $use_network_hooks = is_multisite();
21
 
22
  if ( $use_network_hooks ) {
23
- add_action( 'network_admin_menu', [ $this, 'network_menu_page' ] );
24
- add_filter( 'network_admin_plugin_action_links_' . plugin_basename( C4WP_PLUGIN_FILE ), [ $this, 'add_settings_link' ] );
25
  } else {
26
- add_action( 'admin_menu', [ $this, 'menu_page' ] );
27
  }
28
 
29
  }
30
 
31
- function admin_enqueue_scripts() {
 
 
 
 
 
32
  wp_register_script( 'c4wp-admin', C4WP_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery' ), C4WP_PLUGIN_VERSION, false );
33
  }
34
 
35
- function admin_init() {
 
 
 
 
 
36
  register_setting( 'c4wp_admin_options', 'c4wp_admin_options', array( $this, 'options_sanitize' ) );
37
 
38
  $current_tab = 'c4wp-admin-captcha';
39
  if ( ! empty( $_GET['page'] ) ) {
40
- $current_tab = $_GET['page'];
41
  }
42
 
43
  foreach ( $this->get_sections( $current_tab ) as $section_id => $section ) {
@@ -48,7 +80,13 @@ class C4WP_Settings {
48
  }
49
  }
50
 
51
- function get_sections( $section_we_want = 'c4wp-admin-captcha' ) {
 
 
 
 
 
 
52
  $captcha_sections = array(
53
  'google_keys' => array(
54
  'section_title' => '',
@@ -57,8 +95,8 @@ class C4WP_Settings {
57
  echo '<span style="margin-top: 10px; display: block;">';
58
  printf(
59
  /* translators: link to the settings page with text "Settings page" */
60
- esc_html__( 'In this page you can configure the type of reCAPTCHA that you want to use on your website. Once you configure your CAPTCHA, head to the %s to configure where the CAPTCHA should be used, whitelist IP addresses and configure other settings.', 'advanced-nocaptcha-recaptcha' ),
61
- '<a href="' . esc_url( $settings_url ) . '">' . esc_html__( 'Settings page', 'advanced-nocaptcha-recaptcha' ) . '</a>'
62
  );
63
  echo '</span>';
64
  },
@@ -79,12 +117,16 @@ class C4WP_Settings {
79
  ),
80
  );
81
 
82
- $sections = ( $section_we_want == 'c4wp-admin-captcha' ) ? $captcha_sections : $settings_sections;
83
  return apply_filters( 'c4wp_settings_sections', $sections );
84
  }
85
 
86
-
87
- function get_fields() {
 
 
 
 
88
  $score_values = array();
89
  for ( $i = 0.0; $i <= 1; $i += 0.1 ) {
90
  $score_values[ "$i" ] = number_format_i18n( $i, 1 );
@@ -103,10 +145,11 @@ class C4WP_Settings {
103
 
104
  if ( ! c4wp_is_premium_version() ) {
105
  $forms_preamble_desc .= sprintf(
 
106
  __( 'To add CAPTCHA checks to WooCommerce, Contact Form 7, BuddyPress and other forms created by third party plugins you need to %s', 'advanced-nocaptcha-recaptcha' ),
107
  '<a target="_blank" rel="noopener noreferrer" href="' . esc_url( '#' ) . '">' . esc_html__( 'upgrade to Premium', 'advanced-nocaptcha-recaptcha' ) . '</a>'
108
  );
109
- $lang_selector_desc .= esc_html__( ' In the Premium edition you can configure the plugin to automatically detect the language settings of the visitor\'s and use that language.', 'advanced-nocaptcha-recaptcha' );
110
  }
111
 
112
  $comment_form_label = esc_html__( 'Comments form', 'advanced-nocaptcha-recaptcha' );
@@ -120,8 +163,8 @@ class C4WP_Settings {
120
  'section_id' => 'google_keys',
121
  'type' => 'html',
122
  'label' => sprintf(
123
- '<strong style="position: absolute;">%1$s</strong>',
124
- esc_html__( 'Select the type of reCAPTCHA you want to use', 'advanced-nocaptcha-recaptcha' )
125
  ),
126
  'class' => 'wrap-around-content',
127
  ),
@@ -141,8 +184,8 @@ class C4WP_Settings {
141
  'section_id' => 'google_keys',
142
  'type' => 'html',
143
  'label' => sprintf(
144
- '<strong style="position: absolute;">%1$s</strong>',
145
- esc_html__( 'Specify the Site & Secret key', 'advanced-nocaptcha-recaptcha' )
146
  ),
147
  'class' => 'wrap-around-content',
148
  ),
@@ -152,6 +195,7 @@ class C4WP_Settings {
152
  'label' => sprintf(
153
  '<p class="description c4wp-desc" style="position: absolute;">%1$s</p>',
154
  sprintf(
 
155
  esc_html__( 'To communicate with Google and utilize the reCAPTCHA service you need to get a Site Key and Secret Key. You can obtain these keys for free by registering for your Google reCAPTCHA. Refer to %s if you need help with the process.', 'advanced-nocaptcha-recaptcha' ),
156
  '<a href="' . esc_url( 'https://www.wpwhitesecurity.com/support/kb/get-google-recaptcha-keys/' ) . '" target="_blank">' . esc_html__( 'how to get the Google reCAPTCHA keys', 'advanced-nocaptcha-recaptcha' ) . '</a>'
157
  )
@@ -172,8 +216,19 @@ class C4WP_Settings {
172
  'section_id' => 'google_keys',
173
  'type' => 'html',
174
  'label' => sprintf(
175
- '<strong style="position: absolute;">%1$s</strong>',
176
- esc_html__( 'Configure the below optional settings to fine-tune the reCAPTCHA to your requirements.', 'advanced-nocaptcha-recaptcha' )
 
 
 
 
 
 
 
 
 
 
 
177
  ),
178
  'class' => 'wrap-around-content',
179
  ),
@@ -184,7 +239,7 @@ class C4WP_Settings {
184
  'class' => 'regular toggleable disabled c4wp-show-field-for-v3',
185
  'std' => '0.5',
186
  'options' => $score_values,
187
- 'desc' => esc_html__( 'Use this setting to specify sensitivity of the CAPTCHA check. The closer to 1 the more sensitive the CAPTCHA check will be, which also means more traffic will be marked as spam. This option is only available for reCAPTCHA v3.', 'advanced-nocaptcha-recaptcha' ) . '</br>',
188
  ),
189
  'v3_script_load' => array(
190
  'label' => esc_html__( 'Load CAPTCHA v3 scripts on:', 'advanced-nocaptcha-recaptcha' ),
@@ -196,7 +251,7 @@ class C4WP_Settings {
196
  'all_pages' => esc_html__( 'All Pages', 'advanced-nocaptcha-recaptcha' ),
197
  'form_pages' => esc_html__( 'Form Pages', 'advanced-nocaptcha-recaptcha' ),
198
  ),
199
- 'desc' => esc_html__( 'By default CAPTCHA only loads on the pages where it is required, mainly forms. However, for V3 you can configure it to load on all pages so it has a better context of the traffic and works more efficiently. The CAPTCHA test will never interrupt users on non-form pages.', 'advanced-nocaptcha-recaptcha' ) . '</br>',
200
  ),
201
  'language_handling' => array(
202
  'label' => esc_html__( 'CAPTCHA language', 'advanced-nocaptcha-recaptcha' ),
@@ -207,7 +262,7 @@ class C4WP_Settings {
207
  'options' => array(
208
  'manually_choose' => esc_html__( 'Select a language', 'advanced-nocaptcha-recaptcha' ),
209
  ),
210
- 'desc' => $lang_selector_desc . '</br>',
211
  ),
212
  'language' => array(
213
  'label' => '',
@@ -268,7 +323,7 @@ class C4WP_Settings {
268
  'label' => esc_html__( 'Error message', 'advanced-nocaptcha-recaptcha' ),
269
  'section_id' => 'google_keys',
270
  'std' => esc_html__( 'Please solve the CAPTCHA to proceed', 'advanced-nocaptcha-recaptcha' ),
271
- 'desc' => esc_html__( 'Specify the message you want to show users who do not complete the CAPTCHA.', 'advanced-nocaptcha-recaptcha' ) . '</br>',
272
  ),
273
  'theme' => array(
274
  'label' => esc_html__( 'Theme', 'advanced-nocaptcha-recaptcha' ),
@@ -303,7 +358,19 @@ class C4WP_Settings {
303
  'bottomleft' => esc_html__( 'Bottom Left', 'advanced-nocaptcha-recaptcha' ),
304
  'inline' => esc_html__( 'Inline', 'advanced-nocaptcha-recaptcha' ),
305
  ),
306
- 'desc' => esc_html__( 'Badge shows for invisible captcha', 'advanced-nocaptcha-recaptcha' ) . '</br>',
 
 
 
 
 
 
 
 
 
 
 
 
307
  ),
308
  'recaptcha_domain' => array(
309
  'label' => esc_html__( 'reCAPTCHA domain', 'advanced-nocaptcha-recaptcha' ),
@@ -316,7 +383,7 @@ class C4WP_Settings {
316
  'google.net' => 'google.net',
317
  'recaptcha.net' => 'recaptcha.net',
318
  ),
319
- 'desc' => esc_html__( 'Use this setting to change the domain if Google is not accessible or blocked.', 'advanced-nocaptcha-recaptcha' ) . '</br>',
320
  ),
321
  'remove_css' => array(
322
  'label' => esc_html__( 'Remove CSS', 'advanced-nocaptcha-recaptcha' ),
@@ -324,7 +391,7 @@ class C4WP_Settings {
324
  'type' => 'checkbox',
325
  'class' => 'checkbox toggleable disabled c4wp-show-field-for-v2_checkbox',
326
  'cb_label' => esc_html__( "Remove this plugin's css from login page?", 'advanced-nocaptcha-recaptcha' ),
327
- 'desc' => __( 'This css increase login page width to adjust with Captcha width.', 'advanced-nocaptcha-recaptcha' ) . '</br>',
328
  ),
329
 
330
  // Settings.
@@ -406,7 +473,13 @@ class C4WP_Settings {
406
  return $fields;
407
  }
408
 
409
- function callback( $field ) {
 
 
 
 
 
 
410
  $attrib = '';
411
  if ( ! empty( $field['required'] ) ) {
412
  $attrib .= ' required = "required"';
@@ -427,7 +500,7 @@ class C4WP_Settings {
427
  $value = c4wp_get_option( $field['id'], $field['std'] );
428
 
429
  if ( ! empty( $field['desc'] ) ) {
430
- printf( '<p class="description mb-10">%s</p>', $field['desc'] );
431
  }
432
 
433
  switch ( $field['type'] ) {
@@ -549,12 +622,19 @@ class C4WP_Settings {
549
  break;
550
 
551
  default:
 
552
  printf( esc_html__( 'No hook defined for %s', 'advanced-nocaptcha-recaptcha' ), esc_html( $field['type'] ) );
553
  break;
554
  }
555
  }
556
 
557
- function options_sanitize( $value ) {
 
 
 
 
 
 
558
  if ( ! $value || ! is_array( $value ) ) {
559
  return $value;
560
  }
@@ -572,7 +652,14 @@ class C4WP_Settings {
572
  return $value;
573
  }
574
 
575
- function posted_value_sanitize( $value, $field ) {
 
 
 
 
 
 
 
576
  $sanitized = $value;
577
  switch ( $field['type'] ) {
578
  case 'text':
@@ -584,14 +671,14 @@ class C4WP_Settings {
584
  break;
585
  case 'number':
586
  case 'number-inline':
587
- if ( isset( $field['id'] ) && 'failed_login_cron_schedule' == $field['id'] ) {
588
  if ( absint( $value ) > 10 ) {
589
  $value = 10;
590
  } elseif ( absint( $value ) < 1 ) {
591
  $value = 1;
592
  }
593
  }
594
- if ( isset( $field['id'] ) && 'failed_login_allow' == $field['id'] ) {
595
  if ( absint( $value ) > 20 ) {
596
  $value = 10;
597
  } elseif ( absint( $value ) < 1 ) {
@@ -629,7 +716,12 @@ class C4WP_Settings {
629
  return apply_filters( 'c4wp_settings_field_sanitize_filter', $sanitized, $field, $value );
630
  }
631
 
632
- function menu_page() {
 
 
 
 
 
633
  $icon_url = C4WP_PLUGIN_URL . 'assets/img/20x20-icon.png';
634
  add_menu_page( esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), $icon_url, 99 );
635
  $hook_captcha_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), 0 );
@@ -646,7 +738,12 @@ class C4WP_Settings {
646
  add_action( "load-$hook_settings_submenu", array( $this, 'c4wp_admin_page_enqueue_scripts' ) );
647
  }
648
 
649
- function network_menu_page() {
 
 
 
 
 
650
  add_menu_page( esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), '', 99 );
651
  $hook_captcha_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), 0 );
652
  $hook_settings_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA 4WP Settings', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'Settings & Placements', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-settings', array( $this, 'admin_settings' ), 1 );
@@ -662,12 +759,22 @@ class C4WP_Settings {
662
  add_action( "load-$hook_settings_submenu", array( $this, 'c4wp_admin_page_enqueue_scripts' ) );
663
  }
664
 
665
- function c4wp_admin_page_enqueue_scripts() {
666
- wp_enqueue_style( 'c4wp-admin', C4WP_PLUGIN_URL . 'assets/css/admin.css' );
667
-
 
 
 
 
 
668
  }
669
 
670
- function settings_save() {
 
 
 
 
 
671
  if ( current_user_can( 'manage_options' ) && isset( $_POST['c4wp_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'c4wp-admin-settings' === $_GET['page'] ||
672
  current_user_can( 'manage_options' ) && isset( $_POST['c4wp_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'c4wp-admin-captcha' === $_GET['page'] ) {
673
  check_admin_referer( 'c4wp_admin_options-options' );
@@ -686,7 +793,12 @@ class C4WP_Settings {
686
  }
687
  }
688
 
689
- function admin_settings() {
 
 
 
 
 
690
  wp_enqueue_script( 'c4wp-admin' );
691
  wp_localize_script(
692
  'c4wp-admin',
@@ -699,17 +811,36 @@ class C4WP_Settings {
699
 
700
  $current_tab = 'c4wp-admin-captcha';
701
  if ( ! empty( $_GET['page'] ) ) {
702
- $current_tab = $_GET['page'];
703
  }
 
 
 
 
 
 
 
704
  ?>
705
- <div class="wrap fs-section">
 
 
 
 
 
 
 
 
 
 
 
 
706
  <!-- Plugin settings go here -->
707
  <div id="c4wp-help">
708
  <h1>
709
  <?php
710
- if ( 'c4wp-admin-captcha' == $current_tab ) {
711
- _e( 'Captcha Configuration', 'advanced-nocaptcha-recaptcha' );
712
- } elseif ( 'c4wp-admin-settings' == $current_tab ) {
713
  _e( 'CAPTCHA Placements', 'advanced-nocaptcha-recaptcha' );
714
  }
715
  ?>
@@ -718,11 +849,11 @@ class C4WP_Settings {
718
  <div id="post-body-content">
719
  <div id="tab_container">
720
  <?php
721
- if ( 'c4wp-admin-captcha' == $current_tab || 'c4wp-admin-settings' == $current_tab ) {
722
  $this->settings_form();
723
- } elseif ( 'c4wp-admin-help' == $current_tab ) {
724
  $this->display_help_page();
725
- } elseif ( 'c4wp-admin-upgrade' == $current_tab ) {
726
  $this->display_upgrade_page();
727
  }
728
  ?>
@@ -744,7 +875,12 @@ class C4WP_Settings {
744
  <?php
745
  }
746
 
747
- function settings_form() {
 
 
 
 
 
748
 
749
  ?>
750
  <?php $this->c4wp_settings_notice(); ?>
@@ -763,7 +899,7 @@ class C4WP_Settings {
763
  /**
764
  * Creates and displays notices upon successful saving of settings or errors if needed.
765
  */
766
- function c4wp_settings_notice() {
767
  $errors = get_transient( 'c4wp_admin_options_errors' );
768
  $notice = '';
769
  if ( empty( $errors ) ) {
@@ -771,15 +907,15 @@ class C4WP_Settings {
771
  }
772
 
773
  foreach ( $errors as $error ) {
774
- if ( 'empty_site_key' == $error ) {
775
  $notice .= '<div class="notice notice-error"><p>' . esc_html__( 'The site key that you have entered is invalid. Please try again.', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
776
  }
777
- if ( 'empty_secret_key' == $error ) {
778
  $notice .= '<div class="notice notice-error"><p>' . esc_html__( 'The secret key that you have entered is invalid. Please try again.', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
779
  }
780
- if ( 'success' == $error ) {
781
  $context = esc_html__( 'Captcha settings', 'advanced-nocaptcha-recaptcha' );
782
- if ( isset( $_REQUEST['page'] ) && 'c4wp-admin-captcha' == $_REQUEST['page'] ) {
783
  $context = esc_html__( 'Captcha configuration', 'advanced-nocaptcha-recaptcha' );
784
  }
785
  $notice .= '<div class="notice notice-success"><p>' . $context . esc_html__( ' updated', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
@@ -791,7 +927,12 @@ class C4WP_Settings {
791
  echo $notice;
792
  }
793
 
794
- function c4wp_admin_sidebar() {
 
 
 
 
 
795
  $return = '';
796
  if ( ! c4wp_is_premium_version() ) :
797
  $icon_url = C4WP_PLUGIN_URL . 'assets/img/c4wp-logo-full.png';
@@ -832,12 +973,12 @@ class C4WP_Settings {
832
  * Validate targetted options and remove from the array which is about to be saved if invalid.
833
  * Also handles error/success notices based on result.
834
  *
835
- * @param array $value
836
- * @return array
837
  *
838
  * @since 7.0.0
839
  */
840
- function validate_and_set_notices( $value ) {
841
  $errors = array();
842
 
843
  if ( isset( $value['site_key'] ) && isset( $value['secret_key'] ) ) {
@@ -865,22 +1006,46 @@ class C4WP_Settings {
865
  return $value;
866
  }
867
 
868
- function add_settings_link( $links ) {
869
- // add settings link in plugins page
 
 
 
 
 
 
870
  $settings_link = '<a href="' . c4wp_settings_page_url() . '">' . esc_html__( 'Settings', 'advanced-nocaptcha-recaptcha' ) . '</a>';
871
  array_unshift( $links, $settings_link );
872
  return $links;
873
  }
874
 
875
- function display_help_page() {
 
 
 
 
 
876
  require_once 'templates/help/index.php';
877
  }
878
 
879
- function display_upgrade_page() {
 
 
 
 
 
880
  require_once 'templates/upgrade/index.php';
881
  }
882
 
883
- static function push_at_to_associative_array( $array, $key, $new ) {
 
 
 
 
 
 
 
 
884
  $keys = array_keys( $array );
885
  $index = array_search( $key, $keys, true );
886
  $pos = false === $index ? count( $array ) : $index + 1;
1
+ <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.Security.NonceVerification.Missing
2
 
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit; // Exit if accessed directly.
5
+ }
6
+
7
+ /**
8
+ * Main Settings class.
9
+ */
10
  class C4WP_Settings {
11
 
12
+ /**
13
+ * Class instance.
14
+ *
15
+ * @var C4WP_Settings
16
+ */
17
  private static $instance;
18
 
19
+ /**
20
+ * Class initiator.
21
+ *
22
+ * @return $instance - Class instance.
23
+ */
24
  public static function init() {
25
  if ( ! self::$instance instanceof self ) {
26
  self::$instance = new self();
28
  return self::$instance;
29
  }
30
 
31
+ /**
32
+ * Actions used by our class.
33
+ *
34
+ * @return void
35
+ */
36
+ public function actions_filters() {
37
+ add_action( 'admin_init', array( $this, 'admin_init' ) );
38
+ add_action( 'admin_init', array( $this, 'settings_save' ), 99 );
39
+ add_filter( 'plugin_action_links_' . plugin_basename( C4WP_PLUGIN_FILE ), array( $this, 'add_settings_link' ) );
40
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
41
+
42
  $use_network_hooks = is_multisite();
43
 
44
  if ( $use_network_hooks ) {
45
+ add_action( 'network_admin_menu', array( $this, 'network_menu_page' ) );
46
+ add_filter( 'network_admin_plugin_action_links_' . plugin_basename( C4WP_PLUGIN_FILE ), array( $this, 'add_settings_link' ) );
47
  } else {
48
+ add_action( 'admin_menu', array( $this, 'menu_page' ) );
49
  }
50
 
51
  }
52
 
53
+ /**
54
+ * Add settings page scripts.
55
+ *
56
+ * @return void
57
+ */
58
+ public function admin_enqueue_scripts() {
59
  wp_register_script( 'c4wp-admin', C4WP_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery' ), C4WP_PLUGIN_VERSION, false );
60
  }
61
 
62
+ /**
63
+ * Add settings pages to WP admin.
64
+ *
65
+ * @return void
66
+ */
67
+ public function admin_init() {
68
  register_setting( 'c4wp_admin_options', 'c4wp_admin_options', array( $this, 'options_sanitize' ) );
69
 
70
  $current_tab = 'c4wp-admin-captcha';
71
  if ( ! empty( $_GET['page'] ) ) {
72
+ $current_tab = wp_unslash( $_GET['page'] );
73
  }
74
 
75
  foreach ( $this->get_sections( $current_tab ) as $section_id => $section ) {
80
  }
81
  }
82
 
83
+ /**
84
+ * Create sections used within settings.
85
+ *
86
+ * @param string $section_we_want - Section to return.
87
+ * @return array $sections - Sections created.
88
+ */
89
+ public function get_sections( $section_we_want = 'c4wp-admin-captcha' ) {
90
  $captcha_sections = array(
91
  'google_keys' => array(
92
  'section_title' => '',
95
  echo '<span style="margin-top: 10px; display: block;">';
96
  printf(
97
  /* translators: link to the settings page with text "Settings page" */
98
+ esc_html__( 'Follow the 3 steps on this CAPTCHA configuration page to configure the integration with the Google reCAPTCHA service so you can use CAPTCHA checks on your website. use on your website. Once you configure the integration navigate to the %s page to configure where CAPTCHA should be added on your website, whitelist IP addresses and configure other settings', 'advanced-nocaptcha-recaptcha' ),
99
+ '<a href="' . esc_url( $settings_url ) . '">' . esc_html__( 'Settings & placements', 'advanced-nocaptcha-recaptcha' ) . '</a>'
100
  );
101
  echo '</span>';
102
  },
117
  ),
118
  );
119
 
120
+ $sections = ( 'c4wp-admin-captcha' === $section_we_want ) ? $captcha_sections : $settings_sections;
121
  return apply_filters( 'c4wp_settings_sections', $sections );
122
  }
123
 
124
+ /**
125
+ * Main plugin setting fields.
126
+ *
127
+ * @return array - Settings fields.
128
+ */
129
+ public function get_fields() {
130
  $score_values = array();
131
  for ( $i = 0.0; $i <= 1; $i += 0.1 ) {
132
  $score_values[ "$i" ] = number_format_i18n( $i, 1 );
145
 
146
  if ( ! c4wp_is_premium_version() ) {
147
  $forms_preamble_desc .= sprintf(
148
+ /* translators:link to upgrade page */
149
  __( 'To add CAPTCHA checks to WooCommerce, Contact Form 7, BuddyPress and other forms created by third party plugins you need to %s', 'advanced-nocaptcha-recaptcha' ),
150
  '<a target="_blank" rel="noopener noreferrer" href="' . esc_url( '#' ) . '">' . esc_html__( 'upgrade to Premium', 'advanced-nocaptcha-recaptcha' ) . '</a>'
151
  );
152
+ $lang_selector_desc .= esc_html__( ' In the Premium edition you can configure the plugin to automatically detect the language settings of the visitor\'s and use that language.', 'advanced-nocaptcha-recaptcha' );
153
  }
154
 
155
  $comment_form_label = esc_html__( 'Comments form', 'advanced-nocaptcha-recaptcha' );
163
  'section_id' => 'google_keys',
164
  'type' => 'html',
165
  'label' => sprintf(
166
+ '<strong style="position: absolute; font-size: 16px;">%1$s</strong>',
167
+ esc_html__( 'STEP 1: Select the type of reCAPTCHA you want to use', 'advanced-nocaptcha-recaptcha' )
168
  ),
169
  'class' => 'wrap-around-content',
170
  ),
184
  'section_id' => 'google_keys',
185
  'type' => 'html',
186
  'label' => sprintf(
187
+ '<strong style="position: absolute; font-size: 16px">%1$s</strong>',
188
+ esc_html__( 'STEP 2: Specify the Site & Secret keys', 'advanced-nocaptcha-recaptcha' )
189
  ),
190
  'class' => 'wrap-around-content',
191
  ),
195
  'label' => sprintf(
196
  '<p class="description c4wp-desc" style="position: absolute;">%1$s</p>',
197
  sprintf(
198
+ /* translators:link to help page */
199
  esc_html__( 'To communicate with Google and utilize the reCAPTCHA service you need to get a Site Key and Secret Key. You can obtain these keys for free by registering for your Google reCAPTCHA. Refer to %s if you need help with the process.', 'advanced-nocaptcha-recaptcha' ),
200
  '<a href="' . esc_url( 'https://www.wpwhitesecurity.com/support/kb/get-google-recaptcha-keys/' ) . '" target="_blank">' . esc_html__( 'how to get the Google reCAPTCHA keys', 'advanced-nocaptcha-recaptcha' ) . '</a>'
201
  )
216
  'section_id' => 'google_keys',
217
  'type' => 'html',
218
  'label' => sprintf(
219
+ '<strong style="position: absolute; font-size: 16px;">%1$s</strong>',
220
+ esc_html__( 'STEP 3 (OPTIONAL): Fine-tune reCAPTCHA to your requirements', 'advanced-nocaptcha-recaptcha' )
221
+ ),
222
+ 'class' => 'wrap-around-content',
223
+ ),
224
+ 'score)subtitle' => array(
225
+ 'section_id' => 'google_keys',
226
+ 'type' => 'html',
227
+ 'label' => sprintf(
228
+ '<p class="description c4wp-desc" style="position: absolute;">%1$s</p>',
229
+ sprintf(
230
+ esc_html__( 'Use the below settings to configure and fine-tune CAPTCHA to your requirements. All the below settings are optional and with them you can configure different aspects of the CAPTCHA checks on your website, such as look and feel and also sensitivy.', 'advanced-nocaptcha-recaptcha' )
231
+ )
232
  ),
233
  'class' => 'wrap-around-content',
234
  ),
239
  'class' => 'regular toggleable disabled c4wp-show-field-for-v3',
240
  'std' => '0.5',
241
  'options' => $score_values,
242
+ 'desc' => esc_html__( 'Use this setting to specify sensitivity of the CAPTCHA check. The closer to 1 the more sensitive the CAPTCHA check will be, which also means more traffic will be marked as spam. This option is only available for reCAPTCHA v3.', 'advanced-nocaptcha-recaptcha' ),
243
  ),
244
  'v3_script_load' => array(
245
  'label' => esc_html__( 'Load CAPTCHA v3 scripts on:', 'advanced-nocaptcha-recaptcha' ),
251
  'all_pages' => esc_html__( 'All Pages', 'advanced-nocaptcha-recaptcha' ),
252
  'form_pages' => esc_html__( 'Form Pages', 'advanced-nocaptcha-recaptcha' ),
253
  ),
254
+ 'desc' => esc_html__( 'By default CAPTCHA only loads on the pages where it is required, mainly forms. However, for V3 you can configure it to load on all pages so it has a better context of the traffic and works more efficiently. The CAPTCHA test will never interrupt users on non-form pages.', 'advanced-nocaptcha-recaptcha' ),
255
  ),
256
  'language_handling' => array(
257
  'label' => esc_html__( 'CAPTCHA language', 'advanced-nocaptcha-recaptcha' ),
262
  'options' => array(
263
  'manually_choose' => esc_html__( 'Select a language', 'advanced-nocaptcha-recaptcha' ),
264
  ),
265
+ 'desc' => $lang_selector_desc,
266
  ),
267
  'language' => array(
268
  'label' => '',
323
  'label' => esc_html__( 'Error message', 'advanced-nocaptcha-recaptcha' ),
324
  'section_id' => 'google_keys',
325
  'std' => esc_html__( 'Please solve the CAPTCHA to proceed', 'advanced-nocaptcha-recaptcha' ),
326
+ 'desc' => esc_html__( 'Specify the message you want to show users who do not complete the CAPTCHA.', 'advanced-nocaptcha-recaptcha' ),
327
  ),
328
  'theme' => array(
329
  'label' => esc_html__( 'Theme', 'advanced-nocaptcha-recaptcha' ),
358
  'bottomleft' => esc_html__( 'Bottom Left', 'advanced-nocaptcha-recaptcha' ),
359
  'inline' => esc_html__( 'Inline', 'advanced-nocaptcha-recaptcha' ),
360
  ),
361
+ 'desc' => esc_html__( 'Badge shows for invisible captcha', 'advanced-nocaptcha-recaptcha' ),
362
+ ),
363
+ 'badge_v3' => array(
364
+ 'label' => esc_html__( 'Badge v3', 'advanced-nocaptcha-recaptcha' ),
365
+ 'section_id' => 'google_keys',
366
+ 'type' => 'select',
367
+ 'class' => 'regular toggleable disabled c4wp-show-field-for-v3',
368
+ 'std' => 'bottomright',
369
+ 'options' => array(
370
+ 'bottomright' => esc_html__( 'Bottom Right', 'advanced-nocaptcha-recaptcha' ),
371
+ 'bottomleft' => esc_html__( 'Bottom Left', 'advanced-nocaptcha-recaptcha' ),
372
+ ),
373
+ 'desc' => esc_html__( 'Badge shows for invisible captcha v3', 'advanced-nocaptcha-recaptcha' ),
374
  ),
375
  'recaptcha_domain' => array(
376
  'label' => esc_html__( 'reCAPTCHA domain', 'advanced-nocaptcha-recaptcha' ),
383
  'google.net' => 'google.net',
384
  'recaptcha.net' => 'recaptcha.net',
385
  ),
386
+ 'desc' => esc_html__( 'Use this setting to change the domain if Google is not accessible or blocked.', 'advanced-nocaptcha-recaptcha' ),
387
  ),
388
  'remove_css' => array(
389
  'label' => esc_html__( 'Remove CSS', 'advanced-nocaptcha-recaptcha' ),
391
  'type' => 'checkbox',
392
  'class' => 'checkbox toggleable disabled c4wp-show-field-for-v2_checkbox',
393
  'cb_label' => esc_html__( "Remove this plugin's css from login page?", 'advanced-nocaptcha-recaptcha' ),
394
+ 'desc' => __( 'This css increase login page width to adjust with Captcha width.', 'advanced-nocaptcha-recaptcha' ),
395
  ),
396
 
397
  // Settings.
473
  return $fields;
474
  }
475
 
476
+ /**
477
+ * Field callback.
478
+ *
479
+ * @param array $field - Field data.
480
+ * @return void
481
+ */
482
+ public function callback( $field ) {
483
  $attrib = '';
484
  if ( ! empty( $field['required'] ) ) {
485
  $attrib .= ' required = "required"';
500
  $value = c4wp_get_option( $field['id'], $field['std'] );
501
 
502
  if ( ! empty( $field['desc'] ) ) {
503
+ printf( '<p class="description mb-10">%s</p>', esc_html( $field['desc'] ) );
504
  }
505
 
506
  switch ( $field['type'] ) {
622
  break;
623
 
624
  default:
625
+ /* translators:field type */
626
  printf( esc_html__( 'No hook defined for %s', 'advanced-nocaptcha-recaptcha' ), esc_html( $field['type'] ) );
627
  break;
628
  }
629
  }
630
 
631
+ /**
632
+ * Sanitize provided value.
633
+ *
634
+ * @param string $value - Value to sanitize.
635
+ * @return string $value - Sanitized value.
636
+ */
637
+ public function options_sanitize( $value ) {
638
  if ( ! $value || ! is_array( $value ) ) {
639
  return $value;
640
  }
652
  return $value;
653
  }
654
 
655
+ /**
656
+ * Sanitize posted value.
657
+ *
658
+ * @param string $value - Value to sanitize.
659
+ * @param array $field - Field to sanitize.
660
+ * @return string$sanitized - Sanitized value.
661
+ */
662
+ public function posted_value_sanitize( $value, $field ) {
663
  $sanitized = $value;
664
  switch ( $field['type'] ) {
665
  case 'text':
671
  break;
672
  case 'number':
673
  case 'number-inline':
674
+ if ( isset( $field['id'] ) && 'failed_login_cron_schedule' === $field['id'] ) {
675
  if ( absint( $value ) > 10 ) {
676
  $value = 10;
677
  } elseif ( absint( $value ) < 1 ) {
678
  $value = 1;
679
  }
680
  }
681
+ if ( isset( $field['id'] ) && 'failed_login_allow' === $field['id'] ) {
682
  if ( absint( $value ) > 20 ) {
683
  $value = 10;
684
  } elseif ( absint( $value ) < 1 ) {
716
  return apply_filters( 'c4wp_settings_field_sanitize_filter', $sanitized, $field, $value );
717
  }
718
 
719
+ /**
720
+ * Create admin menu link.
721
+ *
722
+ * @return void
723
+ */
724
+ public function menu_page() {
725
  $icon_url = C4WP_PLUGIN_URL . 'assets/img/20x20-icon.png';
726
  add_menu_page( esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), $icon_url, 99 );
727
  $hook_captcha_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), 0 );
738
  add_action( "load-$hook_settings_submenu", array( $this, 'c4wp_admin_page_enqueue_scripts' ) );
739
  }
740
 
741
+ /**
742
+ * Create network admin menu link.
743
+ *
744
+ * @return void
745
+ */
746
+ public function network_menu_page() {
747
  add_menu_page( esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), '', 99 );
748
  $hook_captcha_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-captcha', array( $this, 'admin_settings' ), 0 );
749
  $hook_settings_submenu = add_submenu_page( 'c4wp-admin-captcha', esc_html__( 'CAPTCHA 4WP Settings', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'Settings & Placements', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'c4wp-admin-settings', array( $this, 'admin_settings' ), 1 );
759
  add_action( "load-$hook_settings_submenu", array( $this, 'c4wp_admin_page_enqueue_scripts' ) );
760
  }
761
 
762
+ /**
763
+ * Add admin CSS.
764
+ *
765
+ * @return void
766
+ */
767
+ public function c4wp_admin_page_enqueue_scripts() {
768
+ $version = C4WP_PLUGIN_VERSION;
769
+ wp_enqueue_style( 'c4wp-admin', C4WP_PLUGIN_URL . 'assets/css/admin.css', array(), $version );
770
  }
771
 
772
+ /**
773
+ * Save settings.
774
+ *
775
+ * @return void
776
+ */
777
+ public function settings_save() {
778
  if ( current_user_can( 'manage_options' ) && isset( $_POST['c4wp_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'c4wp-admin-settings' === $_GET['page'] ||
779
  current_user_can( 'manage_options' ) && isset( $_POST['c4wp_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'c4wp-admin-captcha' === $_GET['page'] ) {
780
  check_admin_referer( 'c4wp_admin_options-options' );
793
  }
794
  }
795
 
796
+ /**
797
+ * Settings page markup.
798
+ *
799
+ * @return void
800
+ */
801
+ public function admin_settings() {
802
  wp_enqueue_script( 'c4wp-admin' );
803
  wp_localize_script(
804
  'c4wp-admin',
811
 
812
  $current_tab = 'c4wp-admin-captcha';
813
  if ( ! empty( $_GET['page'] ) ) {
814
+ $current_tab = wp_unslash( $_GET['page'] );
815
  }
816
+
817
+ // Determine if a Site/Secret key has been stored.
818
+ $site_key = trim( c4wp_get_option( 'site_key' ) );
819
+ $secret_key = trim( c4wp_get_option( 'secret_key' ) );
820
+ $settings_url = function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
821
+ $settings_wrapper_class = ( empty( $site_key ) || empty( $secret_key ) ) ? 'captcha_keys_required wrap fs-section': 'wrap fs-section';
822
+
823
  ?>
824
+ <div class="<?php echo esc_attr( $settings_wrapper_class ); ?>">
825
+ <div id="captcha_keys_notice" class="notice notice-info" style="display: none">
826
+ <p>
827
+ <?php
828
+ printf(
829
+ 'For the CAPTCHA check to work on the forms you have selected, configure the reCAPTCHA integration in the %1$s section. %2$s %3$s',
830
+ '<strong>' . esc_html__( 'CAPTCHA Configuration', 'advanced-nocaptcha-recaptcha' ) . '</strong>',
831
+ '</br></br><a href="' . esc_url( $settings_url ) . '" class="button button-primary">' . esc_html__( 'Configure it now', 'advanced-nocaptcha-recaptcha' ) . '</a>',
832
+ '<a href="#" class="button button-secondary">' . esc_html__( 'I\'ll configure it later', 'advanced-nocaptcha-recaptcha' ) . '</a>'
833
+ );
834
+ ?>
835
+ </p>
836
+ </div>
837
  <!-- Plugin settings go here -->
838
  <div id="c4wp-help">
839
  <h1>
840
  <?php
841
+ if ( 'c4wp-admin-captcha' === $current_tab ) {
842
+ _e( 'CAPTCHA integration & configuration', 'advanced-nocaptcha-recaptcha' );
843
+ } elseif ( 'c4wp-admin-settings' === $current_tab ) {
844
  _e( 'CAPTCHA Placements', 'advanced-nocaptcha-recaptcha' );
845
  }
846
  ?>
849
  <div id="post-body-content">
850
  <div id="tab_container">
851
  <?php
852
+ if ( 'c4wp-admin-captcha' === $current_tab || 'c4wp-admin-settings' === $current_tab ) {
853
  $this->settings_form();
854
+ } elseif ( 'c4wp-admin-help' === $current_tab ) {
855
  $this->display_help_page();
856
+ } elseif ( 'c4wp-admin-upgrade' === $current_tab ) {
857
  $this->display_upgrade_page();
858
  }
859
  ?>
875
  <?php
876
  }
877
 
878
+ /**
879
+ * Setting form wrapper.
880
+ *
881
+ * @return void
882
+ */
883
+ public function settings_form() {
884
 
885
  ?>
886
  <?php $this->c4wp_settings_notice(); ?>
899
  /**
900
  * Creates and displays notices upon successful saving of settings or errors if needed.
901
  */
902
+ public function c4wp_settings_notice() {
903
  $errors = get_transient( 'c4wp_admin_options_errors' );
904
  $notice = '';
905
  if ( empty( $errors ) ) {
907
  }
908
 
909
  foreach ( $errors as $error ) {
910
+ if ( 'empty_site_key' === $error ) {
911
  $notice .= '<div class="notice notice-error"><p>' . esc_html__( 'The site key that you have entered is invalid. Please try again.', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
912
  }
913
+ if ( 'empty_secret_key' === $error ) {
914
  $notice .= '<div class="notice notice-error"><p>' . esc_html__( 'The secret key that you have entered is invalid. Please try again.', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
915
  }
916
+ if ( 'success' === $error ) {
917
  $context = esc_html__( 'Captcha settings', 'advanced-nocaptcha-recaptcha' );
918
+ if ( isset( $_REQUEST['page'] ) && 'c4wp-admin-captcha' === $_REQUEST['page'] ) {
919
  $context = esc_html__( 'Captcha configuration', 'advanced-nocaptcha-recaptcha' );
920
  }
921
  $notice .= '<div class="notice notice-success"><p>' . $context . esc_html__( ' updated', 'advanced-nocaptcha-recaptcha' ) . '</p></div>';
927
  echo $notice;
928
  }
929
 
930
+ /**
931
+ * Create admin sidebar.
932
+ *
933
+ * @return string $return - HTNML markup.
934
+ */
935
+ public function c4wp_admin_sidebar() {
936
  $return = '';
937
  if ( ! c4wp_is_premium_version() ) :
938
  $icon_url = C4WP_PLUGIN_URL . 'assets/img/c4wp-logo-full.png';
973
  * Validate targetted options and remove from the array which is about to be saved if invalid.
974
  * Also handles error/success notices based on result.
975
  *
976
+ * @param array $value - Value to validate.
977
+ * @return array - Validated value.
978
  *
979
  * @since 7.0.0
980
  */
981
+ public function validate_and_set_notices( $value ) {
982
  $errors = array();
983
 
984
  if ( isset( $value['site_key'] ) && isset( $value['secret_key'] ) ) {
1006
  return $value;
1007
  }
1008
 
1009
+ /**
1010
+ * Add link to settings to dashboard menu.
1011
+ *
1012
+ * @param array $links - Default links.
1013
+ * @return array $links - Updated links.
1014
+ */
1015
+ public function add_settings_link( $links ) {
1016
+ // add settings link in plugins page.
1017
  $settings_link = '<a href="' . c4wp_settings_page_url() . '">' . esc_html__( 'Settings', 'advanced-nocaptcha-recaptcha' ) . '</a>';
1018
  array_unshift( $links, $settings_link );
1019
  return $links;
1020
  }
1021
 
1022
+ /**
1023
+ * Includs help page content.
1024
+ *
1025
+ * @return void
1026
+ */
1027
+ public function display_help_page() {
1028
  require_once 'templates/help/index.php';
1029
  }
1030
 
1031
+ /**
1032
+ * Includs upgrade page content.
1033
+ *
1034
+ * @return void
1035
+ */
1036
+ public function display_upgrade_page() {
1037
  require_once 'templates/upgrade/index.php';
1038
  }
1039
 
1040
+ /**
1041
+ * Help function to push an item to an associate array.
1042
+ *
1043
+ * @param array $array - Original array.
1044
+ * @param string $key - new item key.
1045
+ * @param string $new - New item svalue.
1046
+ * @return array $array - Updated array.
1047
+ */
1048
+ public static function push_at_to_associative_array( $array, $key, $new ) {
1049
  $keys = array_keys( $array );
1050
  $index = array_search( $key, $keys, true );
1051
  $pos = false === $index ? count( $array ) : $index + 1;
admin/templates/help/help.php CHANGED
@@ -1,8 +1,18 @@
1
  <?php
2
- // Plugin adverts sidebar
3
- require_once 'sidebar.php';
4
- $admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
5
- $settings_admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-settings' ) : admin_url( 'admin.php?page=c4wp-admin-settings' );
 
 
 
 
 
 
 
 
 
 
6
  ?>
7
  <div class="c4wp-help-main">
8
  <!-- getting started -->
@@ -58,4 +68,4 @@
58
  #postbox-container-1 {
59
  display: none;
60
  }
61
- </style>
1
  <?php
2
+ /**
3
+ * Help page content.
4
+ *
5
+ * @package C4WP
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ require_once 'sidebar.php';
13
+ $admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
14
+ $settings_admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-settings' ) : admin_url( 'admin.php?page=c4wp-admin-settings' );
15
+
16
  ?>
17
  <div class="c4wp-help-main">
18
  <!-- getting started -->
68
  #postbox-container-1 {
69
  display: none;
70
  }
71
+ </style>
admin/templates/help/index.php CHANGED
@@ -1,16 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div class="wrap help-wrap">
2
  <div class="nav-tab-wrapper">
3
  <?php
4
- // Get current tab
5
- $current_tab = isset( $_GET['tab'] ) ? $_GET['tab'] : 'help';
6
  ?>
7
  <a href="<?php echo esc_url( remove_query_arg( 'tab' ) ); ?>" class="nav-tab<?php echo 'help' === $current_tab ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'Help', 'advanced-nocaptcha-recaptcha' ); ?></a>
8
  <a href="<?php echo esc_url( add_query_arg( 'tab', 'system-info' ) ); ?>" class="nav-tab<?php echo 'system-info' === $current_tab ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'System Info', 'advanced-nocaptcha-recaptcha' ); ?></a>
9
  </div>
10
  <div class="c4wp-help-section nav-tabs">
11
  <?php
12
- // Require page content. Default help.php
13
- require_once $current_tab . '.php';
 
 
14
  ?>
15
  </div>
16
  </div>
1
+ <?php
2
+ /**
3
+ * Help tabs.
4
+ *
5
+ * @package C4WP
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+ ?>
12
+
13
  <div class="wrap help-wrap">
14
  <div class="nav-tab-wrapper">
15
  <?php
16
+ // Get current tab, it can only be help or system info, ignore anything else.
17
+ $current_tab = ( isset( $_GET['tab'] ) && 'system-info' === $_GET['tab'] ) ? esc_html( wp_unslash( $_GET['tab'] ) ) : 'help';
18
  ?>
19
  <a href="<?php echo esc_url( remove_query_arg( 'tab' ) ); ?>" class="nav-tab<?php echo 'help' === $current_tab ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'Help', 'advanced-nocaptcha-recaptcha' ); ?></a>
20
  <a href="<?php echo esc_url( add_query_arg( 'tab', 'system-info' ) ); ?>" class="nav-tab<?php echo 'system-info' === $current_tab ? ' nav-tab-active' : ''; ?>"><?php esc_html_e( 'System Info', 'advanced-nocaptcha-recaptcha' ); ?></a>
21
  </div>
22
  <div class="c4wp-help-section nav-tabs">
23
  <?php
24
+ // Require page content. Default help.php. Only allow one or the other, nothing else.
25
+ if ( 'system-info' === $current_tab || 'help' === $current_tab ) {
26
+ require_once trailingslashit( dirname( __FILE__ ) ) . $current_tab . '.php';
27
+ }
28
  ?>
29
  </div>
30
  </div>
admin/templates/help/sidebar.php CHANGED
@@ -1,15 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div class="our-wordpress-plugins side-bar">
2
  <h3><?php esc_html_e( 'Other plugins developed by us:', 'advanced-nocaptcha-recaptcha' ); ?></h3>
3
  <ul>
4
  <li>
5
  <div class="plugin-box">
6
  <div class="plugin-img">
7
- <img src="<?php echo C4WP_PLUGIN_URL; ?>assets/img/wp-security-audit-log-img.jpg" alt="">
8
  </div>
9
  <div class="plugin-desc">
10
  <p><?php esc_html_e( 'Keep a log of users and under the hood site activity.', 'advanced-nocaptcha-recaptcha' ); ?></p>
11
  <div class="cta-btn">
12
- <a href="<?php echo esc_url(
 
 
13
  add_query_arg(
14
  array(
15
  'utm_source' => 'plugin',
@@ -19,7 +33,9 @@
19
  ),
20
  'https://wpactivitylog.com'
21
  )
22
- ); ?>" target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
 
 
23
  </div>
24
  </div>
25
  </div>
@@ -27,12 +43,14 @@
27
  <li>
28
  <div class="plugin-box">
29
  <div class="plugin-img">
30
- <img src="<?php echo C4WP_PLUGIN_URL; ?>assets/img/wp-2fa.jpg" alt="">
31
  </div>
32
  <div class="plugin-desc">
33
  <p><?php esc_html_e( 'Add an extra layer of security to your login pages with 2FA & require your users to use it.', 'advanced-nocaptcha-recaptcha' ); ?></p>
34
  <div class="cta-btn">
35
- <a href="<?php echo esc_url(
 
 
36
  add_query_arg(
37
  array(
38
  'utm_source' => 'plugin',
@@ -42,7 +60,9 @@
42
  ),
43
  'https://www.wpwhitesecurity.com/wordpress-plugins/wp-2fa/'
44
  )
45
- ); ?>" target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
 
 
46
  </div>
47
  </div>
48
  </div>
@@ -50,12 +70,14 @@
50
  <li>
51
  <div class="plugin-box">
52
  <div class="plugin-img">
53
- <img src="<?php echo C4WP_PLUGIN_URL; ?>assets/img/website-file-changes-monitor.jpg" alt="">
54
  </div>
55
  <div class="plugin-desc">
56
  <p><?php esc_html_e( 'Automatically identify unauthorized file changes on your WordPress site.', 'advanced-nocaptcha-recaptcha' ); ?></p>
57
  <div class="cta-btn">
58
- <a href="<?php echo esc_url(
 
 
59
  add_query_arg(
60
  array(
61
  'utm_source' => 'plugin',
@@ -65,7 +87,9 @@
65
  ),
66
  'https://www.wpwhitesecurity.com/wordpress-plugins/website-file-changes-monitor/'
67
  )
68
- ); ?>" target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
 
 
69
  </div>
70
  </div>
71
  </div>
1
+ <?php
2
+ /**
3
+ * Help tabs.
4
+ *
5
+ * @package C4WP
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+ ?>
12
+
13
  <div class="our-wordpress-plugins side-bar">
14
  <h3><?php esc_html_e( 'Other plugins developed by us:', 'advanced-nocaptcha-recaptcha' ); ?></h3>
15
  <ul>
16
  <li>
17
  <div class="plugin-box">
18
  <div class="plugin-img">
19
+ <img src="<?php echo esc_url( C4WP_PLUGIN_URL . 'assets/img/wp-security-audit-log-img.jpg' ); ?>" alt="">
20
  </div>
21
  <div class="plugin-desc">
22
  <p><?php esc_html_e( 'Keep a log of users and under the hood site activity.', 'advanced-nocaptcha-recaptcha' ); ?></p>
23
  <div class="cta-btn">
24
+ <a href="
25
+ <?php
26
+ echo esc_url(
27
  add_query_arg(
28
  array(
29
  'utm_source' => 'plugin',
33
  ),
34
  'https://wpactivitylog.com'
35
  )
36
+ );
37
+ ?>
38
+ " target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
39
  </div>
40
  </div>
41
  </div>
43
  <li>
44
  <div class="plugin-box">
45
  <div class="plugin-img">
46
+ <img src="<?php echo esc_url( C4WP_PLUGIN_URL . 'assets/img/wp-2fa.jpg' ); ?>" alt="">
47
  </div>
48
  <div class="plugin-desc">
49
  <p><?php esc_html_e( 'Add an extra layer of security to your login pages with 2FA & require your users to use it.', 'advanced-nocaptcha-recaptcha' ); ?></p>
50
  <div class="cta-btn">
51
+ <a href="
52
+ <?php
53
+ echo esc_url(
54
  add_query_arg(
55
  array(
56
  'utm_source' => 'plugin',
60
  ),
61
  'https://www.wpwhitesecurity.com/wordpress-plugins/wp-2fa/'
62
  )
63
+ );
64
+ ?>
65
+ " target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
66
  </div>
67
  </div>
68
  </div>
70
  <li>
71
  <div class="plugin-box">
72
  <div class="plugin-img">
73
+ <img src="<?php echo esc_url( C4WP_PLUGIN_URL . 'assets/img/website-file-changes-monitor.jpg' ); ?>" alt="">
74
  </div>
75
  <div class="plugin-desc">
76
  <p><?php esc_html_e( 'Automatically identify unauthorized file changes on your WordPress site.', 'advanced-nocaptcha-recaptcha' ); ?></p>
77
  <div class="cta-btn">
78
+ <a href="
79
+ <?php
80
+ echo esc_url(
81
  add_query_arg(
82
  array(
83
  'utm_source' => 'plugin',
87
  ),
88
  'https://www.wpwhitesecurity.com/wordpress-plugins/website-file-changes-monitor/'
89
  )
90
+ );
91
+ ?>
92
+ " target="_blank"><?php esc_html_e( 'LEARN MORE', 'advanced-nocaptcha-recaptcha' ); ?></a>
93
  </div>
94
  </div>
95
  </div>
admin/templates/help/system-info.php CHANGED
@@ -1,6 +1,17 @@
1
  <?php
2
- // Plugin adverts sidebar
3
- require_once 'sidebar.php';
 
 
 
 
 
 
 
 
 
 
 
4
  ?>
5
  <div class="c4wp-help-main">
6
  <!-- getting started -->
1
  <?php
2
+ /**
3
+ * System info area markup.
4
+ *
5
+ * @package C4WP
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+
12
+ // Plugin adverts sidebar.
13
+ require_once 'sidebar.php';
14
+
15
  ?>
16
  <div class="c4wp-help-main">
17
  <!-- getting started -->
admin/templates/upgrade/index.php CHANGED
@@ -1,9 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div class="wrap features-wrap">
2
  <div class="c4wp-upgrade-section">
3
 
4
  <div class="content-block">
5
  <div class="logo-wrap">
6
- <img src="<?php echo C4WP_PLUGIN_URL; ?>assets/img/c4wp-logo-full.png" alt="">
7
  </div>
8
  <p><?php esc_html_e( 'Add spam protection to block spam bots and allow real humans to easily interact with your WordPress website by adding CAPTCHA to any form on your website, including comments forms, login forms, and checkout pages.', 'c4wp-wpp' ); ?></p>
9
  <p><?php esc_html_e( 'Get started within just minutes with CAPTCHA 4WP, an easy to use WordPress plugin that helps you protect your website from any type of spam and automated bot attacks.', 'c4wp-wpp' ); ?></p>
@@ -369,7 +381,7 @@
369
  }
370
 
371
  .logo-wrap img {
372
- max-width: 230px;
373
  margin-top: 20px;
374
  }
375
 
@@ -378,4 +390,4 @@
378
  margin-right: 30px;
379
  }
380
 
381
- </style>
1
+ <?php
2
+ /**
3
+ * Upfate page content.
4
+ *
5
+ * @package C4WP
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit; // Exit if accessed directly.
10
+ }
11
+ ?>
12
+
13
  <div class="wrap features-wrap">
14
  <div class="c4wp-upgrade-section">
15
 
16
  <div class="content-block">
17
  <div class="logo-wrap">
18
+ <img src="<?php echo esc_url( C4WP_PLUGIN_URL . 'assets/img/c4wp-logo-full.png' ); ?>" alt="">
19
  </div>
20
  <p><?php esc_html_e( 'Add spam protection to block spam bots and allow real humans to easily interact with your WordPress website by adding CAPTCHA to any form on your website, including comments forms, login forms, and checkout pages.', 'c4wp-wpp' ); ?></p>
21
  <p><?php esc_html_e( 'Get started within just minutes with CAPTCHA 4WP, an easy to use WordPress plugin that helps you protect your website from any type of spam and automated bot attacks.', 'c4wp-wpp' ); ?></p>
381
  }
382
 
383
  .logo-wrap img {
384
+ max-width: 230px;
385
  margin-top: 20px;
386
  }
387
 
390
  margin-right: 30px;
391
  }
392
 
393
+ </style>
advanced-nocaptcha-recaptcha.php CHANGED
@@ -1,14 +1,14 @@
1
- <?php
2
 
3
  /**
4
- * CAPTCHA 4WP (Premium)
5
  *
6
  * @copyright Copyright (C) 2013-2022, WP White Security - support@wpwhitesecurity.com
7
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
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
@@ -36,65 +36,94 @@
36
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
37
  */
38
 
39
- if ( !defined( 'ABSPATH' ) ) {
40
- exit;
41
- // Exit if accessed directly.
42
  }
43
 
44
  require_once ABSPATH . '/wp-admin/includes/plugin.php';
45
- class C4WP
46
- {
47
- private static $instance;
48
- private function __construct()
49
- {
50
-
51
-
52
- if ( is_plugin_active( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' ) ) {
53
- deactivate_plugins( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' );
54
- return;
55
- }
56
-
57
- $this->constants();
58
- $this->includes();
59
- $this->actions();
60
- }
61
-
62
- public static function init()
63
- {
64
- if ( !self::$instance instanceof self ) {
65
- self::$instance = new self();
66
- }
67
- return self::$instance;
68
- }
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__ );
76
- define( 'C4WP_TABLE_PREFIX', 'c4wp_' );
77
- }
78
-
79
- private function includes()
80
- {
81
- require_once C4WP_PLUGIN_DIR . 'functions.php';
82
- }
83
-
84
- private function actions()
85
- {
86
- add_action( 'after_setup_theme', 'c4wp_include_require_files' );
87
- add_action( 'init', 'c4wp_translation' );
88
- add_action( 'login_enqueue_scripts', 'c4wp_login_enqueue_scripts' );
89
- }
90
-
91
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
 
93
  }
94
- //END Class
95
-
96
- // ... Your plugin's main file logic ...
97
- add_action( 'plugins_loaded', array( 'C4WP', 'init' ) );
98
 
99
  register_activation_hook( __FILE__, 'c4wp_redirect_after_activation' );
100
 
@@ -104,7 +133,7 @@ register_activation_hook( __FILE__, 'c4wp_redirect_after_activation' );
104
  * @return void
105
  */
106
  function c4wp_redirect_after_activation() {
107
- add_option( 'c4wp_redirect_after_activation', true );
108
  }
109
 
110
  add_action( 'admin_init', 'c4wp_activation_redirect' );
@@ -115,9 +144,9 @@ add_action( 'admin_init', 'c4wp_activation_redirect' );
115
  * @return void
116
  */
117
  function c4wp_activation_redirect() {
118
- if ( is_admin() && get_option( 'c4wp_redirect_after_activation', false ) ) {
119
- delete_option( 'c4wp_redirect_after_activation' );
120
- $admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
121
- exit( wp_redirect( $admin_url ) );
122
- }
123
  }
1
+ <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName
2
 
3
  /**
4
+ * CAPTCHA 4WP
5
  *
6
  * @copyright Copyright (C) 2013-2022, WP White Security - support@wpwhitesecurity.com
7
  * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher
8
  *
9
  * @wordpress-plugin
10
  * Plugin Name: CAPTCHA 4WP
11
+ * Version: 7.1.0
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
36
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
37
  */
38
 
39
+ if ( ! defined( 'ABSPATH' ) ) {
40
+ exit;
41
+ // Exit if accessed directly.
42
  }
43
 
44
  require_once ABSPATH . '/wp-admin/includes/plugin.php';
45
+
46
+ /**
47
+ * Main C4WP Class.
48
+ */
49
+ class C4WP {
50
+
51
+ /**
52
+ * Class instance.
53
+ *
54
+ * @var C4WP instance.
55
+ */
56
+ private static $instance;
57
+
58
+ /**
59
+ * Class constructor.
60
+ */
61
+ private function __construct() {
62
+
63
+
64
+ if ( is_plugin_active( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' ) ) {
65
+ deactivate_plugins( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' );
66
+ return;
67
+ }
68
+
69
+ $this->constants();
70
+ $this->includes();
71
+ $this->actions();
72
+ }
73
+
74
+ /**
75
+ * Class initiator.
76
+ *
77
+ * @return $instance - C4WP instance.
78
+ */
79
+ public static function init() {
80
+ if ( ! self::$instance instanceof self ) {
81
+ self::$instance = new self();
82
+ }
83
+ return self::$instance;
84
+ }
85
+
86
+ /**
87
+ * Setup plugin constants.
88
+ *
89
+ * @return void
90
+ */
91
+ private function constants() {
92
+ define( 'C4WP_PLUGIN_VERSION', '7.1.0' );
93
+ define( 'C4WP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
94
+ define( 'C4WP_PLUGIN_URL', plugins_url( '/', __FILE__ ) );
95
+ define( 'C4WP_PLUGIN_FILE', __FILE__ );
96
+ define( 'C4WP_TABLE_PREFIX', 'c4wp_' );
97
+ }
98
+
99
+ /**
100
+ * Include functions and pro extensions.
101
+ *
102
+ * @return void
103
+ */
104
+ private function includes() {
105
+ require_once C4WP_PLUGIN_DIR . 'functions.php';
106
+ }
107
+
108
+ /**
109
+ * Add plugin actions.
110
+ *
111
+ * @return void
112
+ */
113
+ private function actions() {
114
+ add_action( 'after_setup_theme', 'c4wp_include_require_files' );
115
+ add_action( 'init', 'c4wp_translation' );
116
+ add_action( 'login_enqueue_scripts', 'c4wp_login_enqueue_scripts' );
117
+
118
+ }
119
+
120
+
121
 
122
  }
123
+ // END Class.
124
+
125
+ // ... Your plugin's main file logic ...
126
+ add_action( 'plugins_loaded', array( 'C4WP', 'init' ) );
127
 
128
  register_activation_hook( __FILE__, 'c4wp_redirect_after_activation' );
129
 
133
  * @return void
134
  */
135
  function c4wp_redirect_after_activation() {
136
+ add_option( 'c4wp_redirect_after_activation', true );
137
  }
138
 
139
  add_action( 'admin_init', 'c4wp_activation_redirect' );
144
  * @return void
145
  */
146
  function c4wp_activation_redirect() {
147
+ if ( is_admin() && get_option( 'c4wp_redirect_after_activation', false ) ) {
148
+ delete_option( 'c4wp_redirect_after_activation' );
149
+ $admin_url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
150
+ exit( wp_safe_redirect( esc_url( $admin_url ) ) ); // phpcs:ignore
151
+ }
152
  }
anr-captcha-class.php CHANGED
@@ -1,12 +1,31 @@
1
- <?php
2
 
3
- if ( ! class_exists( 'c4wp_captcha_class' ) ) {
4
- class c4wp_captcha_class {
5
 
 
 
 
 
 
 
 
 
 
 
6
  private static $instance;
7
 
 
 
 
 
 
8
  private static $captcha_count = 0;
9
 
 
 
 
 
 
10
  public static function init() {
11
  if ( ! self::$instance instanceof self ) {
12
  self::$instance = new self();
@@ -14,7 +33,12 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
14
  return self::$instance;
15
  }
16
 
17
- function actions_filters() {
 
 
 
 
 
18
  if ( c4wp_is_form_enabled( 'login' ) && ! defined( 'XMLRPC_REQUEST' ) ) {
19
  add_action( 'login_form', array( $this, 'login_form_field' ), 99 );
20
  add_filter( 'login_form_middle', array( $this, 'login_form_return' ), 99 );
@@ -58,7 +82,13 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
58
  }
59
  }
60
 
61
- function add_error_to_mgs( $mgs = false ) {
 
 
 
 
 
 
62
  if ( false === $mgs ) {
63
  $mgs = c4wp_get_option( 'error_message', '' );
64
  }
@@ -69,15 +99,25 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
69
  return apply_filters( 'c4wp_error_message', $message, $mgs );
70
  }
71
 
72
- function total_captcha() {
 
 
 
 
 
73
  return self::$captcha_count;
74
  }
75
 
76
- function captcha_form_field() {
 
 
 
 
 
77
  self::$captcha_count++;
78
  $site_key = trim( c4wp_get_option( 'site_key' ) );
79
  $number = $this->total_captcha();
80
- $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' );
81
 
82
  $field = '<div class="c4wp_captcha_field" style="margin-bottom: 10px;"><div id="c4wp_captcha_field_' . $number . '" class="c4wp_captcha_field_div">';
83
  if ( 'v3' === $version ) {
@@ -87,12 +127,17 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
87
  return $field;
88
  }
89
 
90
- function footer_script() {
 
 
 
 
 
91
  static $included = false;
92
 
93
- $number = $this->total_captcha();
94
  $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' );
95
-
96
  if ( ! $number && ( 'v3' !== $version || 'all_pages' !== c4wp_get_option( 'v3_script_load', 'all_pages' ) ) ) {
97
  return;
98
  }
@@ -117,15 +162,20 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
117
  }
118
  }
119
 
120
- function v2_checkbox_script() {
 
 
 
 
 
121
  ?>
122
  <script type="text/javascript">
123
  var c4wp_onloadCallback = function() {
124
  for ( var i = 0; i < document.forms.length; i++ ) {
125
  var form = document.forms[i];
126
- var captcha_div = form.querySelector( '.c4wp_captcha_field_div' );
127
  if ( null === captcha_div )
128
- continue;
129
  captcha_div.innerHTML = '';
130
  ( function( form ) {
131
  var c4wp_captcha = grecaptcha.render( captcha_div,{
@@ -133,6 +183,7 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
133
  'size' : '<?php echo esc_js( c4wp_get_option( 'size', 'normal' ) ); ?>',
134
  'theme' : '<?php echo esc_js( c4wp_get_option( 'theme', 'light' ) ); ?>'
135
  });
 
136
  <?php
137
  $additonal_js = apply_filters( 'c4wp_captcha_callback_additonal_js', false );
138
  echo $additonal_js;
@@ -143,7 +194,7 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
143
 
144
  </script>
145
  <?php
146
- $lang = $this->determine_captcha_language();
147
  $google_url = apply_filters( 'c4wp_v2_checkbox_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?onload=c4wp_onloadCallback&render=explicit' . $lang, c4wp_recaptcha_domain() ), $lang );
148
  ?>
149
  <script src="<?php echo esc_url( $google_url ); ?>"
@@ -152,7 +203,12 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
152
  <?php
153
  }
154
 
155
- function v2_invisible_script() {
 
 
 
 
 
156
  ?>
157
  <script type="text/javascript">
158
  var c4wp_onloadCallback = function() {
@@ -225,8 +281,8 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
225
  }
226
  };
227
  </script>
228
- <?php
229
- $lang = $this->determine_captcha_language();
230
  $google_url = apply_filters( 'c4wp_v2_invisible_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?onload=c4wp_onloadCallback&render=explicit' . $lang, c4wp_recaptcha_domain() ), $lang );
231
  ?>
232
  <script src="<?php echo esc_url( $google_url ); ?>"
@@ -235,10 +291,16 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
235
  <?php
236
  }
237
 
238
- function v3_script() {
239
-
 
 
 
 
 
240
  $site_key = trim( c4wp_get_option( 'site_key' ) );
241
- $lang = $this->determine_captcha_language();
 
242
 
243
  $google_url = apply_filters( 'c4wp_v3_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?render=' . $site_key . $lang, c4wp_recaptcha_domain() ), $site_key, $lang );
244
  ?>
@@ -277,91 +339,147 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
277
  } )( grecaptcha );
278
  </script>
279
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
280
  }
281
 
282
-
283
- function form_field() {
 
 
 
 
284
  echo $this->form_field_return();
285
  }
286
 
287
- function form_field_return( $return = '' ) {
 
 
 
 
 
 
288
  return $return . $this->captcha_form_field();
289
  }
290
-
291
- function login_form_field() {
 
 
 
 
 
292
  if ( $this->show_login_captcha() ) {
293
  $this->form_field();
294
  }
295
  }
296
-
297
- function login_form_return( $field = '' ) {
 
 
 
 
 
 
298
  if ( $this->show_login_captcha() ) {
299
  $field = $this->form_field_return( $field );
300
  }
301
  return $field;
302
  }
303
-
304
- function show_login_captcha() {
 
 
 
 
 
305
  $show_captcha = true;
306
- $ip = $_SERVER['REMOTE_ADDR'];
307
 
308
  $show_captcha = apply_filters( 'c4wp_login_captcha_filter', $show_captcha, $ip );
309
 
310
  return $show_captcha;
311
  }
312
 
313
- function ms_form_field( $errors ) {
314
- if ( $errmsg = $errors->get_error_message( 'c4wp_error' ) ) {
315
- echo '<p class="error">' . $errmsg . '</p>';
 
 
 
 
 
 
 
316
  }
317
  $this->form_field();
318
  }
319
 
320
- function verify( $response = false ) {
 
 
 
 
 
 
321
  static $last_verify = null;
322
- static $last_response = null;
323
- static $duplicate_response = false;
324
-
325
- $remoteip = $_SERVER['REMOTE_ADDR'];
 
 
 
 
326
 
327
-
328
- $secret_key = trim( c4wp_get_option( 'secret_key' ) );
329
- $verify = false;
330
-
331
 
332
  if ( false === $response ) {
333
- $response = isset( $_POST['g-recaptcha-response'] ) ? $_POST['g-recaptcha-response'] : '';
334
  }
335
-
336
  // Store what we send to google in case we need to verify if its a duplicated request.
337
- $last_response = $response;
338
- if ( $response == $last_response ) {
339
- $duplicate_response = true;
340
- }
341
-
342
  $pre_check = apply_filters( 'c4wp_verify_captcha_pre', null, $response );
343
-
344
  if ( null !== $pre_check ) {
345
  return $pre_check;
346
  }
347
 
348
- if ( ! $secret_key ) { // if $secre_key is not set
 
349
  return true;
350
  }
351
 
352
  if ( ! $response || ! $remoteip ) {
353
  return $verify;
354
  }
355
-
356
  if ( null !== $last_verify ) {
357
  return $last_verify;
358
  }
359
 
360
  $url = apply_filters( 'c4wp_google_verify_url', sprintf( 'https://www.%s/recaptcha/api/siteverify', c4wp_recaptcha_domain() ) );
361
 
362
- // make a POST request to the Google reCAPTCHA Server
363
  $request = wp_remote_post(
364
- $url, array(
 
365
  'timeout' => 10,
366
  'body' => array(
367
  'secret' => $secret_key,
@@ -371,36 +489,44 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
371
  )
372
  );
373
 
374
- // get the request response body
375
  $request_body = wp_remote_retrieve_body( $request );
376
  if ( ! $request_body ) {
377
  return $verify;
378
  }
379
 
380
  $result = json_decode( $request_body, true );
381
-
382
- if ( isset( $result['success'] ) && true == $result['success'] ) {
383
  if ( 'v3' === c4wp_get_option( 'captcha_version' ) ) {
384
- $score = isset( $result['score'] ) ? $result['score'] : 0;
385
  $action = isset( $result['action'] ) ? $result['action'] : '';
386
- $verify = c4wp_get_option( 'score', '0.5' ) <= $score && 'advanced_nocaptcha_recaptcha' == $action;
387
  } else {
388
  $verify = true;
389
  }
390
  }
391
-
392
- $verify = apply_filters( 'c4wp_verify_captcha', $verify, $result, $response );
393
- $last_verify = $verify;
394
-
395
  // If we know this is a duplicated request, pass verification.
396
- if ( isset( $result['error-codes'] ) && 'timeout-or-duplicate' == $result['error-codes'][0] && $duplicate_response ) {
397
- $verify = true;
398
- }
399
 
400
  return $verify;
401
  }
402
 
403
- function login_verify( $user, $username = '', $password = '' ) {
 
 
 
 
 
 
 
 
404
  global $wpdb;
405
  if ( ! $username ) {
406
  return $user;
@@ -427,35 +553,52 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
427
 
428
  /**
429
  * Checks if the current authentication request is RESTy or a custom URL where it should not load.
 
 
430
  */
431
- function is_rest_request() {
432
- if ( defined( 'REST_REQUEST' ) && REST_REQUEST || isset( $_GET[ 'rest_route' ] ) && strpos( $_GET[ 'rest_route' ], '/', 0 ) === 0 ) {
433
  return true;
434
  }
435
-
436
  global $wp_rewrite;
437
- if ( $wp_rewrite === null ) $wp_rewrite = new WP_Rewrite();
438
-
 
 
439
  $rest_url = wp_parse_url( trailingslashit( rest_url() ) );
440
- $current_url = wp_parse_url( add_query_arg( [] ) );
441
- $is_rest = strpos( $current_url[ 'path' ], $rest_url[ 'path' ], 0 ) === 0;
442
 
443
  return $is_rest;
444
  }
445
-
446
- function registration_verify( $errors, $sanitized_user_login, $user_email ) {
 
 
 
 
 
 
 
 
447
  if ( ! $this->verify() ) {
 
 
 
 
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
-
458
- function ms_form_field_verify( $result ) {
 
 
 
 
 
 
459
  if ( isset( $_POST['stage'] ) && 'validate-user-signup' === $_POST['stage'] && ! $this->verify() ) {
460
  $result['errors']->add( 'c4wp_error', c4wp_get_option( 'error_message' ) );
461
  }
@@ -463,7 +606,13 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
463
  return $result;
464
  }
465
 
466
- function ms_blog_verify( $result ) {
 
 
 
 
 
 
467
  if ( ! $this->verify() ) {
468
  $result['errors']->add( 'c4wp_error', c4wp_get_option( 'error_message' ) );
469
  }
@@ -471,30 +620,44 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
471
  return $result;
472
  }
473
 
474
- function lostpassword_verify( $result, $user_id ) {
 
 
 
 
 
 
 
475
 
476
  // Allow admins to send reset links.
477
- if ( current_user_can( 'manage_options' ) && isset( $_REQUEST['action'] ) && in_array( wp_unslash( $_REQUEST['action'] ), array('resetpassword', 'send-password-reset') ) ) {
478
  return $result;
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
 
489
  return $result;
490
  }
491
 
492
- function reset_password_verify( $errors, $user ) {
 
 
 
 
 
 
 
493
  // Allow admins to send reset links.
494
- if ( current_user_can( 'manage_options' ) && isset( $_REQUEST['action'] ) && in_array( wp_unslash( $_REQUEST['action'] ), array('resetpassword', 'send-password-reset') ) ) {
495
  return $errors;
496
  }
497
-
498
  if ( ! $this->verify() ) {
499
  // Bail if we have nothign to work with.
500
  if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
@@ -502,12 +665,22 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
502
  }
503
  $errors->add( 'c4wp_error', $this->add_error_to_mgs() );
504
  }
 
 
505
  }
506
 
507
- function comment_verify( $commentdata ) {
 
 
 
 
 
 
508
  if ( ! $this->verify() ) {
509
  wp_die(
510
- '<p>' . $this->add_error_to_mgs() . '</p>', __( 'Comment Submission Failure' ), array(
 
 
511
  'response' => 403,
512
  'back_link' => true,
513
  )
@@ -517,38 +690,55 @@ if ( ! class_exists( 'c4wp_captcha_class' ) ) {
517
  return $commentdata;
518
  }
519
 
520
- function comment_verify_490( $approved ) {
 
 
 
 
 
 
521
  if ( ! $this->verify() ) {
522
  return new WP_Error( 'c4wp_error', $this->add_error_to_mgs(), 403 );
523
  }
524
  return $approved;
525
  }
526
-
527
  /**
528
  * Checks if the current page load is actually an iframe found in the new customizer/widgets areas within WP 5.8+.
529
  *
530
  * @return bool
531
  */
532
- function check_should_js_embed() {
533
  // Ensure we dont load inside an iframe/preview.
534
  if ( isset( $_GET['legacy-widget-preview'] ) || isset( $_GET['customize_messenger_channel'] ) ) {
535
  return false;
536
- }
537
  return true;
538
  }
539
-
540
  /**
541
  * Auto detects language if applicable, otherwise returns the users desired language from the settings.
542
- *
543
  * @return string
544
  */
545
- function determine_captcha_language() {
546
- $language = trim( c4wp_get_option( 'language' ) );
 
 
 
 
 
 
 
 
 
 
 
547
  $lang = '&hl=' . $language;
548
  return $lang;
549
  }
550
  } //END CLASS
551
  } //ENDIF
552
 
553
- add_action( 'init', array( c4wp_captcha_class::init(), 'actions_filters' ), -9 );
554
 
1
+ <?php // phpcs:disable WordPress.Files.FileName.InvalidClassFileName, WordPress.WP.EnqueuedResources.NonEnqueuedScript, WordPress.Security.NonceVerification.Missing, WordPress.WP.GlobalVariablesOverride.Prohibited, WordPress.Security.NonceVerification.Recommended, WordPress.Security.EscapeOutput.OutputNotEscaped
2
 
3
+ if ( ! class_exists( 'C4wp_Captcha_Class' ) ) {
 
4
 
5
+ /**
6
+ * Main class.
7
+ */
8
+ class C4wp_Captcha_Class {
9
+
10
+ /**
11
+ * Class instance.
12
+ *
13
+ * @var C4wp_Captcha_Class
14
+ */
15
  private static $instance;
16
 
17
+ /**
18
+ * Counter for number of captchas found within an page.
19
+ *
20
+ * @var integer
21
+ */
22
  private static $captcha_count = 0;
23
 
24
+ /**
25
+ * Class initiator.
26
+ *
27
+ * @return $instance - C4WP_Pro instance.
28
+ */
29
  public static function init() {
30
  if ( ! self::$instance instanceof self ) {
31
  self::$instance = new self();
33
  return self::$instance;
34
  }
35
 
36
+ /**
37
+ * Setup actions and filters used in our plugin.
38
+ *
39
+ * @return void
40
+ */
41
+ public function actions_filters() {
42
  if ( c4wp_is_form_enabled( 'login' ) && ! defined( 'XMLRPC_REQUEST' ) ) {
43
  add_action( 'login_form', array( $this, 'login_form_field' ), 99 );
44
  add_filter( 'login_form_middle', array( $this, 'login_form_return' ), 99 );
82
  }
83
  }
84
 
85
+ /**
86
+ * Return our error message, for use with WP_Error etc.
87
+ *
88
+ * @param boolean $mgs - Current message.
89
+ * @return string $message - Our message.
90
+ */
91
+ public function add_error_to_mgs( $mgs = false ) {
92
  if ( false === $mgs ) {
93
  $mgs = c4wp_get_option( 'error_message', '' );
94
  }
99
  return apply_filters( 'c4wp_error_message', $message, $mgs );
100
  }
101
 
102
+ /**
103
+ * Return number of captchas found in a page.
104
+ *
105
+ * @return int $captcha_count - Captcha count.
106
+ */
107
+ public function total_captcha() {
108
  return self::$captcha_count;
109
  }
110
 
111
+ /**
112
+ * Create and return captcha field markup.
113
+ *
114
+ * @return string $field - Field HTML Markup.
115
+ */
116
+ public function captcha_form_field() {
117
  self::$captcha_count++;
118
  $site_key = trim( c4wp_get_option( 'site_key' ) );
119
  $number = $this->total_captcha();
120
+ $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' );
121
 
122
  $field = '<div class="c4wp_captcha_field" style="margin-bottom: 10px;"><div id="c4wp_captcha_field_' . $number . '" class="c4wp_captcha_field_div">';
123
  if ( 'v3' === $version ) {
127
  return $field;
128
  }
129
 
130
+ /**
131
+ * Prints plugin scripts to the footer when needed.
132
+ *
133
+ * @return void
134
+ */
135
+ public function footer_script() {
136
  static $included = false;
137
 
138
+ $number = $this->total_captcha();
139
  $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' );
140
+
141
  if ( ! $number && ( 'v3' !== $version || 'all_pages' !== c4wp_get_option( 'v3_script_load', 'all_pages' ) ) ) {
142
  return;
143
  }
162
  }
163
  }
164
 
165
+ /**
166
+ * V2 checkboc inline script.
167
+ *
168
+ * @return void
169
+ */
170
+ public function v2_checkbox_script() {
171
  ?>
172
  <script type="text/javascript">
173
  var c4wp_onloadCallback = function() {
174
  for ( var i = 0; i < document.forms.length; i++ ) {
175
  var form = document.forms[i];
176
+ var captcha_div = form.querySelector( '.c4wp_captcha_field_div:not(.rendered)' );
177
  if ( null === captcha_div )
178
+ continue;
179
  captcha_div.innerHTML = '';
180
  ( function( form ) {
181
  var c4wp_captcha = grecaptcha.render( captcha_div,{
183
  'size' : '<?php echo esc_js( c4wp_get_option( 'size', 'normal' ) ); ?>',
184
  'theme' : '<?php echo esc_js( c4wp_get_option( 'theme', 'light' ) ); ?>'
185
  });
186
+ captcha_div.classList.add( 'rendered' );
187
  <?php
188
  $additonal_js = apply_filters( 'c4wp_captcha_callback_additonal_js', false );
189
  echo $additonal_js;
194
 
195
  </script>
196
  <?php
197
+ $lang = $this->determine_captcha_language();
198
  $google_url = apply_filters( 'c4wp_v2_checkbox_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?onload=c4wp_onloadCallback&render=explicit' . $lang, c4wp_recaptcha_domain() ), $lang );
199
  ?>
200
  <script src="<?php echo esc_url( $google_url ); ?>"
203
  <?php
204
  }
205
 
206
+ /**
207
+ * V2 invisible inline script.
208
+ *
209
+ * @return void
210
+ */
211
+ public function v2_invisible_script() {
212
  ?>
213
  <script type="text/javascript">
214
  var c4wp_onloadCallback = function() {
281
  }
282
  };
283
  </script>
284
+ <?php
285
+ $lang = $this->determine_captcha_language();
286
  $google_url = apply_filters( 'c4wp_v2_invisible_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?onload=c4wp_onloadCallback&render=explicit' . $lang, c4wp_recaptcha_domain() ), $lang );
287
  ?>
288
  <script src="<?php echo esc_url( $google_url ); ?>"
291
  <?php
292
  }
293
 
294
+ /**
295
+ * V3 inline scripts.
296
+ *
297
+ * @return void
298
+ */
299
+ public function v3_script() {
300
+
301
  $site_key = trim( c4wp_get_option( 'site_key' ) );
302
+ $lang = $this->determine_captcha_language();
303
+ $position = c4wp_get_option( 'badge_v3', 'bottomright' );
304
 
305
  $google_url = apply_filters( 'c4wp_v3_script_api_src', sprintf( 'https://www.%s/recaptcha/api.js?render=' . $site_key . $lang, c4wp_recaptcha_domain() ), $site_key, $lang );
306
  ?>
339
  } )( grecaptcha );
340
  </script>
341
  <?php
342
+ if ( 'bottomleft' === $position ) :
343
+ ?>
344
+ <style type="text/css">
345
+ .grecaptcha-badge {
346
+ width: 70px !important;
347
+ overflow: hidden !important;
348
+ transition: all 0.3s ease !important;
349
+ left: 4px !important;
350
+ }
351
+ .grecaptcha-badge:hover {
352
+ width: 256px !important;
353
+ }
354
+ </style>
355
+ <?php
356
+ endif;
357
  }
358
 
359
+ /**
360
+ * Echo form field markup.
361
+ *
362
+ * @return void
363
+ */
364
+ public function form_field() {
365
  echo $this->form_field_return();
366
  }
367
 
368
+ /**
369
+ * Return form field markup.
370
+ *
371
+ * @param string $return - Orignal markup.
372
+ * @return string $return - Markup with our field added.
373
+ */
374
+ public function form_field_return( $return = '' ) {
375
  return $return . $this->captcha_form_field();
376
  }
377
+
378
+ /**
379
+ * Displays the login form field if applicable.
380
+ *
381
+ * @return void
382
+ */
383
+ public function login_form_field() {
384
  if ( $this->show_login_captcha() ) {
385
  $this->form_field();
386
  }
387
  }
388
+
389
+ /**
390
+ * Returns the login form field.
391
+ *
392
+ * @param string $field - Original markup.
393
+ * @return string $field - Field markup.
394
+ */
395
+ public function login_form_return( $field = '' ) {
396
  if ( $this->show_login_captcha() ) {
397
  $field = $this->form_field_return( $field );
398
  }
399
  return $field;
400
  }
401
+
402
+ /**
403
+ * Determine if a captcha should be shown for a given login attempt.
404
+ *
405
+ * @return bool *show_captcha - Wether to show or now.
406
+ */
407
+ public function show_login_captcha() {
408
  $show_captcha = true;
409
+ $ip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : false;
410
 
411
  $show_captcha = apply_filters( 'c4wp_login_captcha_filter', $show_captcha, $ip );
412
 
413
  return $show_captcha;
414
  }
415
 
416
+ /**
417
+ * Add login form field to multisite form.
418
+ *
419
+ * @param WP_Error $errors - Error messages.
420
+ * @return void
421
+ */
422
+ public function ms_form_field( $errors ) {
423
+ $err_messages = $errors->get_error_message( 'c4wp_error' );
424
+ if ( $err_messages ) {
425
+ echo '<p class="error">' . esc_attr( $errmsg ) . '</p>';
426
  }
427
  $this->form_field();
428
  }
429
 
430
+ /**
431
+ * Main verification function. Return if a submission is allowed or not.
432
+ *
433
+ * @param boolean $response - Current response.
434
+ * @return bool - Was request valid?
435
+ */
436
+ public function verify( $response = false ) {
437
  static $last_verify = null;
438
+ static $last_response = null;
439
+ static $duplicate_response = false;
440
+
441
+ $remoteip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : '';
442
+
443
+
444
+ $secret_key = trim( c4wp_get_option( 'secret_key' ) );
445
+ $verify = false;
446
 
 
 
 
 
447
 
448
  if ( false === $response ) {
449
+ $response = isset( $_POST['g-recaptcha-response'] ) ? sanitize_text_field( wp_unslash( $_POST['g-recaptcha-response'] ) ) : '';
450
  }
451
+
452
  // Store what we send to google in case we need to verify if its a duplicated request.
453
+ $last_response = $response;
454
+ if ( $response === $last_response ) {
455
+ $duplicate_response = true;
456
+ }
457
+
458
  $pre_check = apply_filters( 'c4wp_verify_captcha_pre', null, $response );
459
+
460
  if ( null !== $pre_check ) {
461
  return $pre_check;
462
  }
463
 
464
+ // if $secret_key is not set.
465
+ if ( ! $secret_key ) {
466
  return true;
467
  }
468
 
469
  if ( ! $response || ! $remoteip ) {
470
  return $verify;
471
  }
472
+
473
  if ( null !== $last_verify ) {
474
  return $last_verify;
475
  }
476
 
477
  $url = apply_filters( 'c4wp_google_verify_url', sprintf( 'https://www.%s/recaptcha/api/siteverify', c4wp_recaptcha_domain() ) );
478
 
479
+ // make a POST request to the Google reCAPTCHA Server.
480
  $request = wp_remote_post(
481
+ $url,
482
+ array(
483
  'timeout' => 10,
484
  'body' => array(
485
  'secret' => $secret_key,
489
  )
490
  );
491
 
492
+ // get the request response body.
493
  $request_body = wp_remote_retrieve_body( $request );
494
  if ( ! $request_body ) {
495
  return $verify;
496
  }
497
 
498
  $result = json_decode( $request_body, true );
499
+
500
+ if ( isset( $result['success'] ) && true === $result['success'] ) {
501
  if ( 'v3' === c4wp_get_option( 'captcha_version' ) ) {
502
+ $score = isset( $result['score'] ) ? $result['score'] : 0;
503
  $action = isset( $result['action'] ) ? $result['action'] : '';
504
+ $verify = c4wp_get_option( 'score', '0.5' ) <= $score && 'advanced_nocaptcha_recaptcha' === $action;
505
  } else {
506
  $verify = true;
507
  }
508
  }
509
+
510
+ $verify = apply_filters( 'c4wp_verify_captcha', $verify, $result, $response );
511
+ $last_verify = $verify;
512
+
513
  // If we know this is a duplicated request, pass verification.
514
+ if ( isset( $result['error-codes'] ) && 'timeout-or-duplicate' === $result['error-codes'][0] && $duplicate_response ) {
515
+ $verify = true;
516
+ }
517
 
518
  return $verify;
519
  }
520
 
521
+ /**
522
+ * Verify a login attempt.
523
+ *
524
+ * @param WP_User $user - User object.
525
+ * @param string $username - Login username.
526
+ * @param string $password - Login password.
527
+ * @return WP_User|WP_Error - Always return the user, WP Error otherwise.
528
+ */
529
+ public function login_verify( $user, $username = '', $password = '' ) {
530
  global $wpdb;
531
  if ( ! $username ) {
532
  return $user;
553
 
554
  /**
555
  * Checks if the current authentication request is RESTy or a custom URL where it should not load.
556
+ *
557
+ * @return boolean - Was a rest request?
558
  */
559
+ public function is_rest_request() {
560
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST || isset( $_GET['rest_route'] ) && strpos( sanitize_text_field( wp_unslash( $_GET['rest_route'] ) ), '/', 0 ) === 0 ) {
561
  return true;
562
  }
563
+
564
  global $wp_rewrite;
565
+ if ( null === $wp_rewrite ) {
566
+ $wp_rewrite = new WP_Rewrite();
567
+ }
568
+
569
  $rest_url = wp_parse_url( trailingslashit( rest_url() ) );
570
+ $current_url = wp_parse_url( add_query_arg( array() ) );
571
+ $is_rest = strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
572
 
573
  return $is_rest;
574
  }
575
+
576
+ /**
577
+ * Verify a registration attempt.
578
+ *
579
+ * @param WP_Error $errors - Current error array.
580
+ * @param string $sanitized_user_login - Current user login.
581
+ * @param string $user_email - User email address.
582
+ * @return WP_Error - Error array with ours added, if applicable.
583
+ */
584
+ public function registration_verify( $errors, $sanitized_user_login, $user_email ) {
585
  if ( ! $this->verify() ) {
586
+ // Bail if we have nothign to work with.
587
+ if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
588
+ return $errors;
589
+ }
590
  $errors->add( 'c4wp_error', $this->add_error_to_mgs() );
591
  }
 
 
 
 
 
592
  return $errors;
593
  }
594
+
595
+ /**
596
+ * Verify a new user signup on a multisite network.
597
+ *
598
+ * @param array $result - Error array.
599
+ * @return array $result - Error array with ours added, if applicable.
600
+ */
601
+ public function ms_form_field_verify( $result ) {
602
  if ( isset( $_POST['stage'] ) && 'validate-user-signup' === $_POST['stage'] && ! $this->verify() ) {
603
  $result['errors']->add( 'c4wp_error', c4wp_get_option( 'error_message' ) );
604
  }
606
  return $result;
607
  }
608
 
609
+ /**
610
+ * Verify a new user signup on a WPMU form.
611
+ *
612
+ * @param array $result - Error array.
613
+ * @return array $result - Error array with ours added, if applicable.
614
+ */
615
+ public function ms_blog_verify( $result ) {
616
  if ( ! $this->verify() ) {
617
  $result['errors']->add( 'c4wp_error', c4wp_get_option( 'error_message' ) );
618
  }
620
  return $result;
621
  }
622
 
623
+ /**
624
+ * Verify lost password form submissin.
625
+ *
626
+ * @param WP_Error $result - Current errors.
627
+ * @param int $user_id - User ID.
628
+ * @return WP_Error - Error array with ours added, if applicable.
629
+ */
630
+ public function lostpassword_verify( $result, $user_id ) {
631
 
632
  // Allow admins to send reset links.
633
+ if ( current_user_can( 'manage_options' ) && isset( $_REQUEST['action'] ) && in_array( wp_unslash( $_REQUEST['action'] ), array( 'resetpassword', 'send-password-reset' ), true ) ) {
634
  return $result;
635
  }
636
+
637
  if ( ! $this->verify() ) {
638
+ // Bail if we have nothign to work with.
639
  if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
640
  return $result;
641
  }
642
+ $result->add( 'c4wp_error', $this->add_error_to_mgs() );
643
  }
644
 
645
  return $result;
646
  }
647
 
648
+ /**
649
+ * Verify password reset submissions.
650
+ *
651
+ * @param WP_Error $errors - Current errors.
652
+ * @param WP_User $user - User object.
653
+ * @return WP_Error|WP_User - User object or error.
654
+ */
655
+ public function reset_password_verify( $errors, $user ) {
656
  // Allow admins to send reset links.
657
+ if ( current_user_can( 'manage_options' ) && isset( $_REQUEST['action'] ) && in_array( wp_unslash( $_REQUEST['action'] ), array( 'resetpassword', 'send-password-reset' ), true ) ) {
658
  return $errors;
659
  }
660
+
661
  if ( ! $this->verify() ) {
662
  // Bail if we have nothign to work with.
663
  if ( ! isset( $_POST['g-recaptcha-response'] ) ) {
665
  }
666
  $errors->add( 'c4wp_error', $this->add_error_to_mgs() );
667
  }
668
+
669
+ return $errors;
670
  }
671
 
672
+ /**
673
+ * Verify comment submissions.
674
+ *
675
+ * @param array $commentdata - Submitted data.
676
+ * @return array - New comment data.
677
+ */
678
+ public function comment_verify( $commentdata ) {
679
  if ( ! $this->verify() ) {
680
  wp_die(
681
+ '<p>' . $this->add_error_to_mgs() . '</p>',
682
+ esc_html__( 'Comment Submission Failure' ),
683
+ array(
684
  'response' => 403,
685
  'back_link' => true,
686
  )
690
  return $commentdata;
691
  }
692
 
693
+ /**
694
+ * Very comment in WP 4.9 and older.
695
+ *
696
+ * @param bool $approved - Approval currently.
697
+ * @returnb ool $approved - Our approval.
698
+ */
699
+ public function comment_verify_490( $approved ) {
700
  if ( ! $this->verify() ) {
701
  return new WP_Error( 'c4wp_error', $this->add_error_to_mgs(), 403 );
702
  }
703
  return $approved;
704
  }
705
+
706
  /**
707
  * Checks if the current page load is actually an iframe found in the new customizer/widgets areas within WP 5.8+.
708
  *
709
  * @return bool
710
  */
711
+ public function check_should_js_embed() {
712
  // Ensure we dont load inside an iframe/preview.
713
  if ( isset( $_GET['legacy-widget-preview'] ) || isset( $_GET['customize_messenger_channel'] ) ) {
714
  return false;
715
+ }
716
  return true;
717
  }
718
+
719
  /**
720
  * Auto detects language if applicable, otherwise returns the users desired language from the settings.
721
+ *
722
  * @return string
723
  */
724
+ public function determine_captcha_language() {
725
+ $language = trim( c4wp_get_option( 'language' ) );
726
+ $auto_detect = c4wp_get_option( 'language_handling' );
727
+
728
+ $lang = '';
729
+ if ( 'manually_choose' === $auto_detect ) {
730
+ $lang = '&hl=' . $language;
731
+ } else {
732
+ $lang = '&hl=' . get_bloginfo( 'language' );
733
+ }
734
+
735
+ /*
736
+ */
737
  $lang = '&hl=' . $language;
738
  return $lang;
739
  }
740
  } //END CLASS
741
  } //ENDIF
742
 
743
+ add_action( 'init', array( C4wp_Captcha_Class::init(), 'actions_filters' ), -9 );
744
 
assets/css/admin.css CHANGED
@@ -246,6 +246,9 @@ tr.upgrade-required {
246
  tr.upgrade-required.c4wp-border-top {
247
  border-top: 1px solid #2b597a;
248
  }
 
 
 
249
 
250
  tr.upgrade-required > th {
251
  padding-left: 15px;
246
  tr.upgrade-required.c4wp-border-top {
247
  border-top: 1px solid #2b597a;
248
  }
249
+ tr.upgrade-required.c4wp-border-bottom {
250
+ border-bottom: 1px solid #2b597a;
251
+ }
252
 
253
  tr.upgrade-required > th {
254
  padding-left: 15px;
assets/img/20x20-icon-inverse.png ADDED
Binary file
assets/js/admin.js CHANGED
@@ -171,6 +171,15 @@ jQuery(document).ready(function( $ ){
171
  jQuery( 'body' ).on( 'click', 'input.disabled', function ( e ) {
172
  e.preventDefault();
173
  });
 
 
 
 
 
 
 
 
 
174
  });
175
 
176
 
171
  jQuery( 'body' ).on( 'click', 'input.disabled', function ( e ) {
172
  e.preventDefault();
173
  });
174
+
175
+ jQuery('.captcha_keys_required .checkbox[id*="enabled_forms"]').change(function() {
176
+ jQuery( '#captcha_keys_notice' ).slideDown( 500 );
177
+ });
178
+
179
+ jQuery( 'body' ).on( 'click', '#captcha_keys_notice .button-secondary', function ( e ) {
180
+ e.preventDefault();
181
+ jQuery( '#captcha_keys_notice' ).slideUp( 500 );
182
+ });
183
  });
184
 
185
 
functions.php CHANGED
@@ -1,7 +1,18 @@
1
- <?php
2
- // Add update hook.
 
 
 
 
 
 
3
  add_action( 'init', 'c4wp_plugin_update', -15 );
4
 
 
 
 
 
 
5
  function c4wp_plugin_update() {
6
  $prev_version = c4wp_get_option( 'version', '3.1' );
7
  if ( version_compare( $prev_version, C4WP_PLUGIN_VERSION, '!=' ) ) {
@@ -17,6 +28,12 @@ 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', '<' ) ) {
22
  if ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ) {
@@ -29,7 +46,7 @@ function c4wp_plugin_update_32( $prev_version ) {
29
  }
30
  $options['error_message'] = str_replace( esc_html__( '<strong>ERROR</strong>: ', 'advanced-nocaptcha-recaptcha' ), '', c4wp_get_option( 'error_message' ) );
31
 
32
- $enabled_forms = [];
33
  if ( ! empty( $options['login'] ) ) {
34
  $enabled_forms[] = 'login';
35
  }
@@ -65,9 +82,15 @@ function c4wp_plugin_update_32( $prev_version ) {
65
  }
66
  }
67
 
 
 
 
 
 
 
68
  function c4wp_plugin_update_51( $prev_version ) {
69
  if ( version_compare( $prev_version, '5.1', '<' ) ) {
70
- $options = [];
71
  if ( 'invisible' === c4wp_get_option( 'size' ) ) {
72
  $options['size'] = 'normal';
73
  $options['captcha_version'] = 'v2_invisible';
@@ -77,29 +100,41 @@ function c4wp_plugin_update_51( $prev_version ) {
77
  }
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' ] ) );
99
  $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" );
100
  }
101
  }
102
 
 
 
 
 
 
 
103
  function c4wp_plugin_update_706( $prev_version ) {
104
  if ( version_compare( $prev_version, '7.0.6', '<' ) ) {
105
  delete_transient( 'c4wp_config_file_hash' );
@@ -109,18 +144,25 @@ function c4wp_plugin_update_706( $prev_version ) {
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
  */
125
  function c4wp_get_option( $option, $default = '', $section = 'c4wp_admin_options' ) {
126
 
@@ -144,6 +186,11 @@ function c4wp_get_option( $option, $default = '', $section = 'c4wp_admin_options
144
 
145
  /**
146
  * Handle updating option for our plugin.
 
 
 
 
 
147
  */
148
  function c4wp_update_option( $options, $value = '', $section = 'c4wp_admin_options' ) {
149
 
@@ -161,39 +208,58 @@ function c4wp_update_option( $options, $value = '', $section = 'c4wp_admin_optio
161
  if ( $update_site_options ) {
162
  update_site_option( $section, wp_parse_args( $options, get_site_option( $section ) ) );
163
  } else {
164
- update_option( $section, wp_parse_args( $options, get_option( $section ) ) );
165
  }
166
 
167
  return true;
168
  }
169
 
170
  /**
171
- * Checks if a specific form is enabled within the plugins settings.
 
 
 
172
  */
173
  function c4wp_is_form_enabled( $form ) {
174
  if ( ! $form ) {
175
  return false;
176
  }
177
  $enabled_forms = array_merge( c4wp_get_option( 'enabled_forms', array() ), c4wp_get_option( 'enabled_forms_wc', array() ), c4wp_get_option( 'enabled_forms_bp', array() ), c4wp_get_option( 'enabled_forms_bbp', array() ) );
178
-
179
  if ( ! is_array( $enabled_forms ) ) {
180
  return false;
181
  }
182
  return in_array( $form, $enabled_forms, true );
183
  }
184
 
 
 
 
 
 
185
  function c4wp_translation() {
186
- // SETUP TEXT DOMAIN FOR TRANSLATIONS
187
  load_plugin_textdomain( 'advanced-nocaptcha-recaptcha', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
188
  }
189
 
 
 
 
 
 
190
  function c4wp_login_enqueue_scripts() {
191
 
192
  if ( ! c4wp_get_option( 'remove_css' ) && 'normal' === c4wp_get_option( 'size', 'normal' ) && 'v2_checkbox' === c4wp_get_option( 'captcha_version', 'v2_checkbox' ) ) {
193
- wp_enqueue_style( 'c4wp-login-style', C4WP_PLUGIN_URL . 'assets/css/style.css' );
 
194
  }
195
  }
196
 
 
 
 
 
 
197
  function c4wp_include_require_files() {
198
  $fep_files = array(
199
  'main' => 'anr-captcha-class.php',
@@ -211,42 +277,70 @@ function c4wp_include_require_files() {
211
  add_action( 'wp_footer', 'c4wp_wp_footer', 99999 );
212
  add_action( 'login_footer', 'c4wp_wp_footer', 99999 );
213
 
 
 
 
 
 
214
  function c4wp_wp_footer() {
215
- c4wp_captcha_class::init()->footer_script();
216
  }
217
 
218
- add_action( 'c4wp_captcha_form_field', function() { c4wp_captcha_form_field( true ); } );
219
- add_shortcode( 'c4wp-captcha', 'c4wp_captcha_form_field' );
220
-
221
- // Old versions for back-compat.
222
- add_action( 'anr_captcha_form_field', function() { c4wp_captcha_form_field( true ); } );
223
- add_shortcode( 'anr-captcha', 'c4wp_captcha_form_field' );
224
 
 
 
 
 
 
 
225
  function c4wp_captcha_form_field( $echo = false ) {
226
  if ( $echo ) {
227
- c4wp_captcha_class::init()->form_field();
228
  } else {
229
- return c4wp_captcha_class::init()->form_field_return();
230
  }
231
 
232
  }
233
 
 
 
 
 
 
 
234
  function anr_verify_captcha( $response = false ) {
235
- return c4wp_captcha_class::init()->verify( $response );
236
  }
237
 
 
 
 
 
 
 
238
  function c4wp_verify_captcha( $response = false ) {
239
- return c4wp_captcha_class::init()->verify( $response );
240
  }
241
 
242
  add_filter( 'shake_error_codes', 'c4wp_add_shake_error_codes' );
243
 
 
 
 
 
 
 
244
  function c4wp_add_shake_error_codes( $shake_error_codes ) {
245
  $shake_error_codes[] = 'c4wp_error';
246
 
247
  return $shake_error_codes;
248
  }
249
 
 
 
 
 
 
250
  function c4wp_fs_uninstall_cleanup() {
251
  global $wpdb;
252
 
@@ -255,26 +349,50 @@ function c4wp_fs_uninstall_cleanup() {
255
  if ( $post_id ) {
256
  // There may have too many post meta. delete them first in one query.
257
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d", $post_id ) );
258
-
259
  wp_delete_post( $post_id, true );
260
  }
261
  }
262
 
 
 
 
 
 
 
263
  function c4wp_fs_support_forum_url( $wp_org_support_forum_url ) {
264
  return 'https://www.wpwhitesecurity.com/contact/';
265
  }
266
 
267
- function c4wp_recaptcha_domain(){
 
 
 
 
 
268
  $domain = c4wp_get_option( 'recaptcha_domain', 'google.com' );
269
  return apply_filters( 'c4wp_recaptcha_domain', $domain );
270
  }
271
 
272
 
273
- function c4wp_settings_page_url( $tab = false ){
 
 
 
 
 
 
274
  $url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() || ! function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
275
  return $url;
276
  }
277
 
 
 
 
 
 
 
 
278
  function hide_freemius_submenu_items( $is_visible, $submenu_id ) {
279
  if ( 'contact' === $submenu_id ) {
280
  $is_visible = false;
@@ -282,6 +400,11 @@ function hide_freemius_submenu_items( $is_visible, $submenu_id ) {
282
  return $is_visible;
283
  }
284
 
 
 
 
 
 
285
  function c4wp_get_sysinfo() {
286
  // System info.
287
  global $wpdb;
@@ -351,7 +474,7 @@ function c4wp_get_sysinfo() {
351
  $active_plugins = get_option( 'active_plugins', array() );
352
 
353
  foreach ( $plugins as $plugin_path => $plugin ) {
354
- if ( ! in_array( $plugin_path, $active_plugins ) ) {
355
  continue;
356
  }
357
 
@@ -363,7 +486,7 @@ function c4wp_get_sysinfo() {
363
  $sysinfo .= "\n" . '-- WordPress Inactive Plugins --' . "\n\n";
364
 
365
  foreach ( $plugins as $plugin_path => $plugin ) {
366
- if ( in_array( $plugin_path, $active_plugins ) ) {
367
  continue;
368
  }
369
 
@@ -418,12 +541,12 @@ function c4wp_get_sysinfo() {
418
  $c4wp_options = get_option( 'c4wp_admin_options' );
419
 
420
  if ( ! empty( $c4wp_options ) ) {
421
- foreach ( $c4wp_options as $option => $value) {
422
  $sysinfo .= 'Option: ' . $option . "\n";
423
  $sysinfo .= 'Value: ' . print_r( $value, true ) . "\n\n";
424
  }
425
  }
426
-
427
  $sysinfo .= "\n" . '### System Info → End ###' . "\n\n";
428
 
429
  return $sysinfo;
@@ -432,7 +555,7 @@ function c4wp_get_sysinfo() {
432
  /**
433
  * Determines if an install is premium/paying.
434
  *
435
- * @return void
436
  */
437
  function c4wp_is_premium_version() {
438
  return ( class_exists( 'C4WP_Pro' ) && ! c4wp_fs()->is_not_paying() ) ? true : false;
1
+ <?php // phpcs:disable WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase, WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.PHP.DevelopmentFunctions.error_log_print_r
2
+
3
+ /**
4
+ * Add update hook.
5
+ *
6
+ * @package C4WP
7
+ */
8
+
9
  add_action( 'init', 'c4wp_plugin_update', -15 );
10
 
11
+ /**
12
+ * Check if update scripts need to run.
13
+ *
14
+ * @return void
15
+ */
16
  function c4wp_plugin_update() {
17
  $prev_version = c4wp_get_option( 'version', '3.1' );
18
  if ( version_compare( $prev_version, C4WP_PLUGIN_VERSION, '!=' ) ) {
28
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_706', 30 );
29
  add_action( 'c4wp_plugin_update', 'c4wp_plugin_update_7061', 40 );
30
 
31
+ /**
32
+ * Update script for 3.2 and below.
33
+ *
34
+ * @param string $prev_version - Old version number.
35
+ * @return void
36
+ */
37
  function c4wp_plugin_update_32( $prev_version ) {
38
  if ( version_compare( $prev_version, '3.2', '<' ) ) {
39
  if ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ) {
46
  }
47
  $options['error_message'] = str_replace( esc_html__( '<strong>ERROR</strong>: ', 'advanced-nocaptcha-recaptcha' ), '', c4wp_get_option( 'error_message' ) );
48
 
49
+ $enabled_forms = array();
50
  if ( ! empty( $options['login'] ) ) {
51
  $enabled_forms[] = 'login';
52
  }
82
  }
83
  }
84
 
85
+ /**
86
+ * Update script for 5.1 and below.
87
+ *
88
+ * @param string $prev_version - Old version number.
89
+ * @return void
90
+ */
91
  function c4wp_plugin_update_51( $prev_version ) {
92
  if ( version_compare( $prev_version, '5.1', '<' ) ) {
93
+ $options = array();
94
  if ( 'invisible' === c4wp_get_option( 'size' ) ) {
95
  $options['size'] = 'normal';
96
  $options['captcha_version'] = 'v2_invisible';
100
  }
101
  }
102
 
103
+ /**
104
+ * Update script for 7.0 and below.
105
+ *
106
+ * @param string $prev_version - Old version number.
107
+ * @return void
108
+ */
109
  function c4wp_plugin_update_70( $prev_version ) {
110
  if ( version_compare( $prev_version, '7.0.6.1', '<' ) ) {
111
  if ( is_multisite() ) {
112
+ if ( ! get_site_option( 'c4wp_70_upgrade_complete' ) ) {
113
+ $original_options = get_site_option( 'anr_admin_options' );
114
+ update_site_option( 'c4wp_admin_options', $original_options );
115
+ update_site_option( 'c4wp_70_upgrade_complete', true );
116
+ delete_site_option( 'anr_admin_options' );
117
+ }
118
  } else {
119
+ if ( ! get_option( 'c4wp_70_upgrade_complete' ) ) {
120
+ $original_options = get_option( 'anr_admin_options' );
121
+ update_option( 'c4wp_admin_options', $original_options );
122
+ update_option( 'c4wp_70_upgrade_complete', true );
123
+ delete_option( 'anr_admin_options' );
124
+ }
125
  }
126
  global $wpdb;
127
+ $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->posts} WHERE post_type = %s", array( 'anr-post' ) ) );
128
  $wpdb->query( "DELETE meta FROM {$wpdb->postmeta} meta LEFT JOIN {$wpdb->posts} posts ON posts.ID = meta.post_id WHERE posts.ID IS NULL;" );
129
  }
130
  }
131
 
132
+ /**
133
+ * Update script for 7.0.6 and below.
134
+ *
135
+ * @param string $prev_version - Old version number.
136
+ * @return void
137
+ */
138
  function c4wp_plugin_update_706( $prev_version ) {
139
  if ( version_compare( $prev_version, '7.0.6', '<' ) ) {
140
  delete_transient( 'c4wp_config_file_hash' );
144
  /**
145
  * Update langiage if auto-detect was enabled.
146
  *
147
+ * @param string $prev_version - Previous version.
148
  * @return void
149
  */
150
  function c4wp_plugin_update_7061( $prev_version ) {
151
+ $current_lang = c4wp_get_option( 'language' );
152
  if ( version_compare( $prev_version, '7.0.6.1', '<' ) && empty( $current_lang ) ) {
153
+ c4wp_update_option( 'language', 'en' );
154
  }
155
  }
156
 
157
+
158
  /**
159
  * Handle getting options for our plugin.
160
+ *
161
+ * @param string $option - Name of option to update.
162
+ * @param string $default - Default value.
163
+ * @param string $section - Section which handles the option.
164
+ *
165
+ * @return bool:string - Option value.
166
  */
167
  function c4wp_get_option( $option, $default = '', $section = 'c4wp_admin_options' ) {
168
 
186
 
187
  /**
188
  * Handle updating option for our plugin.
189
+ *
190
+ * @param string $options - Name of option to update.
191
+ * @param string $value - New value.
192
+ * @param string $section - Section which handles the option.
193
+ * @return bool - Was option updated.
194
  */
195
  function c4wp_update_option( $options, $value = '', $section = 'c4wp_admin_options' ) {
196
 
208
  if ( $update_site_options ) {
209
  update_site_option( $section, wp_parse_args( $options, get_site_option( $section ) ) );
210
  } else {
211
+ update_option( $section, wp_parse_args( $options, get_option( $section ) ) );
212
  }
213
 
214
  return true;
215
  }
216
 
217
  /**
218
+ * Undocumented function
219
+ *
220
+ * @param string $form - Form name.
221
+ * @return bool - Is enabled?
222
  */
223
  function c4wp_is_form_enabled( $form ) {
224
  if ( ! $form ) {
225
  return false;
226
  }
227
  $enabled_forms = array_merge( c4wp_get_option( 'enabled_forms', array() ), c4wp_get_option( 'enabled_forms_wc', array() ), c4wp_get_option( 'enabled_forms_bp', array() ), c4wp_get_option( 'enabled_forms_bbp', array() ) );
228
+
229
  if ( ! is_array( $enabled_forms ) ) {
230
  return false;
231
  }
232
  return in_array( $form, $enabled_forms, true );
233
  }
234
 
235
+ /**
236
+ * Add transation file.
237
+ *
238
+ * @return void
239
+ */
240
  function c4wp_translation() {
241
+ // SETUP TEXT DOMAIN FOR TRANSLATIONS.
242
  load_plugin_textdomain( 'advanced-nocaptcha-recaptcha', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
243
  }
244
 
245
+ /**
246
+ * Undocumented function
247
+ *
248
+ * @return void
249
+ */
250
  function c4wp_login_enqueue_scripts() {
251
 
252
  if ( ! c4wp_get_option( 'remove_css' ) && 'normal' === c4wp_get_option( 'size', 'normal' ) && 'v2_checkbox' === c4wp_get_option( 'captcha_version', 'v2_checkbox' ) ) {
253
+ $verion = C4WP_PLUGIN_VERSION;
254
+ wp_enqueue_style( 'c4wp-login-style', C4WP_PLUGIN_URL . 'assets/css/style.css', C4WP_PLUGIN_VERSION, $verion );
255
  }
256
  }
257
 
258
+ /**
259
+ * Include main plugin settings.
260
+ *
261
+ * @return void
262
+ */
263
  function c4wp_include_require_files() {
264
  $fep_files = array(
265
  'main' => 'anr-captcha-class.php',
277
  add_action( 'wp_footer', 'c4wp_wp_footer', 99999 );
278
  add_action( 'login_footer', 'c4wp_wp_footer', 99999 );
279
 
280
+ /**
281
+ * Add our foot scripts.
282
+ *
283
+ * @return void
284
+ */
285
  function c4wp_wp_footer() {
286
+ C4wp_Captcha_Class::init()->footer_script();
287
  }
288
 
 
 
 
 
 
 
289
 
290
+ /**
291
+ * Create a captcha field.
292
+ *
293
+ * @param boolean $echo - Should echo or return.
294
+ * @return string - HTML Markup.
295
+ */
296
  function c4wp_captcha_form_field( $echo = false ) {
297
  if ( $echo ) {
298
+ C4wp_Captcha_Class::init()->form_field();
299
  } else {
300
+ return C4wp_Captcha_Class::init()->form_field_return();
301
  }
302
 
303
  }
304
 
305
+ /**
306
+ * Verify a captcha response (old version of plugin).
307
+ *
308
+ * @param boolean $response - Response to check.
309
+ * @return bool - Verification.
310
+ */
311
  function anr_verify_captcha( $response = false ) {
312
+ return C4wp_Captcha_Class::init()->verify( $response );
313
  }
314
 
315
+ /**
316
+ * Verify a captcha response.
317
+ *
318
+ * @param boolean $response - Response to check.
319
+ * @return bool - Verification.
320
+ */
321
  function c4wp_verify_captcha( $response = false ) {
322
+ return C4wp_Captcha_Class::init()->verify( $response );
323
  }
324
 
325
  add_filter( 'shake_error_codes', 'c4wp_add_shake_error_codes' );
326
 
327
+ /**
328
+ * Add shake script to error screen.
329
+ *
330
+ * @param array $shake_error_codes - Current error codes.
331
+ * @return array - Codes, with ours appended.
332
+ */
333
  function c4wp_add_shake_error_codes( $shake_error_codes ) {
334
  $shake_error_codes[] = 'c4wp_error';
335
 
336
  return $shake_error_codes;
337
  }
338
 
339
+ /**
340
+ * Clean up any used data on uninstall.
341
+ *
342
+ * @return void
343
+ */
344
  function c4wp_fs_uninstall_cleanup() {
345
  global $wpdb;
346
 
349
  if ( $post_id ) {
350
  // There may have too many post meta. delete them first in one query.
351
  $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->postmeta WHERE post_id = %d", $post_id ) );
352
+
353
  wp_delete_post( $post_id, true );
354
  }
355
  }
356
 
357
+ /**
358
+ * Create URL for our contact page.
359
+ *
360
+ * @param string $wp_org_support_forum_url - Original URL.
361
+ * @return string - Our URL.
362
+ */
363
  function c4wp_fs_support_forum_url( $wp_org_support_forum_url ) {
364
  return 'https://www.wpwhitesecurity.com/contact/';
365
  }
366
 
367
+ /**
368
+ * Create correct captcha domain URL.
369
+ *
370
+ * @return string - URL.
371
+ */
372
+ function c4wp_recaptcha_domain() {
373
  $domain = c4wp_get_option( 'recaptcha_domain', 'google.com' );
374
  return apply_filters( 'c4wp_recaptcha_domain', $domain );
375
  }
376
 
377
 
378
+ /**
379
+ * Setup settings page URL.
380
+ *
381
+ * @param boolean $tab - Is tab settings.
382
+ * @return string - URL.
383
+ */
384
+ function c4wp_settings_page_url( $tab = false ) {
385
  $url = ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() || ! function_exists( 'c4wp_same_settings_for_all_sites' ) ) ? network_admin_url( 'admin.php?page=c4wp-admin-captcha' ) : admin_url( 'admin.php?page=c4wp-admin-captcha' );
386
  return $url;
387
  }
388
 
389
+ /**
390
+ * Hode freemius contact link.
391
+ *
392
+ * @param bool $is_visible - Is currently visible.
393
+ * @param int $submenu_id - Item ID.
394
+ * @return bool - Is isible.
395
+ */
396
  function hide_freemius_submenu_items( $is_visible, $submenu_id ) {
397
  if ( 'contact' === $submenu_id ) {
398
  $is_visible = false;
400
  return $is_visible;
401
  }
402
 
403
+ /**
404
+ * Create system info for debugging.
405
+ *
406
+ * @return string - File markup.
407
+ */
408
  function c4wp_get_sysinfo() {
409
  // System info.
410
  global $wpdb;
474
  $active_plugins = get_option( 'active_plugins', array() );
475
 
476
  foreach ( $plugins as $plugin_path => $plugin ) {
477
+ if ( ! in_array( $plugin_path, $active_plugins, true ) ) {
478
  continue;
479
  }
480
 
486
  $sysinfo .= "\n" . '-- WordPress Inactive Plugins --' . "\n\n";
487
 
488
  foreach ( $plugins as $plugin_path => $plugin ) {
489
+ if ( in_array( $plugin_path, $active_plugins, true ) ) {
490
  continue;
491
  }
492
 
541
  $c4wp_options = get_option( 'c4wp_admin_options' );
542
 
543
  if ( ! empty( $c4wp_options ) ) {
544
+ foreach ( $c4wp_options as $option => $value ) {
545
  $sysinfo .= 'Option: ' . $option . "\n";
546
  $sysinfo .= 'Value: ' . print_r( $value, true ) . "\n\n";
547
  }
548
  }
549
+
550
  $sysinfo .= "\n" . '### System Info → End ###' . "\n\n";
551
 
552
  return $sysinfo;
555
  /**
556
  * Determines if an install is premium/paying.
557
  *
558
+ * @return bool - Is premium or not.
559
  */
560
  function c4wp_is_premium_version() {
561
  return ( class_exists( 'C4WP_Pro' ) && ! c4wp_fs()->is_not_paying() ) ? true : false;
languages/advanced-nocaptcha-recaptcha.pot CHANGED
@@ -1,8 +1,8 @@
1
- # Copyright (C) 2022 captcha-4wp
2
- # This file is distributed under the same license as the captcha-4wp package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: captcha-4wp\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
@@ -16,844 +16,687 @@ msgstr ""
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
- #: anr-captcha-class.php:66
20
  msgid "Please solve Captcha correctly"
21
  msgstr ""
22
 
23
- #: anr-captcha-class.php:68
24
  msgid "ERROR"
25
  msgstr ""
26
 
27
- #: functions.php:30
28
  msgid "<strong>ERROR</strong>: "
29
  msgstr ""
30
 
31
  #. translators: link to the settings page with text "Settings page"
32
- #: admin/settings.php:60
33
- msgid "In this page you can configure the type of reCAPTCHA that you want to use on your website. Once you configure your CAPTCHA, head to the %s to configure where the CAPTCHA should be used, whitelist IP addresses and configure other settings."
34
  msgstr ""
35
 
36
- #: admin/settings.php:61
37
- msgid "Settings page"
38
  msgstr ""
39
 
40
- #: admin/settings.php:73
41
  msgid "In this page you can configure where on your website you want to add the CAPTCHA check. You can also configure several other settings, such as whitelisting IP addresses, excluding logged in users from CAPTCHA checks and more."
42
  msgstr ""
43
 
44
  #. translators: expression "very restrictive" in bold
45
- #: admin/settings.php:94
46
  msgid "Any value above 0.5 is %s."
47
  msgstr ""
48
 
49
- #: admin/settings.php:95
50
  msgid "very restrictive"
51
  msgstr ""
52
 
53
- #: admin/settings.php:97
54
  msgid "This means that you might end up locked out from your website. Therefore test this on a staging website website beforehand."
55
  msgstr ""
56
 
57
- #: admin/settings.php:101
58
  msgid "You can add a CAPTCHA check to the below list of pages on WordPress."
59
  msgstr ""
60
 
61
- #: admin/settings.php:102
62
  msgid "Use the setting below to select the language of the text used in the CAPTCHA text."
63
  msgstr ""
64
 
65
- #: admin/settings.php:106
 
66
  msgid "To add CAPTCHA checks to WooCommerce, Contact Form 7, BuddyPress and other forms created by third party plugins you need to %s"
67
  msgstr ""
68
 
69
- #: admin/settings.php:107
70
  msgid "upgrade to Premium"
71
  msgstr ""
72
 
73
- #: admin/settings.php:109
74
  msgid " In the Premium edition you can configure the plugin to automatically detect the language settings of the visitor's and use that language."
75
  msgstr ""
76
 
77
- #: admin/settings.php:112
78
  msgid "Comments form"
79
  msgstr ""
80
 
81
- #: admin/settings.php:115
82
  msgid "(Incompatible with Jetpack comments)"
83
  msgstr ""
84
 
85
- #: admin/settings.php:124
86
- msgid "Select the type of reCAPTCHA you want to use"
87
  msgstr ""
88
 
89
- #: admin/settings.php:129
90
  msgid "reCAPTCHA version"
91
  msgstr ""
92
 
93
- #: admin/settings.php:135
94
  msgid "Version 2 (Users have to check the \"I’m not a robot” checkbox)"
95
  msgstr ""
96
 
97
- #: admin/settings.php:136
98
  msgid "Version 2 (No user interaction needed, however, if traffic is suspicious, users are asked to solve a CAPTCHA)"
99
  msgstr ""
100
 
101
- #: admin/settings.php:137
102
  msgid "Version 3 (verify request with a score without user interaction)"
103
  msgstr ""
104
 
105
- #: admin/settings.php:145
106
- msgid "Specify the Site & Secret key"
107
  msgstr ""
108
 
109
- #: admin/settings.php:155
 
110
  msgid "To communicate with Google and utilize the reCAPTCHA service you need to get a Site Key and Secret Key. You can obtain these keys for free by registering for your Google reCAPTCHA. Refer to %s if you need help with the process."
111
  msgstr ""
112
 
113
- #: admin/settings.php:156
114
  msgid "how to get the Google reCAPTCHA keys"
115
  msgstr ""
116
 
117
- #: admin/settings.php:162
118
  msgid "Site Key"
119
  msgstr ""
120
 
121
- #: admin/settings.php:167
122
  msgid "Secret Key"
123
  msgstr ""
124
 
125
- #: admin/settings.php:176
126
- msgid "Configure the below optional settings to fine-tune the reCAPTCHA to your requirements."
 
 
 
 
127
  msgstr ""
128
 
129
- #: admin/settings.php:181
130
  msgid "Captcha Score"
131
  msgstr ""
132
 
133
- #: admin/settings.php:187
134
  msgid "Use this setting to specify sensitivity of the CAPTCHA check. The closer to 1 the more sensitive the CAPTCHA check will be, which also means more traffic will be marked as spam. This option is only available for reCAPTCHA v3."
135
  msgstr ""
136
 
137
- #: admin/settings.php:190
138
  msgid "Load CAPTCHA v3 scripts on:"
139
  msgstr ""
140
 
141
- #: admin/settings.php:196
142
  msgid "All Pages"
143
  msgstr ""
144
 
145
- #: admin/settings.php:197
146
  msgid "Form Pages"
147
  msgstr ""
148
 
149
- #: admin/settings.php:199
150
  msgid "By default CAPTCHA only loads on the pages where it is required, mainly forms. However, for V3 you can configure it to load on all pages so it has a better context of the traffic and works more efficiently. The CAPTCHA test will never interrupt users on non-form pages."
151
  msgstr ""
152
 
153
- #: admin/settings.php:202
154
  msgid "CAPTCHA language"
155
  msgstr ""
156
 
157
- #: admin/settings.php:208
158
  msgid "Select a language"
159
  msgstr ""
160
 
161
- #: admin/settings.php:219
162
  msgid "Arabic"
163
  msgstr ""
164
 
165
- #: admin/settings.php:220
166
  msgid "Bulgarian"
167
  msgstr ""
168
 
169
- #: admin/settings.php:221
170
  msgid "Catalan"
171
  msgstr ""
172
 
173
- #: admin/settings.php:222
174
  msgid "Chinese (Simplified)"
175
  msgstr ""
176
 
177
- #: admin/settings.php:223
178
  msgid "Chinese (Traditional)"
179
  msgstr ""
180
 
181
- #: admin/settings.php:224
182
  msgid "Croatian"
183
  msgstr ""
184
 
185
- #: admin/settings.php:225
186
  msgid "Czech"
187
  msgstr ""
188
 
189
- #: admin/settings.php:226
190
  msgid "Danish"
191
  msgstr ""
192
 
193
- #: admin/settings.php:227
194
  msgid "Dutch"
195
  msgstr ""
196
 
197
- #: admin/settings.php:228
198
  msgid "English (UK)"
199
  msgstr ""
200
 
201
- #: admin/settings.php:229
202
  msgid "English (US)"
203
  msgstr ""
204
 
205
- #: admin/settings.php:230
206
  msgid "Filipino"
207
  msgstr ""
208
 
209
- #: admin/settings.php:231
210
  msgid "Finnish"
211
  msgstr ""
212
 
213
- #: admin/settings.php:232
214
  msgid "French"
215
  msgstr ""
216
 
217
- #: admin/settings.php:233
218
  msgid "French (Canadian)"
219
  msgstr ""
220
 
221
- #: admin/settings.php:234
222
  msgid "German"
223
  msgstr ""
224
 
225
- #: admin/settings.php:235
226
  msgid "German (Austria)"
227
  msgstr ""
228
 
229
- #: admin/settings.php:236
230
  msgid "German (Switzerland)"
231
  msgstr ""
232
 
233
- #: admin/settings.php:237
234
  msgid "Greek"
235
  msgstr ""
236
 
237
- #: admin/settings.php:238
238
  msgid "Hebrew"
239
  msgstr ""
240
 
241
- #: admin/settings.php:239
242
  msgid "Hindi"
243
  msgstr ""
244
 
245
- #: admin/settings.php:240
246
  msgid "Hungarain"
247
  msgstr ""
248
 
249
- #: admin/settings.php:241
250
  msgid "Indonesian"
251
  msgstr ""
252
 
253
- #: admin/settings.php:242
254
  msgid "Italian"
255
  msgstr ""
256
 
257
- #: admin/settings.php:243
258
  msgid "Japanese"
259
  msgstr ""
260
 
261
- #: admin/settings.php:244
262
  msgid "Korean"
263
  msgstr ""
264
 
265
- #: admin/settings.php:245
266
  msgid "Latvian"
267
  msgstr ""
268
 
269
- #: admin/settings.php:246
270
  msgid "Lithuanian"
271
  msgstr ""
272
 
273
- #: admin/settings.php:247
274
  msgid "Norwegian"
275
  msgstr ""
276
 
277
- #: admin/settings.php:248
278
  msgid "Persian"
279
  msgstr ""
280
 
281
- #: admin/settings.php:249
282
  msgid "Polish"
283
  msgstr ""
284
 
285
- #: admin/settings.php:250
286
  msgid "Portuguese"
287
  msgstr ""
288
 
289
- #: admin/settings.php:251
290
  msgid "Portuguese (Brazil)"
291
  msgstr ""
292
 
293
- #: admin/settings.php:252
294
  msgid "Portuguese (Portugal)"
295
  msgstr ""
296
 
297
- #: admin/settings.php:253
298
  msgid "Romanian"
299
  msgstr ""
300
 
301
- #: admin/settings.php:254
302
  msgid "Russian"
303
  msgstr ""
304
 
305
- #: admin/settings.php:255
306
  msgid "Serbian"
307
  msgstr ""
308
 
309
- #: admin/settings.php:256
310
  msgid "Slovak"
311
  msgstr ""
312
 
313
- #: admin/settings.php:257
314
  msgid "Slovenian"
315
  msgstr ""
316
 
317
- #: admin/settings.php:258
318
  msgid "Spanish"
319
  msgstr ""
320
 
321
- #: admin/settings.php:259
322
  msgid "Spanish (Latin America)"
323
  msgstr ""
324
 
325
- #: admin/settings.php:260
326
  msgid "Swedish"
327
  msgstr ""
328
 
329
- #: admin/settings.php:261
330
  msgid "Thai"
331
  msgstr ""
332
 
333
- #: admin/settings.php:262
334
  msgid "Turkish"
335
  msgstr ""
336
 
337
- #: admin/settings.php:263
338
  msgid "Ukrainian"
339
  msgstr ""
340
 
341
- #: admin/settings.php:264
342
  msgid "Vietnamese"
343
  msgstr ""
344
 
345
- #: admin/settings.php:268
346
  msgid "Error message"
347
  msgstr ""
348
 
349
- #: admin/settings.php:270
350
  msgid "Please solve the CAPTCHA to proceed"
351
  msgstr ""
352
 
353
- #: admin/settings.php:271
354
  msgid "Specify the message you want to show users who do not complete the CAPTCHA."
355
  msgstr ""
356
 
357
- #: admin/settings.php:274
358
  msgid "Theme"
359
  msgstr ""
360
 
361
- #: admin/settings.php:280
362
  msgid "Light"
363
  msgstr ""
364
 
365
- #: admin/settings.php:281
366
  msgid "Dark"
367
  msgstr ""
368
 
369
- #: admin/settings.php:285
370
  msgid "Size"
371
  msgstr ""
372
 
373
- #: admin/settings.php:291
374
  msgid "Normal"
375
  msgstr ""
376
 
377
- #: admin/settings.php:292
378
  msgid "Compact"
379
  msgstr ""
380
 
381
- #: admin/settings.php:296
382
  msgid "Badge"
383
  msgstr ""
384
 
385
- #: admin/settings.php:302
386
  msgid "Bottom Right"
387
  msgstr ""
388
 
389
- #: admin/settings.php:303
390
  msgid "Bottom Left"
391
  msgstr ""
392
 
393
- #: admin/settings.php:304
394
  msgid "Inline"
395
  msgstr ""
396
 
397
- #: admin/settings.php:306
398
  msgid "Badge shows for invisible captcha"
399
  msgstr ""
400
 
401
- #: admin/settings.php:309
 
 
 
 
 
 
 
 
402
  msgid "reCAPTCHA domain"
403
  msgstr ""
404
 
405
- #: admin/settings.php:319
406
  msgid "Use this setting to change the domain if Google is not accessible or blocked."
407
  msgstr ""
408
 
409
- #: admin/settings.php:322
410
  msgid "Remove CSS"
411
  msgstr ""
412
 
413
- #: admin/settings.php:326
414
  msgid "Remove this plugin's css from login page?"
415
  msgstr ""
416
 
417
- #: admin/settings.php:327
418
  msgid "This css increase login page width to adjust with Captcha width."
419
  msgstr ""
420
 
421
- #: admin/settings.php:336
422
  msgid "Select where on your website you want to add the CAPTCHA check"
423
  msgstr ""
424
 
425
- #: admin/settings.php:349
426
  msgid "WordPress pages"
427
  msgstr ""
428
 
429
- #: admin/settings.php:354
430
  msgid "Login form"
431
  msgstr ""
432
 
433
- #: admin/settings.php:355
434
  msgid "Registration form"
435
  msgstr ""
436
 
437
- #: admin/settings.php:356
438
  msgid "Reset password form"
439
  msgstr ""
440
 
441
- #: admin/settings.php:357
442
  msgid "Lost password form"
443
  msgstr ""
444
 
445
- #: admin/settings.php:371, admin/settings.php:820
446
  msgid "Upgrade to Premium"
447
  msgstr ""
448
 
449
- #: admin/settings.php:372
450
  msgid "Find out more"
451
  msgstr ""
452
 
453
- #: admin/settings.php:375
454
  msgid "Checkout and login pages on WooCommerce stores"
455
  msgstr ""
456
 
457
- #: admin/settings.php:376
458
  msgid "Contact Form 7, MailChimp 4 WordPress forms"
459
  msgstr ""
460
 
461
- #: admin/settings.php:377
462
  msgid "BuddyPress and bbPress"
463
  msgstr ""
464
 
465
- #: admin/settings.php:378
466
  msgid "And others"
467
  msgstr ""
468
 
469
- #: admin/settings.php:552
 
470
  msgid "No hook defined for %s"
471
  msgstr ""
472
 
473
- #: admin/settings.php:634, admin/settings.php:635, admin/settings.php:635, admin/settings.php:650, admin/settings.php:651, admin/settings.php:651
474
  msgid "CAPTCHA Configuration"
475
  msgstr ""
476
 
477
- #: admin/settings.php:634, admin/settings.php:650
478
  msgid "CAPTCHA 4WP"
479
  msgstr ""
480
 
481
- #: admin/settings.php:636, admin/settings.php:652
482
  msgid "CAPTCHA 4WP Settings"
483
  msgstr ""
484
 
485
- #: admin/settings.php:636, admin/settings.php:652
486
  msgid "Settings & Placements"
487
  msgstr ""
488
 
489
- #: admin/settings.php:637, admin/settings.php:637, admin/settings.php:653, admin/settings.php:653
490
  msgid "Help & Contact Us"
491
  msgstr ""
492
 
493
- #: admin/settings.php:640, admin/settings.php:640, admin/settings.php:656, admin/settings.php:656
494
  msgid "Premium Features ➤"
495
  msgstr ""
496
 
497
- #: admin/settings.php:696
498
  msgid "Please supply a valid IP"
499
  msgstr ""
500
 
501
- #: admin/settings.php:713
 
 
 
 
 
 
 
 
502
  msgid "CAPTCHA Placements"
503
  msgstr ""
504
 
505
- #: admin/settings.php:711
506
- msgid "Captcha Configuration"
507
  msgstr ""
508
 
509
- #: admin/settings.php:775
510
  msgid "The site key that you have entered is invalid. Please try again."
511
  msgstr ""
512
 
513
- #: admin/settings.php:778
514
  msgid "The secret key that you have entered is invalid. Please try again."
515
  msgstr ""
516
 
517
- #: admin/settings.php:781
518
  msgid "Captcha settings"
519
  msgstr ""
520
 
521
- #: admin/settings.php:783
522
  msgid "Captcha configuration"
523
  msgstr ""
524
 
525
- #: admin/settings.php:785
526
  msgid " updated"
527
  msgstr ""
528
 
529
- #: admin/settings.php:802
530
  msgid "Upgrade to Premium for:"
531
  msgstr ""
532
 
533
- #: admin/settings.php:807
534
  msgid "Use the language that your website viewers understand"
535
  msgstr ""
536
 
537
- #: admin/settings.php:808
538
  msgid "Spam protection for your WooCommerce stores"
539
  msgstr ""
540
 
541
- #: admin/settings.php:809
542
  msgid "Specify where to put the CAPTCHA test on WooCommerce checkout page"
543
  msgstr ""
544
 
545
- #: admin/settings.php:810
546
  msgid "One-click Contact Form 7 forms spam protection"
547
  msgstr ""
548
 
549
- #: admin/settings.php:811
550
  msgid "One-click spam protection for Mailchimp for WordPress forms"
551
  msgstr ""
552
 
553
- #: admin/settings.php:812
554
  msgid "CAPTCHA tests & spam protection for BuddyPress, bbPress & other third party plugins"
555
  msgstr ""
556
 
557
- #: admin/settings.php:813
558
  msgid "Add CAPTCHA to any type of form, even PHP forms"
559
  msgstr ""
560
 
561
- #: admin/settings.php:814
562
  msgid "Boost login security, add CAPTCHA tests only failed logins"
563
  msgstr ""
564
 
565
- #: admin/settings.php:815
566
  msgid "Remove CAPTCHA for logged in users"
567
  msgstr ""
568
 
569
- #: admin/settings.php:816
570
  msgid "Remove CAPTCHA for specific IP addresses"
571
  msgstr ""
572
 
573
- #: admin/settings.php:817
574
  msgid "Remove CAPTCHA from specific URLs"
575
  msgstr ""
576
 
577
- #: admin/settings.php:818
578
  msgid "No Ads!"
579
  msgstr ""
580
 
581
- #: admin/settings.php:820
582
  msgid "Get a FREE 7-day trial"
583
  msgstr ""
584
 
585
- #: admin/settings.php:870, extensions/pro-feature.php:63
586
  msgid "Settings"
587
  msgstr ""
588
 
589
- #: extensions/pro-feature.php:45
590
- msgid "Multisite User Signup Form"
591
- msgstr ""
592
-
593
- #: extensions/pro-feature.php:49
594
- msgid "Automatically detect and match the visitor's language settings (better user experience)."
595
- msgstr ""
596
-
597
- #: extensions/pro-feature.php:62
598
- msgid "Do you want a CAPTCHA test on the login page only when there are failed logins?"
599
- msgstr ""
600
-
601
- #: extensions/pro-feature.php:73
602
- msgid "You can configure the plugin to not show a CAPTCHA test by default on the login page and only show it after a number of failed logins from an IP address. By default, the list of offending IP address is flushed every 7 days. Use the setting below to specify a shorter or longer time period."
603
- msgstr ""
604
-
605
- #: extensions/pro-feature.php:78
606
- msgid "Show CAPTCHA test only when there are failed logins"
607
- msgstr ""
608
-
609
- #: extensions/pro-feature.php:85
610
- msgid "Number of failed logins required to trigger CAPTCHA tests"
611
- msgstr ""
612
-
613
- #: extensions/pro-feature.php:95
614
- msgid "Specify how often should the plugin flush the list of IP addresses"
615
- msgstr ""
616
-
617
- #: extensions/pro-feature.php:100
618
- msgid "Number of days can be between 1 and 10 days."
619
- msgstr ""
620
-
621
- #: extensions/pro-feature.php:101
622
- msgid "Every"
623
- msgstr ""
624
-
625
- #: extensions/pro-feature.php:102
626
- msgid "days."
627
- msgstr ""
628
-
629
- #: extensions/pro-feature.php:112
630
- msgid "Do you want to disable CAPTCHA tests for logged in users?"
631
- msgstr ""
632
-
633
- #: extensions/pro-feature.php:122
634
- msgid "By default the CAPTCHA tests are always active. However, you can disable CAPTCHA tests for logged in users, or for users with a specific user role."
635
- msgstr ""
636
-
637
- #: extensions/pro-feature.php:127
638
- msgid "Disable CAPTCHA tests for logged in users"
639
- msgstr ""
640
-
641
- #: extensions/pro-feature.php:133
642
- msgid "No"
643
- msgstr ""
644
-
645
- #: extensions/pro-feature.php:134
646
- msgid "Remove CAPTCHA tests for all logged in users"
647
- msgstr ""
648
-
649
- #: extensions/pro-feature.php:135
650
- msgid "Remove CAPTCHA tests for users with these user roles"
651
- msgstr ""
652
-
653
- #: extensions/pro-feature.php:151
654
- msgid "Do you want to disable CAPTCHA tests for some IP addresses?"
655
- msgstr ""
656
-
657
- #: extensions/pro-feature.php:161
658
- msgid "If you do not want any CAPTCHA tests from traffic coming from specific IP addresses, add these IP addresses in the option above."
659
- msgstr ""
660
-
661
- #: extensions/pro-feature.php:165
662
- msgid "No CAPTCHA tests for these IP addresses"
663
- msgstr ""
664
-
665
- #: extensions/pro-feature.php:182
666
- msgid "Do you want to remove CAPTCHA tests on some specific website pages / URLs?"
667
- msgstr ""
668
-
669
- #: extensions/pro-feature.php:192
670
- msgid "When using CAPTCHA v3 you can configure it to work on all pages. This is very useful for CAPTCHA itself to learn about the type of traffic / spam traffic your website receives. If you are using CAPTCHA v3 and would like to exclude CAPTCHA from specific URLs, use the below setting. You should only specify the path of the page / URL, without the domain. For example /wp-json/, /contact-us/"
671
- msgstr ""
672
-
673
- #: extensions/pro-feature.php:197
674
- msgid "Remove CAPTCHA from these URLs:"
675
- msgstr ""
676
-
677
- #: extensions/third-party/bbpress.php:42
678
- msgid "bbPress pages"
679
- msgstr ""
680
-
681
- #: extensions/third-party/bbpress.php:47
682
- msgid "bbPress New topic"
683
- msgstr ""
684
-
685
- #: extensions/third-party/bbpress.php:48
686
- msgid "bbPress reply to topic"
687
- msgstr ""
688
-
689
- #: extensions/third-party/buddypress.php:46
690
- msgid "BuddyPress pages"
691
- msgstr ""
692
-
693
- #: extensions/third-party/buddypress.php:51
694
- msgid "BuddyPress register"
695
- msgstr ""
696
-
697
- #: extensions/third-party/buddypress.php:52
698
- msgid "BuddyPress comments form"
699
- msgstr ""
700
-
701
- #: extensions/third-party/buddypress.php:53
702
- msgid "BuddyPress create group"
703
- msgstr ""
704
-
705
- #: extensions/third-party/contact-form-7.php:97
706
- msgid "captcha"
707
- msgstr ""
708
-
709
- #: extensions/third-party/contact-form-7.php:104
710
- msgid "Add a recaptcha field to your contact form."
711
- msgstr ""
712
-
713
- #: extensions/third-party/contact-form-7.php:125
714
- msgid "Insert Tag"
715
- msgstr ""
716
-
717
- #: extensions/third-party/woocommerce.php:78
718
- msgid "WooCommerces pages"
719
- msgstr ""
720
-
721
- #: extensions/third-party/woocommerce.php:83
722
- msgid "WooCommerce Checkout"
723
- msgstr ""
724
-
725
- #: extensions/third-party/woocommerce.php:84
726
- msgid "WooCommerce Login"
727
- msgstr ""
728
-
729
- #: extensions/third-party/woocommerce.php:85
730
- msgid "WooCommerce Registration form"
731
- msgstr ""
732
-
733
- #: extensions/third-party/woocommerce.php:86
734
- msgid "WooCommerce Reset password form"
735
- msgstr ""
736
-
737
- #: extensions/third-party/woocommerce.php:87
738
- msgid "WooCommerce Lost password form"
739
- msgstr ""
740
-
741
- #: extensions/third-party/woocommerce.php:99
742
- msgid "WooCommerce checkout position"
743
- msgstr ""
744
-
745
- #: extensions/third-party/woocommerce.php:105
746
- msgid "Below checkout"
747
- msgstr ""
748
-
749
- #: extensions/third-party/woocommerce.php:106
750
- msgid "Above checkout button"
751
- msgstr ""
752
-
753
- #: extensions/third-party/woocommerce.php:107
754
- msgid "Above payment selection"
755
- msgstr ""
756
-
757
- #: extensions/third-party/woocommerce.php:109
758
- msgid "Choose a location for the captcha input (v2 checkbox only)"
759
- msgstr ""
760
-
761
- #: extensions/third-party/woocommerce.php:113
762
- msgid "WooCommerce checkout login"
763
- msgstr ""
764
-
765
- #: extensions/third-party/woocommerce.php:118
766
- msgid "Remove CAPTCHA from login form if on checkout page?"
767
- msgstr ""
768
-
769
- #: admin/templates/help/help.php:10
770
  msgid "Getting Started"
771
  msgstr ""
772
 
773
- #: admin/templates/help/help.php:14
774
  msgid "Configure the CAPTCHA & Get the API keys"
775
  msgstr ""
776
 
777
- #: admin/templates/help/help.php:15
778
  msgid "Configure the CAPTCHA and add specify the keys in the plugin"
779
  msgstr ""
780
 
781
- #: admin/templates/help/help.php:16
782
  msgid "Configure on which pages you want to add the CAPTCHA test"
783
  msgstr ""
784
 
785
- #: admin/templates/help/help.php:19
786
  msgid "It should only take you a few minutes to get started. Should you encounter any problems or require assistance, you can use any of the following options:"
787
  msgstr ""
788
 
789
- #: admin/templates/help/help.php:26
790
  msgid "Plugin Support"
791
  msgstr ""
792
 
793
- #: admin/templates/help/help.php:28
794
  msgid "You can post your question on our support forum or send us an email for 1 to 1 support. Email support is provided to both free and premium plugin users."
795
  msgstr ""
796
 
797
- #: admin/templates/help/help.php:30
798
  msgid "Free support forum"
799
  msgstr ""
800
 
801
- #: admin/templates/help/help.php:31
802
  msgid "Free email support"
803
  msgstr ""
804
 
805
- #: admin/templates/help/help.php:38
806
  msgid "Plugin Documentation"
807
  msgstr ""
808
 
809
- #: admin/templates/help/help.php:40
810
  msgid "For more technical information about the WP Activity Log plugin please visit the plugin’s knowledge base. Refer to the list of WordPress security events for a complete list of Events and IDs that the plugin uses to keep a log of all the changes in the WordPress activity log."
811
  msgstr ""
812
 
813
- #: admin/templates/help/help.php:42
814
  msgid "Knowledge Base"
815
  msgstr ""
816
 
817
- #: admin/templates/help/help.php:48
818
  msgid "Rate CAPTCHA 4WP"
819
  msgstr ""
820
 
821
- #: admin/templates/help/help.php:50
822
  msgid "We work really hard to deliver a plugin that enables you to add CAPTCHA checks and tests on your WordPress website to protect it against spam bots and other automated malicious attacks. It takes thousands of man-hours every year and an endless amount of dedication to research, develop and maintain the free edition of CAPTCHA 4WP. If you like what you see, and find CAPTCHA 4WP useful we ask you nothing more than to please rate our plugin. We appreciate every star!"
823
  msgstr ""
824
 
825
- #: admin/templates/help/help.php:52
826
  msgid "Rate plugin"
827
  msgstr ""
828
 
829
- #: admin/templates/help/index.php:7
830
  msgid "Help"
831
  msgstr ""
832
 
833
- #: admin/templates/help/index.php:8
834
  msgid "System Info"
835
  msgstr ""
836
 
837
- #: admin/templates/help/sidebar.php:2
838
  msgid "Other plugins developed by us:"
839
  msgstr ""
840
 
841
- #: admin/templates/help/sidebar.php:10
842
  msgid "Keep a log of users and under the hood site activity."
843
  msgstr ""
844
 
845
- #: admin/templates/help/sidebar.php:22, admin/templates/help/sidebar.php:45, admin/templates/help/sidebar.php:68
846
  msgid "LEARN MORE"
847
  msgstr ""
848
 
849
- #: admin/templates/help/sidebar.php:33
850
  msgid "Add an extra layer of security to your login pages with 2FA & require your users to use it."
851
  msgstr ""
852
 
853
- #: admin/templates/help/sidebar.php:56
854
  msgid "Automatically identify unauthorized file changes on your WordPress site."
855
  msgstr ""
856
 
857
- #: admin/templates/help/system-info.php:8
858
  msgid "System information"
859
  msgstr ""
1
+ # Copyright (C) 2022 advanced-nocaptcha-recaptcha
2
+ # This file is distributed under the same license as the advanced-nocaptcha-recaptcha package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: advanced-nocaptcha-recaptcha\n"
6
  "MIME-Version: 1.0\n"
7
  "Content-Type: text/plain; charset=UTF-8\n"
8
  "Content-Transfer-Encoding: 8bit\n"
16
  "X-Poedit-SourceCharset: UTF-8\n"
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
 
19
+ #: anr-captcha-class.php:96
20
  msgid "Please solve Captcha correctly"
21
  msgstr ""
22
 
23
+ #: anr-captcha-class.php:98
24
  msgid "ERROR"
25
  msgstr ""
26
 
27
+ #: functions.php:47
28
  msgid "<strong>ERROR</strong>: "
29
  msgstr ""
30
 
31
  #. translators: link to the settings page with text "Settings page"
32
+ #: admin/settings.php:98
33
+ msgid "Follow the 3 steps on this CAPTCHA configuration page to configure the integration with the Google reCAPTCHA service so you can use CAPTCHA checks on your website. use on your website. Once you configure the integration navigate to the %s page to configure where CAPTCHA should be added on your website, whitelist IP addresses and configure other settings"
34
  msgstr ""
35
 
36
+ #: admin/settings.php:99
37
+ msgid "Settings & placements"
38
  msgstr ""
39
 
40
+ #: admin/settings.php:111
41
  msgid "In this page you can configure where on your website you want to add the CAPTCHA check. You can also configure several other settings, such as whitelisting IP addresses, excluding logged in users from CAPTCHA checks and more."
42
  msgstr ""
43
 
44
  #. translators: expression "very restrictive" in bold
45
+ #: admin/settings.php:136
46
  msgid "Any value above 0.5 is %s."
47
  msgstr ""
48
 
49
+ #: admin/settings.php:137
50
  msgid "very restrictive"
51
  msgstr ""
52
 
53
+ #: admin/settings.php:139
54
  msgid "This means that you might end up locked out from your website. Therefore test this on a staging website website beforehand."
55
  msgstr ""
56
 
57
+ #: admin/settings.php:143
58
  msgid "You can add a CAPTCHA check to the below list of pages on WordPress."
59
  msgstr ""
60
 
61
+ #: admin/settings.php:144
62
  msgid "Use the setting below to select the language of the text used in the CAPTCHA text."
63
  msgstr ""
64
 
65
+ #. translators:link to upgrade page
66
+ #: admin/settings.php:149
67
  msgid "To add CAPTCHA checks to WooCommerce, Contact Form 7, BuddyPress and other forms created by third party plugins you need to %s"
68
  msgstr ""
69
 
70
+ #: admin/settings.php:150
71
  msgid "upgrade to Premium"
72
  msgstr ""
73
 
74
+ #: admin/settings.php:152
75
  msgid " In the Premium edition you can configure the plugin to automatically detect the language settings of the visitor's and use that language."
76
  msgstr ""
77
 
78
+ #: admin/settings.php:155
79
  msgid "Comments form"
80
  msgstr ""
81
 
82
+ #: admin/settings.php:158
83
  msgid "(Incompatible with Jetpack comments)"
84
  msgstr ""
85
 
86
+ #: admin/settings.php:167
87
+ msgid "STEP 1: Select the type of reCAPTCHA you want to use"
88
  msgstr ""
89
 
90
+ #: admin/settings.php:172
91
  msgid "reCAPTCHA version"
92
  msgstr ""
93
 
94
+ #: admin/settings.php:178
95
  msgid "Version 2 (Users have to check the \"I’m not a robot” checkbox)"
96
  msgstr ""
97
 
98
+ #: admin/settings.php:179
99
  msgid "Version 2 (No user interaction needed, however, if traffic is suspicious, users are asked to solve a CAPTCHA)"
100
  msgstr ""
101
 
102
+ #: admin/settings.php:180
103
  msgid "Version 3 (verify request with a score without user interaction)"
104
  msgstr ""
105
 
106
+ #: admin/settings.php:188
107
+ msgid "STEP 2: Specify the Site & Secret keys"
108
  msgstr ""
109
 
110
+ #. translators:link to help page
111
+ #: admin/settings.php:199
112
  msgid "To communicate with Google and utilize the reCAPTCHA service you need to get a Site Key and Secret Key. You can obtain these keys for free by registering for your Google reCAPTCHA. Refer to %s if you need help with the process."
113
  msgstr ""
114
 
115
+ #: admin/settings.php:200
116
  msgid "how to get the Google reCAPTCHA keys"
117
  msgstr ""
118
 
119
+ #: admin/settings.php:206
120
  msgid "Site Key"
121
  msgstr ""
122
 
123
+ #: admin/settings.php:211
124
  msgid "Secret Key"
125
  msgstr ""
126
 
127
+ #: admin/settings.php:220
128
+ msgid "STEP 3 (OPTIONAL): Fine-tune reCAPTCHA to your requirements"
129
+ msgstr ""
130
+
131
+ #: admin/settings.php:230
132
+ msgid "Use the below settings to configure and fine-tune CAPTCHA to your requirements. All the below settings are optional and with them you can configure different aspects of the CAPTCHA checks on your website, such as look and feel and also sensitivy."
133
  msgstr ""
134
 
135
+ #: admin/settings.php:236
136
  msgid "Captcha Score"
137
  msgstr ""
138
 
139
+ #: admin/settings.php:242
140
  msgid "Use this setting to specify sensitivity of the CAPTCHA check. The closer to 1 the more sensitive the CAPTCHA check will be, which also means more traffic will be marked as spam. This option is only available for reCAPTCHA v3."
141
  msgstr ""
142
 
143
+ #: admin/settings.php:245
144
  msgid "Load CAPTCHA v3 scripts on:"
145
  msgstr ""
146
 
147
+ #: admin/settings.php:251
148
  msgid "All Pages"
149
  msgstr ""
150
 
151
+ #: admin/settings.php:252
152
  msgid "Form Pages"
153
  msgstr ""
154
 
155
+ #: admin/settings.php:254
156
  msgid "By default CAPTCHA only loads on the pages where it is required, mainly forms. However, for V3 you can configure it to load on all pages so it has a better context of the traffic and works more efficiently. The CAPTCHA test will never interrupt users on non-form pages."
157
  msgstr ""
158
 
159
+ #: admin/settings.php:257
160
  msgid "CAPTCHA language"
161
  msgstr ""
162
 
163
+ #: admin/settings.php:263
164
  msgid "Select a language"
165
  msgstr ""
166
 
167
+ #: admin/settings.php:274
168
  msgid "Arabic"
169
  msgstr ""
170
 
171
+ #: admin/settings.php:275
172
  msgid "Bulgarian"
173
  msgstr ""
174
 
175
+ #: admin/settings.php:276
176
  msgid "Catalan"
177
  msgstr ""
178
 
179
+ #: admin/settings.php:277
180
  msgid "Chinese (Simplified)"
181
  msgstr ""
182
 
183
+ #: admin/settings.php:278
184
  msgid "Chinese (Traditional)"
185
  msgstr ""
186
 
187
+ #: admin/settings.php:279
188
  msgid "Croatian"
189
  msgstr ""
190
 
191
+ #: admin/settings.php:280
192
  msgid "Czech"
193
  msgstr ""
194
 
195
+ #: admin/settings.php:281
196
  msgid "Danish"
197
  msgstr ""
198
 
199
+ #: admin/settings.php:282
200
  msgid "Dutch"
201
  msgstr ""
202
 
203
+ #: admin/settings.php:283
204
  msgid "English (UK)"
205
  msgstr ""
206
 
207
+ #: admin/settings.php:284
208
  msgid "English (US)"
209
  msgstr ""
210
 
211
+ #: admin/settings.php:285
212
  msgid "Filipino"
213
  msgstr ""
214
 
215
+ #: admin/settings.php:286
216
  msgid "Finnish"
217
  msgstr ""
218
 
219
+ #: admin/settings.php:287
220
  msgid "French"
221
  msgstr ""
222
 
223
+ #: admin/settings.php:288
224
  msgid "French (Canadian)"
225
  msgstr ""
226
 
227
+ #: admin/settings.php:289
228
  msgid "German"
229
  msgstr ""
230
 
231
+ #: admin/settings.php:290
232
  msgid "German (Austria)"
233
  msgstr ""
234
 
235
+ #: admin/settings.php:291
236
  msgid "German (Switzerland)"
237
  msgstr ""
238
 
239
+ #: admin/settings.php:292
240
  msgid "Greek"
241
  msgstr ""
242
 
243
+ #: admin/settings.php:293
244
  msgid "Hebrew"
245
  msgstr ""
246
 
247
+ #: admin/settings.php:294
248
  msgid "Hindi"
249
  msgstr ""
250
 
251
+ #: admin/settings.php:295
252
  msgid "Hungarain"
253
  msgstr ""
254
 
255
+ #: admin/settings.php:296
256
  msgid "Indonesian"
257
  msgstr ""
258
 
259
+ #: admin/settings.php:297
260
  msgid "Italian"
261
  msgstr ""
262
 
263
+ #: admin/settings.php:298
264
  msgid "Japanese"
265
  msgstr ""
266
 
267
+ #: admin/settings.php:299
268
  msgid "Korean"
269
  msgstr ""
270
 
271
+ #: admin/settings.php:300
272
  msgid "Latvian"
273
  msgstr ""
274
 
275
+ #: admin/settings.php:301
276
  msgid "Lithuanian"
277
  msgstr ""
278
 
279
+ #: admin/settings.php:302
280
  msgid "Norwegian"
281
  msgstr ""
282
 
283
+ #: admin/settings.php:303
284
  msgid "Persian"
285
  msgstr ""
286
 
287
+ #: admin/settings.php:304
288
  msgid "Polish"
289
  msgstr ""
290
 
291
+ #: admin/settings.php:305
292
  msgid "Portuguese"
293
  msgstr ""
294
 
295
+ #: admin/settings.php:306
296
  msgid "Portuguese (Brazil)"
297
  msgstr ""
298
 
299
+ #: admin/settings.php:307
300
  msgid "Portuguese (Portugal)"
301
  msgstr ""
302
 
303
+ #: admin/settings.php:308
304
  msgid "Romanian"
305
  msgstr ""
306
 
307
+ #: admin/settings.php:309
308
  msgid "Russian"
309
  msgstr ""
310
 
311
+ #: admin/settings.php:310
312
  msgid "Serbian"
313
  msgstr ""
314
 
315
+ #: admin/settings.php:311
316
  msgid "Slovak"
317
  msgstr ""
318
 
319
+ #: admin/settings.php:312
320
  msgid "Slovenian"
321
  msgstr ""
322
 
323
+ #: admin/settings.php:313
324
  msgid "Spanish"
325
  msgstr ""
326
 
327
+ #: admin/settings.php:314
328
  msgid "Spanish (Latin America)"
329
  msgstr ""
330
 
331
+ #: admin/settings.php:315
332
  msgid "Swedish"
333
  msgstr ""
334
 
335
+ #: admin/settings.php:316
336
  msgid "Thai"
337
  msgstr ""
338
 
339
+ #: admin/settings.php:317
340
  msgid "Turkish"
341
  msgstr ""
342
 
343
+ #: admin/settings.php:318
344
  msgid "Ukrainian"
345
  msgstr ""
346
 
347
+ #: admin/settings.php:319
348
  msgid "Vietnamese"
349
  msgstr ""
350
 
351
+ #: admin/settings.php:323
352
  msgid "Error message"
353
  msgstr ""
354
 
355
+ #: admin/settings.php:325
356
  msgid "Please solve the CAPTCHA to proceed"
357
  msgstr ""
358
 
359
+ #: admin/settings.php:326
360
  msgid "Specify the message you want to show users who do not complete the CAPTCHA."
361
  msgstr ""
362
 
363
+ #: admin/settings.php:329
364
  msgid "Theme"
365
  msgstr ""
366
 
367
+ #: admin/settings.php:335
368
  msgid "Light"
369
  msgstr ""
370
 
371
+ #: admin/settings.php:336
372
  msgid "Dark"
373
  msgstr ""
374
 
375
+ #: admin/settings.php:340
376
  msgid "Size"
377
  msgstr ""
378
 
379
+ #: admin/settings.php:346
380
  msgid "Normal"
381
  msgstr ""
382
 
383
+ #: admin/settings.php:347
384
  msgid "Compact"
385
  msgstr ""
386
 
387
+ #: admin/settings.php:351
388
  msgid "Badge"
389
  msgstr ""
390
 
391
+ #: admin/settings.php:357, admin/settings.php:370
392
  msgid "Bottom Right"
393
  msgstr ""
394
 
395
+ #: admin/settings.php:358, admin/settings.php:371
396
  msgid "Bottom Left"
397
  msgstr ""
398
 
399
+ #: admin/settings.php:359
400
  msgid "Inline"
401
  msgstr ""
402
 
403
+ #: admin/settings.php:361
404
  msgid "Badge shows for invisible captcha"
405
  msgstr ""
406
 
407
+ #: admin/settings.php:364
408
+ msgid "Badge v3"
409
+ msgstr ""
410
+
411
+ #: admin/settings.php:373
412
+ msgid "Badge shows for invisible captcha v3"
413
+ msgstr ""
414
+
415
+ #: admin/settings.php:376
416
  msgid "reCAPTCHA domain"
417
  msgstr ""
418
 
419
+ #: admin/settings.php:386
420
  msgid "Use this setting to change the domain if Google is not accessible or blocked."
421
  msgstr ""
422
 
423
+ #: admin/settings.php:389
424
  msgid "Remove CSS"
425
  msgstr ""
426
 
427
+ #: admin/settings.php:393
428
  msgid "Remove this plugin's css from login page?"
429
  msgstr ""
430
 
431
+ #: admin/settings.php:394
432
  msgid "This css increase login page width to adjust with Captcha width."
433
  msgstr ""
434
 
435
+ #: admin/settings.php:403
436
  msgid "Select where on your website you want to add the CAPTCHA check"
437
  msgstr ""
438
 
439
+ #: admin/settings.php:416
440
  msgid "WordPress pages"
441
  msgstr ""
442
 
443
+ #: admin/settings.php:421
444
  msgid "Login form"
445
  msgstr ""
446
 
447
+ #: admin/settings.php:422
448
  msgid "Registration form"
449
  msgstr ""
450
 
451
+ #: admin/settings.php:423
452
  msgid "Reset password form"
453
  msgstr ""
454
 
455
+ #: admin/settings.php:424
456
  msgid "Lost password form"
457
  msgstr ""
458
 
459
+ #: admin/settings.php:438, admin/settings.php:961
460
  msgid "Upgrade to Premium"
461
  msgstr ""
462
 
463
+ #: admin/settings.php:439
464
  msgid "Find out more"
465
  msgstr ""
466
 
467
+ #: admin/settings.php:442
468
  msgid "Checkout and login pages on WooCommerce stores"
469
  msgstr ""
470
 
471
+ #: admin/settings.php:443
472
  msgid "Contact Form 7, MailChimp 4 WordPress forms"
473
  msgstr ""
474
 
475
+ #: admin/settings.php:444
476
  msgid "BuddyPress and bbPress"
477
  msgstr ""
478
 
479
+ #: admin/settings.php:445
480
  msgid "And others"
481
  msgstr ""
482
 
483
+ #. translators:field type
484
+ #: admin/settings.php:626
485
  msgid "No hook defined for %s"
486
  msgstr ""
487
 
488
+ #: admin/settings.php:726, admin/settings.php:727, admin/settings.php:727, admin/settings.php:747, admin/settings.php:748, admin/settings.php:748, admin/settings.php:830
489
  msgid "CAPTCHA Configuration"
490
  msgstr ""
491
 
492
+ #: admin/settings.php:726, admin/settings.php:747
493
  msgid "CAPTCHA 4WP"
494
  msgstr ""
495
 
496
+ #: admin/settings.php:728, admin/settings.php:749
497
  msgid "CAPTCHA 4WP Settings"
498
  msgstr ""
499
 
500
+ #: admin/settings.php:728, admin/settings.php:749
501
  msgid "Settings & Placements"
502
  msgstr ""
503
 
504
+ #: admin/settings.php:729, admin/settings.php:729, admin/settings.php:750, admin/settings.php:750
505
  msgid "Help & Contact Us"
506
  msgstr ""
507
 
508
+ #: admin/settings.php:732, admin/settings.php:732, admin/settings.php:753, admin/settings.php:753
509
  msgid "Premium Features ➤"
510
  msgstr ""
511
 
512
+ #: admin/settings.php:808
513
  msgid "Please supply a valid IP"
514
  msgstr ""
515
 
516
+ #: admin/settings.php:831
517
+ msgid "Configure it now"
518
+ msgstr ""
519
+
520
+ #: admin/settings.php:832
521
+ msgid "I'll configure it later"
522
+ msgstr ""
523
+
524
+ #: admin/settings.php:844
525
  msgid "CAPTCHA Placements"
526
  msgstr ""
527
 
528
+ #: admin/settings.php:842
529
+ msgid "CAPTCHA integration & configuration"
530
  msgstr ""
531
 
532
+ #: admin/settings.php:911
533
  msgid "The site key that you have entered is invalid. Please try again."
534
  msgstr ""
535
 
536
+ #: admin/settings.php:914
537
  msgid "The secret key that you have entered is invalid. Please try again."
538
  msgstr ""
539
 
540
+ #: admin/settings.php:917
541
  msgid "Captcha settings"
542
  msgstr ""
543
 
544
+ #: admin/settings.php:919
545
  msgid "Captcha configuration"
546
  msgstr ""
547
 
548
+ #: admin/settings.php:921
549
  msgid " updated"
550
  msgstr ""
551
 
552
+ #: admin/settings.php:943
553
  msgid "Upgrade to Premium for:"
554
  msgstr ""
555
 
556
+ #: admin/settings.php:948
557
  msgid "Use the language that your website viewers understand"
558
  msgstr ""
559
 
560
+ #: admin/settings.php:949
561
  msgid "Spam protection for your WooCommerce stores"
562
  msgstr ""
563
 
564
+ #: admin/settings.php:950
565
  msgid "Specify where to put the CAPTCHA test on WooCommerce checkout page"
566
  msgstr ""
567
 
568
+ #: admin/settings.php:951
569
  msgid "One-click Contact Form 7 forms spam protection"
570
  msgstr ""
571
 
572
+ #: admin/settings.php:952
573
  msgid "One-click spam protection for Mailchimp for WordPress forms"
574
  msgstr ""
575
 
576
+ #: admin/settings.php:953
577
  msgid "CAPTCHA tests & spam protection for BuddyPress, bbPress & other third party plugins"
578
  msgstr ""
579
 
580
+ #: admin/settings.php:954
581
  msgid "Add CAPTCHA to any type of form, even PHP forms"
582
  msgstr ""
583
 
584
+ #: admin/settings.php:955
585
  msgid "Boost login security, add CAPTCHA tests only failed logins"
586
  msgstr ""
587
 
588
+ #: admin/settings.php:956
589
  msgid "Remove CAPTCHA for logged in users"
590
  msgstr ""
591
 
592
+ #: admin/settings.php:957
593
  msgid "Remove CAPTCHA for specific IP addresses"
594
  msgstr ""
595
 
596
+ #: admin/settings.php:958
597
  msgid "Remove CAPTCHA from specific URLs"
598
  msgstr ""
599
 
600
+ #: admin/settings.php:959
601
  msgid "No Ads!"
602
  msgstr ""
603
 
604
+ #: admin/settings.php:961
605
  msgid "Get a FREE 7-day trial"
606
  msgstr ""
607
 
608
+ #: admin/settings.php:1017
609
  msgid "Settings"
610
  msgstr ""
611
 
612
+ #: admin/templates/help/help.php:20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
613
  msgid "Getting Started"
614
  msgstr ""
615
 
616
+ #: admin/templates/help/help.php:24
617
  msgid "Configure the CAPTCHA & Get the API keys"
618
  msgstr ""
619
 
620
+ #: admin/templates/help/help.php:25
621
  msgid "Configure the CAPTCHA and add specify the keys in the plugin"
622
  msgstr ""
623
 
624
+ #: admin/templates/help/help.php:26
625
  msgid "Configure on which pages you want to add the CAPTCHA test"
626
  msgstr ""
627
 
628
+ #: admin/templates/help/help.php:29
629
  msgid "It should only take you a few minutes to get started. Should you encounter any problems or require assistance, you can use any of the following options:"
630
  msgstr ""
631
 
632
+ #: admin/templates/help/help.php:36
633
  msgid "Plugin Support"
634
  msgstr ""
635
 
636
+ #: admin/templates/help/help.php:38
637
  msgid "You can post your question on our support forum or send us an email for 1 to 1 support. Email support is provided to both free and premium plugin users."
638
  msgstr ""
639
 
640
+ #: admin/templates/help/help.php:40
641
  msgid "Free support forum"
642
  msgstr ""
643
 
644
+ #: admin/templates/help/help.php:41
645
  msgid "Free email support"
646
  msgstr ""
647
 
648
+ #: admin/templates/help/help.php:48
649
  msgid "Plugin Documentation"
650
  msgstr ""
651
 
652
+ #: admin/templates/help/help.php:50
653
  msgid "For more technical information about the WP Activity Log plugin please visit the plugin’s knowledge base. Refer to the list of WordPress security events for a complete list of Events and IDs that the plugin uses to keep a log of all the changes in the WordPress activity log."
654
  msgstr ""
655
 
656
+ #: admin/templates/help/help.php:52
657
  msgid "Knowledge Base"
658
  msgstr ""
659
 
660
+ #: admin/templates/help/help.php:58
661
  msgid "Rate CAPTCHA 4WP"
662
  msgstr ""
663
 
664
+ #: admin/templates/help/help.php:60
665
  msgid "We work really hard to deliver a plugin that enables you to add CAPTCHA checks and tests on your WordPress website to protect it against spam bots and other automated malicious attacks. It takes thousands of man-hours every year and an endless amount of dedication to research, develop and maintain the free edition of CAPTCHA 4WP. If you like what you see, and find CAPTCHA 4WP useful we ask you nothing more than to please rate our plugin. We appreciate every star!"
666
  msgstr ""
667
 
668
+ #: admin/templates/help/help.php:62
669
  msgid "Rate plugin"
670
  msgstr ""
671
 
672
+ #: admin/templates/help/index.php:19
673
  msgid "Help"
674
  msgstr ""
675
 
676
+ #: admin/templates/help/index.php:20
677
  msgid "System Info"
678
  msgstr ""
679
 
680
+ #: admin/templates/help/sidebar.php:14
681
  msgid "Other plugins developed by us:"
682
  msgstr ""
683
 
684
+ #: admin/templates/help/sidebar.php:22
685
  msgid "Keep a log of users and under the hood site activity."
686
  msgstr ""
687
 
688
+ #: admin/templates/help/sidebar.php:38, admin/templates/help/sidebar.php:65, admin/templates/help/sidebar.php:92
689
  msgid "LEARN MORE"
690
  msgstr ""
691
 
692
+ #: admin/templates/help/sidebar.php:49
693
  msgid "Add an extra layer of security to your login pages with 2FA & require your users to use it."
694
  msgstr ""
695
 
696
+ #: admin/templates/help/sidebar.php:76
697
  msgid "Automatically identify unauthorized file changes on your WordPress site."
698
  msgstr ""
699
 
700
+ #: admin/templates/help/system-info.php:19
701
  msgid "System information"
702
  msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
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
9
  License URI: http://www.gnu.org/licenses/gpl.html
@@ -14,11 +14,13 @@ Stop spam bots, fake accounts, and fake orders and allow prospects and customers
14
 
15
  <strong>THE MOST POWERFUL & EASY TO USE CAPTCHA SOLUTION FOR WORDPRESS WEBSITES</strong><br />
16
 
17
- Add CAPTCHA to any form on your WordPress website. Protect the WordPress comments, login, lost password and user registration forms with CAPTCHA. With CAPTCHA 4WP you can also add CAPTCHA to forms created with Contact Form 7, MailChimp for WordPress, BuddyPress, WooCommerce, bbPress and many others.
18
 
19
- CAPTCHA 4WP is very easy to us, allowing you to implement CAPTCHA to any form easily, including your WooCommerce checkout page within just minutes. The plugin is trusted by more than 200,000 administrators to protect their websites from spam, fake accounts, & fake orders!
20
 
21
- > With the free edition you can add CAPTCHA to the built-in forms in WordPress, such as the login and comments form. To add CAPTCHA to forms by third party plugins, such as WooCommerce, Contact Form 7 and BuddyPress <strong>[upgrade to CAPTCHA 4WP Premium](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/pricing/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=C4WP&utm_content=plugin+repos+description)</strong>.<strong>
 
 
22
  >
23
 
24
  #### Maintained & Supported by WP White Security
@@ -29,20 +31,20 @@ WP White Security is a European development company that builds high-quality Wor
29
 
30
  * WordPress Login, user registration and comment form
31
  * WordPress lost password and reset password pages
32
- * WooCommerce checkout & registration form (Premium)
33
- * WooCommerce login, password reset / lost password pages (Premium)
34
  * BuddyPress user registration, comments and group forms (Premium)
35
  * bbPress(New topic, reply to topic & registration) (Premium)
36
- * Contact & other types of forms created with Contact Form 7, MailChimp for WordPress and other third party plugins (Premium).
37
 
38
  ### Additional features
39
 
40
- * Select from different types of CAPTCHA (v2 I'm not robot checkbox, v2 invisible or v3)
41
  * Set CAPTCHA passmark score
42
  * Configure the plugin to automatically detect the visitor's language setting and show CAPTCHA in that language
43
  * Configure the CAPTCHA properties, such as theme, size, badge location & more
44
- * White-list logged in users, IP address and URLs
45
- * Add CAPTCHA to any type of form, including PHP forms
46
  * Show CAPTCHA on login page if there are failed logins
47
 
48
  Refer to the <strong>[CAPTCHA plugin benefits and features](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/features-benefits/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=all+plugins&utm_content=plugin+repos+description)</strong> for a complete list of all the features you can take advantage of to protect your website and e-commerce store from spam, automated spam bots, fake registrations, and fake orders!
@@ -108,12 +110,39 @@ Simply select the WooCommerce page you want to add CAPTCHA to in the plugin's CA
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  = 7.0.6.1 (20220315) =
112
 
113
  * **Improvements**
114
  * Ensure migration script to new options table is run where needed.
115
- * Ensure correct default language is set during update in free edition.
116
- * Ensure verification does not hinder hook requests where no CAPTCHA is posted.
117
 
118
  = 7.0.6 (20220304) =
119
 
@@ -123,14 +152,30 @@ Release notes: [CAPTCHA 4WP 7.0.6 Free Edition](https://www.wpwhitesecurity.com/
123
  * CAPTCHA on forms creatd with third party plugins available through the Premium. [Get a free 7-day trial](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/plugin-trial/).
124
 
125
  * **Improvements**
126
- * Ensure plugin does not attempt to verify if submission contains no captcha field.
 
 
 
 
127
  * Overall admin UI improvements, including responsive styling.
 
 
 
 
 
128
 
129
  * **Bug fixes**
130
  * Updated v2 invisible form submission JS for wider compatibility.
 
131
  * Fix logic to ensure "login_captcha_filter" return accurate response.
 
 
 
132
  * Fixed error which caused "please solve CAPTCHA" message to appear on the "lost password" form.
133
  * Fixed redirection during installation on a network to ensure plugin takes user to correct admin area.
 
 
 
134
  * Fix JS bug which could cause comments to not POST with v2 invisible captcha.
135
 
136
  = 7.0.3 (20220121) =
@@ -139,7 +184,9 @@ Release notes: [CAPTCHA 4WP 7.0.6 Free Edition](https://www.wpwhitesecurity.com/
139
  * Improved logic to dermine if a login verification should be "skipped" dependant on POSTed values.
140
 
141
  * **Bug fixes**
 
142
  * Fixed: Fixed issue which could cause login CAPTCHA's to not display.
 
143
 
144
  = 7.0.2 (20220119) =
145
 
@@ -154,12 +201,15 @@ Release notes: [CAPTCHA 4WP 7.0.6 Free Edition](https://www.wpwhitesecurity.com/
154
 
155
  = 7.0.0 (20220119) =
156
 
157
- Release notes: [Plugin reload: Advanced noCaptcha & invisible Captcha is now CAPTCHA 4WP](https://www.wpwhitesecurity.com/advanced-nocaptcha-recaptcha-renamed-captcha-4wp)
158
 
159
  * **New features**
160
 
161
  * Plugin renamed to CAPTCHA 4WP.
162
- * New UI with improved UX.
 
 
 
163
  * Plugin can now be activated at multisite network level or at individual child-sites level.
164
 
165
  * **Improvements**
@@ -168,11 +218,11 @@ Release notes: [Plugin reload: Advanced noCaptcha & invisible Captcha is now CAP
168
  * Updated a number of translatable strings.
169
  * Added a specific upgrade script to handle upgrades from pre v7.0.
170
  * Fixed support for PHP v7.2.
 
 
171
  * Added compatibility support for Wordfence 2FA.
172
  * Ensure failed logins filter only runs when apppropriate.
173
  * Added ability to detect and ignore REST API requests.
174
- * Removed the Freemius SDK.
175
- * Added a dedicated help and support area with downloadable "system info" for easier troubleshooting (in case support need it).
176
  * Failed login data is now stored in its own table with configurable pruning.
177
  * Seperated WooCommerce form logic to allow registration and login forms to be enabled/disabled independantally from the WordPress built-in forms.
178
  * Third party plugins extensions are now handled via seperate classes for modularity.
@@ -180,7 +230,12 @@ Release notes: [Plugin reload: Advanced noCaptcha & invisible Captcha is now CAP
180
  * Removed obsolete "NoJS" setting.
181
  * Improved v2 Checkbox field positioning on WP login page.
182
  * Added support for Buddypress comments and activity areas.
183
-
 
 
 
 
 
184
  = 6.1.7 (20211006) =
185
 
186
  * IMPROVEMENT: Updated all the FAQs and help text links to point to the new documentation pages.
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.1
6
+ Stable tag: 7.1.0
7
  Requires PHP: 7.0
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
14
 
15
  <strong>THE MOST POWERFUL & EASY TO USE CAPTCHA SOLUTION FOR WORDPRESS WEBSITES</strong><br />
16
 
17
+ Add CAPTCHA to forms on your WordPress website. Protect the WordPress website and e-commerce store from spam comments, automated login attacks, fake registrations and fake orders with CAPTCHA.
18
 
19
+ CAPTCHA 4WP is very easy to us, allowing you to implement CAPTCHA to any built-in WordPress form easily. With the Premium edition you can also add CAPTCHA checks to WooCommerce checkout pages and other forms within just minutes.
20
 
21
+ The plugin is trusted by more than 200,000 administrators to protect their websites from spam, fake accounts, & fake orders!
22
+
23
+ > <strong>With the free edition you can add CAPTCHA to the built-in WordPress forms; the login page, registration form, comments, reset and lost password forms. To add CAPTCHA to forms created with third party plugins such as WooCommerce, Contact Form 7, Gravity Forms, and BuddyPress <strong>[upgrade to CAPTCHA 4WP Premium](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/pricing/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=C4WP&utm_content=plugin+repos+description).</strong>
24
  >
25
 
26
  #### Maintained & Supported by WP White Security
31
 
32
  * WordPress Login, user registration and comment form
33
  * WordPress lost password and reset password pages
34
+ * WooCommerce checkout & registration forms (Premium)
35
+ * WooCommerce login, password reset & lost password pages (Premium)
36
  * BuddyPress user registration, comments and group forms (Premium)
37
  * bbPress(New topic, reply to topic & registration) (Premium)
38
+ * Contact & other types of forms created with Contact Form 7, Gravity Forms, WPForms, MailChimp for WordPress and other third party plugins (Premium).
39
 
40
  ### Additional features
41
 
42
+ * Select from different types of CAPTCHA (v2 I'm not robot checkbox, v2 invisible or v3 invisible)
43
  * Set CAPTCHA passmark score
44
  * Configure the plugin to automatically detect the visitor's language setting and show CAPTCHA in that language
45
  * Configure the CAPTCHA properties, such as theme, size, badge location & more
46
+ * White-list logged in users, IP address and URLs (Premium)
47
+ * Add CAPTCHA to any type of form, including PHP forms (Premium)
48
  * Show CAPTCHA on login page if there are failed logins
49
 
50
  Refer to the <strong>[CAPTCHA plugin benefits and features](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/features-benefits/?utm_source=wordpress.org&utm_medium=referral&utm_campaign=all+plugins&utm_content=plugin+repos+description)</strong> for a complete list of all the features you can take advantage of to protect your website and e-commerce store from spam, automated spam bots, fake registrations, and fake orders!
110
 
111
  == Changelog ==
112
 
113
+ = 7.1.0 (20220629) =
114
+
115
+ Release notes: [Support for WPForms & Gravity Forms plugins](https://www.wpwhitesecurity.com/captcha-4wp-7-1-0/)
116
+
117
+ * **New features**
118
+ * Added support for Gravity Forms.
119
+ * Added support for WPForms.
120
+ * New setting to show the CAPTCHA logo on the lower left rather than the default, right.
121
+
122
+ * **Security fix**
123
+ * Local File Inclusion reported by ZhongFu Su (JrXnm) of WuHan University.
124
+
125
+ * **Improvements**
126
+ * Improved JS handling within the WooCommerce checkout to ensure a more robust field during checkout changes.
127
+ * Improved settings inline help text.
128
+ * The action ‘c4wp_captcha_form_field’ is now exclusive to premium editon.
129
+ * Ensure applicable settings only accessible based on the current license.
130
+ * Support for [c4wp-captcha] shortcode is now exclusive to the premium edition.
131
+ * Streamlined plugin’s internal build process.
132
+ * Improved Coding Standards throughout plugin.
133
+
134
+ * **Bug fixes**
135
+ * Fixed logic issue which could cause an error during new user registration.
136
+ * Ensure only specific internal files can be loaded within the help area.
137
+ * Ensure applicable functions return first argument where needed.
138
+ * Allow for variants in variables caused by server operating system.
139
+
140
  = 7.0.6.1 (20220315) =
141
 
142
  * **Improvements**
143
  * Ensure migration script to new options table is run where needed.
144
+ * Ensure correct default language is set during update in free edition.
145
+ * Ensure verification does not hinder hook requests where no CAPTCHA is posted.
146
 
147
  = 7.0.6 (20220304) =
148
 
152
  * CAPTCHA on forms creatd with third party plugins available through the Premium. [Get a free 7-day trial](https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/plugin-trial/).
153
 
154
  * **Improvements**
155
+ * Update logic to ensure whitelisted IP addresses action only runs when needed.
156
+ * Ensure plugin does not attempt to verify if submission contains to captcha field.
157
+ * Updated Contact Form 7 "embeddable" form tag to include response field.
158
+ * Updated branding within the Freemius admin areas.
159
+ * Improved the CAPTCHA placement within the WooCommerce "password reset" page.
160
  * Overall admin UI improvements, including responsive styling.
161
+ * Improved BuddyPress JS support for better compatibility.
162
+ * Improved overall JS to ensure functions are defined when used.
163
+ * Improved WooCommerce extension logic to ensure code only runs when functions are available.
164
+ * Improved inline help text, including warning for users of JetPack comments regarding incompatibilty.
165
+ * Improved logic within whitelisting to ensure accurate results.
166
 
167
  * **Bug fixes**
168
  * Updated v2 invisible form submission JS for wider compatibility.
169
+ * Updated features logic to ensure extensions are always loaded based on license.
170
  * Fix logic to ensure "login_captcha_filter" return accurate response.
171
+ * Reinstated original "anr_nocaptcha" Contact Form 7 form tag (backward compatability).
172
+ * Corrected Mailchimp 4 WP form tag from [c4wp_captcha] to [c4wp-captcha].
173
+ * Ensure CAPTCHA language has the correct default in new installations.
174
  * Fixed error which caused "please solve CAPTCHA" message to appear on the "lost password" form.
175
  * Fixed redirection during installation on a network to ensure plugin takes user to correct admin area.
176
+ * Fixed login within WooCommerce checkout which could cause CAPTCHA to always be hidden for logged in users.
177
+ * Corrected typo within BBPress extension.
178
+ * Ensure previous anr_nocaptcha Contact Form 7 code is validated.
179
  * Fix JS bug which could cause comments to not POST with v2 invisible captcha.
180
 
181
  = 7.0.3 (20220121) =
184
  * Improved logic to dermine if a login verification should be "skipped" dependant on POSTed values.
185
 
186
  * **Bug fixes**
187
+ * Fixed: Re-implemented support for original CF7 form tag.
188
  * Fixed: Fixed issue which could cause login CAPTCHA's to not display.
189
+ * Fixed: Fixed issue related to null variable in CF7 extension.
190
 
191
  = 7.0.2 (20220119) =
192
 
201
 
202
  = 7.0.0 (20220119) =
203
 
204
+ Release notes: [Plugin reload: Advanced noCaptcha & invisible Captcha is now CAPTCHA 4WP](https://www.wpwhitesecurity.com/advanced-nocaptcha-recaptcha-renamed-captcha-4wp]
205
 
206
  * **New features**
207
 
208
  * Plugin renamed to CAPTCHA 4WP.
209
+ * New UI with improved UX.
210
+ * A setting to choose where to place the CAPTCHA check on the WooCommerce checkout page.
211
+ * Added the option to exclude CAPTCHA from specific URLs.
212
+ * Auto detect visitor language and auto-configure the CAPTCHA test language to match the visitor's language setting.
213
  * Plugin can now be activated at multisite network level or at individual child-sites level.
214
 
215
  * **Improvements**
218
  * Updated a number of translatable strings.
219
  * Added a specific upgrade script to handle upgrades from pre v7.0.
220
  * Fixed support for PHP v7.2.
221
+ * Removed the Freemius SDK from free edition.
222
+ * Added a dedicated help and support area with downloadable "system info" for easier troubleshooting (in case support need it).
223
  * Added compatibility support for Wordfence 2FA.
224
  * Ensure failed logins filter only runs when apppropriate.
225
  * Added ability to detect and ignore REST API requests.
 
 
226
  * Failed login data is now stored in its own table with configurable pruning.
227
  * Seperated WooCommerce form logic to allow registration and login forms to be enabled/disabled independantally from the WordPress built-in forms.
228
  * Third party plugins extensions are now handled via seperate classes for modularity.
230
  * Removed obsolete "NoJS" setting.
231
  * Improved v2 Checkbox field positioning on WP login page.
232
  * Added support for Buddypress comments and activity areas.
233
+
234
+ * **Bug fixes**
235
+ * Fixed: plugin "blocking" admin request to send a "reset password" email via a user's profile page.
236
+ * Fixed: CAPTCHA not appearing on WordPress "lost password" form.
237
+ * Removed obsolete code related to "FEP" forms.
238
+
239
  = 6.1.7 (20211006) =
240
 
241
  * IMPROVEMENT: Updated all the FAQs and help text links to point to the new documentation pages.