78% wise-forms

Code Review | Wise Forms

WordPress plugin Wise Forms scored78%from 54 tests.

About plugin

  • Plugin page: wise-forms
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.8
  • WordPress version: 6.3.1
  • First release: Jul 3, 2017
  • Latest release: Jul 18, 2017
  • Number of updates: 7
  • Update frequency: every 2.3 days
  • Top authors: marcin.lawrowski (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /772 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.26MB] [CPU: ▼4.42ms] Passed 4 tests

Analyzing server-side resources used by Wise Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2940.09 ▼1.47
Dashboard /wp-admin3.62 ▲0.2757.29 ▼22.93
Posts /wp-admin/edit.php3.67 ▲0.3153.89 ▲2.59
Add New Post /wp-admin/post-new.php6.13 ▲0.25113.10 ▲12.54
Media Library /wp-admin/upload.php3.45 ▲0.2340.69 ▲4.12
Forms /wp-admin/admin.php?page=wise-forms-forms3.5442.89
Results /wp-admin/admin.php?page=wise-forms-results3.4842.83

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 89 new files
Database: 2 new tables, 7 new options
New tables
wp_wise_forms_results
wp_wise_forms
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_wiseformswidget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Wise Forms
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,061 ▲29015.13 ▲0.385.37 ▲3.0237.77 ▼7.07
Dashboard /wp-admin2,382 ▲1916.46 ▲1.41139.64 ▲18.8644.35 ▲1.78
Posts /wp-admin/edit.php2,291 ▲2023.34 ▲1.3056.79 ▲20.3634.70 ▲0.85
Add New Post /wp-admin/post-new.php1,548 ▲3417.65 ▲0.05625.43 ▼76.1539.39 ▼20.11
Media Library /wp-admin/upload.php1,421 ▲334.16 ▼0.1085.24 ▼29.9144.48 ▼5.35
Forms /wp-admin/admin.php?page=wise-forms-forms1,0543.0842.3926.29
Results /wp-admin/admin.php?page=wise-forms-results1,0873.0642.2626.34

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_wiseformswidget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/RadioButtons.php
    • > /wp-content/plugins/wise-forms/src/views/admin/Results.php
    • > /wp-content/plugins/wise-forms/src/views/admin/FormAddEdit-FieldsTab.php
    • > /wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/Container2Cols.php
    • > /wp-content/plugins/wise-forms/src/views/admin/parts/FieldsTemplates.php
    • > /wp-content/plugins/wise-forms/src/views/admin/parts/FieldPropertiesFormsTemplates.php
    • > /wp-content/plugins/wise-forms/src/views/admin/Dashboard.php
    • > /wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/ButtonSubmit.php
    • > /wp-content/plugins/wise-forms/src/shortcodes/form/templates/FieldBox.php
    • > /wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/DropDownList.php
  • 87× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/DropDownList.php on line 13
    • > PHP Notice
      Undefined variable: inputStyles in wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/TextArea.php on line 14
    • > PHP Notice
      Undefined variable: inputContainerClasses in wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/TextArea.php on line 11
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/wise-forms/src/shortcodes/form/templates/fields/TextInput.php on line 22
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wise-forms/src/shortcodes/form/templates/FieldBox.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wise-forms/src/views/admin/Forms.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WiseFormsController' not found in wp-content/plugins/wise-forms/src/controllers/admin/WiseFormsAdminDashboardController.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wise-forms/wise-forms-core.php:15
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wise-forms/src/views/admin/FormAddEdit-TargetsTab.php:19
    • > PHP Notice
      Undefined variable: urlPagePrevious in wp-content/plugins/wise-forms/src/views/admin/Results.php on line 25

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt might help

wise-forms/wise-forms-core.php 85% from 13 tests

Analyzing the main PHP file in "Wise Forms" version 1.2.0
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wise-forms.php" instead of "wise-forms-core.php")
  • Description: The description should be shorter than 140 characters (currently 187 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected4,214 lines of code in 62 files:
LanguageFilesBlank linesComment linesLines of code
PHP505971,0192,934
JavaScript6163142790
CSS310217428
SVG30062

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity10.41
▷ Minimum class complexity1.00
▷ Maximum class complexity30.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes311.11%
▷ Concrete classes2488.89%
▷ Final classes00.00%
Methods188
▷ Static methods189.57%
▷ Public methods12667.02%
▷ Protected methods3619.15%
▷ Private methods2613.83%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
16 PNG files occupy 0.30MB with 0.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-04.png63.20KB27.49KB▼ 56.51%
assets/icons/columns.png0.41KB0.21KB▼ 49.29%
assets/screenshot-05.png53.85KB23.77KB▼ 55.85%
assets/icons/shield.png0.67KB0.75KB0.00%
assets/icons/drop-down-list.png0.52KB0.38KB▼ 26.60%