Skip to content

Data Management

The Data Management section controls how long the audit log is kept and whether all plugin data is deleted when Learnomy is removed. It is a small section with big consequences, so the uninstall option is off by default.

  • Set how many days the audit log keeps entries before they are removed automatically.
  • Choose whether removing the plugin also permanently deletes all of its data.
  • Keep your student progress, transactions, and other data safe by default if you ever reinstall.

Data Management first view

Go to LMS Settings and click Data Management in the sidebar.

In the Data Retention card, set Audit Log Retention (days). Entries older than this are removed automatically. The default is 365. There is no enforced minimum, so a small number here really does prune aggressively - set 30 or more unless you have a reason not to.

Set the On Uninstall toggle, Remove all plugin data when the plugin is deleted:

  • Off (default and recommended) – deleting the plugin keeps all your data, so a reinstall picks up where you left off.
  • On – deleting the plugin permanently drops every course, enrollment, certificate, and transaction. This cannot be undone. The warning note under the toggle spells this out.

Click Save Changes.

Field Option key Notes
Audit Log Retention (days) data_retention_days Default 365. No enforced minimum.
Email Log Retention (days) email_log_retention_days How long sent-email records are kept. 0 keeps them indefinitely.
On Uninstall delete_data_on_uninstall Toggle. Off by default. When on, uninstall wipes all plugin data.

Uninstall is handled by uninstall.php, which only performs a destructive cleanup when opted in. Two flags are honoured for backward compatibility:

  • learnomy_settings['delete_data_on_uninstall'] === 1 – the current canonical flag set by the toggle above.
  • learnomy_settings['uninstall_data'] === 'delete_everything' – a legacy enum from pre-2026-05-16 installs, still respected.

When neither is set (or both are falsy) the safe default is to keep all data. When opted in, uninstall.php drops every lrn_* table, deletes all learnomy_* options, user meta, and transients, removes the lrn_student and lrn_instructor roles, and cancels all scheduled learnomy_* cron and Action Scheduler jobs.