66% salesbox-forms

Code Review | Salesbox forms

WordPress plugin Salesbox forms scored66%from 54 tests.

About plugin

  • Plugin page: salesbox-forms
  • Plugin version: 1.1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.6
  • WordPress version: 6.3.1
  • First release: Mar 6, 2021
  • Latest release: Apr 5, 2021
  • Number of updates: 15
  • Update frequency: every 2.1 days
  • Top authors: tienanhnguyen0108 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /498 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲1.59MB] [CPU: ▲5.92ms] Passed 4 tests

Analyzing server-side resources used by Salesbox forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.96 ▲1.4950.58 ▲7.16
Dashboard /wp-admin4.91 ▲1.6162.89 ▲10.11
Posts /wp-admin/edit.php5.02 ▲1.6761.20 ▲10.97
Add New Post /wp-admin/post-new.php7.52 ▲1.6496.71 ▼4.56
Media Library /wp-admin/upload.php4.83 ▲1.6153.12 ▲16.69
Add New /wp-admin/admin.php?page=sbf-new4.9444.20
Contact Forms /wp-admin/admin.php?page=sbf4.8747.00
Connect to Salesbox /wp-admin/admin.php?page=sbf-integration4.8144.86

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 94 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
sbf
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Salesbox forms
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲8313.75 ▼0.656.49 ▲4.3339.37 ▼8.21
Dashboard /wp-admin2,236 ▲484.85 ▼1.01104.66 ▲4.9740.49 ▼2.12
Posts /wp-admin/edit.php2,113 ▲212.03 ▲0.0635.75 ▼2.2434.36 ▼1.70
Add New Post /wp-admin/post-new.php6,204 ▲4,67119.17 ▼3.85897.06 ▲194.2950.32 ▼4.81
Media Library /wp-admin/upload.php1,412 ▲244.20 ▲0.00105.18 ▼2.5450.94 ▲5.26
Add New /wp-admin/admin.php?page=sbf-new3,2512.5153.3936.74
Contact Forms /wp-admin/admin.php?page=sbf1,2141.9730.1932.59
Connect to Salesbox /wp-admin/admin.php?page=sbf-integration8842.3528.9429.12

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=sbf-new
    • > Notice in wp-content/plugins/salesbox-forms/admin/includes/editor.php+298
    Undefined offset: 0
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=sbf-new
    • > Notice in wp-content/plugins/salesbox-forms/admin/includes/editor.php+391
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/salesbox-forms/admin/edit-contact-form.php
    • > /wp-content/plugins/salesbox-forms/admin/includes/editor.php
  • 37× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salesbox-forms/modules/salesbox-crm.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salesbox-forms/includes/submission.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salesbox-forms/includes/rest-api.php:3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/salesbox-forms/admin/includes/class-contact-forms-list-table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/salesbox-forms/salesbox-crm-form.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salesbox-forms/modules/hidden.php:3
    • > PHP Warning
      Use of undefined constant SBF_PLUGIN_DIR - assumed 'SBF_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salesbox-forms/load.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/salesbox-forms/modules/select.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'SBF_PLUGIN_DIR/admin/includes/admin-functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/salesbox-forms/admin/admin.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/salesbox-forms/modules/disallowed-list.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=sbf
    • > Intervention (severe) in unknown
    /wp-admin/admin.php?page=sbf-new - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: salesbox, feedback, email, contact, form...

salesbox-forms/salesbox-crm-form.php 85% from 13 tests

The main PHP file in "Salesbox forms" ver. 1.1.3 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("salesbox-forms.php" instead of "salesbox-crm-form.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 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
There were no executable files found in this plugin13,588 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP522,82437510,012
CSS81731182,180
JavaScript173451101,395
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity28.76
▷ Minimum class complexity1.00
▷ Maximum class complexity105.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes14.00%
▷ Concrete classes2496.00%
▷ Final classes00.00%
Methods300
▷ Static methods3010.00%
▷ Public methods24080.00%
▷ Protected methods206.67%
▷ Private methods4013.33%
Functions250
▷ Named functions23393.20%
▷ Anonymous functions176.80%
Constants35
▷ Global constants1851.43%
▷ Class constants1748.57%
▷ Public constants17100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/js/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png6.94KB4.18KB▼ 39.78%
includes/js/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png6.86KB4.18KB▼ 39.05%
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.26KB0.09KB▼ 66.79%
includes/js/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png4.57KB4.18KB▼ 8.43%
includes/js/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png0.38KB0.12KB▼ 67.68%