78% dbtools

Code Review | DBtools

WordPress plugin DBtools scored78%from 54 tests.

About plugin

  • Plugin page: dbtools
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.6.1
  • WordPress version: 6.3.1
  • First release: Jul 27, 2015
  • Latest release: Aug 28, 2016
  • Number of updates: 26
  • Update frequency: every 35.7 days
  • Top authors: mdgeus (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,480 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.34ms] Passed 4 tests

An overview of server-side resources used by DBtools
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.24 ▼3.08
Dashboard /wp-admin3.33 ▲0.0357.75 ▼2.39
Posts /wp-admin/edit.php3.38 ▲0.0352.86 ▲1.65
Add New Post /wp-admin/post-new.php5.91 ▲0.0387.11 ▼6.88
Media Library /wp-admin/upload.php3.25 ▲0.0337.74 ▼1.02
Maintenance /wp-admin/admin.php?page=dbtools_optimize3.2246.28
Backup /wp-admin/admin.php?page=dbtools_backup3.2335.59
DBtools /wp-admin/admin.php?page=dbtools_menu3.2233.47

Server storage [IO: ▲0.02MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • Illegal file modification found: 1 file (0.04KB) outside of "wp-content/plugins/dbtools/" and "wp-content/uploads/"
    • (new file) dbtools/index.php
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded
1.2.2
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

DBtools: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.68 ▲0.131.77 ▼0.1748.54 ▲6.49
Dashboard /wp-admin2,218 ▲415.71 ▲0.0592.77 ▼5.5474.05 ▲32.59
Posts /wp-admin/edit.php2,132 ▲291.98 ▼0.0633.74 ▼1.2936.82 ▲4.45
Add New Post /wp-admin/post-new.php1,574 ▲4823.23 ▼0.09636.36 ▼66.27180.03 ▲124.95
Media Library /wp-admin/upload.php1,426 ▲264.22 ▲0.0399.56 ▼13.1280.05 ▲33.96
Maintenance /wp-admin/admin.php?page=dbtools_optimize8491.336.9320.68
Backup /wp-admin/admin.php?page=dbtools_backup7141.127.1720.32
DBtools /wp-admin/admin.php?page=dbtools_menu8421.9923.6125.87

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • 1.2.2
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/dbtools/tools/optimize.php
    • > /wp-content/plugins/dbtools/download.php
    • > /wp-content/plugins/dbtools/tools/backup.php
    • > /wp-content/plugins/dbtools/DBtools.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dbtools_menu
    • > Network (severe)
    wp-content/plugins/dbtools/images/icon.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: backup, database, tools, optimize, tool

dbtools/DBtools.php 92% from 13 tests

The entry point to "DBtools" version 1.2.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("dbtools.php" instead of "DBtools.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected317 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP44534309
HTML1208

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin