83% custom-database-tables

Code Review | Custom DataBase Tables

WordPress plugin Custom DataBase Tables scored83%from 54 tests.

About plugin

  • Plugin page: custom-database-t...
  • Plugin version: 2.1.34
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Jun 2, 2014
  • Latest release: Sep 28, 2016
  • Number of updates: 112
  • Update frequency: every 7.6 days
  • Top authors: ka2 (100%)

Code review

54 tests

User reviews

30 reviews

Install metrics

700+ active /74,150 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Custom DataBase Tables
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.32 ▲4.28
Dashboard /wp-admin3.31 ▼0.0444.81 ▼16.30
Posts /wp-admin/edit.php3.36 ▲0.0049.37 ▲5.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.44 ▼22.01
Media Library /wp-admin/upload.php3.23 ▲0.0033.86 ▼0.08

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 84 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Custom DataBase Tables
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.171.77 ▲0.1443.16 ▲4.08
Dashboard /wp-admin2,203 ▲125.83 ▲0.93104.06 ▼2.4838.14 ▼7.49
Posts /wp-admin/edit.php2,092 ▲32.00 ▲0.0039.49 ▲2.7134.46 ▼2.54
Add New Post /wp-admin/post-new.php1,514 ▼1917.56 ▼5.39725.30 ▲118.5766.28 ▲15.04
Media Library /wp-admin/upload.php1,388 ▼04.39 ▲0.2199.15 ▼8.1740.45 ▼2.49

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Trait 'CustomDataBaseTables\\Lib\\CdbtView' not found in wp-content/plugins/custom-database-tables/lib/shortcodes.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-database-tables/cdbt.php:46
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-database-tables/templates/components/cdbt_table.php:42
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-database-tables/templates/components/cdbt_forms.php:57
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-database-tables/templates/admin/cdbt_management_console.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-database-tables/templates/admin/cdbt_options.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CustomDataBaseTables\\Lib\\CdbtUtility' not found in wp-content/plugins/custom-database-tables/lib/core.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/custom-database-tables/templates/components/cdbt_modal.php:25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-database-tables/templates/admin/cdbt_tables.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-database-tables/templates/admin/cdbt_web_apis.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can look at the official readme.txt

custom-database-tables/cdbt.php 85% from 13 tests

"Custom DataBase Tables" version 2.1.34's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 346 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-database-tables.php" instead of "cdbt.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected16,473 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP331,9893,17212,925
PO File18029962,515
SVG810997
JavaScript9113532
CSS40324

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 203)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity134.41
▷ Minimum class complexity28.00
▷ Maximum class complexity436.00
Average method complexity11.81
▷ Minimum method complexity1.00
▷ Maximum method complexity203.00
Code structure
Namespaces1
Interfaces0
Traits9
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes225.00%
Methods212
▷ Static methods146.60%
▷ Public methods18285.85%
▷ Protected methods178.02%
▷ Private methods136.13%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants14
▷ Global constants321.43%
▷ Class constants1178.57%
▷ Public constants11100.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
11 PNG files occupy 0.41MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cdbt-noimage_reversal.png1.56KB1.40KB▼ 10.33%
assets/images/cdbt_v2_image_3.png44.66KB19.15KB▼ 57.12%
assets/images/database-table.png0.29KB0.29KB0.00%
assets/images/cdbt_v2_image_1.png54.90KB24.15KB▼ 56.01%
assets/images/cdbt_v2_image_5.png44.65KB19.36KB▼ 56.64%