// Block spam keywords and Russian text in WPForms
add_filter( 'wpforms_process_before_form_data', 'wpforms_block_spam_keywords', 10, 2 );

function wpforms_block_spam_keywords( $form_data, $entry ) {
    
    // Spam keywords to block
    $spam_keywords = array(
        'viagra', 'cialis', 'pharmacy', 'casino', 'loan', 'bitcoin', 
        'cryptocurrency', 'pills', 'medications', 'drugs', 'sex', 'porn',
        'gambling', 'payday', 'discount', 'купить', 'заказать', 'цена',
        'онлайн', 'сайт', 'магазин', 'доставка'
    );
    
    // Get the message field content
    $message = '';
    if ( isset( $entry['fields'] ) ) {
        foreach ( $entry['fields'] as $field ) {
            if ( isset( $field['value'] ) ) {
                $message .= ' ' . $field['value'];
            }
        }
    }
    
    // Convert to lowercase for checking
    $message_lower = strtolower( $message );
    
    // Check for spam keywords
    foreach ( $spam_keywords as $keyword ) {
        if ( strpos( $message_lower, $keyword ) !== false ) {
            wpforms()->process->errors[ $form_data['id'] ]['header'] = 'Spam detected. Your submission has been blocked.';
            return $form_data;
        }
    }
    
    // Check for Cyrillic (Russian) characters
    if ( preg_match( '/[\x{0400}-\x{04FF}]/u', $message ) ) {
        wpforms()->process->errors[ $form_data['id'] ]['header'] = 'Spam detected. Your submission has been blocked.';
        return $form_data;
    }
    
    return $form_data;
}<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//premiersolutionsinc.net/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://premiersolutionsinc.net/post-sitemap.xml</loc>
		<lastmod>2026-04-04T23:50:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://premiersolutionsinc.net/page-sitemap.xml</loc>
		<lastmod>2026-05-12T15:05:46+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://premiersolutionsinc.net/category-sitemap.xml</loc>
		<lastmod>2026-04-04T23:50:20+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://premiersolutionsinc.net/author-sitemap.xml</loc>
		<lastmod>2026-04-05T00:23:18+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->