94% advanced-database-cleaner

Code Review | Advanced Database Cleaner

WordPress plugin Advanced Database Cleaner scored 94% from 54 tests.

About plugin

  • Plugin page: advanced-database...
  • Plugin version: 3.0.4
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-5.9
  • WordPress version: 5.9.2
  • First release: Sep 18, 2015
  • Latest release: Feb 3, 2022
  • Number of updates: 180
  • Update frequency: every 13.0 days
  • Top authors: symptote (100%)

Code review

54 tests

User reviews

992 reviews

Install metrics

80,000+ active / 713,533 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.26MB] [CPU: ▼291.91ms] Passed 4 tests

Server-side resources used by Advanced Database Cleaner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3461.89 ▲9.96
Dashboard /wp-admin3.69 ▲0.2935.77 ▲2.54
Posts /wp-admin/edit.php3.92 ▲0.2840.94 ▲3.41
Add New Post /wp-admin/post-new.php7.16 ▲0.1994.91 ▼1,177.98
Media Library /wp-admin/upload.php3.57 ▲0.2826.77 ▲4.41
WP DB Cleaner /wp-admin/tools.php?page=advanced_db_cleaner3.6732.54

Server storage [IO: ▲0.55MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 62 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Advanced Database Cleaner
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,816 ▲6216.01 ▲0.215.63 ▼0.202.32 ▼0.42
Dashboard /wp-admin2,921 ▲606.13 ▼0.04118.77 ▼15.30153.98 ▼6.95
Posts /wp-admin/edit.php2,721 ▲273.37 ▲0.1461.35 ▼3.00140.92 ▼2.56
Add New Post /wp-admin/post-new.php1,674 ▲1316.11 ▼0.35418.28 ▲6.60150.13 ▼8.06
Media Library /wp-admin/upload.php1,731 ▲335.54 ▲0.00146.53 ▲9.70191.33 ▲3.46
WP DB Cleaner /wp-admin/tools.php?page=advanced_db_cleaner2,4843.1759.75182.60

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 22× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/advanced-database-cleaner/includes/premium_page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/class_clean_tables.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/class_clean_transient.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/class_general_cleanup.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/class_clean_tables.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/class_clean_options.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/page_custom_clean.php:4
    • > PHP Warning
      Use of undefined constant ADBC_PLUGIN_DIR_PATH - assumed 'ADBC_PLUGIN_DIR_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/header_page_custom_clean.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/class_clean_comment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/class_clean_revision_draft_trash.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 13 tag instead of maximum 10
The official readme.txt might help

advanced-database-cleaner/advanced-db-cleaner.php 92% from 13 tests

The entry point to "Advanced Database Cleaner" version 3.0.4 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("advanced-database-cleaner.php" instead of "advanced-db-cleaner.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin6,874 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP261,2979855,736
CSS240116776
SVG2204256
JavaScript23628106

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity49.53
▷ Minimum class complexity30.00
▷ Maximum class complexity92.00
Average method complexity5.36
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods167
▷ Static methods10.60%
▷ Public methods16498.20%
▷ Protected methods00.00%
▷ Private methods31.80%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/help.png3.96KB2.63KB▼ 33.51%
images/icon-128x128.png9.76KB4.10KB▼ 58.00%
images/premium_ok.png4.54KB3.56KB▼ 21.67%
images/menu-icon.png0.49KB0.71KB0.00%
images/order_now.png14.00KB6.45KB▼ 53.91%