first commit
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
/* BB PRESS */
|
||||
add_action( 'bbp_new_topic_pre_extras','wpa_bbp_extra_validation');
|
||||
add_action( 'bbp_new_reply_pre_extras','wpa_bbp_extra_validation');
|
||||
|
||||
function wpa_bbp_extra_validation(){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','bbpress', $_POST);
|
||||
bbp_add_error( 'bbp_extra_email', __( $GLOBALS['wpa_error_message'], 'bbpress' ) );
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
function wpa_calderaforms_extra_validation( ) {
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','calderaforms', $_POST);
|
||||
die($GLOBALS['wpa_error_message']);
|
||||
}
|
||||
};
|
||||
add_action( 'caldera_forms_pre_load_processors', 'wpa_calderaforms_extra_validation', 10, 0 );
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
add_filter( 'wpcf7_validate', 'wpa_contactform7_extra_validation', 10, 2 );
|
||||
|
||||
function wpa_contactform7_extra_validation($result, $tags){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','contactform7', $_POST);
|
||||
$result->invalidate('', $GLOBALS['wpa_error_message']);
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
foreach($_POST as $param => $value){
|
||||
if(strpos($param, 'et_pb_contactform_submit') === 0){
|
||||
$is_divi_form = 'true';
|
||||
$divi_form_additional = str_replace('et_pb_contactform_submit', '', $param);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($is_divi_form) && $is_divi_form == 'true'){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','divi_form', $_POST);
|
||||
echo "<div id='et_pb_contact_form{$divi_form_additional}'><p>".$GLOBALS['wpa_error_message']."</p><div></div></div>";
|
||||
die();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
function wpa_elementor_extra_validation( $record, $ajax_handler ) {
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
$all_fields = $record->get( 'fields' );
|
||||
$firstField = array_key_first($all_fields);
|
||||
do_action('wpa_handle_spammers','elementor', $_POST);
|
||||
$ajax_handler->add_error($all_fields[$firstField]['id'], $GLOBALS['wpa_error_message']);
|
||||
}
|
||||
};
|
||||
add_action( 'elementor_pro/forms/validation', 'wpa_elementor_extra_validation', 10, 2 );
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
function wpa_fluent_form_extra_validation($insertData, $data, $form) {
|
||||
if (wpa_check_is_spam($data)){
|
||||
do_action('wpa_handle_spammers','fluent_forms', $data);
|
||||
//die($GLOBALS['wpa_error_message']);
|
||||
wp_send_json_error(['errors' => $GLOBALS['wpa_error_message']]);
|
||||
wp_die();
|
||||
}
|
||||
};
|
||||
add_action( 'fluentform_before_insert_submission', 'wpa_fluent_form_extra_validation', 10, 3 );
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
add_filter( 'frm_validate_entry', 'wpa_formidable_extra_validation', 10, 2 );
|
||||
|
||||
function wpa_formidable_extra_validation($errors, $values){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','formidable', $_POST);
|
||||
$errors['my_error'] = $GLOBALS['wpa_error_message'];
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
add_action( 'gform_validation', 'wpa_gravityforms_extra_validation');
|
||||
|
||||
function wpa_gravityforms_extra_validation($validation_result ){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
$form = $validation_result['form'];
|
||||
do_action('wpa_handle_spammers','gravityforms', $_POST);
|
||||
$validation_result['is_valid'] = false;
|
||||
foreach( $form['fields'] as &$field ) {
|
||||
if ( $field->id == '1' ) {
|
||||
$field->failed_validation = true;
|
||||
$field->validation_message = $GLOBALS['wpa_error_message'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
$validation_result['form'] = $form;
|
||||
}
|
||||
return $validation_result;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
add_filter('cred_form_validate','wpa_toolsetform_extra_validation',20,2);
|
||||
|
||||
function wpa_toolsetform_extra_validation($error_fields, $form_data)
|
||||
{
|
||||
list($fields,$errors)=$error_fields;
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','toolset_form', $_POST);
|
||||
die($GLOBALS['wpa_error_message']);
|
||||
}
|
||||
return array($fields,$errors);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
// WP Comments
|
||||
add_filter( 'preprocess_comment', 'wpa_wpcomment_extra_validation' );
|
||||
|
||||
function wpa_wpcomment_extra_validation( $commentdata ) {
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','wpcomment', $_POST);
|
||||
wp_die( __( $GLOBALS['wpa_error_message'] ) );
|
||||
}
|
||||
return $commentdata;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
add_filter( 'wpforms_process_before', 'wpa_wpforms_extra_validation', 10, 2 );
|
||||
|
||||
function wpa_wpforms_extra_validation($entry, $form_data){
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','wpforms', $_POST);
|
||||
wpforms()->process->errors[ $form_data['id'] ][ '0' ] = $GLOBALS['wpa_error_message'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) exit;
|
||||
|
||||
add_action( 'register_form', 'wpa_wpregistration_add_initiator_field' );
|
||||
function wpa_wpregistration_add_initiator_field() {
|
||||
echo '<input type="hidden" id="wpa_initiator" class="wpa_initiator" name="wpa_initiator" value="" />';
|
||||
}
|
||||
|
||||
add_filter( 'registration_errors', 'wpa_wpregistration_extra_validation', 10, 3 );
|
||||
|
||||
function wpa_wpregistration_extra_validation( $errors, $sanitized_user_login, $user_email ) {
|
||||
if (wpa_check_is_spam($_POST)){
|
||||
do_action('wpa_handle_spammers','wpregistration', $_POST);
|
||||
$errors->add( 'wpa_extra_email', __($GLOBALS['wpa_error_message']) );
|
||||
}
|
||||
return $errors;
|
||||
}
|
||||
Reference in New Issue
Block a user