
967 N.E.2d 876 (2012)
359 Ill. Dec. 846
The PEOPLE of the State of Illinois, Plaintiff-Appellee,
v.
Cindy L. SWEENEY, Defendant-Appellee.
No. 3-10-0781.
Appellate Court of Illinois, Third District.
March 22, 2012.
*878 Thomas A. Karalis (argued), Office of the State Appellate Defender, Ottawa, for Cindy L. Sweeney.
James Glasgow, State's Attorney, Joliet (Terry A. Mertel and Gary F. Gnidovec (argued), State's Attorneys Appellate Prosecutor's Office, of counsel), for the People.

OPINION
Justice McDADE delivered the judgment of the court, with opinion.
¶ 1 Cindy Sweeney, the defendant, pled guilty to driving while her license was suspended. 625 ILCS 5/6-303(d-1) (West 2004). The court imposed a 6-year term of imprisonment, but stayed the mittimus for 30 months and allowed the defendant to remain free on a recognizance bond. Over 45 months after the court imposed this sentence, it sua sponte vacated it and sentenced the defendant to a 30-month term of probation. Thereafter, the State filed a petition to revoke the defendant's probation. The court granted this petition and imposed a six-year term of imprisonment.
¶ 2 The defendant now appeals, contending that: (1) the original sentence whereby the court imposed a 6-year term of imprisonment, but stayed it for 30 months, was unauthorized, or, alternatively, the defendant had fully served this sentence at the time the court imposed the 30 month term of probation; (2) the proceeding on June 12, 2008, during which the court vacated the original sentence and imposed the 30-month term of probation was void because the defendant was not represented by counsel and the court did not obtain a waiver of the defendant's right to counsel; and (3) the trial court abused its discretion when it did not award the defendant credit for the time she spent on probation.
¶ 3 Taking the issues out of order, the defendant asserts and the State concedes that the proceeding whereby the court vacated the defendant's original sentence and imposed the 30-month term of probation was void. Because we agree, we vacate the term of probation the court imposed on June 12, 2008, the subsequent revocation of that probation, and that revocation as the basis for the sentence that resulted therefrom.
¶ 4 We further conclude that although the trial court had the proper authority to impose a 6-year term of imprisonment for the defendant's conviction for driving while her license was suspended, it did not have authority to stay the mittimus for over 45 months, thus rendering that portion of the sentence void. Because the stay was an essential part of the defendant's plea agreement, we vacate the entire sentence *879 and allow the defendant to withdraw her guilty plea. We also conclude that the trial court did not abuse its discretion by refusing to grant the defendant credit for time she spent on probation or otherwise under the control of the trial court. Therefore, we remand the cause to the trial court to permit the defendant to withdraw her guilty plea. If the defendant chooses to withdraw her guilty plea, the trial court is to vacate the defendant's conviction and proceed with trial. However, if the defendant persists in her plea of guilty, the trial court is to resentence the defendant according to the statutory guidelines.

¶ 5 FACTS
¶ 6 The State charged the defendant with the Class 4 felony offense of driving while her license was suspended. 625 ILCS 5/6-303(d-1) (West 2004). The charge stemmed from an incident on May 29, 2003, where the defendant drove her vehicle at a time when her license had previously been suspended for driving under the influence.
¶ 7 The defendant appeared in court on August 24, 2004, and gave her consent for the court to engage in a conference with the State and her attorney pursuant to Illinois Supreme Court Rule 402 (eff. July 1, 1997). Thereafter, on August 26, 2004, the defendant pled guilty to driving while her license was suspended and indicated that she expected the court to impose the sentence that resulted from the Rule 402 conference. Specifically, defense counsel disclosed that pursuant to the Rule 402 conference, the court would sentence the defendant to an extended term of imprisonment of six years, with credit for time served. However, the court would stay enforcement of the sentence, during which time it would release the defendant on a personal recognizance bond and require her to report to a probation officer twice per week for drug testing. The court clarified that the sentence would be stayed for a period of 30 months, which was the maximum term of probation that the court could impose on the defendant. The parties also noted that they understood that if the defendant tested positive for drugs, possessed drugs or any other illegal substances, or drove a vehicle, the court would immediately issue the mittimus.
¶ 8 After the court ascertained that the defendant understood the proposed plea and sentence, and heard the factual basis for the offense, it accepted the plea, entered a conviction, and imposed the aforementioned sentence. On the written sentencing order, the court indicated that it imposed a six-year term of imprisonment and that the term of imprisonment was stayed, but it left blank the line indicating for how long the sentence was stayed. However, the court also entered a written order explaining the terms of the sentence, and this order indicated that the defendant's sentence was stayed for "up to 30 months." This order further indicated that defendant must appear before the court from time to time as directed by the court and set her initial reporting date as October 14, 2004.
¶ 9 At the October 14 hearing, the court permitted defense counsel to withdraw. The court also noted that all of the defendant's drug tests had been negative and reduced the frequency with which the defendant took these tests to a random basis, four or five times per month. The court informed the defendant that it "want[ed] to keep a relative short leash on [her]" and stated that if the defendant did not come in to perform the test when the probation officer called her, it would consider the test as a positive result.
¶ 10 The record indicates that the defendant regularly appeared in court from October 2004 to June 2008, during which time *880 she had ultimately progressed on her drug problem to having random drug testing on an open basis as determined by her probation officer and the court. However, at a hearing on August 25, 2005, the State requested that the court issue the mittimus because the defendant had been charged with domestic battery for an altercation with her sister during which time she had been consuming alcohol. The court subsequently denied this request. The record also indicates that the defendant did not initially appear at a July 11, 2007, hearing. At that hearing, the court granted the State's request for leave to file a "petition to revoke," and issued a warrant for the defendant's arrest. The docket entries indicate that the defendant eventually appeared in court that day, and the court quashed the warrant and the State withdrew the petition to revoke.
¶ 11 The court conducted a hearing on June 12, 2008, over 45 months after the court entered the original sentence. At that time, the assistant State's Attorney indicated to the court that since it had originally sentenced the defendant, it "had stayed [the mittimus] over and over and over again for [the defendant] to show the Court that she was in compliance with what the court was requiring her to do," and that "[t]here must have been some confusion on [the State's Attorney's] office's part as to what was going on with the case because then a [petition to revoke] was filed even though [the defendant] was never given probation and [the case] was continued on that basis." The prosecutor then stated that she believed that "at [that] point there need[ed] to be some resolution to [the] case in regards to the original sentence of the Department of Corrections and as to what the Court want[ed] to do in regards to the sentence." The court stated that the defendant did not have counsel present, but that it did not believe it was "absolutely necessary." The court then vacated the sentence it imposed on August 26, 2004, and sentenced the defendant to a 30-month term of probation. The court entered a written sentencing order that mandated that the defendant must, among other things, continue her participation in random drug tests and refrain from committing any other criminal offenses. It also ordered the defendant to serve a 15-day jail term and gave her credit for 15 days of time served.
¶ 12 On February 20, 2009, the State filed a petition to revoke the defendant's probation. In that petition, the State alleged that the defendant had been arrested for driving while her license was revoked on two separate occasions, specifically on June 27, 2008, and November 20, 2008, and also that there was an active warrant for the defendant's arrest in Du Page County for the offense of theft by deception.
¶ 13 On February 26, 2010, the defendant appeared with counsel before Judge Stephen White and admitted that she committed the two offenses of driving while her license was revoked as alleged in the State's petition. The court accepted the defendant's admission, revoked her probation, and set the cause for a sentencing hearing. At the April 28, 2010, sentencing hearing, defense counsel informed the court that the defendant had pled guilty to an offense in Du Page County that did not serve as the basis for revoking her probation in the instant case, and also noted that the defendant was serving a term of imprisonment on that offense that was set to expire in 2011. Counsel requested that the court order the instant sentence to run concurrently with the sentence that defendant was serving for the Du Page County offense. The State asserted that the court, under another judge, originally imposed and stayed a six-year term of imprisonment, and that it had been "kind *881 enough" to vacate the original sentence because the defendant had represented to that court that she was following its directions, but was actually committing new criminal offenses. The State thus believed that the court should "reinstate the six-year sentence." The court imposed a 6-year term of imprisonment with credit for 62 days of time served. The record indicates that the defendant began serving this term on April 28, 2010, and remains incarcerated at the present time.
¶ 14 The defendant subsequently filed a motion to reconsider her sentence. The court conducted a hearing and took the matter under advisement. The court ultimately denied this motion. The defendant appealed.

¶ 15 ANALYSIS

¶ 16 I. Propriety of the Defendant's Original Sentence
¶ 17 The defendant first contends that the sentence imposed by the trial court is void because the court lacked the authority to impose a sentence that provided that as much as 30 months could pass before the sentence was to be executed, and also that the sentence was not authorized because it was not complete at the time the court imposed it. Essentially, the defendant asserts that since the sentence in its entirety was not authorized by statute, the entire sentence is void. The State, on the other hand, contends that the original sentence was proper despite the fact that the term of imprisonment remained unexecuted, and that while a stay of this duration was not articulated in the Unified Code of Corrections (the Code) (730 ILCS 5/1-1-1 et seq. (West 2004)), it was not void.
¶ 18 We conclude that while the 6-year term of imprisonment is valid, the portion of the judgment staying the defendant's term of imprisonment for 30 months, or for the 45 months it actually remain stayed, is void. Because, as is set out below, the stay was an essential part of the defendant's plea agreement, the entire agreement is therefore void. Thus, we remand the cause to permit the defendant to withdraw her guilty plea if she chooses.

¶ 19 A. The Validity of the 30-Month Stay
¶ 20 In general, a trial court has wide discretion in fashioning the sentence of a criminal defendant and we review a trial court's sentencing determination for an abuse of discretion. People v. Bailey, 409 Ill.App.3d 574, 350 Ill.Dec. 410, 948 N.E.2d 690 (2011). For the Class 4 felony offense of driving with a suspended or revoked license, the trial court could have sentenced the instant defendant to an extended term of imprisonment between 1 and 6 years (730 ILCS 5/5-8-1, 5-8-2 (West 2004)), or to a term of probation for up to 30 months (730 ILCS 5/5-6-2 (West 2004)). The statute itself does not authorize the essentially hybrid sentence of a 6-year prison term with a 30-month stay imposed by the court. Nor have we found any other statutory or common law authority for the trial court to stay the defendant's term of imprisonment for either 30 months or for the 45 months it actually remained stayed.
¶ 21 Pursuant to Illinois Supreme Court Rule 609(b) (eff. Sept. 1, 1974), "[i]f an appeal is taken from a judgment following which the defendant is sentenced to imprisonment[,] * * * the defendant may be admitted to bail and the sentence * * * stayed, with or without bond, by a judge of the trial or reviewing court." The defendant in the instant case took no appeal from the August 2004 judgment. More broadly, our review of the case law shows that if a court sentences a defendant to a term of imprisonment, it generally will only order a stay of the execution of the *882 sentence to permit the defendant to attend to personal affairs (People v. O'Connor, 37 Ill.App.3d 310, 345 N.E.2d 520 (1976)), pending appeal (People v. Eagle Books, Inc., 151 Ill.2d 235, 176 Ill.Dec. 852, 602 N.E.2d 798 (1992)), or to see that the defendant successfully completes a term of probation (People v. Watson, 318 Ill. App.3d 140, 252 Ill.Dec. 573, 743 N.E.2d 147 (2000)). However, when the court lacks the inherent authority to enter the order (see People v. Simmons, 256 Ill. App.3d 651, 195 Ill.Dec. 295, 628 N.E.2d 759 (1993)), its order is void. Consequently, since this portion of the sentencing order was not authorized by statute, court rule, or case law, it is void.

¶ 22 B. The Validity of the Original Six-Year Term of Imprisonment
¶ 23 We next consider whether the void portion of the sentence requires a finding that the sentence as a whole has been rendered void. Whether a judgment entered by the trial court is void is a question of law that we review de novo. People v. Graham, 406 Ill.App.3d 1183, 349 Ill.Dec. 657, 947 N.E.2d 294 (2011).
¶ 24 When a trial court enters a sentencing order that was wholly unauthorized by statute, the sentence is void, and it must be vacated. Simmons, 256 Ill. App.3d 651, 195 Ill.Dec. 295, 628 N.E.2d 759. However, when a court has proper jurisdiction over the parties and the subject matter and imposes a sentence in excess of its statutory authority, only the portion of the sentence that exceeded that court's authority is void, and thus, only that portion must be vacated. In re T.E., 85 Ill.2d 326, 53 Ill.Dec. 241, 423 N.E.2d 910 (1981); see also People v. Daugherty, 104 Ill.App.3d 89, 59 Ill.Dec. 807, 432 N.E.2d 391 (1982).
¶ 25 The appellate court has found exceptions to this general rule when the sentence results from a plea agreement. A trial court lacks authority to accept and enter a judgment on a plea agreement that includes a sentencing provision not contemplated by statute, as such an order is beyond the court's inherent authority. People v. Gregory, 379 Ill. App.3d 414, 318 Ill.Dec. 531, 883 N.E.2d 762 (2008). Furthermore, a plea agreement may not be partially enforced if the unenforceable portion is an essential part, or a major element, of the agreement. People v. Hare, 315 Ill.App.3d 606, 248 Ill.Dec. 587, 734 N.E.2d 515 (2000). Thus, in an instance of this sort, "when a trial court vacates an illegal sentence that it entered in accordance with a plea agreement, the illegality voids the entire agreement and not merely the sentence." Hare, 315 Ill.App.3d at 610, 248 Ill.Dec. 587, 734 N.E.2d 515.
¶ 26 In this case, the portion of the sentencing order that imposes the six-year term of imprisonment on the defendant is clearly authorized by the statute and is thus valid. Specifically, our review of the record reveals that the defendant was eligible for an extended-term sentence because of her criminal history, thereby subjecting her to a term of imprisonment between one and six years. See 730 ILCS 5/5-8-1, 5-8-2 (West 2004). The trial court imposed a six-year term of imprisonment, the maximum permitted by statute. Therefore, we agree with the State's contention that this portion of the sentence is authorized by statute, and thus, it was a proper exercise of the court's discretion and is not, standing alone, void.
¶ 27 We have, however, already found that the trial court had no authority to stay enforcement of the mittimus for over 45 months and that the portion of the order granting the stay is void. Notwithstanding her current challenge to its validity, *883 the 30-month stay was an essential part of the defendant's plea. The defendant made it abundantly clear at the time of sentencing that the 30-month stay was a prerequisite to her plea. Moreover, because the court had participated in the Rule 402 conference at which the plea agreement was fashioned, both the court and the State were aware of and acquiesced in her terms. There can be no real dispute that the stay was integral to defendant's acceptance of the plea.
¶ 28 Accordingly, we find that the entire plea agreement is void because it contains an essential term that is not authorized by statute. We remand the cause to the trial court with directions to allow the defendant to withdraw her guilty plea if she chooses. Thereafter, depending on the course the defendant pursues, the court may proceed with trial or resentence the defendant according to the statutory guidelines.

¶ 29 II. Trial Court's Decision to Sua Sponte Vacate the Defendant's Original Sentence
¶ 30 The defendant next argues that the June 12, 2008, proceeding during which the court vacated the original sentence and imposed a 30-month term of probation was void because the defendant was not represented by counsel and she did not waive her right to counsel. The State concedes error and acknowledges that the June 12, 2008, proceeding was void, albeit on a different basis. The State asserts that sentence imposed at this proceeding was void because the trial court lacked authority to modify the defendant's sentence more than 30 days after it entered her original sentence on August 26, 2004. We find that the trial court lacked jurisdiction to sua sponte vacate and modify a defendant's sentence almost four years after it entered it; thus, the June 12, 2008, proceeding is void.
¶ 31 The question of whether a trial court has the authority to vacate a sentence more than 30 days after it entered the sentence is a question of law that we review de novo. See People v. Rowell, 229 Ill.2d 82, 321 Ill.Dec. 765, 890 N.E.2d 487 (2008).
¶ 32 Section 5-8-1 of the Unified Code of Corrections (the Code) governs modifications and reductions to a defendant's sentence. 730 ILCS 5/5-8-1 (West 2008). Pursuant to this section, a defendant may file a motion to reduce or modify her sentence within 30 days of the entry of the sentencing order. 730 ILCS 5/5-8-1 (West 2008). Section 5-8-1(c) of the Code also provides that a trial "court may reduce a sentence without motion, within 30 days after the sentence is imposed." 730 ILCS 5/5-8-1(c) (West 2008).
¶ 33 Thus, it is well established that "the authority of a trial court to alter a sentence terminates after 30 days." People v. Flowers, 208 Ill.2d 291, 303, 280 Ill.Dec. 653, 802 N.E.2d 1174 (2003). To illustrate, in People ex rel. Carey v. Rosin, 75 Ill.2d 151, 25 Ill.Dec. 816, 387 N.E.2d 692 (1979), the supreme court concluded that a trial court lacked power to modify a defendant's sentence more than 30 days after it imposed the sentence, notwithstanding that the defendant's sentence of imprisonment had been stayed pending appeal. The Rosin case involved a situation where, on February 23, 1977, the trial court sentenced the defendant to a 60-day jail term but stayed execution of the sentence pending appeal. Thereafter, on September 25, 1978, the court modified the sentence to a one-year term of probation. The supreme court concluded that the trial court in Rosin lacked jurisdiction to modify the defendant's sentence from a 60-day jail term to a 1-year probation term because more than 30 days had elapsed since it had originally sentenced the defendant. *884 See also People v. Hills, 78 Ill.2d 500, 36 Ill.Dec. 682, 401 N.E.2d 523 (1980) (the supreme court concluded that a trial court lacked the power to modify or reduce a sentence more than 30 days after the court had imposed it, notwithstanding when the sentence was executed).
¶ 34 Likewise, in this case, the trial court lacked jurisdiction to reduce, modify, or alter the defendant's sentence in any manner whatsoever at the June 12, 2008, hearing, because more than 30 days had elapsed since the trial court originally sentenced the defendant on August 26, 2004. Consequently, the 30-month term of probation that the trial court imposed on June 12, 2008, is void, as the court lacked the authority to impose it. Therefore, we vacate the defendant's 30-month term of probation.
¶ 35 In reaching this conclusion, we considered revestment and determined that the parties did not revest the trial court with jurisdiction at the June 12, 2008, hearing. Under the doctrine of revestment, "the parties may, by voluntarily appearing and participating in further proceedings, revest the court with jurisdiction over their persons and the subject matter of the action." People v. Minniti, 373 Ill. App.3d 55, 311 Ill.Dec. 251, 867 N.E.2d 1237 (2007). Specifically, the parties revest a court with jurisdiction over a matter more than 30 days after the entry of a final judgment if they actively participate in a proceeding that is inconsistent with the merits of the prior final judgment. People v. Bannister, 236 Ill.2d 1, 337 Ill. Dec. 685, 923 N.E.2d 244 (2009). Where the parties do not ignore the prior judgment, start to retry the case, and indicate that they consented to having the judgment set aside, revestment does not apply. See Sears v. Sears, 85 Ill.2d 253, 52 Ill. Dec. 608, 422 N.E.2d 610 (1981).
¶ 36 Here, revestment also does not apply for two reasons. First, the record does not indicate that the parties appeared at the June 12, 2008, hearing in an attempt to set aside the defendant's conviction. Rather, the parties appeared pursuant to the court's August 24, 2004, order that they should do so from time to time. Thus, the proceedings were not inconsistent with the merits of the final judgment. Second, for the aforementioned reason, the parties' participation in the hearing was also not voluntary, as it was pursuant to the court's order that parties shall appear from time to time. We especially believe that we cannot deem the defendant's participation in the events of the June 12, 2008, as voluntary inasmuch as the court had previously permitted her counsel to withdraw and sua sponte determined that representation by counsel was not "absolutely necessary." In the absence of counsel, her participating cannot be deemed knowing or intentional.

¶ 37 III. Sentencing Credit
¶ 38 The defendant contends that the trial court did not consider whether it should award her credit against the six-year term of imprisonment it imposed on April 28, 2010, for the time she spent on probation from June 12, 2008, to April 28, 2010. She thus asserts that if this court were to remand the cause, we should order the trial court to award the defendant credit for this period of time or order the trial court to consider the matter. The State contends, among other things, that credit for time spent on probation is discretionary and that the defendant improperly presumes that the trial court would have awarded her this credit. We conclude that the trial court did not abuse its discretion when it did not award the defendant credit for time she spent on probation, as this credit is not automatic under section 5-6-4(h) of the Code (730 ILCS *885 5/5-6-4(h) (West 2008)), and the record does not indicate that defendant was otherwise owed this credit.
¶ 39 At the outset, we acknowledge our conclusion that the June 12, 2008, proceeding during which the court imposed the instant term of probation is void. Nonetheless, we also acknowledge that during this time, the defendant was under the control of the court. Specifically, notwithstanding the label this court gives the void term of probation, the defendant was not a free person while she was under this sentence. Additionally, we note that had the court properly sentenced the defendant at the August 2004 sentencing hearing, and imposed the maximum term of imprisonment of six years, she may have fully served this term by the time the court imposed the void sentence at the June 12, 2008, hearing. Thus, because the defendant faces the possibility of being resentenced on remand, we will consider her request for credit.
¶ 40 Pursuant to section 5-6-4(h) of the Code, a "term of probation * * * shall not be credited by the court against a sentence of imprisonment * * * unless the court orders otherwise." 730 ILCS 5/5-6-4(h) (West 2010). Thus, "[t]he trial court's failure to comment about [the] defendant's probation means [that the] defendant will not receive credit for that time." People v. Kauffman, 172 Ill.App.3d 1040, 1043, 123 Ill.Dec. 182, 527 N.E.2d 645 (1988). We will not disturb a trial court's determination whether to award a defendant credit for time spent on probation absent an abuse of discretion. People v. Schwartz, 182 Ill.App.3d 515, 131 Ill.Dec. 15, 538 N.E.2d 203 (1989).
¶ 41 In this case, the trial court did not abuse its discretion when it did not award the defendant credit for the time she spent on probation from June 12, 2008, to April, 28, 2010. Specifically, the record indicates that during this time, the defendant continued to drive with a suspended license, the original offense in the case at bar. It also indicates that the defendant was incarcerated on another offense when the court revoked her probation and imposed the six-year term of imprisonment on April 10, 2010. Thus, the record does not provide a sufficient basis for a compelling claim that the trial court should have granted the defendant this credit.
¶ 42 Additionally, the trial court is presumed to know the law and to have properly applied it. See People v. Phillips, 392 Ill.App.3d 243, 331 Ill.Dec. 641, 911 N.E.2d 462 (2009). Consequently, it is presumed to have known that it had the discretion to award the defendant credit for time spent on probation at the sentencing hearing for the revocation of the defendant's probation. We believe by failing to comment or award the defendant credit for time spent on probation, the court exercised its discretion to deny this credit. Furthermore, the court took the defendant's motion to reconsider her sentence under advisement and still did not award her credit for time spent on probation. Because the record does not indicate that the court abused its discretion, we decline to reverse its judgment.
¶ 43 That said, however, we note that, but for the unusual sequence of sentencing events occurring in this case, the defendant would probably have completed either the 6-year sentence or a 30-month term of probation properly imposed in August 2004 well before she actually began to serve the six-year term in April 2010. We acknowledge that defendant was initially complicit in the original sentencing order but note that subsequent events were driven by the State and the court while defendant was unrepresented by counsel. Some attempt *886 to balance the equities on remand would not be inappropriate.

¶ 44 CONCLUSION
¶ 45 For the foregoing reasons, we remand the cause to the circuit court of Will County with directions to allow the defendant to withdraw her guilty plea, and depending on the course the defendant chooses, to otherwise proceed in conformity with this opinion.
¶ 46 Sentence vacated; cause remanded.
Justice LYTTON concurred in the judgment and opinion.
Presiding Justice SCHMIDT specially concurred, with opinion.
¶ 47 Presiding Justice SCHMIDT, specially concurring:
¶ 48 I concur in the judgment, but write separately to point out that since we find the six-year term of imprisonment imposed on April 28, 2010, void, it makes no sense to me to then discuss credit against that sentence. I find the discussion in paragraphs 37 through 43 unnecessary.
