ID;
$current_screen = get_current_screen();
$notice_nonce = wp_create_nonce( 'dismiss_captcha_notice' );
$logo_img_src = ANR_PLUGIN_URL . 'assets/img/hero-logo.png';
$meta_key = 'nocaptcha_plugin_notice_ignore_' . str_replace( '.', '', ANR_PLUGIN_VERSION );
// General notice in dashboard.
if ( current_user_can( 'manage_options' ) && ! get_user_meta( $user_id, $meta_key ) && $current_screen->base !== 'settings_page_anr-admin-settings' ) {
// Add scripts.
wp_enqueue_script( 'anr-admin' );
$notice_title = 'ANNOUNCEMENT: UPCOMING BREAKING CHANGE ON 15th MARCH';
$notice_text = '
With the CAPTCHA 4WP plugin, you can add CAPTCHA to forms created by third-party plugins such as Contact Form 7 and WooCommerce. This is a premium feature. However, this feature was also working in the free edition. Therefore we are temporarily allowing it in the Free edition for a few more weeks before moving it to Premium, to give users who are already using it the time they need to take the necessary action. We will fix this and this feature will stop working in the Free edition on 15th March.
';
$notice_text .= 'If you would like to continue using this functionality, please upgrade to Premium before 15th March 2022.
';
$notice_text .= 'Thank you for your understanding and for using our plugin.
';
echo '
'.$notice_title.' '.$notice_text.' Dismiss. ';
}
// General notice in dashboard.
if ( current_user_can( 'manage_options' ) && $current_screen->base === 'settings_page_anr-admin-settings' ) {
$notice_title = 'ANNOUNCEMENT: UPCOMING BREAKING CHANGE ON 15th MARCH';
$notice_text = 'With this plugin, you can add CAPTCHA to forms created by third-party plugins such as Contact Form 7 and WooCommerce. This is a premium feature. However, this feature was also working in the free edition. Therefore we are temporarily allowing it in the Free edition for a few more weeks before moving it to Premium, to give users who are already using it the time they need to take the necessary action. We will fix this and this feature will stop working in the Free edition on 15th March.
';
$notice_text .= 'If you would like to continue using this functionality, please upgrade to Premium before 15th March 2022.
';
$notice_text .= 'Thank you for your understanding and for using our plugin.
';
echo '
'.$notice_title.' '.$notice_text.' ';
}
}
function adv_nocaptcha_plugin_notice_ignore() {
// Grab POSTed data.
$nonce = filter_input( INPUT_POST, 'nonce', 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' ) );
}
global $current_user;
$user_id = $current_user->ID;
$meta_key = 'nocaptcha_plugin_notice_ignore_' . str_replace( '.', '', ANR_PLUGIN_VERSION );
$updated = add_user_meta( $user_id, $meta_key, 'true', true );
wp_send_json_success($updated);
}
function admin_enqueue_scripts() {
wp_register_script( 'anr-admin', ANR_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery' ), ANR_PLUGIN_VERSION, true );
}
function admin_init() {
register_setting( 'anr_admin_options', 'anr_admin_options', array( $this, 'options_sanitize' ) );
foreach ( $this->get_sections() as $section_id => $section ) {
add_settings_section( $section_id, $section['section_title'], ! empty( $section['section_callback'] ) ? $section['section_callback'] : null, 'anr_admin_options' );
}
foreach ( $this->get_fields() as $field_id => $field ) {
add_settings_field( $field['id'], $field['label'], ! empty( $field['callback'] ) ? $field['callback'] : array( $this, 'callback' ), 'anr_admin_options', $field['section_id'], $field );
}
}
function get_sections() {
$sections = array(
'google_keys' => array(
'section_title' => __( 'Google Keys', 'advanced-nocaptcha-recaptcha' ),
'section_callback' => function() {
printf( __( 'Get reCaptcha keys from Google . Make sure to get keys for your selected captcha type. How to get google reCAPTCHA keys? .', 'advanced-nocaptcha-recaptcha' ), 'https://www.google.com/recaptcha/admin', 'https://www.wpwhitesecurity.com/support/kb/get-google-recaptcha-keys/' );
},
),
'forms' => array(
'section_title' => __( 'Forms', 'advanced-nocaptcha-recaptcha' ),
),
'other' => array(
'section_title' => __( 'Other Settings', 'advanced-nocaptcha-recaptcha' ),
),
);
return apply_filters( 'anr_settings_sections', $sections );
}
function get_fields() {
$score_values = [];
for ( $i = 0.0; $i <= 1; $i += 0.1 ) {
$score_values[ "$i" ] = number_format_i18n( $i, 1 );
}
$score_description = sprintf(
/* translators: expression "very restrictive" in bold */
esc_html__( 'Any value above 0.5 is %s.', 'advanced-nocaptcha-recaptcha' ),
''.__( 'very restrictive', 'advanced-nocaptcha-recaptcha' ) . ' '
);
$score_description .= ' ' . esc_html__( 'This means that you might end up locked out from your website. Therefore test this on a staging website website beforehand.', 'advanced-nocaptcha-recaptcha' );
$fields = array(
'captcha_version' => array(
'label' => __( 'reCAPTCHA type', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'google_keys',
'type' => 'select',
'class' => 'regular',
'std' => 'v2_checkbox',
'options' => array(
'v2_checkbox' => __( 'V2 "I\'m not a robot"', 'advanced-nocaptcha-recaptcha' ),
'v2_invisible' => __( 'V2 Invisible', 'advanced-nocaptcha-recaptcha' ),
'v3' => __( 'V3', 'advanced-nocaptcha-recaptcha' ),
),
'desc' => __( 'Select your reCAPTCHA type. Make sure to use site key and secret key for your selected type.', 'advanced-nocaptcha-recaptcha' ),
),
'site_key' => array(
'label' => __( 'Site Key', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'google_keys',
),
'secret_key' => array(
'label' => __( 'Secret Key', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'google_keys',
),
'enabled_forms' => array(
'label' => __( 'Enabled Forms', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'forms',
'type' => 'multicheck',
'class' => 'checkbox',
'options' => array(
'login' => __( 'Login Form', 'advanced-nocaptcha-recaptcha' ),
'registration' => __( 'Registration Form', 'advanced-nocaptcha-recaptcha' ),
'ms_user_signup' => __( 'Multisite User Signup Form', 'advanced-nocaptcha-recaptcha' ),
'lost_password' => __( 'Lost Password Form', 'advanced-nocaptcha-recaptcha' ),
'reset_password' => __( 'Reset Password Form', 'advanced-nocaptcha-recaptcha' ),
'comment' => __( 'Comment Form', 'advanced-nocaptcha-recaptcha' ),
'bbp_new' => __( 'bbPress New topic', 'advanced-nocaptcha-recaptcha' ),
'bbp_reply' => __( 'bbPress reply to topic', 'advanced-nocaptcha-recaptcha' ),
'bp_register' => __( 'BuddyPress register', 'advanced-nocaptcha-recaptcha' ),
'wc_checkout' => __( 'WooCommerce Checkout', 'advanced-nocaptcha-recaptcha' ),
),
'desc' => sprintf( __( 'For "Contact Form 7" you need to follow this instruction . For other forms see this instruction ', 'advanced-nocaptcha-recaptcha' ), esc_url( 'https://www.wpwhitesecurity.com/support/kb/adding-captcha-contact-form-7-forms/' ), esc_url( anr_settings_page_url( 'instruction' ) ) ),
),
'error_message' => array(
'label' => __( 'Error Message', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'std' => __( 'Please solve Captcha correctly', 'advanced-nocaptcha-recaptcha' ),
),
'language' => array(
'label' => __( 'Captcha Language', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular',
'options' => array(
'' => __( 'Auto Detect', 'advanced-nocaptcha-recaptcha' ),
'ar' => __( 'Arabic', 'advanced-nocaptcha-recaptcha' ),
'bg' => __( 'Bulgarian', 'advanced-nocaptcha-recaptcha' ),
'ca' => __( 'Catalan', 'advanced-nocaptcha-recaptcha' ),
'zh-CN' => __( 'Chinese (Simplified)', 'advanced-nocaptcha-recaptcha' ),
'zh-CN' => __( 'Chinese (Traditional)', 'advanced-nocaptcha-recaptcha' ),
'hr' => __( 'Croatian', 'advanced-nocaptcha-recaptcha' ),
'cs' => __( 'Czech', 'advanced-nocaptcha-recaptcha' ),
'da' => __( 'Danish', 'advanced-nocaptcha-recaptcha' ),
'nl' => __( 'Dutch', 'advanced-nocaptcha-recaptcha' ),
'en-GB' => __( 'English (UK)', 'advanced-nocaptcha-recaptcha' ),
'en' => __( 'English (US)', 'advanced-nocaptcha-recaptcha' ),
'fil' => __( 'Filipino', 'advanced-nocaptcha-recaptcha' ),
'fi' => __( 'Finnish', 'advanced-nocaptcha-recaptcha' ),
'fr' => __( 'French', 'advanced-nocaptcha-recaptcha' ),
'fr-CA' => __( 'French (Canadian)', 'advanced-nocaptcha-recaptcha' ),
'de' => __( 'German', 'advanced-nocaptcha-recaptcha' ),
'de-AT' => __( 'German (Austria)', 'advanced-nocaptcha-recaptcha' ),
'de-CH' => __( 'German (Switzerland)', 'advanced-nocaptcha-recaptcha' ),
'el' => __( 'Greek', 'advanced-nocaptcha-recaptcha' ),
'iw' => __( 'Hebrew', 'advanced-nocaptcha-recaptcha' ),
'hi' => __( 'Hindi', 'advanced-nocaptcha-recaptcha' ),
'hu' => __( 'Hungarain', 'advanced-nocaptcha-recaptcha' ),
'id' => __( 'Indonesian', 'advanced-nocaptcha-recaptcha' ),
'it' => __( 'Italian', 'advanced-nocaptcha-recaptcha' ),
'ja' => __( 'Japanese', 'advanced-nocaptcha-recaptcha' ),
'ko' => __( 'Korean', 'advanced-nocaptcha-recaptcha' ),
'lv' => __( 'Latvian', 'advanced-nocaptcha-recaptcha' ),
'lt' => __( 'Lithuanian', 'advanced-nocaptcha-recaptcha' ),
'no' => __( 'Norwegian', 'advanced-nocaptcha-recaptcha' ),
'fa' => __( 'Persian', 'advanced-nocaptcha-recaptcha' ),
'pl' => __( 'Polish', 'advanced-nocaptcha-recaptcha' ),
'pt' => __( 'Portuguese', 'advanced-nocaptcha-recaptcha' ),
'pt-BR' => __( 'Portuguese (Brazil)', 'advanced-nocaptcha-recaptcha' ),
'pt-PT' => __( 'Portuguese (Portugal)', 'advanced-nocaptcha-recaptcha' ),
'ro' => __( 'Romanian', 'advanced-nocaptcha-recaptcha' ),
'ru' => __( 'Russian', 'advanced-nocaptcha-recaptcha' ),
'sr' => __( 'Serbian', 'advanced-nocaptcha-recaptcha' ),
'sk' => __( 'Slovak', 'advanced-nocaptcha-recaptcha' ),
'sl' => __( 'Slovenian', 'advanced-nocaptcha-recaptcha' ),
'es' => __( 'Spanish', 'advanced-nocaptcha-recaptcha' ),
'es-419' => __( 'Spanish (Latin America)', 'advanced-nocaptcha-recaptcha' ),
'sv' => __( 'Swedish', 'advanced-nocaptcha-recaptcha' ),
'th' => __( 'Thai', 'advanced-nocaptcha-recaptcha' ),
'tr' => __( 'Turkish', 'advanced-nocaptcha-recaptcha' ),
'uk' => __( 'Ukrainian', 'advanced-nocaptcha-recaptcha' ),
'vi' => __( 'Vietnamese', 'advanced-nocaptcha-recaptcha' ),
),
),
'theme' => array(
'label' => __( 'Theme', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular hidden anr-show-field-for-v2_checkbox anr-show-field-for-v2_invisible',
'std' => 'light',
'options' => array(
'light' => __( 'Light', 'advanced-nocaptcha-recaptcha' ),
'dark' => __( 'Dark', 'advanced-nocaptcha-recaptcha' ),
),
),
'size' => array(
'label' => __( 'Size', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular hidden anr-show-field-for-v2_checkbox',
'std' => 'normal',
'options' => array(
'normal' => __( 'Normal', 'advanced-nocaptcha-recaptcha' ),
'compact' => __( 'Compact', 'advanced-nocaptcha-recaptcha' ),
),
),
'badge' => array(
'label' => __( 'Badge', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular hidden anr-show-field-for-v2_invisible',
'std' => 'bottomright',
'options' => array(
'bottomright' => __( 'Bottom Right', 'advanced-nocaptcha-recaptcha' ),
'bottomleft' => __( 'Bottom Left', 'advanced-nocaptcha-recaptcha' ),
'inline' => __( 'Inline', 'advanced-nocaptcha-recaptcha' ),
),
'desc' => __( 'Badge shows for invisible captcha', 'advanced-nocaptcha-recaptcha' ),
),
'failed_login_allow' => array(
'label' => __( 'Failed login Captcha', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'std' => 0,
'type' => 'number',
'class' => 'regular-number',
'sanitize_callback' => 'absint',
'desc' => __( 'Show login Captcha after how many failed attempts? 0 = show always', 'advanced-nocaptcha-recaptcha' ),
),
'v3_script_load' => array(
'label' => __( 'v3 Script Load', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular hidden anr-show-field-for-v3',
'std' => 'all_pages',
'options' => array(
'all_pages' => __( 'All Pages', 'advanced-nocaptcha-recaptcha' ),
'form_pages' => __( 'Form Pages', 'advanced-nocaptcha-recaptcha' ),
),
'desc' => __( 'Loading in All Pages help google for analytics', 'advanced-nocaptcha-recaptcha' ),
),
'score' => array(
'label' => __( 'Captcha Score', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular hidden anr-show-field-for-v3',
'std' => '0.5',
'options' => $score_values,
'desc' => $score_description,
),
'whitelisted_ips' => array(
'label' => __( 'Whitelisted IPs', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'textarea',
'class' => 'regular',
'desc' => __( 'One per line', 'advanced-nocaptcha-recaptcha' ),
),
'recaptcha_domain' => array(
'label' => __( 'Recaptcha Domain', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'select',
'class' => 'regular',
'std' => anr_recaptcha_domain(),
'options' => array(
'google.com' => 'google.com',
'google.net' => 'google.net',
'recaptcha.net' => 'recaptcha.net',
),
'desc' => __( 'If any one is blocked in your country select other one.', 'advanced-nocaptcha-recaptcha' ),
),
'loggedin_hide' => array(
'label' => __( 'Logged in Hide', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'checkbox',
'class' => 'checkbox',
'cb_label' => __( 'Hide Captcha for logged in users?', 'advanced-nocaptcha-recaptcha' ),
),
'remove_css' => array(
'label' => __( 'Remove CSS', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'checkbox',
'class' => 'checkbox hidden anr-show-field-for-v2_checkbox',
'cb_label' => __( "Remove this plugin's css from login page?", 'advanced-nocaptcha-recaptcha' ),
'desc' => __( 'This css increase login page width to adjust with Captcha width.', 'advanced-nocaptcha-recaptcha' ),
),
'no_js' => array(
'label' => __( 'No JS Captcha', 'advanced-nocaptcha-recaptcha' ),
'section_id' => 'other',
'type' => 'checkbox',
'class' => 'checkbox hidden anr-show-field-for-v2_checkbox',
'cb_label' => __( 'Show captcha if javascript disabled?', 'advanced-nocaptcha-recaptcha' ),
'desc' => __( 'If JavaScript is a requirement for your site, we advise that you do NOT check this.', 'advanced-nocaptcha-recaptcha' ),
),
);
if ( ! class_exists( 'ANR_Pro' ) ) :
$fields['pro_notice'] = array(
'section_id' => 'forms',
'type' => 'html',
'std' => sprintf( '', 'https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/pricing/' ),
);
endif;
$fields = apply_filters( 'anr_settings_fields', $fields );
foreach ( $fields as $field_id => $field ) {
$fields[ $field_id ] = wp_parse_args(
$field, array(
'id' => $field_id,
'label' => '',
'cb_label' => '',
'type' => 'text',
'class' => 'regular-text',
'section_id' => '',
'desc' => '',
'std' => '',
)
);
}
return $fields;
}
function callback( $field ) {
$attrib = '';
if ( ! empty( $field['required'] ) ) {
$attrib .= ' required = "required"';
}
if ( ! empty( $field['readonly'] ) ) {
$attrib .= ' readonly = "readonly"';
}
if ( ! empty( $field['disabled'] ) ) {
$attrib .= ' disabled = "disabled"';
}
if ( ! empty( $field['minlength'] ) ) {
$attrib .= ' minlength = "' . absint( $field['minlength'] ) . '"';
}
if ( ! empty( $field['maxlength'] ) ) {
$attrib .= ' maxlength = "' . absint( $field['maxlength'] ) . '"';
}
$value = anr_get_option( $field['id'], $field['std'] );
switch ( $field['type'] ) {
case 'text':
case 'email':
case 'url':
case 'number':
case 'hidden':
case 'submit':
printf(
' ',
esc_attr( $field['type'] ),
esc_attr( $field['id'] ),
esc_attr( $field['class'] ),
esc_attr( $field['id'] ),
isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '',
esc_attr( $value ),
$attrib
);
break;
case 'textarea':
printf( '',
esc_attr( $field['id'] ),
esc_attr( $field['class'] ),
esc_attr( $field['id'] ),
isset( $field['placeholder'] ) ? esc_attr( $field['placeholder'] ) : '',
$attrib,
esc_textarea( $value )
);
break;
case 'checkbox':
printf( ' ', esc_attr( $field['id'] ) );
printf(
' %7$s ',
'checkbox',
esc_attr( $field['id'] ),
esc_attr( $field['class'] ),
esc_attr( $field['id'] ),
'1',
checked( $value, '1', false ),
esc_attr( $field['cb_label'] )
);
break;
case 'multicheck':
printf( ' ', esc_attr( $field['id'] ) );
foreach ( $field['options'] as $key => $label ) {
printf(
' %7$s ',
'checkbox',
esc_attr( $field['id'] ),
esc_attr( $field['class'] ),
esc_attr( $field['id'] ),
esc_attr( $key ),
checked( in_array( $key, (array) $value ), true, false ),
esc_attr( $label )
);
}
break;
case 'select':
printf(
'',
esc_attr( $field['id'] ),
esc_attr( $field['class'] ),
esc_attr( $field['id'] )
);
foreach ( $field['options'] as $key => $label ) {
printf(
'%3$s ',
esc_attr( $key ),
selected( $value, $key, false ),
esc_attr( $label )
);
}
printf( ' ' );
break;
case 'html':
echo $field['std'];
break;
default:
printf( __( 'No hook defined for %s', 'advanced-nocaptcha-recaptcha' ), esc_html( $field['type'] ) );
break;
}
if ( ! empty( $field['desc'] ) ) {
printf( '%s
', $field['desc'] );
}
}
function options_sanitize( $value ) {
if ( ! $value || ! is_array( $value ) ) {
return $value;
}
$fields = $this->get_fields();
foreach ( $value as $option_slug => $option_value ) {
if ( isset( $fields[ $option_slug ] ) && ! empty( $fields[ $option_slug ]['sanitize_callback'] ) ) {
$value[ $option_slug ] = call_user_func( $fields[ $option_slug ]['sanitize_callback'], $option_value );
} elseif ( isset( $fields[ $option_slug ] ) ) {
$value[ $option_slug ] = $this->posted_value_sanitize( $option_value, $fields[ $option_slug ] );
}
}
return $value;
}
function posted_value_sanitize( $value, $field ) {
$sanitized = $value;
switch ( $field['type'] ) {
case 'text':
case 'hidden':
$sanitized = sanitize_text_field( trim( $value ) );
break;
case 'url':
$sanitized = esc_url( $value );
break;
case 'number':
$sanitized = absint( $value );
break;
case 'textarea':
case 'wp_editor':
case 'teeny':
$sanitized = wp_kses_post( $value );
break;
case 'checkbox':
$sanitized = absint( $value );
break;
case 'multicheck':
$sanitized = is_array( $value ) ? array_filter( $value ) : array();
foreach( $sanitized as $key => $p_value ) {
if ( ! array_key_exists( $p_value, $field['options'] ) ) {
unset( $sanitized[ $key ] );
}
}
break;
case 'select':
if ( ! array_key_exists( $value, $field['options'] ) ) {
$sanitized = isset($field['std'])? $field['std'] : '';
}
break;
default:
$sanitized = apply_filters( 'anr_settings_field_sanitize_filter_' . $field['type'], $value, $field );
break;
}
return apply_filters( 'anr_settings_field_sanitize_filter', $sanitized, $field, $value );
}
function menu_page() {
add_options_page( __( 'Advanced noCaptcha & invisible captcha Settings', 'advanced-nocaptcha-recaptcha' ), __( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'anr-admin-settings', array( $this, 'admin_settings' ) );
//add_submenu_page( 'anr-non-exist-menu', 'Advanced noCaptcha reCaptcha - ' . __( 'Instruction', 'advanced-nocaptcha-recaptcha' ), __( 'Instruction', 'advanced-nocaptcha-recaptcha' ), 'manage_options', 'anr-instruction', array( $this, 'instruction_page' ) );
}
function network_menu_page() {
add_submenu_page( 'settings.php', __( 'Advanced noCaptcha & invisible captcha Settings', 'advanced-nocaptcha-recaptcha' ), __( 'CAPTCHA 4WP', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'anr-admin-settings', array( $this, 'admin_settings' ) );
//add_submenu_page( 'anr-non-exist-menu', 'Advanced noCaptcha reCaptcha - ' . __( 'Instruction', 'advanced-nocaptcha-recaptcha' ), __( 'Instruction', 'advanced-nocaptcha-recaptcha' ), 'manage_network_options', 'anr-instruction', array( $this, 'instruction_page' ) );
}
function settings_save() {
if ( current_user_can( 'manage_options' ) && isset( $_POST['anr_admin_options'] ) && isset( $_POST['action'] ) && 'update' === $_POST['action'] && isset( $_GET['page'] ) && 'anr-admin-settings' === $_GET['page'] ) {
check_admin_referer( 'anr_admin_options-options' );
$value = wp_unslash( $_POST['anr_admin_options'] );
if ( ! is_array( $value ) ) {
$value = [];
}
anr_update_option( $value );
wp_safe_redirect( add_query_arg( 'updated', true ) );
exit;
}
}
function get_tabs(){
return [
'settings' => __( 'Settings', 'advanced-nocaptcha-recaptcha' ),
'instruction' => __( 'Instruction', 'advanced-nocaptcha-recaptcha' ),
];
}
function admin_settings() {
wp_enqueue_script( 'anr-admin' );
$current_tab = 'settings';
if( !empty( $_GET['tab'] ) ){
$current_tab = $_GET['tab'];
}
?>
get_tabs() as $k => $v ){
$active = '';
if( $k === $current_tab ){
$active = ' nav-tab-active';
}
printf( '%s ', anr_settings_page_url( $k ), $active, $v );
}
?>
settings_form();
} elseif( 'instruction' == $current_tab ){
$this->instruction_page();
}
?>
anr_admin_sidebar(); ?>
GOOGLE if you do not have already.
How to get google reCAPTCHA keys? .', 'advanced-nocaptcha-recaptcha' ), esc_url( 'https://www.google.com/recaptcha/admin' ), 'https://www.wpwhitesecurity.com/support/kb/get-google-recaptcha-keys/' ); ?>
' . esc_html__( 'Settings', 'advanced-nocaptcha-recaptcha' ) . '' ); ?>
[anr_nocaptcha g-recaptcha-response]' ); ?>
this instruction', 'advanced-nocaptcha-recaptcha' ), esc_url( 'https://www.wpwhitesecurity.com/support/kb/adding-captcha-contact-form-7-forms/' ) ) ?>
do_action( 'anr_captcha_form_field' )", '[anr-captcha]' ); ?>
anr_verify_captcha()' ); ?>
ul.anr-pro-features-ul li.dashicons-yes-alt:before {color:green;}';
$return .= sprintf( '
' . __( 'PRO Features', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'WooCommerce forms', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'Contact Form 7 forms', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'bbPress New topic form', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'bbPress reply to topic form', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'BuddyPress register form', 'advanced-nocaptcha-recaptcha' ) . '
' . __( 'View Details', 'advanced-nocaptcha-recaptcha' ) . '
', 'https://www.wpwhitesecurity.com/wordpress-plugins/captcha-plugin-wordpress/pricing/' );
endif;
return $return;
}
function add_settings_link( $links ) {
// add settings link in plugins page
$settings_link = '' . __( 'Settings', 'advanced-nocaptcha-recaptcha' ) . ' ';
array_unshift( $links, $settings_link );
return $links;
}
} //END CLASS
add_action( 'wp_loaded', array( ANR_Settings::init(), 'actions_filters' ) );