(1) Any person who is charged in any circuit or county court with the commission of a criminal offense by a proper affidavit, indictment or information in cases of misdemeanors or by indictment by the grand jury in cases of felonies, and who is represented by counsel, may, by his own election, appear before the judge of the court at such time as the said judge may fix in vacation of the court and be arraigned and enter a plea of guilty to the offense with which he is charged. Upon the entering of such plea of guilty, the judge shall have the power and authority to impose any lawful and proper sentence upon the defendant in vacation just as though the plea was entered and the sentence imposed during a regular term of the court.
(2) All judgments and orders imposing sentences in vacation upon such pleas of guilty shall be entered upon the minutes of the proper court in vacation just as though same were had and entered during term time.