id = self::$plugin_info['name'] . '-advanced-captcha-settings'; $this->autoload = false; $this->tab_key = 'action'; $this->is_woocommerce = true; } /** * Set Fields. * * @return void */ protected function set_fields() { $this->fields = setup_main_settings_fields( self::$plugin_info, $this, self::$core ); } /** * Settings Hooks. * * @return void */ protected function hooks() { add_action( $this->id . '-before-settings-field-captchas_places_woo_add_to_cart_status', array( $this, 'conflict_notice' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_woo_add_to_cart_status', array( $this, 'woo_add_to_cart_status_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_woo_checkout_status', array( $this, 'woo_checkout_status_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_woo_login_status', array( $this, 'woo_login_status_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_woo_register_status', array( $this, 'woo_register_status_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_comments_status', array( $this, 'comments_status_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_woo_lost_pass_status', array( $this, 'woo_lost_pass_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_wp_login_status', array( $this, 'wp_login_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_wp_register_status', array( $this, 'wp_register_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-captchas_places_wp_lost_pass_status', array( $this, 'wp_lost_pass_sub_fields' ), 100, 1 ); add_action( $this->id . '-just-after-settings-field-login_forms_bypass', array( $this, 'log_forms_bypass_generate_btn' ), 100, 1 ); add_action( $this->id . '-after-settings-field-login_forms_bypass', array( $this, 'log_forms_bypass_field' ), 100, 1 ); } /** * Woo Add To Cart Form Status Sub fields. * * @param array $field * @return void */ public function woo_add_to_cart_status_sub_fields( $field ) { self::print_field( 'captchas_places_woo_add_to_cart_select', true, array(), true, true ); } /** * Woo Checkout Form Status Sub fields. * * @param array $field * @return void */ public function woo_checkout_status_sub_fields( $field ) { self::print_field( 'captchas_places_woo_checkout_select_type', true, array(), true, true ); self::print_field( 'captchas_places_woo_checkout_select', true, array(), true, true ); self::print_field( 'captchas_places_woo_checkout_random_select_num', true, array(), true, true ); } /** * Woo Login Form Status Sub fields. * * @param array $field * @return void */ public function woo_login_status_sub_fields( $field ) { self::print_field( 'captchas_places_woo_login_select_type', true, array(), true, true ); self::print_field( 'captchas_places_woo_login_select', true, array(), true, true ); self::print_field( 'captchas_places_woo_login_random_select_num', true, array(), true, true ); } /** * Woo Register Form Status Sub fields. * * @param array $field * @return void */ public function woo_register_status_sub_fields( $field ) { self::print_field( 'captchas_places_woo_register_select_type', true, array(), true, true ); self::print_field( 'captchas_places_woo_register_select', true, array(), true, true ); self::print_field( 'captchas_places_woo_register_random_select_num', true, array(), true, true ); } /** * Comments Form Review Sub fields. * * @param array $field * @return void */ public function comments_status_sub_fields( $field ) { self::print_field( 'captchas_places_comments_select_type', true, array(), true, true ); self::print_field( 'captchas_places_comments_select', true, array(), true, true ); self::print_field( 'captchas_places_comments_random_select_num', true, array(), true, true ); } /** * Woo Lost Password Sub fields. * * @param array $field * @return void */ public function woo_lost_pass_sub_fields( $field ) { self::print_field( 'captchas_places_woo_lost_pass_select_type', true, array(), true, true ); self::print_field( 'captchas_places_woo_lost_pass_select', true, array(), true, true ); self::print_field( 'captchas_places_woo_lost_pass_random_select_num', true, array(), true, true ); } /** * WP Login Sub fields. * * @param array $field * @return void */ public function wp_login_sub_fields( $field ) { self::print_field( 'captchas_places_wp_login_select_type', true, array(), true, true ); self::print_field( 'captchas_places_wp_login_select', true, array(), true, true ); self::print_field( 'captchas_places_wp_login_random_select_num', true, array(), true, true ); } /** * WP Register Sub fields. * * @param array $field * @return void */ public function wp_register_sub_fields( $field ) { self::print_field( 'captchas_places_wp_register_select_type', true, array(), true, true ); self::print_field( 'captchas_places_wp_register_select', true, array(), true, true ); self::print_field( 'captchas_places_wp_register_random_select_num', true, array(), true, true ); } /** * WP Lost Password Sub fields. * * @param array $field * @return void */ public function wp_lost_pass_sub_fields( $field ) { self::print_field( 'captchas_places_wp_lost_pass_select_type', true, array(), true, true ); self::print_field( 'captchas_places_wp_lost_pass_select', true, array(), true, true ); self::print_field( 'captchas_places_wp_lost_pass_random_select_num', true, array(), true, true ); } /** * Login forms ByPass Generate Button. * * @param array $field * @return void */ public function log_forms_bypass_generate_btn( $field ) { ?> get_settings( 'login_forms_bypass' ); ?>

GeeTestCaptchaV3::init(), 'geetestv4' => GeeTestCaptchaV4::init(), 'hcaptcha' => HCaptcha::init(), 'googlerecaptchav2' => GoogleRecaptchaV2::init(), 'googlerecaptchav3' => GoogleRecaptchaV3::init(), ); $filtered_captchas = $this->filter_captchas_availability( $captchas ); // $filtered_captchas = $filtered_captchas[0]; return apply_filters( self::$plugin_info['name'] . '-captchas', $filtered_captchas ); } /** * Get Captchas Keys. * * @return array */ public function get_captchas_keys() { return array_keys( $this->_get_captchas() ); } /** * Captchas Keys - Names. * * @return array */ public function captchas_mapper( $exclude = array() ) { $captchas = array( 'geetestv3' => esc_html__( 'GeeTest V3' ), 'geetestv4' => esc_html__( 'GeeTest V4' ), 'hcaptcha' => esc_html__( 'HCaptcha' ), 'googlerecaptchav2' => esc_html__( 'Google reCaptcha V2' ), 'googlerecaptchav3' => esc_html__( 'Google reCaptcha V3' ), ); return array_diff_key( $captchas, array_flip( $exclude ) ); } /** * Set Assets. * * @return void */ protected function set_assets() { } /** * Get Failed Verification Notice. * * @return string */ public function get_failed_notice() { return $this->get_settings( 'failed_notice' ); } /** * Conflict Notice. * * @return void */ public function conflict_notice() { ?>