Skip to content

Remove warning from CF7 #63

@Zodiac1978

Description

@Zodiac1978

CF7 introduced a new validator: unsafe email config in version 5.8.1:
https://contactform7.com/2023/09/28/contact-form-7-581/

See this document for more details:
https://contactform7.com/configuration-errors/unsafe-email-without-protection/

As stated here in this issue this error message will not go away, if Honeypot is used:
rocklobster-in/contact-form-7#1284

But as explained in this doc article it can be disabled:
https://contactform7.com/2023/10/15/disabling-only-specific-error-types-of-config-validator/

Using this code:

add_filter(
    'wpcf7_config_validator_available_error_codes',
    function ( $error_codes, $contact_form ) {
 
        // List error codes to disable here.
        $error_codes_to_disable = array(
            'unsafe_email_without_protection',
        );
 
        $error_codes = array_diff( $error_codes, $error_codes_to_disable );
 
        return $error_codes;
    },
    10, 2
);

Maybe you could add this to your plugin.

This could also be a setting or only apply if every form has a honeypot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions