<inputname="q"type="text"class="search-input"placeholder="Search..."aria-label="Input your search terms"autocomplete="off"autocorrect="off"autocapitalize="off"spellcheck="false"/>
<p>This document explains the account locking feature from a technical perspective. Account locking happens when users have outgrown their accounts, and despite e-mail and dashboard alerts, don't upgrade after a grace period.</p><h2id="usage-alert-and-grace-period"class="section-heading">
<p>The <ahref="Plausible.Workers.CheckUsage.html"><codeclass="inline">Plausible.Workers.CheckUsage</code></a> daily background job alerts users they have reached their subscription limits. This runs for outgrown users one day after their last billing date.</p><p>When users reach the number of sites limit, or use >110% of their pageview limit for 2 consecutive billing cycles, the background job sends them an e-mail alert. The e-mail suggests a suitable subscription plan based on usage. For enterprise users, only an internal e-mail is sent to <codeclass="inline">enterprise@plausible.io</code>.</p><p>The user is given 7 days to upgrade their account after the alert, and this is called grace period. The background starts this grace period by adding a <codeclass="inline">users.grace_period</code> JSON to the user record:</p><pre><codeclass="json">// SELECT grace_period FROM users LIMIT 1
}</code></pre><p>During this period, the following alert pops up on the dashboard for both standard and enterprise users:</p><p><imgsrc="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN4GLWMwCrTuTcf31kYE9%2Fuploads%2FmsLk4CdSHKzU8TbfvaPq%2FPasted%20image%2020220909120933.png?alt=media&token=76f247a1-28cf-4d88-a0fa-06547268aee9"alt=""/></p><p>If the user upgrades to a suitable plan, the grace period is removed (check <ahref="Plausible.Billing.html#subscription_updated/1"><codeclass="inline">Plausible.Billing.subscription_updated/1</code></a>), otherwise <ahref="#Account locking">Account locking</a>) follows. For enterprise users, the grace period has a manual lock flag set to true, meaning enterprise accounts can only be locked/unlocked through the internal CRM.</p><h2id="account-locking"class="section-heading">
<p>The grace period is checked daily by the <ahref="Plausible.Workers.LockSites.html"><codeclass="inline">Plausible.Workers.LockSites</code></a> background job.</p><p>For users that expired their grace period, <codeclass="inline">sites.locked</code> is is set to <codeclass="inline">true</code>, restricting access to dashboards. This does not stop event ingestion, so users can have their stats up to date when they finally upgrade.</p><p><imgsrc="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FN4GLWMwCrTuTcf31kYE9%2Fuploads%2FAplurtG7UsGXMskZOlUO%2FPasted%20image%2020220909122622.png?alt=media&token=5c8156d7-d4a7-4c99-8bac-2f1e9b7d4cae"alt=""/></p>