78% aforms-eats

Code Review | AForms Eats

WordPress plugin AForms Eats scored78%from 54 tests.

About plugin

  • Plugin page: aforms-eats
  • Plugin version: 1.3.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Apr 22, 2020
  • Latest release: Feb 28, 2023
  • Number of updates: 31
  • Update frequency: every 33.6 days
  • Top authors: vividcolorsjp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /5,933 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by AForms Eats
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4342.86 ▲7.01
Dashboard /wp-admin3.79 ▲0.4847.69 ▲0.20
Posts /wp-admin/edit.php3.83 ▲0.4755.69 ▲4.73
Add New Post /wp-admin/post-new.php6.39 ▲0.5097.00 ▼2.74
Media Library /wp-admin/upload.php3.70 ▲0.4736.71 ▲3.44
Orders /wp-admin/admin.php?page=wqe-order4.0843.59
Form Settings /wp-admin/admin.php?page=wqe-settings3.8738.52
Forms /wp-admin/admin.php?page=wqe-form3.8535.05

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 344 new files
Database: 2 new tables, 6 new options
New tables
wp_wqeorders
wp_wqeforms
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

AForms Eats: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.23 ▼1.021.72 ▼0.0143.72 ▲0.47
Dashboard /wp-admin2,230 ▲485.83 ▼0.03105.51 ▲0.1441.76 ▲0.60
Posts /wp-admin/edit.php2,116 ▲272.05 ▲0.0239.58 ▼1.7834.88 ▼3.48
Add New Post /wp-admin/post-new.php1,555 ▲2223.03 ▼0.22673.15 ▲36.7657.75 ▲0.87
Media Library /wp-admin/upload.php1,415 ▲244.21 ▼0.0393.45 ▼8.1042.43 ▼0.95
Orders /wp-admin/admin.php?page=wqe-order8892.1925.9326.87
Form Settings /wp-admin/admin.php?page=wqe-settings9042.9965.7429.18
Forms /wp-admin/admin.php?page=wqe-form8891.7537.5328.09

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 8× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/aforms-eats/vendor/aura/payload/phpunit.php
    • > /wp-content/plugins/aforms-eats/vendor/leonelquinteros/php-toml/travis-test/debug.php
    • > /wp-content/plugins/aforms-eats/src/template/front/form.php
    • > /wp-content/plugins/aforms-eats/src/template/admin/form.php
    • > /wp-content/plugins/aforms-eats/vendor/tyam/bamboo/tests/templates/0content.php
    • > /wp-content/plugins/aforms-eats/vendor/aura/di/phpunit.php
    • > /wp-content/plugins/aforms-eats/vendor/tyam/bamboo/tests/templates/subdir/0nested.php
    • > /wp-content/plugins/aforms-eats/vendor/aura/payload-interface/phpunit.php
  • 126× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: status in wp-content/plugins/aforms-eats/src/template/admin/form.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/aforms-eats/src/template/admin/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\BaseConstraint' not found in wp-content/plugins/aforms-eats/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php:20
    • > PHP Fatal error
      Uncaught Error: Call to a member function content() on null in wp-content/plugins/aforms-eats/vendor/tyam/bamboo/tests/templates/subdir/1sidebar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function AFormsEats\\plugins_url() in wp-content/plugins/aforms-eats/src/Config.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/aforms-eats/vendor/scssphp/scssphp/src/Formatter/Compact.php:21
    • > PHP Fatal error
      Trait 'AFormsEats\\Domain\\Lib' not found in wp-content/plugins/aforms-eats/src/Domain/InputProcessor.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Aura\\Di\\Exception' not found in wp-content/plugins/aforms-eats/vendor/aura/di/src/Exception/ServiceNotObject.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Aura\\Di\\Injection\\LazyInterface' not found in wp-content/plugins/aforms-eats/vendor/aura/di/src/Injection/LazyArray.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/aforms-eats/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: restaurant menu, food delivery, price calculator, order form, restaurant ordering...

aforms-eats/aforms-eats.php 92% from 13 tests

The principal PHP file in "AForms Eats" v. 1.3.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 257 characters long)

Code Analysis 95% 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
There were no executable files found in this plugin30,335 lines of code in 297 files:
LanguageFilesBlank linesComment linesLines of code
PHP2204,5477,25719,186
JavaScript131942184,076
Sass263112,181
Markdown3388002,156
PO File26516601,334
JSON173101,174
TOML110064119
XML52076
YAML10020
Dockerfile16811
CSS2022

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,214)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 195)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity17.90
▷ Minimum class complexity1.00
▷ Maximum class complexity1,214.00
Average method complexity4.05
▷ Minimum method complexity1.00
▷ Maximum method complexity195.00
Code structure
Namespaces34
Interfaces20
Traits4
Classes169
▷ Abstract classes52.96%
▷ Concrete classes16497.04%
▷ Final classes00.00%
Methods1,092
▷ Static methods797.23%
▷ Public methods65860.26%
▷ Protected methods39836.45%
▷ Private methods363.30%
Functions39
▷ Named functions820.51%
▷ Anonymous functions3179.49%
Constants132
▷ Global constants107.58%
▷ Class constants12292.42%
▷ Public constants122100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
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/priority.png15.87KB8.86KB▼ 44.20%
vendor/container-interop/container-interop/docs/images/side_by_side_containers.png15.88KB8.43KB▼ 46.90%
vendor/container-interop/container-interop/docs/images/interoperating_containers.png25.13KB12.83KB▼ 48.97%
asset/noimage.png1.62KB1.40KB▼ 13.22%