| Server IP : 185.252.147.100 / Your IP : 216.73.216.196 Web Server : nginx/1.27.3 System : Linux mitrofanov.ru 6.1.0-37-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.140-1 (2025-05-22) x86_64 User : mitr ( 1000) PHP Version : 8.2.29 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/html/tour.mitrofanov.ru/public/wp-content/mu-plugins/ |
Upload File : |
<?php
// https://meowapps.com/contact-form-block/tutorial/
session_start();
if (empty($_SESSION['token'])) {
$_SESSION['token'] = bin2hex(random_bytes(32));
}
add_filter( 'mcfb_form_after_email', 'my_human_check_after_email', 4, 10 );
//add_filter( 'mcfb_validate', 'my_human_check_validate', 2, 10 );
// Add the human check field after the e-mail field
function my_human_check_after_email( $html, $atts, $css, $reply ) {
// if ( $reply && $reply->success )
// return $html;
$token = $_SESSION['token'];
$html .= '<input type="hidden" name="token" value="'.$token.'" />';
return $html;
}
// Check if the field was properly filled in
function my_human_check_validate( $error, $form ) {
if (!empty($_POST['token'])) {
if (hash_equals($_SESSION['token'], $_POST['token'])) {
return null;
} else {
return __( 'You failed to reply to the question. Are you really human?', 'contact-form-block' );
}
}
}
add_filter( 'mcfb_email_to', function ( $to, $form ) {
$to = 'vit@dobrolom.com';
//$to = 'alimovmail@gmail.com';
return $to;
}, 10, 2 );
add_filter( 'mcfb_email_subject', function ( $to, $form ) {
$subject = "[*site*] *name*";
return $subject;
}, 10, 2 );
add_filter( 'mcfb_email_content', function ( $to, $form ) {
return "Имя: *name*\r\nE-mail: *email*\r\n\r\n*message*";
}, 10, 2 );
/*********************PHP MAILER*******************/
add_action( 'phpmailer_init', 'smtp_phpmailer_init' );
function smtp_phpmailer_init( $phpmailer ){
$phpmailer->IsSMTP();
$phpmailer->CharSet = 'UTF-8';
$phpmailer->Host = 'smtp.mail.ru';
$phpmailer->Username = 'avto.amiro@mail.ru';
//wp-config
//define( 'SMTP_PASS', 'fzsvjilpxpdybyfi' );
//$phpmailer->Password = SMTP_PASS;
$phpmailer->Password = 'm0QErcvY0qLjh0Ml8bik';
$phpmailer->SMTPAuth = true;
$phpmailer->SMTPSecure = 'ssl';
$phpmailer->Port = 465;
$phpmailer->From = 'avto.amiro@mail.ru';
$phpmailer->FromName = 'TOUR.Mitrofanov';
$phpmailer->isHTML( true );
}