68% torro-forms

Code Review | Torro Forms

WordPress plugin Torro Forms scored 68% from 54 tests.

About plugin

  • Plugin page: torro-forms
  • Plugin version: 1.0.16
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.8.1
  • WordPress version: 5.9.2
  • First release: May 17, 2016
  • Latest release: Oct 25, 2021
  • Number of updates: 73
  • Update frequency: every 29.3 days
  • Top authors: mahype (54.79%)flixos90 (38.36%)awesome-ug (9.59%)

Code review

54 tests

User reviews

17 reviews

Install metrics

1,000+ active / 29,437 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲1.60MB] [CPU: ▼289.00ms] Passed 4 tests

This is a short check of server-side resources used by Torro Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.94 ▲1.4369.15 ▲10.08
Dashboard /wp-admin5.04 ▲1.6448.23 ▲5.75
Posts /wp-admin/edit.php5.27 ▲1.6350.10 ▲8.78
Add New Post /wp-admin/post-new.php9.16 ▲2.19114.84 ▼1,180.45
Media Library /wp-admin/upload.php5.00 ▲1.7133.69 ▲9.92
Categories /wp-admin/edit-tags.php?taxonomy=attachment_category&post_type=attachment5.0645.42
Submissions /wp-admin/edit.php?post_type=torro_form&page=torro_list_submissions5.1939.91
Settings /wp-admin/edit.php?post_type=torro_form&page=torro_form_settings5.0435.42
Add New /wp-admin/admin.php?page=torro_edit_submission5.0233.82
Add New /wp-admin/post-new.php?post_type=torro_form6.1271.71
Categories /wp-admin/edit-tags.php?taxonomy=torro_form_category&post_type=torro_form4.9941.42
All Forms /wp-admin/edit.php?post_type=torro_form5.0535.05

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 1,695 new files
Database: 7 new tables, 4 new options
New tables
wp_torro_elements
wp_torro_submissions
wp_torro_submission_values
wp_torro_containers
wp_torro_submissionmeta
wp_torro_element_choices
wp_torro_element_settings
New WordPress options
torro_rewrite_rules
torro_general_settings
attachment_category_children
torro_db_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for Torro Forms
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,959 ▲23716.04 ▲0.405.79 ▲0.182.55 ▲0.41
Dashboard /wp-admin3,084 ▲2306.16 ▼0.04116.87 ▼15.32166.20 ▲4.50
Posts /wp-admin/edit.php2,878 ▲1873.28 ▲0.0561.35 ▼3.32140.64 ▼1.01
Add New Post /wp-admin/post-new.php1,823 ▲16219.37 ▲3.04394.76 ▼11.78154.51 ▼8.65
Media Library /wp-admin/upload.php1,890 ▲1895.57 ▲0.08141.16 ▲5.91184.59 ▲0.74
Categories /wp-admin/edit-tags.php?taxonomy=attachment_category&post_type=attachment1,9392.7958.48133.40
Submissions /wp-admin/edit.php?post_type=torro_form&page=torro_list_submissions1,5332.7254.91108.72
Settings /wp-admin/edit.php?post_type=torro_form&page=torro_form_settings1,6733.4369.26190.12
Add New /wp-admin/admin.php?page=torro_edit_submission1,6823.1867.04142.08
Add New /wp-admin/post-new.php?post_type=torro_form8,0119.97209.92174.30
Categories /wp-admin/edit-tags.php?taxonomy=torro_form_category&post_type=torro_form1,8172.7960.95122.41
All Forms /wp-admin/edit.php?post_type=torro_form1,5923.2160.46111.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 7 tables in the database
    • wp_torro_submission_values
    • wp_torro_element_choices
    • wp_torro_element_settings
    • wp_torro_submissions
    • wp_torro_submissionmeta
    • wp_torro_containers
    • wp_torro_elements
  • Zombie WordPress options were found after uninstall: 2 options
    • attachment_category_children
    • torro_general_settings

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 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
  • 11× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/data/sample-plugin/templates/base-suffixed.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/examples/ex09-autofilter.php
    • > /wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/data/templates/require-this-once.php
    • > /wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/data/sample-plugin/templates/data.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/examples/ex05-numbers-250k-rows.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/examples/ex10-freeze-rows-columns.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/examples/ex06-strings-250k-rows.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/example.php
    • > /wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/data/templates/base.php
    • > /wp-content/plugins/torro-forms/vendor/mk-j/php_xlsxwriter/examples/ex02-formats.php
  • 452× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\DB_Objects\\Queries\\Core_Query' not found in wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/src/db-objects/queries/site-query.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/torro-forms/vendor/composer/installers/src/Composer/Installers/MiaoxingInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/torro-forms/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\Translations\\Translations' not found in wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/src/translations/translations-error-handler.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\DB_Objects\\Collection' not found in wp-content/plugins/torro-forms/src/db-objects/element-settings/element-setting-collection.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\Fields\\Textarea' not found in wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/src/fields/wysiwyg.php:20
    • > PHP Fatal error
      Trait 'Leaves_And_Love\\Plugin_Lib\\Traits\\Container_Service_Trait' not found in wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/data/test-container-service-trait-class.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\Tests\\Unit_Test_Case' not found in wp-content/plugins/torro-forms/vendor/felixarntz/plugin-lib/tests/phpunit/tests/traits/container-service-trait.php:17
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/torro-forms/vendor/api-api/core/vendor/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/torro-forms/vendor/api-api/core/tests/bootstrap.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'Leaves_And_Love\\Plugin_Lib\\Translations\\Translations_Manager' not found in wp-content/plugins/torro-forms/src/translations/translations-element-setting-manager.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: polls, votes, forms, form builder, api...

torro-forms/torro-forms.php 92% from 13 tests

Analyzing the main PHP file in "Torro Forms" version 1.0.16
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 141 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin177,495 lines of code in 1,611 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript79619,10317,023112,819
PHP56011,24429,20139,219
JSON352012,101
HTML100596616,408
Markdown3281702,233
CSS353521942,229
Sass40409131,877
SVG211241
YAML6346146
CoffeeScript180106
Bourne Shell23143
Python15042
XML11031

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.90
▷ Minimum class complexity1.00
▷ Maximum class complexity202.00
Average method complexity2.72
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces56
Interfaces19
Traits29
Classes465
▷ Abstract classes5411.61%
▷ Concrete classes41188.39%
▷ Final classes51.22%
Methods2,767
▷ Static methods1806.51%
▷ Public methods1,76963.93%
▷ Protected methods93933.94%
▷ Private methods592.13%
Functions73
▷ Named functions1216.44%
▷ Anonymous functions6183.56%
Constants24
▷ Global constants416.67%
▷ Class constants2083.33%
▷ Public constants20100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 PNG files occupy 0.49MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/felixarntz/plugin-lib/node_modules/wp-media-picker/screenshot.png272.84KB79.33KB▼ 70.92%
vendor/felixarntz/plugin-lib/node_modules/jquery-datetimepicker/screen/3.1.png4.31KB2.63KB▼ 38.92%
vendor/felixarntz/plugin-lib/node_modules/jquery-datetimepicker/screen/3.png2.44KB1.51KB▼ 38.12%
node_modules/c3/htdocs/jasmine/lib/jasmine-2.0.2/jasmine_favicon.png1.45KB1.48KB0.00%
vendor/felixarntz/plugin-lib/node_modules/jquery-datetimepicker/screen/4.png12.29KB5.50KB▼ 55.26%