diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5d8dffe..0000000 --- a/.gitignore +++ /dev/null @@ -1,96 +0,0 @@ -# Netbeans -**/nbproject/* - -# Windows image file caches -Thumbs.db -ehthumbs.db - -# Folder config file -Desktop.ini - -# Packages # -############ -*.7z -*.dmg -*.gz -*.bz2 -*.iso -*.jar -*.rar -*.tar -*.zip -*.tgz -*.map - -# Logs and databases # -###################### -*.log -*.sql - -# OS generated files # -###################### -**.DS_Store* -ehthumbs.db -Icon? -Thumbs.db -._* - -# Vim generated files # -###################### -*.un~ - -# SASS # -########## -**/.sass-cache -**/.sass-cache/* -**/.map - -# Composer # -########## -!resources/js/vendor/ -wpcs/ - -# Bower # -########## -resources/bower_components/* - -# Codekit # -########## -/codekit-config.json -*.codekit -**.codekit-cache/* - -# NPM # -########## -node_modules - -# Compiled Files and Build Dirs # -########## -/README.html -/build/ - -# PhpStrom Project Files # -.idea/ -library/vendors/composer -resources/img/.DS_Store -resources/sass/HTML -resources/sass/Rails -HTML -Rails - -# Sublime Project Files # -########## -# workspace files are user-specific -*.sublime-workspace - -# project files should be checked into the repository, unless a significant -# proportion of contributors will probably not be using SublimeText -*.sublime-project - - -/vendor/ -/vendor-bin/ -/third-party/ - -/php-scoper/vendor -.vscode/launch.json \ No newline at end of file diff --git a/admin/index.php b/admin/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/admin/index.php @@ -0,0 +1,4 @@ +' . esc_html__( 'Important:', 'advanced-nocaptcha-recaptcha' ) . '', + esc_html__( 'To reconfigure the failover now, once you are redirected to the plugin\'s configuration page click', 'advanced-nocaptcha-recaptcha' ), + '' . esc_html__( 'Reconfigure reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ) . '', + esc_html__( 'and click', 'advanced-nocaptcha-recaptcha' ), + '' . esc_html__( 'Next', 'advanced-nocaptcha-recaptcha' ) . '', + esc_html__( 'in the wizard until you get to the failover settings.', 'advanced-nocaptcha-recaptcha' ), + ); + if ( in_array( 'administrator', (array) $user->roles ) ) { + echo '
+

' . esc_html__( 'In the latest version of CAPTCHA 4WP you can configure a failover action for your CAPTCHA check. This means that you can configure the plugin to show a CAPTCHA checkbox or redirect the user when the current v3 reCAPTCHA check fails. Use the buttons below to configure the failover or close this admin notice.', 'advanced-nocaptcha-recaptcha' ) . '

+

' . $help_text . '

+ ' . esc_html__( 'Configure failover action now', 'advanced-nocaptcha-recaptcha' ) . ' ' . esc_html__( "I'll configure it later", 'advanced-nocaptcha-recaptcha' ) . ' +
'; + } + } } /** @@ -57,7 +101,7 @@ public function actions_filters() { */ public function admin_enqueue_scripts() { wp_register_script( 'c4wp-admin', C4WP_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-ui-dialog' ), C4WP_PLUGIN_VERSION, false ); - wp_enqueue_style ( 'wp-jquery-ui-dialog'); + wp_enqueue_style( 'wp-jquery-ui-dialog' ); } /** @@ -69,14 +113,31 @@ public function admin_init() { register_setting( 'c4wp_admin_options', 'c4wp_admin_options', array( $this, 'options_sanitize' ) ); $current_tab = 'c4wp-admin-captcha'; - if ( ! empty( $_GET['page'] ) ) { - $current_tab = wp_unslash( $_GET['page'] ); + if ( ! empty( $_GET['page'] ) ) { // phpcs:ignore + $current_tab = sanitize_text_field( wp_unslash( $_GET['page'] ) ); // phpcs:ignore } foreach ( $this->get_sections( $current_tab ) as $section_id => $section ) { add_settings_section( $section_id, $section['section_title'], ! empty( $section['section_callback'] ) ? $section['section_callback'] : null, 'c4wp_admin_options' ); } + $skip = array( + 'captcha_version_title', + 'captcha_version', + 'site_key_title', + 'site_key_subtitle', + 'site_key', + 'secret_key', + 'key_validation', + 'failure_action', + 'failure_redirect', + 'failure_v2_site_key', + 'failure_v2_secret_key', + 'failure_key_validation', + ); foreach ( $this->get_fields() as $field_id => $field ) { + if ( in_array( $field_id, $skip ) ) { + continue; + } add_settings_field( $field['id'], $field['label'], ! empty( $field['callback'] ) ? $field['callback'] : array( $this, 'callback' ), 'c4wp_admin_options', $field['section_id'], $field ); } } @@ -93,13 +154,15 @@ public function get_sections( $section_we_want = 'c4wp-admin-captcha' ) { 'section_title' => '', 'section_callback' => function() { $settings_url = function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ? network_admin_url( 'admin.php?page=c4wp-admin-settings' ) : admin_url( 'admin.php?page=c4wp-admin-settings' ); + echo '
' . wp_kses( $this->wizard_markup(), c4wp_allowed_kses_args() ) . '
'; echo ''; printf( /* translators: link to the settings page with text "Settings page" */ - 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' ), + esc_html__( 'Use the CAPTCHA configuration wizard to integrate the Google reCAPTCHA service so you can add CAPTCHA checks 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' ), '' . esc_html__( 'Settings & placements', 'advanced-nocaptcha-recaptcha' ) . '' ); echo ''; + echo wp_kses( $this->wizard_launcher_area(), c4wp_allowed_kses_args() ); }, ), ); @@ -165,15 +228,15 @@ public function get_fields() { 'type' => 'html', 'label' => sprintf( '%1$s', - esc_html__( 'STEP 1: Select the type of reCAPTCHA you want to use', 'advanced-nocaptcha-recaptcha' ) + esc_html__( 'Step 1: Select the type of reCAPTCHA you want to use on your website.', 'advanced-nocaptcha-recaptcha' ) ), - 'class' => 'wrap-around-content', + 'class' => 'wrap-around-content c4wp-wizard-captcha-version', ), 'captcha_version' => array( 'label' => esc_html__( 'reCAPTCHA version', 'advanced-nocaptcha-recaptcha' ), 'section_id' => 'google_keys', 'type' => 'radio', - 'class' => 'regular', + 'class' => 'regular c4wp-wizard-captcha-version', 'std' => 'v2_checkbox', 'options' => array( 'v2_checkbox' => esc_html__( 'Version 2 (Users have to check the "I’m not a robot” checkbox)', 'advanced-nocaptcha-recaptcha' ), @@ -186,9 +249,9 @@ public function get_fields() { 'type' => 'html', 'label' => sprintf( '%1$s', - esc_html__( 'STEP 2: Specify the Site & Secret keys', 'advanced-nocaptcha-recaptcha' ) + esc_html__( 'Step 2: Specify the Site & Secret keys', 'advanced-nocaptcha-recaptcha' ) ), - 'class' => 'wrap-around-content', + 'class' => 'wrap-around-content c4wp-wizard-site-keys', ), 'site_key_subtitle' => array( 'section_id' => 'google_keys', @@ -197,21 +260,30 @@ public function get_fields() { '

%1$s

', sprintf( /* translators:link to help page */ - 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' ), + esc_html__( 'To utilize the Google reCAPTCHA service on your website you need to get a Site and Secret key. If you do not have these keys yet, you can option them for free by registering to the Google reCAPTCHA service. Refer to the document %s for a step by step explanation of how to get these keys.', 'advanced-nocaptcha-recaptcha' ), '' . esc_html__( 'how to get the Google reCAPTCHA keys', 'advanced-nocaptcha-recaptcha' ) . '' ) ), - 'class' => 'wrap-around-content', + 'class' => 'wrap-around-content c4wp-wizard-site-keys', ), 'site_key' => array( 'label' => esc_html__( 'Site Key', 'advanced-nocaptcha-recaptcha' ), 'section_id' => 'google_keys', 'required' => true, + 'class' => 'c4wp-wizard-site-keys', ), 'secret_key' => array( 'label' => esc_html__( 'Secret Key', 'advanced-nocaptcha-recaptcha' ), 'section_id' => 'google_keys', 'required' => true, + 'class' => 'c4wp-wizard-site-keys', + ), + 'key_validation' => array( + 'section_id' => 'google_keys', + 'type' => 'html', + 'label' => esc_html__( 'Key Validation', 'advanced-nocaptcha-recaptcha' ), + 'std' => '

' . esc_html__( 'Once you enter the correct Site and Secret keys above, the CAPTCHA method you want to use on your website will appear below. If the keys are incorrect you will instead see an error. If you see an error make sure the CAPTCHA version, website domain and both keys match.', 'advanced-nocaptcha-recaptcha' ) . '

', + 'class' => 'c4wp-wizard-site-keys', ), 'key_validation' => array( 'section_id' => 'google_keys', @@ -225,11 +297,11 @@ public function get_fields() { 'type' => 'html', 'label' => sprintf( '%1$s', - esc_html__( 'STEP 3 (OPTIONAL): Fine-tune reCAPTCHA to your requirements', 'advanced-nocaptcha-recaptcha' ) + esc_html__( 'Optional settings: Fine-tune reCAPTCHA to your requirements', 'advanced-nocaptcha-recaptcha' ) ), - 'class' => 'wrap-around-content', - ), - 'score_subtitle' => array( + 'class' => 'wrap-around-content c4wp-wizard-additional-settings', + + 'score_subtitle' => array( 'section_id' => 'google_keys', 'type' => 'html', 'label' => sprintf( @@ -238,7 +310,7 @@ public function get_fields() { 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' ) ) ), - 'class' => 'wrap-around-content', + 'class' => 'wrap-around-content c4wp-wizard-additional-setting', ), 'score' => array( 'label' => esc_html__( 'Captcha Score', 'advanced-nocaptcha-recaptcha' ), @@ -368,7 +440,7 @@ public function get_fields() { ), 'desc' => esc_html__( 'Badge shows for invisible captcha', 'advanced-nocaptcha-recaptcha' ), ), - 'badge_v3' => array( + 'badge_v3' => array( 'label' => esc_html__( 'Badge', 'advanced-nocaptcha-recaptcha' ), 'section_id' => 'google_keys', 'type' => 'select', @@ -402,6 +474,44 @@ public function get_fields() { 'desc' => __( 'This css increase login page width to adjust with Captcha width.', 'advanced-nocaptcha-recaptcha' ), ), + 'failure_action' => array( + 'label' => esc_html__( 'v3 failover action:', 'advanced-nocaptcha-recaptcha' ), + 'section_id' => 'google_keys', + 'type' => 'select', + 'class' => 'regular', + 'std' => 'nothing', + 'options' => array( + 'v2_checkbox' => esc_html__( 'Show a v2 CAPTCHA checkbox', 'advanced-nocaptcha-recaptcha' ), + 'redirect' => esc_html__( 'Redirect the website visitor to a URL', 'advanced-nocaptcha-recaptcha' ), + 'nothing' => esc_html__( 'Take no action', 'advanced-nocaptcha-recaptcha' ), + ), + ), + 'failure_redirect' => array( + 'label' => esc_html__( 'Redirect URL', 'advanced-nocaptcha-recaptcha' ), + 'section_id' => 'google_keys', + 'required' => false, + 'class' => 'c4wp-wizard-site-keys toggleable c4wp-show-field-for-redirect', + ), + 'failure_v2_site_key' => array( + 'label' => esc_html__( 'v2 Site key:', 'advanced-nocaptcha-recaptcha' ), + 'section_id' => 'google_keys', + 'required' => false, + 'class' => 'c4wp-wizard-site-keys toggleable c4wp-show-field-for-v2_checkbox', + ), + 'failure_v2_secret_key' => array( + 'label' => esc_html__( 'v2 Secret key:', 'advanced-nocaptcha-recaptcha' ), + 'section_id' => 'google_keys', + 'required' => false, + 'class' => 'c4wp-wizard-site-keys toggleable c4wp-show-field-for-v2_checkbox', + ), + 'failure_key_validation' => array( + 'section_id' => 'google_keys', + 'type' => 'html', + 'label' => esc_html__( 'Key Validation', 'advanced-nocaptcha-recaptcha' ), + 'std' => '

' . esc_html__( 'Once you enter the correct Site and Secret keys above, the CAPTCHA method you want to use on your website will appear below. If the keys are incorrect you will instead see an error. If you see an error make sure the CAPTCHA version, website domain and both keys match.', 'advanced-nocaptcha-recaptcha' ) . '

', + 'class' => 'c4wp-wizard-site-keys toggleable c4wp-show-field-for-v2_checkbox', + ), + // Settings. 'enabled_forms_title' => array( 'section_id' => 'forms', @@ -437,20 +547,22 @@ public function get_fields() { if ( ! c4wp_is_premium_version() ) : $features_url = function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ? network_admin_url( 'admin.php?page=c4wp-admin-upgrade' ) : admin_url( 'admin.php?page=c4wp-admin-upgrade' ); + $logos_url = C4WP_PLUGIN_URL . 'assets/img/third-party-logos.png'; $premium_area['premium_title'] = array( 'section_id' => 'forms', 'type' => 'html', 'class' => 'premium-title-wrapper h-140', 'label' => sprintf( - 'Upgrade to Premium to:

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 out of the box support for forms on third party plugins such as:

%1$s %2$s
', + 'Upgrade to Premium to:

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 out of the box support for forms on third party plugins such as:

%1$s %2$s
', esc_html__( 'Upgrade to Premium', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'Find out more', 'advanced-nocaptcha-recaptcha' ), esc_url( 'https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/pricing/?utm_source=plugin&utm_medium=referral&utm_campaign=C4WP&utm_content=plugin+premium+button' ), esc_url( $features_url ), esc_html__( 'Checkout and login pages on WooCommerce stores', 'advanced-nocaptcha-recaptcha' ), - esc_html__( 'Contact Form 7, MailChimp 4 WordPress forms', 'advanced-nocaptcha-recaptcha' ), + esc_html__( 'Contact Form 7, Gravity Forms, WPForms, MailChimp 4 WordPress forms', 'advanced-nocaptcha-recaptcha' ), esc_html__( 'BuddyPress and bbPress', 'advanced-nocaptcha-recaptcha' ), - esc_html__( 'And others', 'advanced-nocaptcha-recaptcha' ) + esc_html__( 'And others', 'advanced-nocaptcha-recaptcha' ), + esc_url( $logos_url ) ), ); @@ -469,6 +581,7 @@ public function get_fields() { 'cb_label_after' => '', 'type' => 'text', 'class' => 'regular-text', + 'el_class' => 'regular', 'section_id' => '', 'desc' => '', 'std' => '', @@ -484,10 +597,11 @@ public function get_fields() { /** * Field callback. * - * @param array $field - Field data. - * @return void + * @param array $field - Field data. + * @param bool $return - To return markup or not. + * @return $output - HTML Markup. */ - public function callback( $field ) { + public function callback( $field, $return = false ) { $attrib = ''; if ( ! empty( $field['required'] ) ) { $attrib .= ' required = "required"'; @@ -507,6 +621,10 @@ public function callback( $field ) { $value = c4wp_get_option( $field['id'], $field['std'] ); + if ( $return ) { + ob_start(); + } + if ( ! empty( $field['desc'] ) ) { printf( '

%s

', esc_html( $field['desc'] ) ); } @@ -517,14 +635,15 @@ public function callback( $field ) { case 'url': case 'submit': printf( - '', + '', esc_attr( $field['type'] ), esc_attr( $field['id'] ), - esc_attr( $field['class'] ), + esc_attr( $field['el_class'] ), esc_attr( $field['id'] ), isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '', esc_attr( $value ), - $attrib + $attrib, // phpcs:ignore + esc_attr( $field['class'] ), ); break; case 'number': @@ -536,7 +655,7 @@ public function callback( $field ) { esc_attr( $field['id'] ), isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '', esc_attr( $value ), - $attrib, + $attrib, // phpcs:ignore esc_attr( $field['min_val'] ), esc_attr( $field['max_val'] ) ); @@ -550,7 +669,7 @@ public function callback( $field ) { esc_attr( $field['id'] ), isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '', esc_attr( $value ), - $attrib, + $attrib, // phpcs:ignore esc_attr( $field['cb_label'] ), esc_attr( $field['cb_label_after'] ), esc_attr( $field['min_val'] ), @@ -564,7 +683,7 @@ public function callback( $field ) { esc_attr( $field['class'] ), esc_attr( $field['id'] ), isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '', - $attrib, + $attrib, // phpcs:ignore esc_textarea( $value ) ); break; @@ -614,7 +733,7 @@ public function callback( $field ) { printf( '' ); break; case 'html': - echo $field['std']; + echo $field['std']; // phpcs:ignore break; case 'radio': foreach ( $field['options'] as $key => $label ) { @@ -624,7 +743,7 @@ public function callback( $field ) { checked( $value, $key, false ), esc_attr( $label ), esc_attr( $field['id'] ), - esc_attr( $field['class'] ) + esc_attr( $field['el_class'] ) ); } break; @@ -634,6 +753,11 @@ public function callback( $field ) { printf( esc_html__( 'No hook defined for %s', 'advanced-nocaptcha-recaptcha' ), esc_html( $field['type'] ) ); break; } + + if ( $return ) { + $output = ob_get_clean(); + return $output; + } } /** @@ -787,7 +911,8 @@ public function settings_save() { current_user_can( 'manage_options' ) && isset( $_POST['c4wp_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'c4wp-admin-captcha' === $_GET['page'] ) { check_admin_referer( 'c4wp_admin_options-options' ); - $value = wp_unslash( $_POST['c4wp_admin_options'] ); + $post_array = filter_input_array( INPUT_POST ); + $value = isset( $post_array['c4wp_admin_options'] ) ? wp_unslash( $post_array['c4wp_admin_options'] ) : false; if ( ! is_array( $value ) ) { $value = array(); } @@ -812,26 +937,30 @@ public function admin_settings() { 'c4wp-admin', 'anrScripts', array( - 'ajax_url' => admin_url( 'admin-ajax.php' ), - 'ipWarning' => esc_html__( 'Please supply a valid IP', 'advanced-nocaptcha-recaptcha' ), - 'switchingWarning' => esc_html__( 'Switching CAPTCHA methods will require your Site Key and Secret key to be replaced, do you wish to proceed?', 'advanced-nocaptcha-recaptcha' ), - 'switchingWarningTitle' => esc_html__( 'Confirm CAPTCHA method change', 'advanced-nocaptcha-recaptcha' ), + 'ajax_url' => admin_url( 'admin-ajax.php' ), + 'captcha_version' => c4wp_get_option( 'captcha_version', 'v2_checkbox' ), + 'ipWarning' => esc_html__( 'Please supply a valid IP', 'advanced-nocaptcha-recaptcha' ), + 'switchingWarning' => esc_html__( 'Switching CAPTCHA methods will require your Site Key and Secret key to be replaced, do you wish to proceed?', 'advanced-nocaptcha-recaptcha' ), + 'switchingWarningTitle' => esc_html__( 'Confirm change of reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ), + 'removeConfigWarningTitle' => esc_html__( 'Confirm removal of reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ), + 'removeConfigWarning' => esc_html__( 'This will remove the current reCAPTCHA integration, which means all the CAPTCHA checks on your website will stop working. Would you like to proceed?', 'advanced-nocaptcha-recaptcha' ), ) ); $current_tab = 'c4wp-admin-captcha'; - if ( ! empty( $_GET['page'] ) ) { - $current_tab = wp_unslash( $_GET['page'] ); + if ( ! empty( $_GET['page'] ) ) { // phpcs:ignore + $current_tab = sanitize_text_field( wp_unslash( $_GET['page'] ) ); // phpcs:ignore } // Determine if a Site/Secret key has been stored. $site_key = trim( c4wp_get_option( 'site_key' ) ); $secret_key = trim( c4wp_get_option( 'secret_key' ) ); $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' ); - $settings_wrapper_class = ( empty( $site_key ) || empty( $secret_key ) ) ? 'captcha_keys_required wrap fs-section': 'wrap fs-section'; + $settings_wrapper_class = ( empty( $site_key ) || empty( $secret_key ) ) ? 'captcha_keys_required wrap fs-section' : 'wrap fs-section'; + $show_wizard = ( empty( c4wp_get_option( 'site_key' ) ) && empty( $site_key ) && empty( $secret_key ) ) ? 'show_wizard_on_load' : ''; ?> -
+
'; } if ( 'success' === $error ) { - $context = esc_html__( 'Captcha settings', 'advanced-nocaptcha-recaptcha' ); - if ( isset( $_REQUEST['page'] ) && 'c4wp-admin-captcha' === $_REQUEST['page'] ) { - $context = esc_html__( 'Captcha configuration', 'advanced-nocaptcha-recaptcha' ); + $context = esc_html__( 'CAPTCHA settings', 'advanced-nocaptcha-recaptcha' ); + if ( isset( $_REQUEST['page'] ) && 'c4wp-admin-captcha' === $_REQUEST['page'] ) { // phpcs:ignore + $context = esc_html__( 'CAPTCHA configuration', 'advanced-nocaptcha-recaptcha' ); // phpcs:ignore } $notice .= '

' . $context . esc_html__( ' updated', 'advanced-nocaptcha-recaptcha' ) . '

'; } @@ -943,7 +1071,7 @@ public function c4wp_settings_notice() { delete_transient( 'c4wp_admin_options_errors' ); - echo $notice; + echo wp_kses_post( $notice ); } /** @@ -967,8 +1095,7 @@ public function c4wp_admin_sidebar() {
  • ' . esc_html__( 'Use the language that your website viewers understand', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'Spam protection for your WooCommerce stores', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'Specify where to put the CAPTCHA test on WooCommerce checkout page', 'advanced-nocaptcha-recaptcha' ) . '
  • -
  • ' . esc_html__( 'One-click Contact Form 7 forms spam protection', 'advanced-nocaptcha-recaptcha' ) . '
  • -
  • ' . esc_html__( 'One-click spam protection for Mailchimp for WordPress forms', 'advanced-nocaptcha-recaptcha' ) . '
  • +
  • ' . esc_html__( 'One-click spam protection for forms built with Contact Form 7, Gravity Forms, WPForms & MailChimp for WordPress', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'CAPTCHA tests & spam protection for BuddyPress, bbPress & other third party plugins', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'Add CAPTCHA to any type of form, even PHP forms', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'Boost login security, add CAPTCHA tests only failed logins', 'advanced-nocaptcha-recaptcha' ) . '
  • @@ -977,7 +1104,7 @@ public function c4wp_admin_sidebar() {
  • ' . esc_html__( 'Remove CAPTCHA from specific URLs', 'advanced-nocaptcha-recaptcha' ) . '
  • ' . esc_html__( 'No Ads!', 'advanced-nocaptcha-recaptcha' ) . '
  • -

    ' . esc_html__( 'Upgrade to Premium', 'advanced-nocaptcha-recaptcha' ) . ' ' . esc_html__( 'Get a FREE 7-day trial', 'advanced-nocaptcha-recaptcha' ) . '

    +

    ' . esc_html__( 'Upgrade to Premium', 'advanced-nocaptcha-recaptcha' ) . ' ' . esc_html__( 'Get a FREE 14-day trial', 'advanced-nocaptcha-recaptcha' ) . '

    ', @@ -1034,7 +1161,11 @@ public function validate_and_set_notices( $value ) { public function add_settings_link( $links ) { // add settings link in plugins page. $settings_link = '' . esc_html__( 'Settings', 'advanced-nocaptcha-recaptcha' ) . ''; - array_unshift( $links, $settings_link ); + + $append_link = ( is_multisite() && function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ) ? true : false; + if ( $append_link || ! is_multisite() ) { + array_unshift( $links, $settings_link ); + } return $links; } @@ -1074,6 +1205,242 @@ public static function push_at_to_associative_array( $array, $key, $new ) { } + /** + * Ignore admin notice. + * + * @return void + */ + public function c4wp_nocaptcha_plugin_notice_ignore() { + // Grab POSTed data. + $nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING ); + $notice_type = filter_input( INPUT_POST, 'notice_type', FILTER_SANITIZE_STRING );; + + // Check nonce. + if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'dismiss_captcha_notice' ) ) { + wp_send_json_error( esc_html__( 'Nonce Verification Failed.', 'advanced-nocaptcha-recaptcha' ) ); + } + + if ( 'multisite' == $notice_type ) { + global $current_user; + $user_id = $current_user->ID; + $updated = add_user_meta( $user_id, 'nocaptcha_plugin_notice_ignore', 'true', true ); + + if ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ) { + update_site_option( 'c4wp_network_notice_dismissed', true ); + } else { + update_option( 'c4wp_network_notice_dismissed', true ); + } + wp_send_json_success( $updated ); + + } elseif ( 'v3_fallback' == $notice_type ) { + if ( function_exists( 'c4wp_same_settings_for_all_sites' ) && c4wp_same_settings_for_all_sites() ) { + update_site_option( 'c4wp_v3_failover_available', false ); + } else { + update_option( 'c4wp_v3_failover_available', false ); + } + } + wp_send_json_success(); + + } + + /** + * Handles markup of the popup settings wizard. + * + * @return $markup - HTML markup. + */ + public function wizard_markup() { + $fields = $this->get_fields(); + + // Add intro card if this is running in 'first time' mode. + $show_wizard_intro = ( empty( c4wp_get_option( 'captcha_version' ) ) && empty( $site_key ) && empty( $secret_key ) ) ? true : false; + $logo_url = C4WP_PLUGIN_URL . 'assets/img/c4wp-logo-full.png'; + $intro_content = ' +
    +
    + + ' . esc_html__( 'Getting started with the CAPTCHA 4WP plugin', 'advanced-nocaptcha-recaptcha' ) . ' +

    ' . esc_html__( 'Thank you for installing the CAPTCHA 4WP plugin. This wizard will help you get started with the plugin so you can configure CAPTCHA and protect your website from spam, and fake registrations and orders.', 'advanced-nocaptcha-recaptcha' ) . '

    +
    + ' . esc_html__( 'Next', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Cancel', 'advanced-nocaptcha-recaptcha' ) . ' +
    + '; + $back_to_intro = '' . esc_html__( 'Back', 'advanced-nocaptcha-recaptcha' ) . ''; + + $markup = ' +
    + + ' . $intro_content . ' +
    +
    + ' . $fields['captcha_version_title']['label'] . ' +

    ' . $fields['captcha_version']['label'] . '

    + ' . $this->callback( $fields['captcha_version'], true ) . ' +
    + ' . esc_html__( 'Next', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Cancel', 'advanced-nocaptcha-recaptcha' ) . ' +
    +
    +
    + ' . $fields['site_key_title']['label'] . ' + ' . $fields['site_key_subtitle']['label'] . ' +

    ' . $fields['site_key']['label'] . ' + ' . $this->callback( $fields['site_key'], true ) . '

    +

    ' . $fields['secret_key']['label'] . ' + ' . $this->callback( $fields['secret_key'], true ) . '

    +

    ' . $this->callback( $fields['key_validation'], true ) . '

    +
    + ' . esc_html__( 'Next', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Back', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Cancel', 'advanced-nocaptcha-recaptcha' ) . ' +
    +
    +
    + ' . esc_html__( 'Step 3: Configure a failover action for reCAPTCHA v3 failure', 'advanced-nocaptcha-recaptcha' ) . ' +

    ' . esc_html__( 'reCAPTCHA v3 is fully automated. This means that by default, if the CAPTCHA check fails the website visitor cannot proceed with what they are doing unless you configure a failover action. Use the below setting to configure the failover action.', 'advanced-nocaptcha-recaptcha' ) . '

    +

    ' . $fields['failure_action']['label'] . ' + ' . $this->callback( $fields['failure_action'], true ) . '

    + + +

    ' . $fields['failure_redirect']['label'] . ' + ' . $this->callback( $fields['failure_redirect'], true ) . '

    +

    ' . $fields['failure_v2_site_key']['label'] . ' + ' . $this->callback( $fields['failure_v2_site_key'], true ) . '

    +

    ' . $fields['failure_v2_secret_key']['label'] . ' + ' . $this->callback( $fields['failure_v2_secret_key'], true ) . '

    +

    ' . $this->callback( $fields['failure_key_validation'], true ) . '

    +
    + ' . esc_html__( 'Next', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Back', 'advanced-nocaptcha-recaptcha' ) . ' + ' . esc_html__( 'Cancel', 'advanced-nocaptcha-recaptcha' ) . ' +
    +
    +
    + ' . esc_html__( ' All done - you can now add CAPTCHA checks to your website', 'advanced-nocaptcha-recaptcha' ) . ' +

    ' . esc_html__( "Now that the Google reCAPTCHA service is fully integrated you can use the optional settings to fine-tune CAPTCHA to your requirements. All the CAPTCHA settings are optional and with them you can configure aspects such as look and feel and CAPTCHA sensitivity. When you are ready navigate to the Settings & Placements page to configure where you'd like to add the CAPTCHA checks", 'advanced-nocaptcha-recaptcha' ) . '

    +
    + ' . esc_html__( 'Finish', 'advanced-nocaptcha-recaptcha' ) . ' +
    +
    + '; + return $markup; + } + + /** + * Handles markup for showing the 'launch wizard' buttons as well as current plugin config. + * + * @return $markup - HTML Markup + */ + public function wizard_launcher_area() { + + $site_key = trim( c4wp_get_option( 'site_key' ) ); + $secret_key = trim( c4wp_get_option( 'secret_key' ) ); + $captcha_version = trim( c4wp_get_option( 'captcha_version' ) ); + $failure_action = trim( c4wp_get_option( 'failure_action' ) ); + $reset_nonce = wp_create_nonce( 'reset_captcha_nonce' ); + + if ( $site_key && $secret_key ) { + $markup = ' +
    ' . esc_html__( 'Reconfigure reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ) . ' ' . esc_html__( 'Remove reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ) . ' + '; + + $markup .= ' + + + + + + + + + '; + } else { + $markup = ' +
    ' . esc_html__( 'Configure Google reCAPTCHA integration', 'advanced-nocaptcha-recaptcha' ) . ' + '; + } + + return $markup; + } + + /** + * Reset current version and keys. + * + * @return void + */ + public function c4wp_reset_captcha_config() { + // Grab POSTed data. + $nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING ); + + // Check nonce. + if ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'reset_captcha_nonce' ) ) { + wp_send_json_error( esc_html__( 'Nonce Verification Failed.', 'advanced-nocaptcha-recaptcha' ) ); + } + + c4wp_update_option( 'site_key' ); + c4wp_update_option( 'secret_key' ); + c4wp_update_option( 'captcha_version' ); + + wp_send_json_success(); + } + + /** + * Adds a setting to allow for testing different CAPTCHA results. + * + * @param array $fields - Current settings array. + * @return array $fields - Modified array. + */ + public function add_logging_and_testing_settings( $fields ) { + + $stored = c4wp_get_option( 'c4wp_recent_results' ); + + $nice_display = ''; + + $additonal_options['override_result'] = array( + 'label' => esc_html__( 'Override validation response.', 'advanced-nocaptcha-recaptcha' ), + 'section_id' => 'google_keys', + 'type' => 'select', + 'class' => 'regular', + 'std' => 'no_override', + 'options' => array( + 'no_override' => esc_html__( 'Do no override', 'advanced-nocaptcha-recaptcha' ), + 'return_false' => esc_html__( 'Return false (failure)', 'advanced-nocaptcha-recaptcha' ), + 'return_true' => esc_html__( 'Return true (pass)', 'advanced-nocaptcha-recaptcha' ), + ), + 'desc' => '', + ); + $additonal_options['recent_verification_results'] = array( + 'section_id' => 'google_keys', + 'type' => 'html', + 'label' => sprintf( + '

    ', + ), + 'class' => 'wrap-around-content c4wp-wizard-captcha-version', + ); + + $fields = self::push_at_to_associative_array( $fields, array_key_last( $fields ), $additonal_options ); + + return $fields; + } + } //END CLASS + add_action( 'wp_loaded', array( C4WP_Settings::init(), 'actions_filters' ) ); diff --git a/admin/templates/index.php b/admin/templates/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/admin/templates/index.php @@ -0,0 +1,4 @@ +

    + + + +

    1-click spam protection for forms built with Gravity FormsAdd CAPTCHA to any form built with Gravity Forms at the click of a button. No shortcodes required.

    + + +

    + + +

    + + + + + +

    1-click spam protection for forms built with WPFormsAdd CAPTCHA to any form built with WPForms at the click of a button. No shortcodes required.

    + + +

    + + +

    + + +

    1-click spam protection for Mailchimp for WordPress formsAdd CAPTCHA to any MC4WP form at the click of a button. No shortcodes required.

    diff --git a/advanced-nocaptcha-recaptcha.php b/advanced-nocaptcha-recaptcha.php index 4e005dc..78cf8a6 100644 --- a/advanced-nocaptcha-recaptcha.php +++ b/advanced-nocaptcha-recaptcha.php @@ -3,12 +3,12 @@ /** * CAPTCHA 4WP * - * @copyright Copyright (C) 2013-2022, WP White Security - support@wpwhitesecurity.com + * @copyright Copyright (C) 2013-2023, WP White Security - support@wpwhitesecurity.com * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public License, version 3 or higher * * @wordpress-plugin * Plugin Name: CAPTCHA 4WP - * Version: 7.1.1 + * Version: 7.2.0 * Plugin URI: https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/ * 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. * Author: WP White Security @@ -62,7 +62,7 @@ private function __construct() { if ( is_plugin_active( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' ) ) { - deactivate_plugins( 'advanced-nocaptcha-and-invisible-captcha-pro/advanced-nocaptcha-and-invisible-captcha-pro.php' ); + deactivate_plugins( 'advanced-nocaptcha-recaptcha/advanced-nocaptcha-recaptcha.php' ); return; } @@ -89,7 +89,7 @@ public static function init() { * @return void */ private function constants() { - define( 'C4WP_PLUGIN_VERSION', '7.1.1' ); + define( 'C4WP_PLUGIN_VERSION', '7.2.0' ); define( 'C4WP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); define( 'C4WP_PLUGIN_URL', plugins_url( '/', __FILE__ ) ); define( 'C4WP_PLUGIN_FILE', __FILE__ ); @@ -150,3 +150,14 @@ function c4wp_activation_redirect() { exit( wp_safe_redirect( esc_url( $admin_url ) ) ); // phpcs:ignore } } + +/** + * Declare compatibility with WC HPOS. + * + * @return void + */ +add_action( 'before_woocommerce_init', function() { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); + } +} ); diff --git a/anr-captcha-class.php b/anr-captcha-class.php index 533042f..b65dce0 100644 --- a/anr-captcha-class.php +++ b/anr-captcha-class.php @@ -1,5 +1,4 @@ -verify(); + + if ( ! $verify ) { + wp_send_json_error(); + } else { + wp_send_json_success(); + } + } + + /** + * Additional JS for getting a response via AJAX for further work. + * + * @return $code - Markup + */ + public function c4wp_ajax_verification_scripts() { + $ajax_url = admin_url( 'admin-ajax.php' ); + $flag_markup = ''; + + $fail_action = c4wp_get_option( 'failure_action', 'nothing' ); + $redirect = c4wp_get_option( 'failure_redirect' ); + $failure_v2_site_key = c4wp_get_option( 'failure_v2_site_key' ); + + $code = " + + var parentElem = captcha_div.parentElement; + + if ( ! form.classList.contains( 'c4wp_verify_underway' ) && captcha_div.parentElement.getAttribute( 'data-c4wp-use-ajax' ) == 'true' ) { + form.classList.add('c4wp_verify_underway' ); + const flagMarkup = '" . $flag_markup . "'; + var flagMarkupDiv = document.createElement('div'); + flagMarkupDiv.innerHTML = flagMarkup.trim(); + + form.appendChild( flagMarkupDiv ); + + var nonce = captcha_div.parentElement.getAttribute( 'data-nonce' ); + + var post_data = { + 'action' : 'c4wp_ajax_verify', + 'nonce' : nonce, + 'response' : data + }; + + var formData = new FormData(); + + formData.append( 'action', 'c4wp_ajax_verify' ); + formData.append( 'nonce', nonce ); + formData.append( 'response', data ); + + fetch( '" . $ajax_url . "', { + method: 'POST', + body: formData, + } ) // wrapped + .then( + res => res.json() + ) + .then( data => { + if ( data['success'] ) { + form.classList.add( 'c4wp_verified' ); + if ( typeof jQuery !== 'undefined' && form_type == 'wc_checkout' ) { + form.classList.add( 'c4wp_v2_fallback_active' ); + jQuery( '.woocommerce-checkout' ).submit(); + return true; + } else if ( typeof jQuery !== 'undefined' && form_type == 'wc_login' ) { + jQuery( '.woocommerce-form-login__submit' ).trigger('click'); + return true; + } else { + if ( typeof form.submit === 'function' ) { + form.submit(); + } else { + HTMLFormElement.prototype.submit.call(form); + } + } + } else { + "; + + if ( 'redirect' === $fail_action ) { + $code .= " + window.location.href = '" . $redirect . "'; + "; + } + + if ( 'v2_checkbox' === $fail_action ) { + $code .= " + captcha_div.innerHTML = ''; + form.classList.add( 'c4wp_v2_fallback_active' ); + flagMarkupDiv.firstChild.setAttribute( 'name', 'c4wp_v2_fallback' ); + + var c4wp_captcha = grecaptcha.render( captcha_div,{ + 'sitekey' : '" . $failure_v2_site_key . "', + 'expired-callback' : function(){ + grecaptcha.reset( c4wp_captcha ); + } + }); + "; + } + + $code .= ' + // Prevent further submission + event.preventDefault(); + return false; + } + } ) + .catch( err => console.error( err ) ); + + // Prevent further submission + event.preventDefault(); + return false; + } + '; + + return $code; } /** @@ -115,15 +259,31 @@ public function total_captcha() { */ public function captcha_form_field() { self::$captcha_count++; - $site_key = trim( c4wp_get_option( 'site_key' ) ); - $number = $this->total_captcha(); - $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' ); + $site_key = trim( c4wp_get_option( 'site_key' ) ); + $number = $this->total_captcha(); + $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' ); + $verify_nonce = wp_create_nonce( 'c4wp_verify_nonce' ); + $fail_action = c4wp_get_option( 'failure_action', 'nothing' ); + + $use_ajax = ''; + if ( 'v2_checkbox' === $fail_action || 'redirect' === $fail_action ) { + $use_ajax = 'data-c4wp-use-ajax="true"'; + if ( 'v2_checkbox' === $fail_action ) { + $key = c4wp_get_option( 'failure_v2_site_key' ); + $use_ajax .= ' data-c4wp-v2-site-key="' . $key . '"'; + } + if ( 'redirect' === $fail_action ) { + $redirect = c4wp_get_option( 'failure_v2_site_key' ); + $use_ajax .= ' data-c4wp-failure-redirect="' . $redirect . '"'; + } + } - $field = '
    '; + $field = '
    '; if ( 'v3' === $version ) { - $field .= ''; + $field .= ''; } $field .= '
    '; + return $field; } @@ -138,6 +298,8 @@ public function footer_script() { $number = $this->total_captcha(); $version = c4wp_get_option( 'captcha_version', 'v2_checkbox' ); + $number = ( function_exists( 'is_buddypress' ) && is_buddypress() && 'v2_invisble' !== $version ) ? 1 : $number; + if ( ! $number && ( 'v3' !== $version || 'all_pages' !== c4wp_get_option( 'v3_script_load', 'all_pages' ) ) ) { return; } @@ -151,6 +313,7 @@ public function footer_script() { return; } + $included = true; if ( 'v2_checkbox' === $version ) { @@ -169,11 +332,11 @@ public function footer_script() { */ public function v2_checkbox_script() { ?> - - - - + + ?> - form_field_return(); + echo $this->form_field_return(); // phpcs:ignore } /** @@ -448,12 +807,16 @@ public function verify( $response = false ) { $remoteip = isset( $_SERVER['REMOTE_ADDR'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REMOTE_ADDR'] ) ) : ''; - $secret_key = trim( c4wp_get_option( 'secret_key' ) ); - $verify = false; + $secret_key = isset( $_POST['c4wp_v2_fallback'] ) ? trim( c4wp_get_option( 'failure_v2_secret_key' ) ) : trim( c4wp_get_option( 'secret_key' ) ); + + $verify = false; if ( false === $response ) { $response = isset( $_POST['g-recaptcha-response'] ) ? sanitize_text_field( wp_unslash( $_POST['g-recaptcha-response'] ) ) : ''; + if ( empty( $response ) ) { + $response = empty( $response ) && isset( $_POST['response'] ) ? sanitize_text_field( wp_unslash( $_POST['response'] ) ) : ''; + } } // Store what we send to google in case we need to verify if its a duplicated request. @@ -506,9 +869,8 @@ public function verify( $response = false ) { if ( isset( $result['success'] ) && true === $result['success'] ) { if ( 'v3' === c4wp_get_option( 'captcha_version' ) ) { - $score = isset( $result['score'] ) ? $result['score'] : 0; - $action = isset( $result['action'] ) ? $result['action'] : ''; - $verify = c4wp_get_option( 'score', '0.5' ) <= $score && 'advanced_nocaptcha_recaptcha' === $action; + $score = isset( $result['score'] ) ? $result['score'] : true; + $verify = c4wp_get_option( 'score', '0.5' ) <= $score; } else { $verify = true; } @@ -522,6 +884,21 @@ public function verify( $response = false ) { $verify = true; } + $dev_mode = apply_filters( 'c4wp_enable_dev_mode', false ); + if ( $dev_mode ) { + $store = array(); + $store['verify_post'] = $_POST; + $store['verify_result'] = $result; + $store['verify_return'] = $verify; + c4wp_log_verify_result( $store ); + + if ( 'return_false' === c4wp_get_option( 'override_result' ) ) { + return false; + } elseif ( 'return_true' === c4wp_get_option( 'override_result' ) ) { + return true; + } + } + return $verify; } @@ -534,6 +911,7 @@ public function verify( $response = false ) { * @return WP_User|WP_Error - Always return the user, WP Error otherwise. */ public function login_verify( $user, $username = '', $password = '' ) { + global $wpdb; if ( ! $username ) { return $user; @@ -547,12 +925,14 @@ public function login_verify( $user, $username = '', $password = '' ) { $show_captcha = $this->show_login_captcha(); - if ( $show_captcha && ! $this->verify() ) { - // Bail if we have nothign to work with. - if ( ! isset( $_POST['g-recaptcha-response'] ) ) { - return $user; + if ( ! isset( $_POST['c4wp_ajax_flag'] ) ) { + if ( $show_captcha && ! $this->verify() ) { + // Bail if we have nothign to work with. + if ( ! isset( $_POST['g-recaptcha-response'] ) ) { + return $user; + } + return new WP_Error( 'c4wp_error', $this->add_error_to_mgs() ); } - return new WP_Error( 'c4wp_error', $this->add_error_to_mgs() ); } return $user; @@ -570,7 +950,7 @@ public function is_rest_request() { global $wp_rewrite; if ( null === $wp_rewrite ) { - $wp_rewrite = new WP_Rewrite(); + $wp_rewrite = new WP_Rewrite(); // phpcs:ignore } $rest_url = wp_parse_url( trailingslashit( rest_url() ) ); @@ -665,12 +1045,14 @@ public function reset_password_verify( $errors, $user ) { return $errors; } - if ( ! $this->verify() ) { - // Bail if we have nothign to work with. - if ( ! isset( $_POST['g-recaptcha-response'] ) ) { - return $user; + if ( ! isset( $_POST['c4wp_ajax_flag'] ) ) { + if ( ! $this->verify() ) { + // Bail if we have nothign to work with. + if ( ! isset( $_POST['g-recaptcha-response'] ) ) { + return $user; + } + $errors->add( 'c4wp_error', $this->add_error_to_mgs() ); } - $errors->add( 'c4wp_error', $this->add_error_to_mgs() ); } return $errors; @@ -683,15 +1065,17 @@ public function reset_password_verify( $errors, $user ) { * @return array - New comment data. */ public function comment_verify( $commentdata ) { - if ( ! $this->verify() ) { - wp_die( - '

    ' . $this->add_error_to_mgs() . '

    ', - esc_html__( 'Comment Submission Failure' ), - array( - 'response' => 403, - 'back_link' => true, - ) - ); + if ( ! isset( $_POST['c4wp_ajax_flag'] ) ) { + if ( ! $this->verify() ) { + wp_die( + '

    ' . wp_kses_post( $this->add_error_to_mgs() ) . '

    ', + esc_html__( 'Comment Submission Failure' ), + array( + 'response' => 403, + 'back_link' => true, + ) + ); + } } return $commentdata; @@ -704,8 +1088,11 @@ public function comment_verify( $commentdata ) { * @returnb ool $approved - Our approval. */ public function comment_verify_490( $approved ) { - if ( ! $this->verify() ) { - return new WP_Error( 'c4wp_error', $this->add_error_to_mgs(), 403 ); + + if ( ! isset( $_POST['c4wp_ajax_flag'] ) ) { + if ( ! $this->verify() ) { + return new WP_Error( 'c4wp_error', $this->add_error_to_mgs(), 403 ); + } } return $approved; } @@ -739,8 +1126,6 @@ public function determine_captcha_language() { $lang = '&hl=' . get_bloginfo( 'language' ); } - /* - */ $lang = '&hl=' . $language; return $lang; } diff --git a/assets/css/admin.css b/assets/css/admin.css index 86aaed7..7678dc5 100644 --- a/assets/css/admin.css +++ b/assets/css/admin.css @@ -365,6 +365,19 @@ ul.c4wp-pro-features-ul li.dashicons-yes-alt:before { height: 290px; } .c4wp-alert { + border-radius: 3px; + padding: 38px 34px; +} +.c4wp-alert .ui-dialog-buttonpane .ui-dialog-buttonset { + float: left !important; +} +.c4wp-alert .ui-dialog-buttonpane .ui-button { + margin-left: 0 !important; + margin-right: 10px; +} +.c4wp-alert .ui-dialog-content { + padding: 0 !important; + padding-bottom: 30px !important; border-radius: 13px; } .c4wp-alert .ui-dialog-titlebar { @@ -374,13 +387,13 @@ ul.c4wp-pro-features-ul li.dashicons-yes-alt:before { font-size: 16px; font-weight: 600; line-height: 2; - padding: 9px 36px 0 9px; + padding: 0px 36px 20px 0px; } .c4wp-alert .ui-dialog-buttonpane { background: #fff; border-top: none; - padding: 0 16px 16px; + padding: 0 !important; } .c4wp-alert .ui-dialog-buttonpane .ui-button + .ui-button { @@ -390,4 +403,166 @@ ul.c4wp-pro-features-ul li.dashicons-yes-alt:before { } .full-hide.disabled { display: none; +} + +#whitelist-ips-userfacing ul li, #whitelist-urls-userfacing ul li { + display: inline-block; + border-width: 1px; + border-style: solid; + padding: 2px 4px; + margin: 2px 0 0 2px; + border-radius: 3px; + cursor: default; + background: #EFE; + border-color: #5B5; +} + +#whitelist-ips-userfacing ul li span, #whitelist-urls-userfacing ul li span { + text-decoration: none; + font-size: 12px; + font-weight: bold; + color: #FFF; + margin-left: 2px; + background: #BBB; + border-radius: 25px; + height: 14px; + display: inline-block; + vertical-align: middle; + width: 14px; + text-align: center; + line-height: 12px; +} + +#c4wp-testrender .grecaptcha-badge { + position: relative !important; + right: 0 !important; + bottom: 0 !important; +} + +#c4wp-setup-wizard { + visibility: hidden; + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgb(29 35 39 / 0%); + z-index: -1; + transition: all 0.25s ease-in-out; + overflow-x: clip; + overflow-y: auto; +} + +#c4wp-setup-wizard.show-wizard { + visibility: visible; + background-color: rgb(29 35 39 / 90%); + display: block; + position: fixed; + z-index: 9999; + transition: all 0.25s ease-in-out; +} + +.toplevel_page_c4wp-admin-captcha .ui-widget-overlay { + + background-color: rgb(29 35 39 / 90%) !important; +} + +#c4wp-setup-wizard #c4wp-setup-wizard-content { + opacity: 0; + width: 800px; + height: auto; + background: white; + top: 140px; + position: absolute; + left: calc(50vw - 425px); + border-radius: 3px; + transition: all 0.25s ease-in-out; + z-index: 10000; + padding: 38px 34px; +} + +#c4wp-close-wizard { + text-decoration: none; + position: absolute; + right: 38px; + display: inline-block; + z-index: 9999; +} +#c4wp-close-wizard:focus { + box-shadow: none; + outline: none; +} + +.c4wp-panel-content { + margin-bottom: 30px; +} + +#c4wp-setup-wizard.show-wizard #c4wp-setup-wizard-content { + top: 200px; + opacity: 1; +} + +.c4wp-wizard-panel { + visibility: hidden; + height: 100%; + transition: all 0.25s ease-in-out; + height: 0; + opacity: 0; +} + +.c4wp-wizard-panel.active { + visibility: visible; + position: relative; + transition: all 0.25s ease-in-out; + height: auto; + opacity: 1; +} + +.c4wp-panel-content strong, +.c4wp-panel-content p { + position: relative !important; + display: block; + margin: 0 0 30px 0 !important; +} + +.c4wp-panel-content p { + font-size: 13px; +} +.c4wp-panel-content p > input, .c4wp-panel-content p > select { + position: absolute; + left: 115px; + top: -4px; + min-width: 380px; +} + +.c4wp-panel-content p.disabled { + display: none; +} + +.c4wp-current-setup p { + margin: 5px 0 8px; +} + +.c4wp-current-setup p span { + display: inline-block; + width: 150px; +} + +#render-settings-placeholder > div, #render-settings-placeholder-fallback > div { + left: 0 !important; +} + +.c4wp-panel-content .toggleable { + height: 0; +} + +#c4wp-setup-wizard-version-select strong + p { + display: none; +} + +.wizard-logo { + position: relative; + max-width: 240px; + display: block; + margin: 0 0 34px; } \ No newline at end of file diff --git a/assets/css/index.php b/assets/css/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/assets/css/index.php @@ -0,0 +1,4 @@ +
    ' ).css( 'height', '78px' ); - } else if ( $captcha_version == 'v2_invisble' ) { - jQuery( '#render-settings-placeholder' ).html( '
    ' ); - } else { - jQuery( '#render-settings-placeholder' ).html( '
    ' ); - setTimeout(function() { - if ( ! jQuery( 'body .grecaptcha-badge' ).length ) { - jQuery( '#c4wp-testrender *' ).remove(); - jQuery( '#c4wp-testrender' ).append( 'Invalid site key' ); - } - }, 500); +function createRenderArea( $captcha_version = 'v2_checkbox', $sitekey = false, $is_fallback = false ) { + + if ( $is_fallback ) { + jQuery( '#render-settings-placeholder-fallback' ).css( 'height', 'auto' ); + if ( $sitekey ) { + if ( $captcha_version == 'v2_checkbox' ) { + jQuery( '#render-settings-placeholder-fallback' ).html( '
    ' ).css( 'height', '78px' ); + } else if ( $captcha_version == 'v2_invisble' ) { + jQuery( '#render-settings-placeholder-fallback' ).html( '
    ' ); + } else { + jQuery( '#render-settings-placeholder-fallback' ).html( '
    ' ); + setTimeout(function() { + if ( ! jQuery( 'body .grecaptcha-badge' ).length ) { + jQuery( '#c4wp-testrender-fb *' ).remove(); + jQuery( '#c4wp-testrender-fb' ).append( 'Invalid site key' ); + jQuery( '#warning' ).attr( 'data-key-invalid', true ); + } + }, 500); + setTimeout(function() { + if ( jQuery( 'body .grecaptcha-badge' ).length ) { + jQuery( 'body .grecaptcha-badge' ).detach().appendTo( '#c4wp-testrender-fb' ) + } + }, 600); + } + } + } else { + jQuery( '.g-recaptcha, #gscripts, #c4wp-testrender, #warning, #render-wrapper' ).remove(); + jQuery('.grecaptcha-badge').parent().remove(); + jQuery( '#render-settings-placeholder' ).css( 'height', 'auto' ); + if ( $sitekey ) { + if ( $captcha_version == 'v2_checkbox' ) { + jQuery( '#render-settings-placeholder' ).html( '
    ' ).css( 'height', '78px' ); + } else if ( $captcha_version == 'v2_invisble' ) { + jQuery( '#render-settings-placeholder' ).html( '
    ' ); + } else { + jQuery( '#render-settings-placeholder' ).html( '
    ' ); + setTimeout(function() { + if ( ! jQuery( 'body .grecaptcha-badge' ).length ) { + jQuery( '#c4wp-testrender *' ).remove(); + jQuery( '#c4wp-testrender' ).append( 'Invalid site key' ); + jQuery( '#warning' ).attr( 'data-key-invalid', true ); + } + }, 500); + setTimeout(function() { + if ( jQuery( 'body .grecaptcha-badge' ).length ) { + jQuery( 'body .grecaptcha-badge' ).detach().appendTo( '#c4wp-testrender' ) + } + }, 600); + } } } } @@ -60,10 +92,24 @@ function c4wpConfirm(dialogText, okFunc, cancelFunc, dialogTitle) { }); } +function testSiteKeys( $captcha_version = 'v2_checkbox', $sitekey = false, $is_fallback = false ) { + createCaptchaScripts( $captcha_version, $sitekey, $is_fallback ); + createRenderArea( $captcha_version, $sitekey, $is_fallback ); +} -function testSiteKeys( $captcha_version = 'v2_checkbox', $sitekey = false ) { - createCaptchaScripts( $captcha_version, $sitekey ); - createRenderArea( $captcha_version, $sitekey ); +function c4wp_admin_show_hide_failure_fields(){ + var selected_value = jQuery( '.c4wp-wizard-panel select[name="c4wp_admin_options[failure_action]"] option:selected' ).val(); + jQuery( '.c4wp-wizard-panel .toggleable' ).slideUp(300).addClass( 'disabled' ); + jQuery( '.c4wp-wizard-panel .toggletext' ).slideUp(300).addClass( 'disabled' ); + jQuery( '.c4wp-wizard-panel .c4wp-show-field-for-'+ selected_value ).slideDown(300).removeClass( 'disabled' ); + jQuery( '.c4wp-wizard-panel .toggleable' ).parent().slideUp(300).addClass( 'disabled' ); + jQuery( '.c4wp-wizard-panel .c4wp-show-field-for-'+ selected_value ).parent().slideDown(300).removeClass( 'disabled' ); + + if ( jQuery( '#c4wp-setup-wizard-v3-fallback' ).hasClass( 'active' ) && 'nothing' == selected_value ) { + jQuery( '.show-wizard [data-check-inputs]' ).attr( 'data-check-inputs', '' ); + } else { + jQuery( '.show-wizard [data-check-inputs]' ).attr( 'data-check-inputs', '#c4wp_admin_options_failure_v2_site_key, #c4wp_admin_options_failure_v2_secret_key' ); + } } jQuery(document).ready(function( $ ){ @@ -74,25 +120,37 @@ jQuery(document).ready(function( $ ){ testSiteKeys( $('input[name="c4wp_admin_options[captcha_version]"]:checked').val(), $(this).val() ); }); - $('.form-table').on( "change", '[name="c4wp_admin_options[captcha_version]"]', function(e) { + $('input[name="c4wp_admin_options[failure_v2_site_key]"]').keyup(function(){ + testSiteKeys( 'v2_checkbox', $(this).val(), true ); + }); + + $('.form-table').on( "change", '[name="c4wp_admin_options[captcha_version]"]', function(e) { testSiteKeys( this.value, $('input[name="c4wp_admin_options[site_key]"]').val() ); c4wp_admin_show_hide_fields(); }); + $( 'body' ).on( "change", 'select[name="c4wp_admin_options[failure_action]"]', function(e) { + c4wp_admin_show_hide_failure_fields(); + }); + jQuery( 'body' ).on( 'click', '[name="c4wp_admin_options[captcha_version]"]', function ( e ) { var radio = $(this); - e.preventDefault(); - c4wpConfirm( anrScripts.switchingWarning, function () { - $(radio).prop('checked', true); - $( '#c4wp_admin_options_site_key, #c4wp_admin_options_secret_key' ).attr( 'value', '' ).val( '' ); - testSiteKeys( $('input[name="c4wp_admin_options[captcha_version]"]:checked').val(), jQuery( '#c4wp_admin_options_site_key' ).attr( 'value' ) ); - c4wp_admin_show_hide_fields(); - return true; - }, function () { - return false; - }, - anrScripts.switchingWarningTitle - ); + + + if ( ! jQuery( '#c4wp-admin-wrap' ).hasClass( 'captcha_keys_required' ) ) { + e.preventDefault(); + c4wpConfirm( anrScripts.switchingWarning, function () { + $(radio).prop('checked', true); + $( '#c4wp_admin_options_site_key, #c4wp_admin_options_secret_key' ).attr( 'value', '' ).val( '' ); + testSiteKeys( $('input[name="c4wp_admin_options[captcha_version]"]:checked').val(), jQuery( '#c4wp_admin_options_site_key' ).attr( 'value' ) ); + c4wp_admin_show_hide_fields(); + return true; + }, function () { + return false; + }, + anrScripts.switchingWarningTitle + ); + } }); // Tidy desc areas. @@ -148,7 +206,7 @@ jQuery(document).ready(function( $ ){ var text = $('#c4wp_admin_options_whitelisted_ips').val(); var output = text.split(','); $( '#whitelist-ips-userfacing' ).html(''); } } @@ -158,7 +216,7 @@ jQuery(document).ready(function( $ ){ var text = $('#c4wp_admin_options_whitelisted_urls').val(); var output = text.split(','); $( '#whitelist-urls-userfacing' ).html(''); } } @@ -293,10 +351,11 @@ jQuery(function() { return true; } - jQuery( 'body' ).on( 'click', 'a[href="#dismiss-captcha-notice"]', function ( e ) { + jQuery( 'body' ).on( 'click', 'a[href="#dismiss-captcha-notice"], a[href="#c4wp-cancel-v3-failover-notice"]', function ( e ) { e.preventDefault(); - var ourButton = jQuery( this ); + let ourButton = jQuery( this ); var nonce = ourButton.attr( 'data-nonce' ); + var type = ourButton.attr( 'data-notice-type' ); jQuery.ajax({ type: 'POST', @@ -305,9 +364,10 @@ jQuery(function() { data: { action: 'c4wp_nocaptcha_plugin_notice_ignore', nonce: nonce, + notice_type: type, }, success: function ( result ) { - jQuery( '#network-captcha-notice' ).slideUp(); + jQuery( ourButton ).closest( '.notice' ).slideUp(); } }); }); @@ -348,6 +408,136 @@ jQuery(function() { } jQuery( '#whitelist_ips_input' ).val( '' ); }); + + jQuery( 'body' ).on( 'click', 'a#launch-c4wp-wizard', function ( e ) { + e.preventDefault(); + + showWizard(); + }); + + function showWizard( goToIntro = false ) { + if ( goToIntro ) { + jQuery( '#c4wp-setup-wizard-intro' ).addClass( 'active' ); + } else { + jQuery( '#c4wp-setup-wizard-intro' ).remove(); + jQuery( '#c4wp-setup-wizard-version-select' ).addClass( 'active' ); + } + setTimeout(function() { + jQuery( '#c4wp-setup-wizard' ).addClass( 'show-wizard' ); + }, 100); + } + + function validateURL(string) { + try { + const newUrl = new URL(string); + return newUrl.protocol === 'http:' || newUrl.protocol === 'https:'; + } catch (err) { + return false; + } + } + + jQuery( 'body' ).on( 'click', '#c4wp-close-wizard, a[href="#c4wp-cancel-wizard"]', function ( e ) { + e.preventDefault(); + jQuery( '#c4wp-setup-wizard' ).removeClass( 'show-wizard' ); + }); + + jQuery( 'body' ).on( 'click', '#reset-c4wp-config', function ( e ) { + e.preventDefault(); + c4wpConfirm( + anrScripts.removeConfigWarning, + function () { + c4wp_reset_captcha_config(); + return true; + }, + function () { + return false; + }, + anrScripts.removeConfigWarningTitle + ); + }); + + jQuery( 'body' ).on( 'click', 'a[data-wizard-goto]', function ( e ) { + e.preventDefault(); + var targetDiv = jQuery( this ).attr( 'href' ); + var inputsToCheck = jQuery( this ).attr( 'data-check-inputs' ); + var current_fallback = jQuery( '#c4wp_admin_options_failure_action option:selected' ).val(); + + if ( ! jQuery( '#c4wp-setup-wizard-v3-fallback' ).hasClass( 'active' ) ) { + if ( targetDiv == '#c4wp-setup-wizard-additional-settings' ) { + var currVal = jQuery('input[name="c4wp_admin_options[captcha_version]"]:checked').val(); + if ( currVal == 'v3' ) { + var targetDiv = '#c4wp-setup-wizard-v3-fallback'; + } + c4wp_admin_show_hide_failure_fields(); + } + } else { + if ( 'redirect' == current_fallback ) { + if ( ! jQuery( '#c4wp_admin_options_failure_redirect' ).val() || ! validateURL( jQuery( '#c4wp_admin_options_failure_redirect' ).val() ) ) { + jQuery( '#c4wp_admin_options_failure_redirect' ).css( 'border', '1px solid red' ); + return true; + } else { + jQuery( '#c4wp_admin_options_failure_redirect' ).css( 'border', '1px solid #8c8f94' ); + jQuery( this ).parent().removeClass('active').slideUp(200); + jQuery( targetDiv ).addClass('active').slideDown(200); + } + } else if ( 'nothing' == current_fallback ) { + jQuery( this ).parent().removeClass('active').slideUp(200); + jQuery( targetDiv ).addClass('active').slideDown(200); + } + } + + if ( targetDiv == '#c4wp-setup-wizard-site-keys' ) { + var currVal = jQuery('input[name="c4wp_admin_options[captcha_version]"]:checked').val(); + if ( typeof currVal == 'undefined' ) { + jQuery('input[name="c4wp_admin_options[captcha_version]"]').css( 'border', '1px solid red' ); + return true; + } else { + jQuery('input[name="c4wp_admin_options[captcha_version]"]').css( 'border', '1px solid #8c8f94' ); + } + } + + if ( inputsToCheck || jQuery( 'body [data-key-invalid]' ).length ) { + if ( ! jQuery( inputsToCheck ).val() || jQuery( 'body [data-key-invalid]' ).length ) { + jQuery( inputsToCheck ).css( 'border', '1px solid red' ); + } else { + jQuery( this ).parent().removeClass('active').slideUp(200); + jQuery( targetDiv ).addClass('active').slideDown(200); + } + } else { + jQuery( this ).parent().removeClass('active').slideUp(200); + jQuery( targetDiv ).addClass('active').slideDown(200); + } + + if ( jQuery( '#c4wp-setup-wizard-site-keys' ).hasClass( 'active' ) ) { + jQuery( '#c4wp-setup-wizard-site-keys .button-primary[data-check-inputs]' ).attr( 'data-check-inputs', '#c4wp_admin_options_site_key, #c4wp_admin_options_secret_key' ); + } + }); + + jQuery( 'body' ).on( 'click', 'a[href="#finish"]', function ( e ) { + e.preventDefault(); + jQuery( '#c4wp-setup-wizard' ).removeClass( 'show-wizard' ); + jQuery( '#c4wp-admin-wrap form #submit' ).trigger('click'); + }); + + function c4wp_reset_captcha_config() { + var nonce = jQuery( '#reset-c4wp-config' ).attr( 'data-nonce' ); + jQuery.ajax({ + type: 'POST', + url: ajaxurl, + async: true, + data: { + action: 'c4wp_reset_captcha_config', + nonce: nonce, + }, + success: function ( result ) { + location.reload(); + } + }); + } + + if ( jQuery( '#c4wp-admin-wrap' ).hasClass( 'show_wizard_on_load' ) ) { + showWizard( true ); + } }); /** diff --git a/assets/js/index.php b/assets/js/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/assets/js/index.php @@ -0,0 +1,4 @@ +is_not_paying() ) || ( class_exists( 'C4WP_Pro' ) && c4wp_fs()->is_trial() ) ) ? true : false; } + +/** + * Add a small log during testing. + * + * @param array $result - Result data. + * @return void + */ +function c4wp_log_verify_result( $result ) { + $stored = c4wp_get_option( 'c4wp_recent_results' ); + if ( ! $stored || ! is_array( $stored ) ) { + $updated_results[] = $result; + c4wp_update_option( 'c4wp_recent_results', $updated_results ); + } else { + $updated_results = array_unshift( $stored, $result ); + c4wp_update_option( 'c4wp_recent_results', $updated_results ); + } +} + +/** + * An easy to use array of allowed HTML for use with sanitzation of our admin areas etc. + * + * @return $wp_kses_args - Our array. + */ +function c4wp_allowed_kses_args() { + $wp_kses_args = array( + 'input' => array( + 'type' => array(), + 'id' => array(), + 'name' => array(), + 'value' => array(), + 'size' => array(), + 'class' => array(), + 'min' => array(), + 'required' => array(), + 'checked' => array(), + ), + 'select' => array( + 'id' => array(), + 'name' => array(), + ), + 'option' => array( + 'id' => array(), + 'name' => array(), + 'value' => array(), + 'selected' => array(), + ), + 'tr' => array( + 'valign' => array(), + 'class' => array(), + 'id' => array(), + ), + 'th' => array( + 'scope' => array(), + 'class' => array(), + 'id' => array(), + ), + 'td' => array( + 'class' => array(), + 'id' => array(), + ), + 'fieldset' => array( + 'class' => array(), + 'id' => array(), + ), + 'legend' => array( + 'class' => array(), + 'id' => array(), + ), + 'label' => array( + 'for' => array(), + 'class' => array(), + 'id' => array(), + ), + 'p' => array( + 'class' => array(), + 'id' => array(), + ), + 'span' => array( + 'class' => array(), + 'id' => array(), + 'style' => array(), + ), + 'li' => array( + 'class' => array(), + 'id' => array(), + 'data-role-key' => array(), + ), + 'a' => array( + 'class' => array(), + 'id' => array(), + 'style' => array(), + 'data-tab-target' => array(), + 'data-wizard-goto' => array(), + 'data-check-inputs' => array(), + 'data-nonce' => array(), + 'href' => array(), + 'target' => array(), + ), + 'h3' => array( + 'class' => array(), + ), + 'br' => array(), + 'b' => array(), + 'i' => array(), + 'div' => array( + 'style' => array(), + 'class' => array(), + 'id' => array(), + ), + 'table' => array( + 'class' => array(), + 'id' => array(), + ), + 'tbody' => array( + 'class' => array(), + 'id' => array(), + ), + 'strong' => array( + 'class' => array(), + 'data-key-invalid' => array(), + 'id' => array(), + ), + 'img' => array( + 'class' => array(), + 'src' => array(), + 'id' => array(), + ), + ); + return $wp_kses_args; +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/index.php @@ -0,0 +1,4 @@ +ERROR: " msgstr "" +#: admin/settings.php:80 +msgid "Important:" +msgstr "" + +#: admin/settings.php:81 +msgid "To reconfigure the failover now, once you are redirected to the plugin's configuration page click" +msgstr "" + +#: admin/settings.php:82, admin/settings.php:1337 +msgid "Reconfigure reCAPTCHA integration" +msgstr "" + +#: admin/settings.php:83 +msgid "and click" +msgstr "" + +#: admin/settings.php:84, admin/settings.php:1257, admin/settings.php:1273, admin/settings.php:1286, admin/settings.php:1306 +msgid "Next" +msgstr "" + +#: admin/settings.php:85 +msgid "in the wizard until you get to the failover settings." +msgstr "" + +#: admin/settings.php:89 +msgid "In the latest version of CAPTCHA 4WP you can configure a failover action for your CAPTCHA check. This means that you can configure the plugin to show a CAPTCHA checkbox or redirect the user when the current v3 reCAPTCHA check fails. Use the buttons below to configure the failover or close this admin notice." +msgstr "" + +#: admin/settings.php:91 +msgid "Configure failover action now" +msgstr "" + +#: admin/settings.php:91, admin/settings.php:964 +msgid "I'll configure it later" +msgstr "" + #. translators: link to the settings page with text "Settings page" -#: admin/settings.php:99 -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" +#: admin/settings.php:161 +msgid "Use the CAPTCHA configuration wizard to integrate the Google reCAPTCHA service so you can add CAPTCHA checks 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" msgstr "" -#: admin/settings.php:100 +#: admin/settings.php:162 msgid "Settings & placements" msgstr "" -#: admin/settings.php:112 +#: admin/settings.php:175 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." msgstr "" #. translators: expression "very restrictive" in bold -#: admin/settings.php:137 +#: admin/settings.php:200 msgid "Any value above 0.5 is %s." msgstr "" -#: admin/settings.php:138 +#: admin/settings.php:201 msgid "very restrictive" msgstr "" -#: admin/settings.php:140 +#: admin/settings.php:203 msgid "This means that you might end up locked out from your website. Therefore test this on a staging website website beforehand." msgstr "" -#: admin/settings.php:144 +#: admin/settings.php:207 msgid "You can add a CAPTCHA check to the below list of pages on WordPress." msgstr "" -#: admin/settings.php:145 +#: admin/settings.php:208 msgid "Use the setting below to select the language of the text used in the CAPTCHA text." msgstr "" #. translators:link to upgrade page -#: admin/settings.php:150 +#: admin/settings.php:213 msgid "To add CAPTCHA checks to WooCommerce, Contact Form 7, BuddyPress and other forms created by third party plugins you need to %s" msgstr "" -#: admin/settings.php:151 +#: admin/settings.php:214 msgid "upgrade to Premium" msgstr "" -#: admin/settings.php:153 +#: admin/settings.php:216 msgid " In the Premium edition you can configure the plugin to automatically detect the language settings of the visitor's and use that language." msgstr "" -#: admin/settings.php:156 +#: admin/settings.php:219 msgid "Comments form" msgstr "" -#: admin/settings.php:159 +#: admin/settings.php:222 msgid "(Incompatible with Jetpack comments)" msgstr "" -#: admin/settings.php:168 -msgid "STEP 1: Select the type of reCAPTCHA you want to use" +#: admin/settings.php:231 +msgid "Step 1: Select the type of reCAPTCHA you want to use on your website." msgstr "" -#: admin/settings.php:173 +#: admin/settings.php:236 msgid "reCAPTCHA version" msgstr "" -#: admin/settings.php:179 +#: admin/settings.php:242 msgid "Version 2 (Users have to check the \"I’m not a robot” checkbox)" msgstr "" -#: admin/settings.php:180 +#: admin/settings.php:243 msgid "Version 2 (No user interaction needed, however, if traffic is suspicious, users are asked to solve a CAPTCHA)" msgstr "" -#: admin/settings.php:181 +#: admin/settings.php:244 msgid "Version 3 (verify request with a score without user interaction)" msgstr "" -#: admin/settings.php:189 -msgid "STEP 2: Specify the Site & Secret keys" +#: admin/settings.php:252 +msgid "Step 2: Specify the Site & Secret keys" msgstr "" #. translators:link to help page -#: admin/settings.php:200 -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." +#: admin/settings.php:263 +msgid "To utilize the Google reCAPTCHA service on your website you need to get a Site and Secret key. If you do not have these keys yet, you can option them for free by registering to the Google reCAPTCHA service. Refer to the document %s for a step by step explanation of how to get these keys." msgstr "" -#: admin/settings.php:201 +#: admin/settings.php:264 msgid "how to get the Google reCAPTCHA keys" msgstr "" -#: admin/settings.php:207 +#: admin/settings.php:270 msgid "Site Key" msgstr "" -#: admin/settings.php:212 +#: admin/settings.php:276 msgid "Secret Key" msgstr "" -#: admin/settings.php:219 +#: admin/settings.php:284, admin/settings.php:503 msgid "Key Validation" msgstr "" -#: admin/settings.php:220 -msgid "Once you enter the Site and Secret keys above the CAPTCHA method will appear below, depending on the method chosen. If the keys are incorrect, there will be an error notice. If you do see an error, check they provided keys match the method and the domain as well." +#: admin/settings.php:285, admin/settings.php:504 +msgid "Once you enter the correct Site and Secret keys above, the CAPTCHA method you want to use on your website will appear below. If the keys are incorrect you will instead see an error. If you see an error make sure the CAPTCHA version, website domain and both keys match." msgstr "" -#: admin/settings.php:228 -msgid "STEP 3 (OPTIONAL): Fine-tune reCAPTCHA to your requirements" +#: admin/settings.php:293 +msgid "Optional settings: Fine-tune reCAPTCHA to your requirements" msgstr "" -#: admin/settings.php:238 +#: admin/settings.php:303 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." msgstr "" -#: admin/settings.php:244 +#: admin/settings.php:309 msgid "Captcha Score" msgstr "" -#: admin/settings.php:250 +#: admin/settings.php:315 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." msgstr "" -#: admin/settings.php:253 +#: admin/settings.php:318 msgid "Load CAPTCHA v3 scripts on:" msgstr "" -#: admin/settings.php:259 +#: admin/settings.php:324 msgid "All Pages" msgstr "" -#: admin/settings.php:260 +#: admin/settings.php:325 msgid "Form Pages" msgstr "" -#: admin/settings.php:262 +#: admin/settings.php:327 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." msgstr "" -#: admin/settings.php:265 +#: admin/settings.php:330 msgid "CAPTCHA language" msgstr "" -#: admin/settings.php:271 +#: admin/settings.php:336 msgid "Select a language" msgstr "" -#: admin/settings.php:282 +#: admin/settings.php:347 msgid "Arabic" msgstr "" -#: admin/settings.php:283 +#: admin/settings.php:348 msgid "Bulgarian" msgstr "" -#: admin/settings.php:284 +#: admin/settings.php:349 msgid "Catalan" msgstr "" -#: admin/settings.php:285 +#: admin/settings.php:350 msgid "Chinese (Simplified)" msgstr "" -#: admin/settings.php:286 +#: admin/settings.php:351 msgid "Chinese (Traditional)" msgstr "" -#: admin/settings.php:287 +#: admin/settings.php:352 msgid "Croatian" msgstr "" -#: admin/settings.php:288 +#: admin/settings.php:353 msgid "Czech" msgstr "" -#: admin/settings.php:289 +#: admin/settings.php:354 msgid "Danish" msgstr "" -#: admin/settings.php:290 +#: admin/settings.php:355 msgid "Dutch" msgstr "" -#: admin/settings.php:291 +#: admin/settings.php:356 msgid "English (UK)" msgstr "" -#: admin/settings.php:292 +#: admin/settings.php:357 msgid "English (US)" msgstr "" -#: admin/settings.php:293 +#: admin/settings.php:358 msgid "Filipino" msgstr "" -#: admin/settings.php:294 +#: admin/settings.php:359 msgid "Finnish" msgstr "" -#: admin/settings.php:295 +#: admin/settings.php:360 msgid "French" msgstr "" -#: admin/settings.php:296 +#: admin/settings.php:361 msgid "French (Canadian)" msgstr "" -#: admin/settings.php:297 +#: admin/settings.php:362 msgid "German" msgstr "" -#: admin/settings.php:298 +#: admin/settings.php:363 msgid "German (Austria)" msgstr "" -#: admin/settings.php:299 +#: admin/settings.php:364 msgid "German (Switzerland)" msgstr "" -#: admin/settings.php:300 +#: admin/settings.php:365 msgid "Greek" msgstr "" -#: admin/settings.php:301 +#: admin/settings.php:366 msgid "Hebrew" msgstr "" -#: admin/settings.php:302 +#: admin/settings.php:367 msgid "Hindi" msgstr "" -#: admin/settings.php:303 +#: admin/settings.php:368 msgid "Hungarain" msgstr "" -#: admin/settings.php:304 +#: admin/settings.php:369 msgid "Indonesian" msgstr "" -#: admin/settings.php:305 +#: admin/settings.php:370 msgid "Italian" msgstr "" -#: admin/settings.php:306 +#: admin/settings.php:371 msgid "Japanese" msgstr "" -#: admin/settings.php:307 +#: admin/settings.php:372 msgid "Korean" msgstr "" -#: admin/settings.php:308 +#: admin/settings.php:373 msgid "Latvian" msgstr "" -#: admin/settings.php:309 +#: admin/settings.php:374 msgid "Lithuanian" msgstr "" -#: admin/settings.php:310 +#: admin/settings.php:375 msgid "Norwegian" msgstr "" -#: admin/settings.php:311 +#: admin/settings.php:376 msgid "Persian" msgstr "" -#: admin/settings.php:312 +#: admin/settings.php:377 msgid "Polish" msgstr "" -#: admin/settings.php:313 +#: admin/settings.php:378 msgid "Portuguese" msgstr "" -#: admin/settings.php:314 +#: admin/settings.php:379 msgid "Portuguese (Brazil)" msgstr "" -#: admin/settings.php:315 +#: admin/settings.php:380 msgid "Portuguese (Portugal)" msgstr "" -#: admin/settings.php:316 +#: admin/settings.php:381 msgid "Romanian" msgstr "" -#: admin/settings.php:317 +#: admin/settings.php:382 msgid "Russian" msgstr "" -#: admin/settings.php:318 +#: admin/settings.php:383 msgid "Serbian" msgstr "" -#: admin/settings.php:319 +#: admin/settings.php:384 msgid "Slovak" msgstr "" -#: admin/settings.php:320 +#: admin/settings.php:385 msgid "Slovenian" msgstr "" -#: admin/settings.php:321 +#: admin/settings.php:386 msgid "Spanish" msgstr "" -#: admin/settings.php:322 +#: admin/settings.php:387 msgid "Spanish (Latin America)" msgstr "" -#: admin/settings.php:323 +#: admin/settings.php:388 msgid "Swedish" msgstr "" -#: admin/settings.php:324 +#: admin/settings.php:389 msgid "Thai" msgstr "" -#: admin/settings.php:325 +#: admin/settings.php:390 msgid "Turkish" msgstr "" -#: admin/settings.php:326 +#: admin/settings.php:391 msgid "Ukrainian" msgstr "" -#: admin/settings.php:327 +#: admin/settings.php:392 msgid "Vietnamese" msgstr "" -#: admin/settings.php:331 +#: admin/settings.php:396 msgid "Error message" msgstr "" -#: admin/settings.php:333 +#: admin/settings.php:398 msgid "Please solve the CAPTCHA to proceed" msgstr "" -#: admin/settings.php:334 +#: admin/settings.php:399 msgid "Specify the message you want to show users who do not complete the CAPTCHA." msgstr "" -#: admin/settings.php:337 +#: admin/settings.php:402 msgid "Theme" msgstr "" -#: admin/settings.php:343 +#: admin/settings.php:408 msgid "Light" msgstr "" -#: admin/settings.php:344 +#: admin/settings.php:409 msgid "Dark" msgstr "" -#: admin/settings.php:348 +#: admin/settings.php:413 msgid "Size" msgstr "" -#: admin/settings.php:354 +#: admin/settings.php:419 msgid "Normal" msgstr "" -#: admin/settings.php:355 +#: admin/settings.php:420 msgid "Compact" msgstr "" -#: admin/settings.php:359, admin/settings.php:372 +#: admin/settings.php:424, admin/settings.php:437 msgid "Badge" msgstr "" -#: admin/settings.php:365, admin/settings.php:378 +#: admin/settings.php:430, admin/settings.php:443 msgid "Bottom Right" msgstr "" -#: admin/settings.php:366, admin/settings.php:379 +#: admin/settings.php:431, admin/settings.php:444 msgid "Bottom Left" msgstr "" -#: admin/settings.php:367 +#: admin/settings.php:432 msgid "Inline" msgstr "" -#: admin/settings.php:369 +#: admin/settings.php:434 msgid "Badge shows for invisible captcha" msgstr "" -#: admin/settings.php:381 +#: admin/settings.php:446 msgid "Badge shows for invisible captcha v3" msgstr "" -#: admin/settings.php:384 +#: admin/settings.php:449 msgid "reCAPTCHA domain" msgstr "" -#: admin/settings.php:394 +#: admin/settings.php:459 msgid "Use this setting to change the domain if Google is not accessible or blocked." msgstr "" -#: admin/settings.php:397 +#: admin/settings.php:462 msgid "Remove CSS" msgstr "" -#: admin/settings.php:401 +#: admin/settings.php:466 msgid "Remove this plugin's css from login page?" msgstr "" -#: admin/settings.php:402 +#: admin/settings.php:467 msgid "This css increase login page width to adjust with Captcha width." msgstr "" -#: admin/settings.php:411 +#: admin/settings.php:471 +msgid "v3 failover action:" +msgstr "" + +#: admin/settings.php:477 +msgid "Show a v2 CAPTCHA checkbox" +msgstr "" + +#: admin/settings.php:478 +msgid "Redirect the website visitor to a URL" +msgstr "" + +#: admin/settings.php:479 +msgid "Take no action" +msgstr "" + +#: admin/settings.php:483 +msgid "Redirect URL" +msgstr "" + +#: admin/settings.php:489 +msgid "v2 Site key:" +msgstr "" + +#: admin/settings.php:495 +msgid "v2 Secret key:" +msgstr "" + +#: admin/settings.php:514 msgid "Select where on your website you want to add the CAPTCHA check" msgstr "" -#: admin/settings.php:424 +#: admin/settings.php:527 msgid "WordPress pages" msgstr "" -#: admin/settings.php:429 +#: admin/settings.php:532 msgid "Login form" msgstr "" -#: admin/settings.php:430 +#: admin/settings.php:533 msgid "Registration form" msgstr "" -#: admin/settings.php:431 +#: admin/settings.php:534 msgid "Reset password form" msgstr "" -#: admin/settings.php:432 +#: admin/settings.php:535 msgid "Lost password form" msgstr "" -#: admin/settings.php:446, admin/settings.php:980 +#: admin/settings.php:550, admin/settings.php:1100 msgid "Upgrade to Premium" msgstr "" -#: admin/settings.php:447 +#: admin/settings.php:551 msgid "Find out more" msgstr "" -#: admin/settings.php:450 +#: admin/settings.php:554 msgid "Checkout and login pages on WooCommerce stores" msgstr "" -#: admin/settings.php:451 -msgid "Contact Form 7, MailChimp 4 WordPress forms" +#: admin/settings.php:555 +msgid "Contact Form 7, Gravity Forms, WPForms, MailChimp 4 WordPress forms" msgstr "" -#: admin/settings.php:452 +#: admin/settings.php:556 msgid "BuddyPress and bbPress" msgstr "" -#: admin/settings.php:453 +#: admin/settings.php:557 msgid "And others" msgstr "" #. translators:field type -#: admin/settings.php:634 +#: admin/settings.php:746 msgid "No hook defined for %s" msgstr "" -#: admin/settings.php:734, admin/settings.php:735, admin/settings.php:735, admin/settings.php:755, admin/settings.php:756, admin/settings.php:756, admin/settings.php:840 +#: admin/settings.php:851, admin/settings.php:852, admin/settings.php:852, admin/settings.php:872, admin/settings.php:873, admin/settings.php:873, admin/settings.php:962 msgid "CAPTCHA Configuration" msgstr "" -#: admin/settings.php:734, admin/settings.php:755 +#: admin/settings.php:851, admin/settings.php:872 msgid "CAPTCHA 4WP" msgstr "" -#: admin/settings.php:736, admin/settings.php:757 +#: admin/settings.php:853, admin/settings.php:874 msgid "CAPTCHA 4WP Settings" msgstr "" -#: admin/settings.php:736, admin/settings.php:757 +#: admin/settings.php:853, admin/settings.php:874 msgid "Settings & Placements" msgstr "" -#: admin/settings.php:737, admin/settings.php:737, admin/settings.php:758, admin/settings.php:758 +#: admin/settings.php:854, admin/settings.php:854, admin/settings.php:875, admin/settings.php:875 msgid "Help & Contact Us" msgstr "" -#: admin/settings.php:740, admin/settings.php:740, admin/settings.php:761, admin/settings.php:761 +#: admin/settings.php:857, admin/settings.php:857, admin/settings.php:878, admin/settings.php:878 msgid "Premium Features ➤" msgstr "" -#: admin/settings.php:816 +#: admin/settings.php:935 msgid "Please supply a valid IP" msgstr "" -#: admin/settings.php:817 +#: admin/settings.php:936 msgid "Switching CAPTCHA methods will require your Site Key and Secret key to be replaced, do you wish to proceed?" msgstr "" -#: admin/settings.php:818 -msgid "Confirm CAPTCHA method change" +#: admin/settings.php:937 +msgid "Confirm change of reCAPTCHA integration" msgstr "" -#: admin/settings.php:841 -msgid "Configure it now" +#: admin/settings.php:938 +msgid "Confirm removal of reCAPTCHA integration" msgstr "" -#: admin/settings.php:842 -msgid "I'll configure it later" +#: admin/settings.php:939 +msgid "This will remove the current reCAPTCHA integration, which means all the CAPTCHA checks on your website will stop working. Would you like to proceed?" msgstr "" -#: admin/settings.php:854 +#: admin/settings.php:963 +msgid "Configure it now" +msgstr "" + +#: admin/settings.php:976 msgid "CAPTCHA Placements" msgstr "" -#: admin/settings.php:852 +#: admin/settings.php:974 msgid "CAPTCHA integration & configuration" msgstr "" -#: admin/settings.php:930 +#: admin/settings.php:1051 msgid "The site key that you have entered is invalid. Please try again." msgstr "" -#: admin/settings.php:933 +#: admin/settings.php:1054 msgid "The secret key that you have entered is invalid. Please try again." msgstr "" -#: admin/settings.php:936 -msgid "Captcha settings" +#: admin/settings.php:1057 +msgid "CAPTCHA settings" msgstr "" -#: admin/settings.php:938 -msgid "Captcha configuration" +#: admin/settings.php:1059 +msgid "CAPTCHA configuration" msgstr "" -#: admin/settings.php:940 +#: admin/settings.php:1061 msgid " updated" msgstr "" -#: admin/settings.php:962 +#: admin/settings.php:1083 msgid "Upgrade to Premium for:" msgstr "" -#: admin/settings.php:967 +#: admin/settings.php:1088 msgid "Use the language that your website viewers understand" msgstr "" -#: admin/settings.php:968 +#: admin/settings.php:1089 msgid "Spam protection for your WooCommerce stores" msgstr "" -#: admin/settings.php:969 +#: admin/settings.php:1090 msgid "Specify where to put the CAPTCHA test on WooCommerce checkout page" msgstr "" -#: admin/settings.php:970 -msgid "One-click Contact Form 7 forms spam protection" -msgstr "" - -#: admin/settings.php:971 -msgid "One-click spam protection for Mailchimp for WordPress forms" +#: admin/settings.php:1091 +msgid "One-click spam protection for forms built with Contact Form 7, Gravity Forms, WPForms & MailChimp for WordPress" msgstr "" -#: admin/settings.php:972 +#: admin/settings.php:1092 msgid "CAPTCHA tests & spam protection for BuddyPress, bbPress & other third party plugins" msgstr "" -#: admin/settings.php:973 +#: admin/settings.php:1093 msgid "Add CAPTCHA to any type of form, even PHP forms" msgstr "" -#: admin/settings.php:974 +#: admin/settings.php:1094 msgid "Boost login security, add CAPTCHA tests only failed logins" msgstr "" -#: admin/settings.php:975 +#: admin/settings.php:1095 msgid "Remove CAPTCHA for logged in users" msgstr "" -#: admin/settings.php:976 +#: admin/settings.php:1096 msgid "Remove CAPTCHA for specific IP addresses" msgstr "" -#: admin/settings.php:977 +#: admin/settings.php:1097 msgid "Remove CAPTCHA from specific URLs" msgstr "" -#: admin/settings.php:978 +#: admin/settings.php:1098 msgid "No Ads!" msgstr "" -#: admin/settings.php:980 -msgid "Get a FREE 7-day trial" +#: admin/settings.php:1100 +msgid "Get a FREE 14-day trial" msgstr "" -#: admin/settings.php:1036 +#: admin/settings.php:1156 msgid "Settings" msgstr "" +#: admin/settings.php:1254 +msgid "Getting started with the CAPTCHA 4WP plugin" +msgstr "" + +#: admin/settings.php:1255 +msgid "Thank you for installing the CAPTCHA 4WP plugin. This wizard will help you get started with the plugin so you can configure CAPTCHA and protect your website from spam, and fake registrations and orders." +msgstr "" + +#: admin/settings.php:1258, admin/settings.php:1274, admin/settings.php:1288, admin/settings.php:1308 +msgid "Cancel" +msgstr "" + +#: admin/settings.php:1261, admin/settings.php:1287, admin/settings.php:1307 +msgid "Back" +msgstr "" + +#: admin/settings.php:1292 +msgid "Step 3: Configure a failover action for reCAPTCHA v3 failure" +msgstr "" + +#: admin/settings.php:1293 +msgid "reCAPTCHA v3 is fully automated. This means that by default, if the CAPTCHA check fails the website visitor cannot proceed with what they are doing unless you configure a failover action. Use the below setting to configure the failover action." +msgstr "" + +#: admin/settings.php:1296 +msgid "Please specify the full URL, including the protocol (HTTP or HTTPS) where you would like the user to be redirected to. For example: " +msgstr "" + +#: admin/settings.php:1297 +msgid "To show the v2 reCAPTCHA checkbox you need to specify the Site and Secret keys. Please specify them below:" +msgstr "" + +#: admin/settings.php:1312 +msgid " All done - you can now add CAPTCHA checks to your website" +msgstr "" + +#: admin/settings.php:1313 +msgid "Now that the Google reCAPTCHA service is fully integrated you can use the optional settings to fine-tune CAPTCHA to your requirements. All the CAPTCHA settings are optional and with them you can configure aspects such as look and feel and CAPTCHA sensitivity. When you are ready navigate to the Settings & Placements page to configure where you'd like to add the CAPTCHA checks" +msgstr "" + +#: admin/settings.php:1315 +msgid "Finish" +msgstr "" + +#: admin/settings.php:1369 +msgid "Configure Google reCAPTCHA integration" +msgstr "" + +#: admin/settings.php:1337 +msgid "Remove reCAPTCHA integration" +msgstr "" + +#: admin/settings.php:1347 +msgid "CAPTCHA version:" +msgstr "" + +#: admin/settings.php:1348, admin/settings.php:1353 +msgid "Site key:" +msgstr "" + +#: admin/settings.php:1349, admin/settings.php:1354 +msgid "Secret key:" +msgstr "" + +#: admin/settings.php:1356, admin/settings.php:1352 +msgid "Failover action:" +msgstr "" + +#: admin/settings.php:1356 +msgid "Redirect to a URL" +msgstr "" + +#: admin/settings.php:1357 +msgid "Failover redirect URL:" +msgstr "" + +#: admin/settings.php:1352 +msgid "v2 checkbox" +msgstr "" + +#: admin/settings.php:1410 +msgid "Override validation response." +msgstr "" + +#: admin/settings.php:1416 +msgid "Do no override" +msgstr "" + +#: admin/settings.php:1417 +msgid "Return false (failure)" +msgstr "" + +#: admin/settings.php:1418 +msgid "Return true (pass)" +msgstr "" + #: admin/templates/help/help.php:20 msgid "Getting Started" msgstr "" diff --git a/languages/index.php b/languages/index.php new file mode 100644 index 0000000..e94d9a4 --- /dev/null +++ b/languages/index.php @@ -0,0 +1,4 @@ +THE MOST POWERFUL & EASY TO USE CAPTCHA SOLUTION FOR WORDPRESS WEBSITES
    -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, Gravity Forms, MailChimp for WordPress, BuddyPress, WooCommerce, bbPress and many others. +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. 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. -With the free edition you can add CAPTCHA to the built-in forms in WordPress, such as the login and comments forms. To add CAPTCHA to forms by third party plugins, such as WooCommerce, Contact Form 7 and BuddyPress [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). +The plugin is trusted by more than 200,000 administrators to protect their websites from spam, fake accounts, & fake orders! + +> 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 [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). +> #### Maintained & Supported by WP White Security @@ -107,6 +110,40 @@ Simply select the WooCommerce page you want to add CAPTCHA to in the plugin's CA == Changelog == += 7.2.0 (20230427) = + +Release notes: [CAPTCHA 4WP 7.2.0 - Failover for V3 and much more!](https://www.wpwhitesecurity.com/c4wp-7-2-0/) + +* **New features & functionality** + * CAPTCHA failure fallback system: V3 now has a fallback option when the initial check fails: choose between redirecting to another page or show a V2 "I am not a robot checkbox". + * First time install wizard to guide users through setting up the Google reCAPTCHA etc. + * Google reCAPTCHA configuration shown in the UI / plugin settings. + * Wizard to assinst user changing the reCAPTCHA configuration. + * Google reCAPTCHA keys validation - all keys are validated within the admin area to ensure the correct details have been provided. + * New WPML config file for WPML support (translations). + * Support for WooCommerce HPOS so user can activate the feature without hinderance. + +* **Improvements** + * WooCommerce support - improved overall form handling to ensure less friction with 3rd party scripts. + * In WPForms editor the plugin's message is shown in the correct place when editing posts via Gutenberg. + * V2 Checkbox - The field now resets itself should it expire due to lack to user input. + * Improved performance and compatibility of custom JS in BuddyPress. + * Core JS is now written in plain Javascript for Improved performance and compatibility. + * Overall coding standards improvements + * UI Improvements to the ‘excluded IP’ and ‘excluded users’ fields in the plugin settings. + * Improved plugin's help and UI text for improved ease of use. + * Moved the Captcha preview within the configuration popup in the plugin settings. + * Removed any use of depreciated JS function ‘jQuery.fn.load’. + +* **Bug fixes** + * CF7 + V2 Invisible - Fixed issue causing mail sent confirmation to be removed on submission. + * BuddyPress + V3 - Fixed issue causing user registration for to return console errors + * WPForms + V3 - Fixed issue causing ‘please solve captcha’ message to still appear on valid submissions. + * Improved compatibility with WP comment systems which do not use jQuery. + * Multisite - Removed link to settings page where needed. + * Fixed bug in Settings which would cause removed IP address and users to re-appear on refresh. + * Fixed issue in ‘hide for IP’ setting which can occur when multiple IDs are present. + = 7.1.1 (20220818) = * **New features** @@ -157,10 +194,12 @@ Release notes: [Support for WPForms & Gravity Forms plugins](https://www.wpwhite * Ensure correct default language is set during update in free edition. * Ensure verification does not hinder hook requests where no CAPTCHA is posted. -= 7.0.6 (20220315) = += 7.0.6 (20220304) = -* **New features & functionality** - * A new setting that allows you to enable CAPTCHA on WooCommerce logins whilst disabling it on the checkout login form. +Release notes: [CAPTCHA 4WP 7.0.6 Free Edition](https://www.wpwhitesecurity.com/c4wp-free-7-0-6/) + +* **Breaking change** + * 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/). Release notes: [CAPTCHA 4WP 7.0.6 Free Edition](https://www.wpwhitesecurity.com/c4wp-free-7-0-6/) diff --git a/wpml-config.xml b/wpml-config.xml new file mode 100644 index 0000000..63dad64 --- /dev/null +++ b/wpml-config.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file