(1) The court shall not accept a plea of guilty or no contest without first determining that the plea is voluntary and intelligently made.(2) The court shall determine whether the plea is the result of prior plea discussions and a plea agreement. If the plea is the result of a plea agreement, the court shall determine the nature of the agreement.(3) If the plea agreement includes an agreement that the district attorney will seek or not oppose dismissal of a charge in exchange for the defendant’s plea of guilty or no contest to another charge, the court may not accept the plea of guilty or no contest unless:
(a) The agreement includes a written provision that indicates whether the court is required to reinstate charges that are dismissed pursuant to the agreement if the plea of guilty or no contest is withdrawn under ORS 135.365 or the judgment of conviction is subsequently reversed, vacated or set aside; and(b) If the agreement requires the court to reinstate charges under the circumstances described in paragraph (a) of this subsection, the defendant has provided the court with a written waiver of the statute of limitations and any statutory or constitutional speedy trial or double jeopardy rights, applicable to the dismissed charges.(4) If the district attorney has agreed to seek charge or sentence concessions which must be approved by the court, the court shall advise the defendant personally that the recommendations of the district attorney are not binding on the court.(5)(a) If the district attorney has provided a plea offer and agreed disposition recommendation to the defendant as provided in ORS 135.405 and the defendant is entering a guilty plea based on the plea offer and agreed disposition recommendation, the court shall determine whether the plea is voluntarily made. Except as otherwise provided in paragraph (b) of this subsection, if the court finds that the plea is voluntarily made, the court shall impose sentence as provided in the agreed disposition recommendation.(b) If the court determines that the agreed disposition recommendation is inappropriate in a particular case, the court shall so advise the parties and allow the defendant an opportunity to withdraw the plea.