62% hsforms

Code Review | Hsforms

WordPress plugin Hsforms scored62%from 54 tests.

About plugin

  • Plugin page: hsforms
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.6
  • WordPress version: 6.3.1
  • First release: Apr 13, 2021
  • Latest release: Apr 13, 2021
  • Number of updates: 6
  • Update frequency: every 0.5 days
  • Top authors: opennewmedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /402 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.86MB] [CPU: ▼39.18ms] Passed 4 tests

Analyzing server-side resources used by Hsforms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.11 ▼0.3514.33 ▼30.69
Dashboard /wp-admin3.16 ▼0.1519.05 ▼30.33
Posts /wp-admin/edit.php3.16 ▼0.2020.47 ▼23.74
Add New Post /wp-admin/post-new.php3.16 ▼2.7321.19 ▼71.95
Media Library /wp-admin/upload.php3.16 ▼0.0821.08 ▼9.03
Segments /wp-admin/edit.php?post_type=segment3.1619.50
General Settings /wp-admin/admin.php?page=hsforms-options3.1619.40
Hotelsuite API /wp-admin/admin.php?page=hsforms-api3.1618.06
RateCodes /wp-admin/edit.php?post_type=ratecode3.1618.82
TravelPeriods /wp-admin/edit.php?post_type=travelperiod3.1619.51

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Hsforms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,028 ▲28214.77 ▲0.4027.01 ▲24.8037.79 ▼6.66
Dashboard /wp-admin2,241 ▲535.85 ▼0.06108.47 ▼7.5638.67 ▼9.97
Posts /wp-admin/edit.php2,124 ▲352.02 ▲0.0240.28 ▲4.8136.36 ▼0.18
Add New Post /wp-admin/post-new.php6,482 ▲4,96821.83 ▲4.24961.65 ▲307.0141.64 ▼5.22
Media Library /wp-admin/upload.php1,423 ▲354.21 ▲0.01100.59 ▲1.3645.18 ▲2.03
Segments /wp-admin/edit.php?post_type=segment1,0932.0038.8730.43
General Settings /wp-admin/admin.php?page=hsforms-options1,0452.0625.3530.61
Hotelsuite API /wp-admin/admin.php?page=hsforms-api8382.0328.5027.77
RateCodes /wp-admin/edit.php?post_type=ratecode1,0961.9433.0930.89
TravelPeriods /wp-admin/edit.php?post_type=travelperiod1,1412.0033.4129.82

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
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/hsforms/src/init.php+184
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 96 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=travelperiod
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/hsforms/src/init.php+238
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 19× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_multiplepaths.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_format.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_mvc.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_math.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_cachestatic.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_single.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_variables.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_customresolving.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_escapingmodifier.php
    • > /wp-content/plugins/hsforms/vendor/typo3fluid/fluid/examples/example_cachewarmup.php
  • 202× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/hsforms/src/RateCode/rc.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/src/ViewHelpers/CycleViewHelper.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Core\\ViewHelper\\AbstractViewHelper' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/src/ViewHelpers/CaseViewHelper.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Tests\\Functional\\Fixtures\\ViewHelpers\\AbstractEscapingViewHelper' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/tests/Functional/Fixtures/ViewHelpers/EscapeChildrenEnabledAndEscapeOutputDisabledViewHelper.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'TYPO3Fluid\\Fluid\\Core\\Parser\\ParsedTemplateInterface' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/src/Core/Parser/ParsingState.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Tests\\Unit\\ViewHelpers\\ViewHelperBaseTestcase' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/tests/Unit/ViewHelpers/IfViewHelperTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'TYPO3Fluid\\Fluid\\Core\\Cache\\FluidCacheInterface' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/src/Core/Cache/SimpleFileCache.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Tests\\UnitTestCase' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/tests/Unit/Core/Cache/FluidCacheWarmupResultTest.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'TYPO3Fluid\\Fluid\\Core\\Parser\\TemplateProcessorInterface' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/src/Core/Parser/TemplateProcessor/EscapingModifierTemplateProcessor.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'TYPO3Fluid\\Fluid\\Tests\\UnitTestCase' not found in wp-content/plugins/hsforms/vendor/typo3fluid/fluid/tests/Unit/Core/ViewHelper/Traits/ParserRuntimeOnlyTest.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

hsforms/plugin.php 77% from 13 tests

The entry point to "Hsforms" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hsforms.php" instead of "plugin.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 505 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected51,386 lines of code in 490 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1393,4002,44322,786
PHP2763,20310,81318,154
JSON10007,864
Markdown92240705
HTML4312835637
PO File2205215442
CSS62519412
Sass3372336
XML11027
YAML19023

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.87
▷ Minimum class complexity1.00
▷ Maximum class complexity72.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces54
Interfaces15
Traits6
Classes217
▷ Abstract classes167.37%
▷ Concrete classes20192.63%
▷ Final classes00.00%
Methods1,401
▷ Static methods634.50%
▷ Public methods1,24288.65%
▷ Protected methods15010.71%
▷ Private methods90.64%
Functions90
▷ Named functions2932.22%
▷ Anonymous functions6167.78%
Constants48
▷ Global constants12.08%
▷ Class constants4797.92%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin