79% formality

Code Review | Formality

WordPress plugin Formality scored79%from 54 tests.

About plugin

  • Plugin page: formality
  • Plugin version: 1.5.7
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2020
  • Latest release: Feb 28, 2023
  • Number of updates: 38
  • Update frequency: every 24.1 days
  • Top authors: michelegiorgi (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active /6,680 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.11MB] [CPU: ▼3.10ms] Passed 4 tests

Server-side resources used by Formality
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.15 ▼1.15
Dashboard /wp-admin3.41 ▲0.1147.09 ▲2.69
Posts /wp-admin/edit.php3.46 ▲0.1148.08 ▼5.81
Add New Post /wp-admin/post-new.php6.20 ▲0.3285.27 ▼8.12
Media Library /wp-admin/upload.php3.33 ▲0.1140.44 ▲7.11
Results /wp-admin/edit.php?post_type=formality_result3.4148.41
Forms /wp-admin/edit.php?post_type=formality_form3.3935.84

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 63 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
formality_welcome
can_compress_scripts

Browser metrics Passed 4 tests

Formality: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.60 ▼0.021.72 ▼0.0943.39 ▲1.13
Dashboard /wp-admin2,229 ▲545.58 ▼0.0692.65 ▼6.7938.30 ▼8.13
Posts /wp-admin/edit.php2,140 ▲401.98 ▼0.0038.10 ▼1.2033.86 ▼2.47
Add New Post /wp-admin/post-new.php6,401 ▲4,87028.00 ▲4.89880.68 ▲214.4338.29 ▼28.94
Media Library /wp-admin/upload.php1,441 ▲384.16 ▼0.0492.90 ▼5.5746.55 ▲2.39
Results /wp-admin/edit.php?post_type=formality_result1,1531.9131.8133.40
Forms /wp-admin/edit.php?post_type=formality_form1,3111.9533.5553.43

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • formality_welcome
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/formality/includes/tools/download.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function language_attributes() in wp-content/plugins/formality/public/templates/formality-form.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/formality/public/templates/formality-notification.php:30

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: block editor, conversational, form, gutenberg, multistep...

formality/formality.php Passed 13 tests

"Formality" version 1.5.7's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
111 characters long description:
Forms made simple (and cute). Designless, multistep, conversational, secure, all-in-one WordPress forms plugin.

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 detected4,448 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP233188192,311
XML17678959
PO File1329381800
JSON400366
SVG1007
JavaScript3003
CSS2022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity30.81
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity62.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods133
▷ Static methods21.50%
▷ Public methods12593.98%
▷ Protected methods00.00%
▷ Private methods86.02%
Functions15
▷ Named functions320.00%
▷ Anonymous functions1280.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
13 compressed PNG files occupy 0.15MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
dist/images/admin/block-preview-text.png3.75KB3.75KB0.03%
dist/images/admin/block-preview-textarea.png4.08KB4.08KB0.00%
dist/images/admin/block-preview-select.png8.83KB8.83KB0.00%
dist/images/admin/block-preview-multiple.png11.86KB11.86KB0.01%
dist/images/admin/block-preview-widget.png26.76KB26.76KB0.00%