(1) Before the court accepts a plea of guilty or no contest, it shall do all of the following:
(a) Address the defendant personally and determine that the plea is made voluntarily with understanding of the nature of the charge and the potential punishment if convicted.
(b) Make such inquiry as satisfies it that the defendant in fact committed the crime charged.
(c) Address the defendant personally and advise the defendant as follows: “If you are not a citizen of the United States of America, you are advised that a plea of guilty or no contest for the offense with which you are charged may result in deportation, the exclusion from admission to this country or the denial of naturalization, under federal law."
(d) Inquire of the district attorney whether he or she has complied with s. 971.095 (2).
(2) If a court fails to advise a defendant as required by sub. (1) (c) and a defendant later shows that the plea is likely to result in the defendant's deportation, exclusion from admission to this country or denial of naturalization, the court on the defendant's motion shall vacate any applicable judgment against the defendant and permit the defendant to withdraw the plea and enter another plea. This subsection does not limit the ability to withdraw a plea of guilty or no contest on any other grounds.
(3) Any plea of guilty which is not accepted by the court or which is subsequently permitted to be withdrawn shall not be used against the defendant in a subsequent action.