84% advanced-database-cleaner

Code Review | Advanced Database Cleaner

WordPress plugin Advanced Database Cleaner scored84%from 54 tests.

About plugin

  • Plugin page: advanced-database...
  • Plugin version: 3.1.3
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 18, 2015
  • Latest release: Sep 13, 2023
  • Number of updates: 192
  • Update frequency: every 15.2 days
  • Top authors: symptote (100%)

Code review

54 tests

User reviews

1305 reviews

Install metrics

100,000+ active /1,186,924 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼2.57ms] Passed 4 tests

Analyzing server-side resources used by Advanced Database Cleaner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.80 ▲0.3445.62 ▲2.70
Dashboard /wp-admin3.62 ▲0.3256.44 ▲1.47
Posts /wp-admin/edit.php3.74 ▲0.3850.87 ▼2.32
Add New Post /wp-admin/post-new.php6.20 ▲0.3290.78 ▼12.13
Media Library /wp-admin/upload.php3.55 ▲0.3243.90 ▲2.87
WP DB Cleaner /wp-admin/tools.php?page=advanced_db_cleaner3.6443.11

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 61 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

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 /2,843 ▲8214.27 ▼0.391.90 ▼0.1343.40 ▼1.55
Dashboard /wp-admin2,221 ▲475.52 ▼0.0691.47 ▼9.3939.11 ▼6.26
Posts /wp-admin/edit.php2,129 ▲292.04 ▲0.0636.57 ▼0.4132.35 ▼2.39
Add New Post /wp-admin/post-new.php1,539 ▲1123.15 ▼0.21687.76 ▼3.9667.23 ▲11.33
Media Library /wp-admin/upload.php1,429 ▲294.14 ▼0.07102.99 ▼10.6448.65 ▲0.04
WP DB Cleaner /wp-admin/tools.php?page=advanced_db_cleaner1,9552.1528.6854.56

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 23× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/custom-schedule-view/class_edit_cleanup_schedule.php:5
    • > 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: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/class_general_cleanup.php:5
    • > PHP Warning
      Use of undefined constant ADBC_PLUGIN_PLAN - assumed 'ADBC_PLUGIN_PLAN' (this will throw an Error in a future version of PHP) in wp-content/plugins/advanced-database-cleaner/includes/header_page_filter.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/advanced-database-cleaner/includes/overview_settings.php:6
    • > 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-schedule-view/class_add_cleanup_schedule.php:5
    • > 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:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/advanced-database-cleaner/includes/custom-clean-view/class_clean_relationships.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The main PHP script in "Advanced Database Cleaner" version 3.1.3 is automatically included on every request by WordPress
The following require your attention:
  • 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 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin8,057 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
PHP272,3771,0896,330
CSS22841021,177
JavaScript210892317
SVG2005233

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity53.73
▷ Minimum class complexity29.00
▷ Maximum class complexity115.00
Average method complexity5.57
▷ Minimum method complexity1.00
▷ Maximum method complexity41.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods173
▷ Static methods10.58%
▷ Public methods16494.80%
▷ Protected methods00.00%
▷ Private methods95.20%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants18
▷ Global constants18100.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/order_now.png14.00KB6.45KB▼ 53.91%
images/premium_ok.png4.54KB3.56KB▼ 21.67%
images/help.png3.96KB2.63KB▼ 33.51%
images/menu-icon.png0.49KB0.71KB0.00%
images/icon-128x128.png9.76KB4.10KB▼ 58.00%