61% webalchlab-ddt-brt

Code Review | WebAlchLab DDT BRT

WordPress plugin WebAlchLab DDT BRT scored61%from 54 tests.

About plugin

  • Plugin page: webalchlab-ddt-brt
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.4.2
  • WordPress version: 6.3.1
  • First release: Jun 12, 2020
  • Latest release: Jun 15, 2020
  • Number of updates: 9
  • Update frequency: every 1.2 days
  • Top authors: webalchlab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /680 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

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

Analyzing server-side resources used by WebAlchLab DDT BRT
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.51 ▼1.88
Dashboard /wp-admin3.32 ▲0.0248.93 ▼1.95
Posts /wp-admin/edit.php3.37 ▲0.0250.28 ▼1.81
Add New Post /wp-admin/post-new.php5.90 ▲0.0297.00 ▼5.37
Media Library /wp-admin/upload.php3.25 ▲0.0237.41 ▼0.83
Mittenti /wp-admin/admin.php?page=waDdtBrt_brt-ddt-mittenti3.2236.08
Genera DDT /wp-admin/admin.php?page=waDdtBrt_brt-ddt3.1939.20
Impostazioni /wp-admin/admin.php?page=waDdtBrt_brt-ddt-impostazioni3.2234.22
DDT Brt /wp-admin/admin.php?page=waDdtBrt_brt-ddt-generale3.2235.13
View DDT /wp-admin/admin.php?page=waDdtBrt_view-ddt3.2232.36
DDT Libero /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero3.1937.37

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 36 new files
Database: 2 new tables, 11 new options
New tables
wp_ddt_brt_mittenti
wp_ddt_brt
New WordPress options
brt-dtt-checkformat
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
recovery_mode_email_last_sent
brt-dtt-cod-mitt
brt-dtt-next_number
widget_recent-posts
can_compress_scripts
...

Browser metrics Passed 4 tests

WebAlchLab DDT BRT: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲5514.37 ▲0.401.76 ▼0.1146.70 ▲2.80
Dashboard /wp-admin2,225 ▲455.60 ▼0.0887.78 ▼4.7141.23 ▼3.64
Posts /wp-admin/edit.php2,127 ▲242.05 ▼0.0039.18 ▼1.4338.47 ▼0.65
Add New Post /wp-admin/post-new.php1,553 ▲2723.12 ▲5.65657.42 ▼42.3655.52 ▼1.48
Media Library /wp-admin/upload.php1,424 ▲214.24 ▲0.0198.38 ▼9.5542.82 ▼6.06
Mittenti /wp-admin/admin.php?page=waDdtBrt_brt-ddt-mittenti9331.9626.5030.88
Genera DDT /wp-admin/admin.php?page=waDdtBrt_brt-ddt7141.4411.0224.63
Impostazioni /wp-admin/admin.php?page=waDdtBrt_brt-ddt-impostazioni9181.9330.0048.77
DDT Brt /wp-admin/admin.php?page=waDdtBrt_brt-ddt-generale9181.8627.3138.49
View DDT /wp-admin/admin.php?page=waDdtBrt_view-ddt8191.9326.6822.93
DDT Libero /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero1,4312.0930.8738.26

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall successfully, leaving 2 tables in the database
    • wp_ddt_brt
    • wp_ddt_brt_mittenti
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_recent-comments
    • db_upgraded
    • brt-dtt-checkformat
    • recovery_mode_email_last_sent
    • brt-dtt-next_number
    • brt-dtt-mitt_default
    • widget_theysaidso_widget
    • brt-dtt-cod-mitt
    • theysaidso_admin_options
    • can_compress_scripts
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt
    • > Error in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+213
    Uncaught Error: Call to undefined function wc_get_order() in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php:213
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): waDdtBrt_generate_ddt_function()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+455
    Undefined variable: mitt_nome
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+456
    Undefined variable: mitt_ind_1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+457
    Undefined variable: mitt_ind_2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+458
    Undefined variable: mitt_cap
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+459
    Undefined variable: mitt_loc
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+460
    Undefined variable: mitt_prov
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+461
    Undefined variable: mitt_ref
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+462
    Undefined variable: mitt_ref_tel
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+464
    Undefined variable: dest_nome
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+465
    Undefined variable: dest_ind
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+466
    Undefined variable: dest_ind2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+467
    Undefined variable: dest_cap
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+468
    Undefined variable: dest_loc
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+469
    Undefined variable: dest_prov
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+470
    Undefined variable: dest_ref
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+471
    Undefined variable: dest_ref_tel
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+472
    Undefined variable: dest_ref_email
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+486
    Undefined variable: contrassegno
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+490
    Undefined variable: note_cli
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+439
    Undefined variable: order_data
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+439
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt&order_id=libero
    • > Notice in wp-content/plugins/webalchlab-ddt-brt/asset/generate-ddt.php+487
    Undefined variable: incasso

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 items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 12
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 13
    • > PHP Warning
      Use of undefined constant waDdtBrt_PLUGIN_PATH - assumed 'waDdtBrt_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 6
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 13
    • > PHP Warning
      Use of undefined constant waDdtBrt_PLUGIN_URL - assumed 'waDdtBrt_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 9
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/webalchlab-ddt-brt/asset/define.php on line 12

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)
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).datepicker is not a function" "TypeError: $(...).datepicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/webalchlab-ddt-brt/js/ddt-brt.js:17:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=waDdtBrt_brt-ddt
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).datepicker is not a function

Optimizations

Plugin configuration 83% 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
Attributes that need to be fixed: The official readme.txt is a good inspiration

webalchlab-ddt-brt/ddt-brt.php 69% from 13 tests

The principal PHP file in "WebAlchLab DDT BRT" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Description: The description should be shorter than 140 characters (currently 174 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.8" instead of "3.0.0")
  • Main file name: The principal plugin file should be the same as the plugin slug ("webalchlab-ddt-brt.php" instead of "ddt-brt.php")

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected6,085 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP215103494,126
CSS2192501,840
JavaScript1131119

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity295.00
▷ Minimum class complexity155.00
▷ Maximum class complexity435.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods121
▷ Static methods00.00%
▷ Public methods8066.12%
▷ Protected methods4133.88%
▷ Private methods00.00%
Functions15
▷ Named functions1493.33%
▷ Anonymous functions16.67%
Constants21
▷ Global constants21100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.60MB with 0.32MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/default.png618.72KB287.26KB▼ 53.57%