61% ez-form-calculator

Code Review | EZ Form Calculator

WordPress plugin EZ Form Calculator scored61%from 54 tests.

About plugin

  • Plugin page: ez-form-calculator
  • Plugin version: 2.14.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2014
  • Latest release: Sep 25, 2020
  • Number of updates: 33
  • Update frequency: every 68.1 days
  • Top authors: keksdieb (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active /41,490 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼1.12ms] 75% from 4 tests

A check of server-side resources used by EZ Form Calculator
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 583.15ms on /wp-admin/admin.php?page=ezfc-help)
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2839.03 ▲0.11
Dashboard /wp-admin3.57 ▲0.2746.39 ▼1.09
Posts /wp-admin/edit.php3.69 ▲0.3349.82 ▲1.02
Add New Post /wp-admin/post-new.php6.16 ▲0.2790.18 ▼4.53
Media Library /wp-admin/upload.php3.50 ▲0.2737.40 ▲4.22
Form settings /wp-admin/admin.php?page=ezfc-settings-form4.1353.62
Global settings /wp-admin/admin.php?page=ezfc-options4.3373.05
ez Form Calculator /wp-admin/admin.php?page=ezfc4.1256.52
Preview /wp-admin/admin.php?page=ezfc-preview3.5036.02
Form submissions /wp-admin/admin.php?page=ezfc-submissions3.6244.99
Help / debug /wp-admin/admin.php?page=ezfc-help3.78583.15
Import / Export /wp-admin/admin.php?page=ezfc-importexport3.6441.47
Stats /wp-admin/admin.php?page=ezfc-stats3.6244.71
Premium version /wp-admin/admin.php?page=ezfc-premium3.6042.75

Server storage [IO: ▲7.13MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 217 new files
Database: 10 new tables, 14 new options
New tables
wp_ezfc_submissions
wp_ezfc_preview
wp_ezfc_files
wp_ezfc_forms_options
wp_ezfc_forms_views
wp_ezfc_debug
wp_ezfc_forms
wp_ezfc_templates
wp_ezfc_forms_elements
wp_ezfc_options
New WordPress options
db_upgraded
ezfc_update_2_13_0_0
ezfc_page_views
widget_ezfc_widget
ezfc_version
widget_recent-comments
ezfc_form_additional_data
ezfc_ext_pdf_seed
widget_theysaidso_widget
theysaidso_admin_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for EZ Form Calculator
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲9713.32 ▼1.261.58 ▼0.4839.46 ▼4.15
Dashboard /wp-admin2,260 ▲725.86 ▲0.96105.78 ▼5.5878.65 ▲35.29
Posts /wp-admin/edit.php2,148 ▲771.97 ▼0.0940.19 ▲1.3638.39 ▲4.34
Add New Post /wp-admin/post-new.php1,560 ▲4117.91 ▼5.32737.40 ▲63.8254.52 ▼10.22
Media Library /wp-admin/upload.php1,442 ▲514.25 ▲0.0496.04 ▼2.9677.79 ▲31.91
Form settings /wp-admin/admin.php?page=ezfc-settings-form9,2628.74372.68205.83
Global settings /wp-admin/admin.php?page=ezfc-options8,36010.00272.69124.45
ez Form Calculator /wp-admin/admin.php?page=ezfc14,52610.41396.6488.15
Preview /wp-admin/admin.php?page=ezfc-preview7081.148.3218.22
Form submissions /wp-admin/admin.php?page=ezfc-submissions1,5245.6062.7088.96
Help / debug /wp-admin/admin.php?page=ezfc-help1,95012.23125.72129.29
Import / Export /wp-admin/admin.php?page=ezfc-importexport1,6125.8271.68101.21
Stats /wp-admin/admin.php?page=ezfc-stats1,6087.19102.2131.21
Premium version /wp-admin/admin.php?page=ezfc-premium2,00814.34316.44139.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 1 table
    • wp_ezfc_forms_views
  • This plugin does not fully uninstall, leaving 12 options in the database
    • ezfc_ext_pdf_dirname
    • ezfc_page_views
    • widget_recent-posts
    • can_compress_scripts
    • ezfc_update_2_13_0_0
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_ezfc_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
Good news, no errors were detected

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ez-form-calculator/ajax.php
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/element_options.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Settings_Element_Option' not found in wp-content/plugins/ez-form-calculator/inc/php/settings/element-options/price_format.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/textfield.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/ez-form-calculator/shortcode.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Settings_Element_Option_minDate' not found in wp-content/plugins/ez-form-calculator/inc/php/settings/element-options/maxDate.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/element_decor.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element_Options' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/checkbox.php:3
    • > PHP Warning
      require_once(EZFC_PATHclass.ezfc_settings.php): failed to open stream: No such file or directory in wp-content/plugins/ez-form-calculator/class.ezfc_functions.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element_Options' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/radio.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Ezfc_Element' not found in wp-content/plugins/ez-form-calculator/inc/php/elements/input.php:3

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/admin.php?page=ezfc-stats
    • > Javascript (severe) in unknown
    /wp-content/plugins/ez-form-calculator/inc/js/stats.js?ver=2.14.0.3 76:38 Uncaught TypeError: Cannot read properties of undefined (reading 'DataTable')

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: No descriptions were found for these screenshots #13, #14 in ez-form-calculator/assets to your readme.txt
The official readme.txt might help

ez-form-calculator/ezfc.php 77% from 13 tests

Analyzing the main PHP file in "EZ Form Calculator" version 2.14.0.3
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("ez-form-calculator.php" instead of "ezfc.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 291 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin45,029 lines of code in 137 files:
LanguageFilesBlank linesComment linesLines of code
PO File46,3217,21118,996
PHP873,7412,36617,364
JavaScript221,2309714,581
SVG1002,671
LESS1630777
CSS192918467
Markdown131086
SQL111086
JSON1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 147)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity61.24
▷ Minimum class complexity1.00
▷ Maximum class complexity769.00
Average method complexity6.03
▷ Minimum method complexity1.00
▷ Maximum method complexity147.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes38
▷ Abstract classes615.79%
▷ Concrete classes3284.21%
▷ Final classes00.00%
Methods455
▷ Static methods13128.79%
▷ Public methods45399.56%
▷ Protected methods00.00%
▷ Private methods20.44%
Functions16
▷ Named functions1381.25%
▷ Anonymous functions318.75%
Constants13
▷ Global constants1184.62%
▷ Class constants215.38%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
23 PNG files occupy 0.22MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/vis-js/img/network/connectIcon.png20.28KB1.37KB▼ 93.27%
assets/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
lib/vis-js/img/network/cross.png17.87KB0.31KB▼ 98.26%
assets/img/ez-icon.png3.21KB0.57KB▼ 82.18%
assets/img/icon-description.png0.37KB0.39KB0.00%