Following on from this topic about weird empty entries, that went quiet for a while but it’s back with a vengeance. I’m seeing this across a few websites again, and the associated IP addresses always resolve to servers (i.e. companies who sell VPS plans).
With Gravity Forms 2.7 on these sites now, I get some additional information at least; there is a note added to the empty entry:
Error while saving field values: WordPress database error: Could not perform query because it contains invalid data.
I’m pretty sure this stuff is spam, and starting to think that ipstenu’s idea of auto-flagging IP addresses from hosts as spam isn’t a bad idea. Not sure it will work if the data is flagged as invalid. Ideas?
If you want to get a look at the values that can’t be saved when future errors like that occur, you can use the following code snippet to create a draft entry array from the $_POST and write it to the core log.
add_action( 'gform_post_note_added', function ( $note_id, $entry_id, $user_id, $user_name, $note, $note_type, $sub_type ) {
if ( $note_type !== 'save_entry' || $sub_type !== 'error' ) {
return;
}
GFCommon::log_debug( "gform_post_note_added: Draft entry based on values for failed entry (#{$entry_id}) => " . print_r( GFFormsModel::get_current_lead(), true ) );
}, 10, 7 );