/** * Validate Gravity Form submissions. * * @since 2.0.0 * * @link https://www.gravityhelp.com/documentation/article/gform_pre_submission/ */ public function gform_pre_submission($form) { if (!zerospam_is_valid()) { do_action('zero_spam_found_spam_gf_form_submission'); zerospam_log_spam('gf'); die(__($this->settings['spammer_msg_comment'], 'zerospam')); } }
/** * Validate Ninja Forms submissions. * * Validates the Ninja Forms (https://wordpress.org/plugins/ninja-forms/) * form submission, and flags the form submission as invalid if the zero-spam * post data isn't present. * * @link http://docs.ninjaforms.com/article/105-ninjaformsprocess * @since 2.0.0 * */ public function ninja_forms_process() { if (!zerospam_is_valid()) { do_action('zero_spam_found_spam_nf_form_submission'); if (!empty($this->settings['log_spammers']) && $this->settings['log_spammers']) { zerospam_log_spam('nf'); } die(__($this->settings['spammer_msg_nf'], 'zerospam')); } }
/** * Pre-process registration fields. * * Used to create custom validation rules on user registration. This fires * when the form is submitted but before user information is saved to the * database. * * @since 2.0.0 * * @link http://codex.wordpress.org/Plugin_API/Action_Reference/register_post */ public function preprocess_registration($errors, $sanitized_user_login, $user_email) { if (!isset($_POST['zerospam_key']) || $_POST['zerospam_key'] != zerospam_get_key()) { do_action('zero_spam_found_spam_registration', $errors, $sanitized_user_login, $user_email); if (isset($this->settings['log_spammers']) && '1' == $this->settings['log_spammers']) { zerospam_log_spam('registration'); } $errors->add('spam_error', __($this->settings['spammer_msg_registration'], 'zerospam')); } return $errors; }
/** * Preprocess comment fields. * * An action hook that is applied to the comment data prior to any other processing of the * comment's information when saving a comment data to the database. * * @since 2.0.0 * * @link http://etivite.com/api-hooks/buddypress/trigger/do_action/bp_signup_validate/ */ public function bp_signup_validate() { global $bp; if (!zerospam_is_valid()) { do_action('zero_spam_found_spam_buddypress_registration'); if (isset($this->settings['log_spammers']) && '1' == $this->settings['log_spammers']) { zerospam_log_spam('buddypress-registration'); } die(__($this->settings['buddypress_msg_registration'], 'zerospam')); } }
/** * Validate Contact Form 7 form submissions. * * Validates the Contact Form 7 (https://wordpress.org/plugins/contact-form-7/) * form submission, and flags the form submission as invalid if the zero-spam * post data isn't present. * * @since 2.0.0 * */ public function wpcf7_validate($result) { if (!zerospam_is_valid()) { do_action('zero_spam_found_spam_cf7_form_submission'); // Temp. fix for the following issue: http://contactform7.com/2015/01/06/contact-form-7-41-beta/ echo __($this->settings['spammer_msg_contact_form_7'], 'zerospam'); zerospam_log_spam('cf7'); die; } return $result; }
/** * Preprocess comment fields. * * An action hook that is applied to the comment data prior to any other processing of the * comment's information when saving a comment data to the database. * * @since 2.0.0 * * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/preprocess_comment */ public function preprocess_comment($commentdata) { if (is_user_logged_in() && current_user_can('moderate_comments') || zerospam_is_valid()) { return $commentdata; } do_action('zero_spam_found_spam_comment', $commentdata); if (!empty($this->settings['log_spammers']) && $this->settings['log_spammers']) { zerospam_log_spam('comment'); } die(__($this->settings['spammer_msg_comment'], 'zerospam')); }