What it does
- Twelve tasks, each with a Check button (a dry run: counts, a few examples and the size, nothing changes) and a Clean now button that stays off until a check found something:
- Old carts of logged-in customers (the shop itself removes guest carts after an hour).
- Expired sessions, the "who is online" log, the customer search log, the login attempt log, the customer activity log, the product view report (whichever your OpenCart version has).
- Unfinished orders (status "missing", never paid) older than the days you set, together with their products, totals and history. Real orders are never touched.
- Rows without a parent: descriptions, links and options of products, categories, pages, orders and customers that were deleted.
- Unused images: files in image/catalog older than the days you set that no product, category, banner, setting or text points to. They are moved to image/unused/ (not deleted), so you can put one back.
- The error log file: emptied.
- Table space: rebuilds the tables that hold a lot of room left behind by deleted rows.
- A list of the 25 biggest tables (rows, size, free room).
- A history of what was cleaned.
- Each clean run is limited (20000 rows, 2000 orders, 500 images, 40 tables): press it again for more, so a big shop does not time out.
- The history is kept when you uninstall.
What it does not do
- It does not run by itself: you press the buttons (no cron).
- A picture used only by a theme file or custom code is not seen as used: that is why images are moved, not deleted. Check the list before cleaning.
- It does not make a backup. Make a database backup first.
- Rows counts in the table list are the database's own estimate.
Tested
Installed and used through the real admin installer on OpenCart 2.3.0.2, 3.0.5.1, 4.0.2.3 and 4.1.0.4 (77 to 85 checks each, 0 failures): every task as a check and as a clean, old rows gone and fresh rows kept, real orders untouched, parent rows kept, images used by a product image row or a text kept, the move to image/unused/, the error log, table rebuild, days held to their limits, an unknown task or SQL in the task name refused, POST only, no admin session no access, uninstall and reinstall keeping the history. The page scripts were not driven in a real browser.
Note
Screenshots are not included yet.