78% database-browser

Code Review | Database Browser

WordPress plugin Database Browser scored 78% from 54 tests.

About plugin

  • Plugin page: database-browser
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.3.2
  • WordPress version: 5.9.2
  • First release: Dec 6, 2010
  • Latest release: Nov 30, 2020
  • Number of updates: 17
  • Update frequency: every 214.8 days
  • Top authors: MrWiblog (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

6,000+ active / 97,099 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: ▼1.06MB] [CPU: ▼323.08ms] Passed 4 tests

Analyzing server-side resources used by Database Browser
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.1852.95 ▲0.80
Dashboard /wp-admin3.27 ▼0.1418.73 ▼13.82
Posts /wp-admin/edit.php3.27 ▼0.3717.78 ▼19.68
Add New Post /wp-admin/post-new.php3.27 ▼3.7020.93 ▼1,251.55
Media Library /wp-admin/upload.php3.27 ▼0.0318.03 ▼7.28
Database browser /wp-admin/tools.php?page=databasebrowser3.2719.26

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 20 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Database Browser
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,773 ▲1915.89 ▲0.245.60 ▼0.342.12 ▼0.18
Dashboard /wp-admin2,899 ▲386.04 ▼0.12119.58 ▼18.93154.33 ▼7.85
Posts /wp-admin/edit.php2,698 ▲73.24 ▲0.0160.40 ▼2.65144.22 ▼2.11
Add New Post /wp-admin/post-new.php1,675 ▲718.10 ▼0.11397.01 ▼20.58160.10 ▲4.10
Media Library /wp-admin/upload.php1,705 ▲105.54 ▲0.02138.21 ▼2.29188.73 ▲6.55
Database browser /wp-admin/tools.php?page=databasebrowser1,0732.4252.95108.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/database-browser/database-browser.php+183
    Undefined index: _wpnonce

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
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=databasebrowser
    • > Notice in wp-content/plugins/database-browser/database-browser.php+284
    Undefined index: _wpnonce
    • > GET request to /wp-admin/tools.php?page=databasebrowser
    • > Notice in wp-content/plugins/database-browser/database-browser.php+210
    Undefined index: table
    • > GET request to /wp-admin/tools.php?page=databasebrowser
    • > Notice in wp-content/plugins/database-browser/database-browser.php+243
    Undefined index: query
    • > GET request to /wp-admin/tools.php?page=databasebrowser
    • > Notice in wp-content/plugins/database-browser/database-browser.php+249
    Undefined index: queryname

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 fix the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/database-browser/tests/Output_Base_Test.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/database-browser/views/results.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/database-browser/views/filters.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/database-browser/views/query.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/database-browser/tests/Output_Base_Test.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/database-browser/views/title.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/database-browser/tests/Output_Base_Test.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/database-browser/views/navigation.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/database-browser/tests/Output_Base_Test.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/database-browser/tests/Output_Base_Test.php:2

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 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The database browser form) image not found
The official readme.txt is a good inspiration

database-browser/database-browser.php Passed 13 tests

The principal PHP file in "Database Browser" v. 1.4.4 is loaded by WordPress automatically on each request
86 characters long description:
Easily browse the data in your database, and download in CSV, XML, SQL and JSON format

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin1,146 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP142363741,089
JavaScript10331
CSS10026

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity12.56
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods4193.18%
▷ Protected methods24.55%
▷ Private methods12.27%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.16MB with 0.08MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png161.87KB78.70KB▼ 51.38%