Conservative Indian-American author and filmmaker Dinesh D'Souza, who has been critical of President Barack Obama through his works, pleaded guilty before a US court to violating election campaign law by making illegal contributions to a Senate campaign.