HEX
Server: Apache/2.4.65 (Debian)
System: Linux 88f31f35b0b8 6.1.0-38-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.147-1 (2025-08-02) x86_64
User: www-data (33)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/malcare-security/form_testing/handlers/contact_form7.php
<?php

if (!defined('ABSPATH')) exit;
if (!class_exists('BVContactForm7Handler')) :

class BVContactForm7Handler {
	private $form_id;
	private $bypass_params = array();

	public function __construct($form_id, $bypass_params) {
		$this->form_id = $form_id;
		$this->bypass_params = $bypass_params;
	}

	public function bypass() {
		if (array_key_exists('should_bypass_captcha', $this->bypass_params)) {
			$this->bypassCaptcha();
		}

		if (array_key_exists('should_bypass_email', $this->bypass_params)) {
			$this->bypassEmail();
		}
	}

	private function bypassCaptcha() {
		add_filter('wpcf7_skip_spam_check', '__return_true', PHP_INT_MAX);
	}

	private function bypassEmail() {
		add_action('wpcf7_before_send_mail', function ($contact_form, &$abort) {
			$abort = true;
		}, PHP_INT_MAX, 2);
	}
}

endif;