93% wp-db-table-editor

Code Review | WP-DB-Table-Editor

WordPress plugin WP-DB-Table-Editor scored 93% from 54 tests.

About plugin

  • Plugin page: wp-db-table-editor
  • Plugin version: 1.8.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.3.2
  • WordPress version: 5.8.1
  • First release: Mar 26, 2014
  • Latest release: Mar 11, 2020
  • Number of updates: 73
  • Update frequency: every 29.9 days
  • Top authors: bobbysmith007 (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active / 48,985 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼136.75ms] Passed 4 tests

Analyzing server-side resources used by WP-DB-Table-Editor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1334.15 ▲10.92
Dashboard /wp-admin3.07 ▲0.0243.75 ▼2.58
Posts /wp-admin/edit.php3.13 ▲0.0249.89 ▲4.87
Add New Post /wp-admin/post-new.php5.43 ▼0.0093.15 ▼551.35
Media Library /wp-admin/upload.php3.02 ▲0.0232.86 ▲2.07

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

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

Browser metrics Passed 4 tests

WP-DB-Table-Editor: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.93 ▲0.4310.35 ▲1.9742.67 ▼13.57
Dashboard /wp-admin2,967 ▲365.94 ▼0.07142.84 ▼10.25111.45 ▲2.70
Posts /wp-admin/edit.php2,739 ▼02.68 ▼0.0169.82 ▲5.5490.81 ▼5.00
Add New Post /wp-admin/post-new.php1,676 ▼2,01119.03 ▲0.64378.96 ▼75.09111.31 ▲2.61
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.01148.93 ▼11.83114.96 ▼5.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
  • 154× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPSQLParser\\processors\\AbstractProcessor' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/processors/LimitProcessor.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPSQLParser\\builders\\Builder' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/builders/PositionBuilder.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'PHPSQLParser\\processors\\AbstractProcessor' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/processors/IntoProcessor.php:42
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPSQLParser\\builders\\Builder' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/builders/IndexKeyBuilder.php:54
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPSQLParser\\builders\\Builder' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/builders/ReservedBuilder.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'PHPSQLParser\\processors\\AbstractProcessor' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/processors/SQLChunkProcessor.php:51
    • > PHP Fatal error
      Uncaught Error: Class 'PHPSQLParser\\processors\\AbstractProcessor' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/processors/ReferenceDefinitionProcessor.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'PHPSQLParser\\processors\\AbstractProcessor' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/processors/UnionProcessor.php:51
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPSQLParser\\builders\\Builder' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/builders/TruncateBuilder.php:52
    • > PHP Fatal error
      Uncaught Error: Interface 'PHPSQLParser\\builders\\Builder' not found in wp-content/plugins/wp-db-table-editor/php-sql-parser/src/PHPSQLParser/builders/BracketStatementBuilder.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Screenshot #1 (Here's a screenshot of it in action) image missing
The official readme.txt is a good inspiration

wp-db-table-editor/db-table-editor.php 92% from 13 tests

The main PHP file in "WP-DB-Table-Editor" ver. 1.8.4 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wp-db-table-editor.php" instead of "db-table-editor.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin97,072 lines of code in 313 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript6115,21911,94270,243
PHP1762,0828,4479,545
CSS142451789,112
HTML531,06127,537
Markdown31150354
PO File23030125
JSON20079
diff163272
Bourne Again Shell1005

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 160)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity10.21
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity160.00
Code structure
Namespaces7
Interfaces1
Traits0
Classes172
▷ Abstract classes10.58%
▷ Concrete classes17199.42%
▷ Final classes10.58%
Methods626
▷ Static methods20.32%
▷ Public methods24238.66%
▷ Protected methods37960.54%
▷ Private methods50.80%
Functions30
▷ Named functions30100.00%
▷ Anonymous functions00.00%
Constants85
▷ Global constants00.00%
▷ Class constants85100.00%
▷ Public constants85100.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
41 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/calendar.png0.78KB0.83KB0.00%
assets/images/accept.png0.76KB0.81KB0.00%
assets/SlickGrid/images/arrow_right_spearmint.png0.13KB0.17KB0.00%
assets/SlickGrid/images/arrow_redo.png0.56KB0.67KB0.00%
assets/SlickGrid/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%