Module · LNK Store Cleaner
  • PrestaShop

LNK Store Cleaner, PrestaShop database cleaning with backup and restore

Carts never ordered, visits from last year, logs, images of deleted products: the database and folders of a PrestaShop shop grow while nobody touches them. LNK Store Cleaner makes them lighter without risk: it simulates first, backs up before every deletion and restores in one click. No cron task to schedule.

  • Version 1.1.1 · PrestaShop 1.7.6 to 8.x
  • Version 1.9.1 · PrestaShop 9
  • PrestaShop 1.7.6 to 9.x
  • PHP 7.1 to 8.4
  • No override

Key points

  • Fourteen cleanings: database and folders.
  • Simulation required, then your approval before any cleaning.
  • Compressed backup, read again and checked before every deletion.
  • One-click restore from the journal.
  • A line used elsewhere in the database is always kept.
  • Vouchers and specific prices off by default.
  • Images and logs in quarantine; upload/ never touched.
  • Backups closed to the web, tested, signed, erased after 30 days.
  • No cron task, without slowing down the back office.
  • Size of the tables and OPTIMIZE TABLE.
  • No data sent outside.
  • Multistore.
  • French, English and Arabic (right to left).
  • PrestaShop 1.7.6 to 9, no override.

A database that grows without you noticing

PrestaShop keeps every cart, every visit, every page seen, every back-office error and every email sent. The ps_connections, ps_guest, ps_cart and ps_log tables can hold hundreds of thousands of lines, the backups get heavier, and the image folder keeps the files of products deleted long ago.

Fourteen ready-made cleanings

Abandoned carts, visits, visitors, back-office log, sent emails log, pages not found, searches, expired sessions, orphan lines; and on the folder side, unused product images, old log files and temporary files. Each one has a sensible minimum age by default (90 days for carts, 180 for visits) that you can make longer. Expired specific prices and vouchers stay off until you switch them on.

Nothing that matters is deleted

A line cited elsewhere in the database is always kept: a cart linked to an order, to a customer message, to a reminder module or to any third-party module stays in place. The simulation tells you which tables protect how many lines. The upload/ folder (files of your customers) is never touched.

A backup before every deletion, a one-click restore

Each batch is written to a compressed backup, read again and checked before it is deleted; if the backup fails, nothing leaves. Images and logs go to quarantine. From the journal, one click puts the lines and files back, while the backup is kept (30 days by default).

Backups closed to the web, and checked

The backups are stored outside the module, under a random name, with protections for Apache, IIS and nginx. The module really asks your shop for a test file: if it can be read, or if the test cannot conclude, there is no deletion. The backups are signed and erased after the chosen time.

No cron task

The module works a few seconds after the pages of the back office, at most every 5 minutes, once the page has been sent, by small batches in a transaction, with a lock and a time limit. A scheduled task address with a token remains available if your back office is seldom opened.

Léger et rapide

No file loaded on the shop: 0 KB of JavaScript, 0 KB of CSS. The work is done after the pages of the back office have been sent; your customers never wait for the cleaning. The Tables section shows the size of each table and OPTIMIZE TABLE gives the freed space back.

Compatible with PrestaShop 1.7.6, 8 and 9

Two versions of the module, one per generation: 1.1 for PrestaShop 1.7.6 to 8.x, 1.9 for PrestaShop 9, PHP 7.1 to 8.4. Multistore: images are checked for every shop. No override.

Frequently asked questions

Which PrestaShop versions does the module work with?

PrestaShop 1.7.6 to 8.x (version 1.1.N) and PrestaShop 9 (version 1.9.N), PHP 7.1 to 8.4. The installed package must match your PrestaShop version.

What does the module clean?

In the database: abandoned carts, old visits and visitors, the back-office log, the sent emails log, pages not found, searches, expired sessions and orphan lines. In the folders: unused product images, old log files and temporary files. Each cleaning is set on its own: on or off, and from which age.

Can the module delete an order or break my shop?

No. A line cited elsewhere in the database (an order, a customer message, another module) is always kept; if a table needed for this check (orders, messages, used vouchers) could not be read, nothing is deleted. Before every deletion, the lines are saved, read again and checked; if the backup fails, nothing is deleted. The work goes by small batches in a transaction, and a table is never emptied in one go.

How do I know what will leave before cleaning?

The "Save and simulate" button counts the lines or files that would leave, estimates the space gained, shows examples and tells which tables protect how many lines. The simulation is required before the first cleaning, and again if you choose a shorter age. A simulation authorises nothing: the cleaning waits for your approval. It starts only after a confirmed click on "Clean now" or on "Turn on automatic cleaning". A shorter age withdraws this approval until a new simulation and a new confirmation. Each cleaning shows its state: "Waiting for your approval" or "Automatic, next pass around …".

Can I go back?

Yes, in one click from the journal, while the backup is kept (30 days by default, adjustable from 7 to 365). Lines and files are put back as they were; a line created again since then is left untouched. The restored cleaning is then switched off, so that it does not remove the same thing again.

Where are the backups stored, and are they protected?

In the var/lnk_dbcleaner/ folder of the shop, outside the module, under a random name, with protections for Apache, IIS and nginx. The module really asks your shop for a test file: if it can be read from the web, or if the test cannot conclude, nothing is deleted. The backups are signed: a modified backup is refused at restore time.

Do I need to schedule a cron task?

No. The module works a few seconds after the pages of the back office, at most every 5 minutes, once the page has been sent. If your back office is seldom opened, a scheduled task address with a token is offered in the advanced settings.

Does the module slow down my shop?

No. It loads no file on the shop and does not work while the pages of your customers are shown (option off by default). In the back office, the work starts after the page has been sent; if your server does not allow it, the module tells you so and offers the scheduled task address.

Will my statistics change?

The visit statistics of PrestaShop lose the visits older than the chosen age (180 days by default); the back office says so under this cleaning. Orders, turnover and customers are not touched.

I use a cart reminder module: is that a problem?

No. A cart is never cleaned before 31 days, and a cart cited by a reminder module (or by any other table) is kept. Visitors are cleaned after carts and visits, and any visitor linked to a kept cart or visit is kept.

Why does no visitor leave during the first days?

The visitors table (guest) has no date: the module notes each day how far it has grown. The first visitors therefore leave only once the chosen age (180 days by default) has passed since the installation, unless older visits already show their age. Without an old enough mark, no visitor leaves: this is on purpose.

Are expired vouchers and specific prices deleted?

Only if you switch it on: these two cleanings are off by default and marked "Commercial data". A voucher used in an order or still in a cart is never removed.

Can a deleted product image be missing in a shop?

No. An image is only targeted if it no longer exists in the catalog, for any shop. The files go to quarantine first and can be put back in one click. The upload/ folder (files sent by your customers) is never touched.

What about a large shop?

The module works by batches (500 lines by default) within a time limit, then resumes at the next batch: nothing locks the database for long. Only one cleaning runs at a time. The Tables section shows the size of each table and the space OPTIMIZE TABLE can give back.

Does the module contain an override?

No. No override: the module makes no change to the core of PrestaShop.

Does the module work in multistore?

Yes. The database is shared by all shops, and so are the settings. An image is only removed if no shop uses it.

What data is sent outside?

None. The only network call is the protection test of the backups, towards your own shop. The backups contain personal data: they are erased after the retention time.

What is left after uninstalling?

Nothing from the module: settings, journal, tables and backups are deleted. The last cleanings can then no longer be restored, and PrestaShop asks you before going on.

Release history

4 versions released for PrestaShop

  1. Version 1.9.1 PrestaShop 9

    Changes

    • Explicit approval before any cleaning: a simulation no longer authorises anything. A cleaning runs on its own only after a confirmed click on "Clean now" or on the new "Turn on automatic cleaning" button. A shorter age withdraws this approval until a new simulation and a new confirmation. After the update, each cleaning waits for your approval.
    • Each cleaning shows its state: "Off", "Simulation needed", "Waiting for your approval" or "Automatic, next pass around …", and the date of its last check.
    • Journal: only the passes that removed something are listed, with the name of the cleaning in your language. The update removes the empty passes already noted.
    • Sizes in the language of the back office (239,5 Ko in French, translated units in Arabic). More accurate table measures on MySQL 8, shown as "about".

    Fixes

    • Module page on a wide screen: the content takes the full width next to the sections; the journal ("Space freed", "Restore") is no longer cut.
    • Arabic: dates, identifiers, table names and sizes stay readable from left to right inside sentences.
    • Backups readable from the web: a single red banner, and the Safety section describes the real result of the test.
    • "Restore" button removed for temporary thumbnails, which are deleted without quarantine.
  2. Version 1.9.0 PrestaShop 9

    New

    • First version: risk-free cleaning of the database and folders of the shop, fourteen cleanings each with their own settings (on or off, minimum age in days, and under "Advanced" the threshold and the pace).
    • Database: abandoned carts (90 days by default, 31 at least), visits (180 days), visitors (180 days, kept when linked to a customer account, to a kept cart or to a kept visit; the table has no date, so the age is read from marks noted each day since the installation), back-office log (90 days), sent emails log (90 days), pages not found (90 days), searches of the shop (365 days), expired sessions (30 days), orphan lines.
    • Expired specific prices and expired cart rules (vouchers): off by default, marked "Commercial data". A voucher used in an order or still in a cart is never removed.
    • Files: unused product images (in no shop), old log files (var/logs, app/logs, log/; never the file of the day, compressed), temporary files of img/tmp and the old app/cache folder. Images, logs and the old cache go to quarantine. Nothing is ever touched in upload/.
    • Generic protection: a line cited in any other table of the database (order, message, reminder module, third-party module) is kept, and nothing is deleted if a table needed for this check (orders, messages, used vouchers) could not be read; the simulation tells which tables protect how many lines.
    • Simulation required before the first run, and again when the scope widens: number of lines or files, estimated size, examples.
    • Compressed SQL backup of each batch, written then read again and checked before the deletion; small batches in a transaction, a lock, a time limit, never any TRUNCATE.
    • Journal of the cleanings and one-click restore: lines and files put back, a line created again since then left as it is; the restored cleaning is then switched off. Signed backups: a modified backup is refused.
    • Backups outside the module, in var/lnk_dbcleaner/ under a random name, closed to the web, with a real test: as long as the shop lets the test file be read, or the test cannot conclude, nothing is deleted. Kept 30 days by default (7 to 365), then erased.
    • No scheduled task: the module works a few seconds after the pages of the back office, at most every 5 minutes, once the page has been sent. Work after the pages of the shop as an option (off by default); scheduled task address with a token as an option.
    • Tables section: size, lines and space to reclaim; OPTIMIZE TABLE after a cleaning (can be switched off).
    • Multistore: shared settings (the database is shared), images checked for every shop.
    • No data sent outside; the only network call is the protection test towards the shop itself.
    • Uninstall: settings, journal and backups deleted.
    • lnk-admin back office in French, English and Arabic (right to left), advanced settings folded.
  3. Version 1.1.1 PrestaShop 1.7.6 to 8.x

    Changes

    • Explicit approval before any cleaning: a simulation no longer authorises anything. A cleaning runs on its own only after a confirmed click on "Clean now" or on the new "Turn on automatic cleaning" button. A shorter age withdraws this approval until a new simulation and a new confirmation. After the update, each cleaning waits for your approval.
    • Each cleaning shows its state: "Off", "Simulation needed", "Waiting for your approval" or "Automatic, next pass around …", and the date of its last check.
    • Journal: only the passes that removed something are listed, with the name of the cleaning in your language. The update removes the empty passes already noted.
    • Sizes in the language of the back office (239,5 Ko in French, translated units in Arabic). More accurate table measures on MySQL 8, shown as "about".

    Fixes

    • Module page on a wide screen: the content takes the full width next to the sections; the journal ("Space freed", "Restore") is no longer cut.
    • Arabic: dates, identifiers, table names and sizes stay readable from left to right inside sentences.
    • Backups readable from the web: a single red banner, and the Safety section describes the real result of the test.
    • "Restore" button removed for temporary thumbnails, which are deleted without quarantine.
Show the previous version
  1. Version 1.1.0 PrestaShop 1.7.6 to 8.x

    New

    • First version: risk-free cleaning of the database and folders of the shop, fourteen cleanings each with their own settings (on or off, minimum age in days, and under "Advanced" the threshold and the pace).
    • Database: abandoned carts (90 days by default, 31 at least), visits (180 days), visitors (180 days, kept when linked to a customer account, to a kept cart or to a kept visit; the table has no date, so the age is read from marks noted each day since the installation), back-office log (90 days), sent emails log (90 days), pages not found (90 days), searches of the shop (365 days), expired sessions (30 days), orphan lines.
    • Expired specific prices and expired cart rules (vouchers): off by default, marked "Commercial data". A voucher used in an order or still in a cart is never removed.
    • Files: unused product images (in no shop), old log files (var/logs, app/logs, log/; never the file of the day, compressed), temporary files of img/tmp and the old app/cache folder. Images, logs and the old cache go to quarantine. Nothing is ever touched in upload/.
    • Generic protection: a line cited in any other table of the database (order, message, reminder module, third-party module) is kept, and nothing is deleted if a table needed for this check (orders, messages, used vouchers) could not be read; the simulation tells which tables protect how many lines.
    • Simulation required before the first run, and again when the scope widens: number of lines or files, estimated size, examples.
    • Compressed SQL backup of each batch, written then read again and checked before the deletion; small batches in a transaction, a lock, a time limit, never any TRUNCATE.
    • Journal of the cleanings and one-click restore: lines and files put back, a line created again since then left as it is; the restored cleaning is then switched off. Signed backups: a modified backup is refused.
    • Backups outside the module, in var/lnk_dbcleaner/ under a random name, closed to the web, with a real test: as long as the shop lets the test file be read, or the test cannot conclude, nothing is deleted. Kept 30 days by default (7 to 365), then erased.
    • No scheduled task: the module works a few seconds after the pages of the back office, at most every 5 minutes, once the page has been sent. Work after the pages of the shop as an option (off by default); scheduled task address with a token as an option.
    • Tables section: size, lines and space to reclaim; OPTIMIZE TABLE after a cleaning (can be switched off).
    • Multistore: shared settings (the database is shared), images checked for every shop.
    • No data sent outside; the only network call is the protection test towards the shop itself.
    • Uninstall: settings, journal and backups deleted.
    • lnk-admin back office in French, English and Arabic (right to left), advanced settings folded.

Your cart

Your cart is empty.