User Tools

Site Tools

Translations of this page:

plugin:housekeeping

Housekeeping

Compatible with version

phplist 3

plugin A plugin to delete old records from the phplist database.

Last updated on
2017-09-17
Repository
Source
By Duncan Cameron

Purpose

This plugin deletes old and unused records from various tables, either single tables or a group of related tables.
The plugin provides a page that can be invoked through menu System > Housekeeping or as a cron job.

Messages

Rows will be deleted from the message table that have a status of 'sent' and whose sent date is earlier than the current date less the configuration threshold value.
Rows will also be deleted from all tables related to the message table, these are

  • linktrack_ml
  • linktrack_uml_click
  • listmessage
  • message_attachment
  • message_data
  • usermessage
  • user_message_bounce
  • user_message_forward

Event log

Rows will be deleted from the eventlog table whose date field is earlier than the current date less the configuration threshold value.

Bounces

Rows will be deleted from the bounces table whose date field is earlier than the current date less the configuration threshold value.
Rows will be deleted from the user_message_bounce table whose time field is earlier than the current date less the configuration threshold value.
Rows will also be deleted from the bounceregex_bounce table that refer to bounces which no longer exist.

Linktrack forward

Rows will be deleted from the linktrack_forward table that are no longer used (do not have a reference in either the linktrack_mk or linktrack_uml_click tables).

User history

Deletes rows from the user_history table that are older than the threshold, but taken from each subscriber's most recent user_history record. This ensures that the user history for a subscriber will never be totally deleted.

For example, if the threshold is 6 months and the most recent user_history record for a subscriber was 2 months ago, then the records for that subscriber older than 8 months will be deleted.

Installation

See the README file on the GitHub page https://github.com/bramley/phplist-plugin-housekeeping for how to install.

Translations

The text displayed by the plugin can be translated into other languages. See the file plugins/HousekeepingPlugin/lan/translations_en.php for the English version that can be used as the basis for another language. Each line in the file contains the English text then the equivalent text in the target language.

To create a new language file, copy translations_en.php to translations_xx.php, where xx is the language code, then change the texts for your target language. You can share your new language file by submitting it for inclusion in the plugin. Please create a topic in the user forum or an issue on GitHub.

Usage

Configuration

The plugin provdes a section on the Settings page where you can configure which tables should be processed.

The threshold values must be specified as a number of days, weeks, months, quarters or years, for example

  • 10 weeks
  • 1 month
  • 60 days

Cron job

The housekeeping can be automated by running a cron job periodically, say each week or month. The cron command should be similar to this but adjusted for the command to run php and the installation directory of phplist:

php /home/xxx/public_html/lists/admin/index.php -p process -m HousekeepingPlugin -c /home/xxx/public_html/lists/config/config.php

plugin/housekeeping.txt · Last modified: 2017/11/19 07:40 by duncanc

Resources
Contact Us

e: info@phplist.com

Boring Bit

phpList is a registered limited company

UK Company No. 07582966

VAT Registration 122 0788 37

© phpList 2016