77% aforms-form-builder-for-price-calculator-cost-estimation

Code Review | AForms -- Form Builder for Price Calculator & Cost Estimation

WordPress plugin AForms -- Form Builder for Price Calculator & Cost Estimation scored77%from 54 tests.

About plugin

  • Plugin page: aforms-form-build...
  • Plugin version: 2.2.6
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Aug 27, 2019
  • Latest release: Sep 21, 2023
  • Number of updates: 103
  • Update frequency: every 14.5 days
  • Top authors: vividcolorsjp (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

3,000+ active /32,366 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.46MB] [CPU: ▼1.29ms] Passed 4 tests

A check of server-side resources used by AForms -- Form Builder for Price Calculator & Cost Estimation
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6348.23 ▲1.34
Dashboard /wp-admin3.74 ▲0.4355.49 ▼0.25
Posts /wp-admin/edit.php3.79 ▲0.4358.80 ▲3.89
Add New Post /wp-admin/post-new.php6.42 ▲0.5394.20 ▼8.59
Media Library /wp-admin/upload.php3.66 ▲0.4341.27 ▲2.34
Form Settings /wp-admin/admin.php?page=wq-settings3.8942.10
Forms /wp-admin/admin.php?page=wq-form3.8538.57
Orders /wp-admin/admin.php?page=wq-order3.8641.41

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 331 new files
Database: 2 new tables, 6 new options
New tables
wp_wqorders
wp_wqforms
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for AForms -- Form Builder for Price Calculator & Cost Estimation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲3014.31 ▼0.441.69 ▼0.3739.87 ▼4.79
Dashboard /wp-admin2,219 ▲425.57 ▼0.1389.87 ▼10.3940.53 ▼7.61
Posts /wp-admin/edit.php2,124 ▲242.01 ▼0.0135.08 ▲0.2131.38 ▼6.80
Add New Post /wp-admin/post-new.php6,268 ▲4,74226.04 ▲8.51890.24 ▲233.4656.93 ▼5.73
Media Library /wp-admin/upload.php1,424 ▲244.22 ▲0.0196.60 ▼10.1643.86 ▼3.71
Form Settings /wp-admin/admin.php?page=wq-settings9773.0271.9731.95
Forms /wp-admin/admin.php?page=wq-form8981.9337.3124.50
Orders /wp-admin/admin.php?page=wq-order7811.8625.6725.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 7× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/payload/phpunit.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/tyam/bamboo/tests/templates/subdir/0nested.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/tyam/bamboo/tests/templates/0content.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/di/phpunit.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/payload-interface/phpunit.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/src/template/front/form.php
    • > /wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/leonelquinteros/php-toml/travis-test/debug.php
  • 128× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerExceptionInterface' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/psr/container/src/NotFoundExceptionInterface.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/di/tests/ResolutionHelperTest.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/src/template/admin/form.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/di/tests/Injection/LazyIncludeTest.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Aura\\Di\\Exception' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/aura/di/src/Exception/ContainerLocked.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/container-interop/container-interop/src/Interop/Container/ContainerInterface.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'JsonSchema\\Constraints\\TypeCheck\\TypeCheckInterface' not found in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeCheck/LooseTypeCheck.php:5
    • > PHP Warning
      require(wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/justinrainbow/json-schema/demo/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/justinrainbow/json-schema/demo/demo.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function wrap() on null in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/vendor/tyam/bamboo/tests/templates/1usersidebar.php:1
    • > PHP Notice
      Undefined variable: status in wp-content/plugins/aforms-form-builder-for-price-calculator-cost-estimation/src/template/admin/form.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 86% 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
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

aforms-form-builder-for-price-calculator-cost-estimation/aforms.php 77% from 13 tests

The principal PHP file in "AForms -- Form Builder for Price Calculator & Cost Estimation" v. 2.2.6 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 206 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("aforms-form-builder-for-price-calculator-cost-estimation.php" instead of "aforms.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin26,722 lines of code in 282 files:
LanguageFilesBlank linesComment linesLines of code
PHP2032,0404,08111,261
JavaScript162581616,130
Sass281403,164
PO File41,3181,3382,768
Markdown3185902,111
JSON163101,060
TOML110064119
XML52076
YAML10020
Dockerfile16811
CSS2022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.62
▷ Minimum class complexity1.00
▷ Maximum class complexity200.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces27
Interfaces21
Traits4
Classes150
▷ Abstract classes32.00%
▷ Concrete classes14798.00%
▷ Final classes00.00%
Methods752
▷ Static methods699.18%
▷ Public methods61481.65%
▷ Protected methods11315.03%
▷ Private methods253.32%
Functions24
▷ Named functions625.00%
▷ Anonymous functions1875.00%
Constants68
▷ Global constants1014.71%
▷ Class constants5885.29%
▷ Public constants58100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.06MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
src/asset/noimage.png2.88KB1.40KB▼ 51.32%
vendor/container-interop/container-interop/docs/images/interoperating_containers.png25.13KB12.83KB▼ 48.97%
asset/noimage.png1.62KB1.40KB▼ 13.22%
vendor/container-interop/container-interop/docs/images/priority.png15.87KB8.86KB▼ 44.20%
vendor/container-interop/container-interop/docs/images/side_by_side_containers.png15.88KB8.43KB▼ 46.90%