replaced all sql queries assembled by escaping and string concat by
$wpdb->prepare functions
replaced INSERT query with $wpdb->insert
removed unnecessary white spaces