77% contact-form-plugin

Code Review | Contact Form by BestWebSoft - Advanced Contact Us Form Builder for WordPress

WordPress plugin Contact Form by BestWebSoft - Advanced Contact Us Form Builder for WordPress scored77%from 54 tests.

About plugin

  • Plugin page: contact-form-plugin
  • Plugin version: 4.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.3.1
  • WordPress version: 6.3.1
  • First release: May 26, 2011
  • Latest release: Sep 13, 2023
  • Number of updates: 194
  • Update frequency: every 23.2 days
  • Top authors: bestwebsoft (100%)

Code review

54 tests

User reviews

289 reviews

Install metrics

60,000+ active /5,020,499 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲1.12MB] [CPU: ▲4.90ms] Passed 4 tests

Server-side resources used by Contact Form by BestWebSoft - Advanced Contact Us Form Builder for WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.57 ▲1.1151.46 ▲4.68
Dashboard /wp-admin4.47 ▲1.1661.37 ▲3.97
Posts /wp-admin/edit.php4.52 ▲1.1658.92 ▲9.02
Add New Post /wp-admin/post-new.php7.00 ▲1.1295.43 ▲1.93
Media Library /wp-admin/upload.php4.33 ▲1.1046.84 ▲12.26

Server storage [IO: ▲9.00MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 179 new files
Database: 1 new table, 8 new options
New tables
wp_cntctfrm_field
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
bstwbsftwppdtplgns_options
widget_recent-comments
cntctfrm_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form by BestWebSoft - Advanced Contact Us Form Builder for WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.84 ▲0.462.24 ▲0.2342.55 ▼0.94
Dashboard /wp-admin2,245 ▲544.91 ▼0.02110.30 ▲8.4843.07 ▲0.11
Posts /wp-admin/edit.php2,211 ▲1192.23 ▲0.2235.83 ▼3.1033.49 ▼3.48
Add New Post /wp-admin/post-new.php1,634 ▲9823.13 ▼0.21701.47 ▲110.5656.92 ▲3.24
Media Library /wp-admin/upload.php1,427 ▲364.21 ▲0.0398.22 ▲0.2142.64 ▼1.77
Settings /wp-admin/contact_form.php260.440.1014.36
BWS Panel /wp-admin/contact_form.php?page=cntctfrm-bws-panel260.440.076.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-plugin/bws_menu/class-bws-settings.php:1453
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/contact-form-plugin/contact_form.php:2428
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/contact-form-plugin/bws_menu/product_list.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Bws_Settings_Tabs' not found in wp-content/plugins/contact-form-plugin/includes/class-cntctfrm-settings.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/contact_form.php
    • > Network (severe)
    wp-admin/contact_form.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/contact_form.php?page=cntctfrm-bws-panel
    • > Network (severe)
    wp-admin/contact_form.php?page=cntctfrm-bws-panel - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Contact Form displaying.), #2 (Contact Form displaying with additional fields.), #3 (Contact Form displaying with 2 columns.), #4 (Contact Form settings page.), #5 (Contact Form additional settings page.), #6 (Contact Form appearance settings page.), #7 (Widget settings for using shortcode in the sidebar.), #8 (Add or remove additional fields easily and label any contact form fields you want.), #9 (Choose additional information about sender you would like to see.), #10 (Enable the file attachement option to get important files from senders via contact form.), #11 (Make any of the standard form fields required or not.), #12 (Translate your contact form to any language with a simple language customizer.), #13 (Receive a copy of the email sent via the contact form.), #14 (Divide your contact form fields into columns and change 'Submit' button position.), #15 (Re-order contact form fields using drag & drop interface.), #16 (Enable the file multiattachment option to get important files from senders via contact form.)
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

contact-form-plugin/contact_form.php 92% from 13 tests

"Contact Form by BestWebSoft - Advanced Contact Us Form Builder for WordPress" version 4.2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("contact-form-plugin.php" instead of "contact_form.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected38,558 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
PO File3011,13422,56523,613
PHP96886538,208
CSS101552615,809
JavaScript748113761
SVG400167

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 113)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity182.00
▷ Minimum class complexity21.00
▷ Maximum class complexity315.00
Average method complexity21.11
▷ Minimum method complexity1.00
▷ Maximum method complexity113.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods27
▷ Static methods00.00%
▷ Public methods2177.78%
▷ Protected methods00.00%
▷ Private methods622.22%
Functions80
▷ Named functions80100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
83 PNG files occupy 5.64MB with 2.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-6.png116.62KB45.64KB▼ 60.86%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-icons_2e83ff_256x240.png4.49KB4.20KB▼ 6.46%
bws_menu/css/jquery-ui-styles/1.10.4/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.32KB0.21KB▼ 34.34%
bws_menu/css/jquery-ui-styles/1.11.4/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%