WordPress – Contact Form7 – Modify php code of analyze to inject own spam-check

Solution:

CF7 have a lot of hooks and filters actually, like wpcf7_skip_mail,wpcf7_mail_sent,wpcf7_before_send_mail and others..

e,g:

 add_action( 'wpcf7_before_send_mail', 'wpcf7_my_before_send_mail' );

   function wpcf7_my_before_send_mail( $wpcf7 ) {

       // put your logic  code here

   }

the following is special for skipping mail

 add_filter( 'wpcf7_skip_mail', function( $skip_mail, $contact_form ) {

       if( /* your logic */ )

           $skip_mail = true;

       return $skip_mail;

   }, 10, 2 );

combining this logic, you can also do something like

add_action("wpcf7_before_send_mail", "wpcf7_do_something");  
function wpcf7_do_something($cf7) {
    // this is the contact form object
    $wpcf = WPCF7_ContactForm::get_current();

    // exam0ple : ID of Form $wpcf->id

    if (/*your logic here*/) {
        // If you want to skip mailing... 
        $wpcf->skip_mail = true;    
    }

    return $wpcf;
}

you should also look at the CF7 Docs, you could find some other ways of fighting spam like ip_blacklist and other tips