78% wp-db-cleaner

Code Review | WP DB Cleaner

WordPress plugin WP DB Cleaner scored78%from 54 tests.

About plugin

  • Plugin page: wp-db-cleaner
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.1
  • WordPress version: 6.3.1
  • First release: Oct 15, 2015
  • Latest release: Mar 1, 2016
  • Number of updates: 9
  • Update frequency: every 15.7 days
  • Top authors: utkarshpatel (77.78%)mehulkaklotar (33.33%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /3,056 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼6.02ms] Passed 4 tests

Server-side resources used by WP DB Cleaner
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1040.57 ▼1.98
Dashboard /wp-admin3.40 ▲0.1046.56 ▼3.52
Posts /wp-admin/edit.php3.51 ▲0.1647.98 ▼1.59
Add New Post /wp-admin/post-new.php6.00 ▲0.1283.63 ▼16.97
Media Library /wp-admin/upload.php3.32 ▲0.1035.29 ▼0.55
WP DB Clean /wp-admin/tools.php?page=db-clean3.2934.16

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP DB Cleaner
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.36 ▼1.381.90 ▼0.1641.33 ▼1.79
Dashboard /wp-admin2,214 ▲315.86 ▲0.93101.09 ▼14.3539.33 ▼7.13
Posts /wp-admin/edit.php2,097 ▲82.00 ▼0.0336.64 ▼2.1634.68 ▲3.00
Add New Post /wp-admin/post-new.php1,521 ▲223.29 ▼0.08665.43 ▼12.2052.95 ▼12.12
Media Library /wp-admin/upload.php1,399 ▲84.19 ▼0.0596.59 ▼17.8839.34 ▼7.76
WP DB Clean /wp-admin/tools.php?page=db-clean7901.536.6118.59

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=db-clean
    • > Notice in wp-admin/includes/class-wp-list-table.php+1626
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/tools.php?page=db-clean
    • > Error in wp-admin/includes/class-wp-list-table.php+1572
    Uncaught Error: Call to a member function render_screen_reader_content() on null in wp-admin/includes/class-wp-list-table.php:1572
    Stack trace:
    #0 wp-content/plugins/wp-db-cleaner/admin/classes/class-wp-orphan-data.php(277): WP_List_Table->display()
    #1 wp-content/plugins/wp-db-cleaner/admin/template/db-cleaner-page.php(33): lm_dbc_orphan_ui()
    #2 wp-content/plugins/wp-db-cleaner/admin/class-wp-db-cleaner-admin.php(53): require_once('/var/www/wordpr...')
    #3 wp-includes/class-wp-hook.php(310): Db_Cleaner_Admin->get_clean_ui()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 wp-admin/tools.php(40): require_once('/var/www/wordpr...')
    #8 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-db-cleaner/admin/classes/class-wp-db-cleaner-list.php on line 12
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/wp-db-cleaner/admin/classes/class-wp-db-cleaner-list.php on line 12
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/wp-db-cleaner/admin/wp-cli/class-wp-cleaner-cli.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wp-db-cleaner/admin/template/db-cleaner-page.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-db-cleaner/admin/classes/class-wp-db-cleaner-list.php on line 12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-db-cleaner === )
Please take inspiration from this readme.txt

wp-db-cleaner/wp-db-cleaner.php Passed 13 tests

The primary PHP file in "WP DB Cleaner" version 2.0.1 is used by WordPress to initiate all plugin functionality
55 characters long description:
Clean WordPress orphan and duplicate data from database

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin754 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP13225540686
Markdown122040
CSS19725
JavaScript12273

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity6.56
▷ Minimum class complexity1.00
▷ Maximum class complexity16.00
Average method complexity1.93
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods54
▷ Static methods47.41%
▷ Public methods4685.19%
▷ Protected methods35.56%
▷ Private methods59.26%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin