78% v-bargain

Code Review | DBargain

WordPress plugin DBargain scored78%from 54 tests.

About plugin

  • Plugin page: v-bargain
  • Plugin version: 4.0.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.0-6.4
  • WordPress version: 6.3.1
  • First release: Aug 20, 2021
  • Latest release: Nov 23, 2023
  • Number of updates: 55
  • Update frequency: every 15.2 days
  • Top authors: iitcanada (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,177 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼1.96ms] 75% from 4 tests

Server-side resources used by DBargain
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 525.31ms on /wp-admin/admin.php?page=dbargain_settings)
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1941.33 ▼0.69
Dashboard /wp-admin3.50 ▲0.1946.34 ▼4.91
Posts /wp-admin/edit.php3.62 ▲0.2549.18 ▲0.94
Add New Post /wp-admin/post-new.php6.10 ▲0.2192.65 ▼3.16
Media Library /wp-admin/upload.php3.42 ▲0.1937.22 ▲3.55
User Guide /wp-admin/admin.php?page=user_guide3.3932.25
Session Chat History /wp-admin/admin.php?page=chat3.4033.52
Settings /wp-admin/admin.php?page=dbargain_settings3.39525.31
All Offers /wp-admin/admin.php?page=dbargain3.39465.22

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts
recovery_mode_email_last_sent
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for DBargain
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲18313.56 ▼1.218.83 ▲7.1139.19 ▼5.88
Dashboard /wp-admin2,254 ▲735.99 ▲0.3198.53 ▼7.8842.05 ▼3.00
Posts /wp-admin/edit.php2,161 ▲582.34 ▲0.3743.78 ▲3.7335.19 ▼4.36
Add New Post /wp-admin/post-new.php1,572 ▲4323.66 ▲0.67622.18 ▼41.4333.02 ▼23.03
Media Library /wp-admin/upload.php1,453 ▲504.51 ▲0.30100.24 ▲0.4340.69 ▼3.60
User Guide /wp-admin/admin.php?page=user_guide8662.0831.0926.58
Session Chat History /wp-admin/admin.php?page=chat7191.516.7319.74
Settings /wp-admin/admin.php?page=dbargain_settings8632.0926.9024.66
All Offers /wp-admin/admin.php?page=dbargain8632.1026.5124.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% 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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dbargain
    • > Warning in wp-content/plugins/v-bargain/templates/expire.php+4
    session_start(): Cannot start session when headers already sent
    • > GET request to /wp-admin/admin.php?page=chat
    • > Notice in wp-content/plugins/v-bargain/templates/chat.php+15
    Undefined variable: sid
    • > GET request to /wp-admin/admin.php?page=chat
    • > Notice in wp-content/plugins/v-bargain/templates/chat.php+15
    Undefined variable: pid
    • > GET request to /wp-admin/admin.php?page=chat
    • > Error in wp-content/plugins/v-bargain/templates/chat.php+25
    Uncaught Error: Call to undefined function wc_get_product() in wp-content/plugins/v-bargain/templates/chat.php:25
    Stack trace:
    #0 wp-content/plugins/v-bargain/include/class-dbargain.php(667): require_once()
    #1 wp-includes/class-wp-hook.php(310): DBargain::chat()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/v-bargain/include/class-dbargain.php:168

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: bargaining plugin wordpress, tool to boost sales, bargaining tool, d-bargain, bargain...

v-bargain/v-bargain.php 85% from 13 tests

The main PHP script in "DBargain" version 4.0.9 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.4" instead of "4.2.0")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,940 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP93602211,789
JavaScript2329151

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity55.00
▷ Minimum class complexity4.00
▷ Maximum class complexity106.00
Average method complexity4.27
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods2575.76%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
include/assets/cart_img.png16.25KB10.10KB▼ 37.87%