62% ws-form

Code Review | WS Form LITE - Drag & Drop Contact Form Builder for WordPress

WordPress plugin WS Form LITE - Drag & Drop Contact Form Builder for WordPress scored62%from 54 tests.

About plugin

  • Plugin page: ws-form
  • Plugin version: 1.9.172
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Sep 21, 2018
  • Latest release: Nov 3, 2023
  • Number of updates: 419
  • Update frequency: every 4.5 days
  • Top authors: westguard (100%)

Code review

54 tests

User reviews

187 reviews

Install metrics

5,000+ active /120,688 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲6.30MB] [CPU: ▲39.79ms] 50% from 4 tests

This is a short check of server-side resources used by WS Form LITE - Drag & Drop Contact Form Builder for WordPress
Please have a look at the following items
  • RAM: Total memory usage should be kept under 10MB (currently 14.19MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&wsf_panel_open=ws_form)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.30MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&wsf_panel_open=ws_form)
PageMemory (MB)CPU Time (ms)
Home /9.47 ▲6.0085.08 ▲47.34
Dashboard /wp-admin9.74 ▲6.4084.04 ▲24.81
Posts /wp-admin/edit.php9.80 ▲6.4389.70 ▲41.73
Add New Post /wp-admin/post-new.php13.61 ▲7.72326.24 ▲228.32
Media Library /wp-admin/upload.php9.60 ▲6.3679.38 ▲45.28
Add New /wp-admin/admin.php?page=ws-form-add9.5364.68
Settings /wp-admin/admin.php?page=ws-form-settings9.8272.74
Upgrade to PRO /wp-admin/admin.php?page=ws-form-upgrade9.5869.19
Forms /wp-admin/admin.php?page=ws-form9.5366.12
Welcome to WS Form /wp-admin/options.php?page=ws-form-welcome9.6866.69
WS Form /wp-admin/options.php?page=ws-form-edit9.5865.30
Submissions /wp-admin/admin.php?page=ws-form-submit9.5465.23
Add-Ons /wp-admin/admin.php?page=ws-form-add-ons9.5868.33
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&wsf_panel_open=ws_form14.19205.70

Server storage [IO: ▲16.22MB] [DB: ▲0.27MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 374 new files
Database: 11 new tables, 7 new options
New tables
wp_wsf_section
wp_wsf_field
wp_wsf_form_meta
wp_wsf_submit
wp_wsf_form
wp_wsf_field_meta
wp_wsf_group
wp_wsf_group_meta
wp_wsf_submit_meta
wp_wsf_section_meta
...
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
widget_ws_form_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WS Form LITE - Drag & Drop Contact Form Builder for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲17514.76 ▲0.491.68 ▼0.1942.03 ▲1.95
Dashboard /wp-admin2,309 ▲1345.78 ▲0.0584.96 ▼23.3742.17 ▲2.39
Posts /wp-admin/edit.php2,190 ▲902.02 ▲0.0242.69 ▲3.0134.39 ▲2.55
Add New Post /wp-admin/post-new.php1,679 ▲14323.64 ▲5.28648.20 ▲9.3536.60 ▼23.79
Media Library /wp-admin/upload.php1,488 ▲884.22 ▲0.0497.49 ▼4.2942.03 ▼2.65
Add New /wp-admin/admin.php?page=ws-form-add1,6326.5968.8348.28
Settings /wp-admin/admin.php?page=ws-form-settings1,5023.3139.9328.97
Upgrade to PRO /wp-admin/admin.php?page=ws-form-upgrade8691.9525.8822.62
Forms /wp-admin/admin.php?page=ws-form1,6415.8865.0129.88
Welcome to WS Form /wp-admin/options.php?page=ws-form-welcome1,6415.8061.1332.95
WS Form /wp-admin/options.php?page=ws-form-edit1,6416.4459.1631.55
Submissions /wp-admin/admin.php?page=ws-form-submit1,6346.5956.2329.39
Add-Ons /wp-admin/admin.php?page=ws-form-add-ons3,1441.7632.16134.40
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php&wsf_panel_open=ws_form10,26924.64701.00144.78

Uninstaller [IO: ▲0.22MB] [DB: ▲0.27MB] 50% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie tables detected upon uninstall: 11 tables
    • wp_wsf_form
    • wp_wsf_submit
    • wp_wsf_group_meta
    • wp_wsf_form_stat
    • wp_wsf_field
    • wp_wsf_submit_meta
    • wp_wsf_section_meta
    • wp_wsf_field_meta
    • wp_wsf_section
    • wp_wsf_group
    • ...
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_ws_form_widget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ws-form/includes/third-party/beaver-builder/modules/ws-form/includes/frontend.php
  • 78× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_Data_Source' not found in wp-content/plugins/ws-form/includes/data-sources/class-ws-form-data-source-user.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_Data_Source' not found in wp-content/plugins/ws-form/includes/data-sources/class-ws-form-data-source-pods.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_Data_Source' not found in wp-content/plugins/ws-form/includes/data-sources/class-ws-form-data-source-preset.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_CSS' not found in wp-content/plugins/ws-form/includes/core/css/class-ws-form-css-layout.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/ws-form/public/preview-fallback.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_API' not found in wp-content/plugins/ws-form/api/class-ws-form-api-submit.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ws-form/includes/third-party/beaver-builder/classes/class-fl-ws-form-loader.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_API' not found in wp-content/plugins/ws-form/api/class-ws-form-api-field.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_Data_Source' not found in wp-content/plugins/ws-form/includes/data-sources/class-ws-form-data-source-woocommerce.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WS_Form_Config' not found in wp-content/plugins/ws-form/includes/frameworks/class-ws-form-framework-ws-form.php:5

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/customize.php?return=%2Fwp-admin%2Fwp-api.php&wsf_panel_open=ws_form
    • > Security (warning) in unknown
    /?customize_changeset_uuid=1ee9213f-fbfc-4705-9446-efe5ccf00e50&customize_theme=twentytwentyone&customize_messenger_channel=preview-0 - An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can escape its sandboxing.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

ws-form/ws-form.php Passed 13 tests

The main PHP script in "WS Form LITE - Drag & Drop Contact Form Builder for WordPress" version 1.9.172 is automatically included on every request by WordPress
28 characters long description:
Build Better WordPress Forms

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin163,616 lines of code in 337 files:
LanguageFilesBlank linesComment linesLines of code
PO File1032,28359,46082,518
PHP11519,5559,93140,864
JavaScript3911,2275,60826,519
CSS321,7425512,442
JSON13415901,167
JSX1351871
HTML117022
Twig1009
SVG4004

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 221)
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity77.87
▷ Minimum class complexity1.00
▷ Maximum class complexity951.00
Average method complexity6.81
▷ Minimum method complexity1.00
▷ Maximum method complexity221.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes90
▷ Abstract classes22.22%
▷ Concrete classes8897.78%
▷ Final classes11.14%
Methods1,101
▷ Static methods36132.79%
▷ Public methods1,08898.82%
▷ Protected methods20.18%
▷ Private methods111.00%
Functions220
▷ Named functions4118.64%
▷ Anonymous functions17981.36%
Constants102
▷ Global constants7876.47%
▷ Class constants2423.53%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.33MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/jquery/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
public/images/external/jquery.minicolors.png67.02KB34.31KB▼ 48.80%
public/images/external/flags@2x.png170.28KB68.04KB▼ 60.04%
admin/jquery/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
public/images/external/flags.png69.20KB23.42KB▼ 66.16%