79% formality

Code Review | Formality

WordPress plugin Formality scored 79% from 54 tests.

About plugin

  • Plugin page: formality
  • Plugin version: 1.4.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.8
  • WordPress version: 5.8.1
  • First release: Aug 28, 2020
  • Latest release: Sep 27, 2021
  • Number of updates: 29
  • Update frequency: every 13.6 days
  • Top authors: michelegiorgi (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

100+ active / 2,791 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.68MB] [CPU: ▼147.16ms] 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.49 ▲0.7738.65 ▲18.73
Dashboard /wp-admin3.71 ▲0.6648.94 ▲9.21
Posts /wp-admin/edit.php3.76 ▲0.6647.94 ▼23.60
Add New Post /wp-admin/post-new.php6.22 ▲0.7893.66 ▼575.27
Media Library /wp-admin/upload.php3.65 ▲0.6537.72 ▲1.04
Forms /wp-admin/edit.php?post_type=formality_form3.7451.32
Results /wp-admin/edit.php?post_type=formality_result3.7135.64

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 68 new files
Database: no new tables, 1 new option
New WordPress options
formality_welcome

Browser metrics Passed 4 tests

Formality: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,731 ▲13615.97 ▲0.329.64 ▲0.9746.41 ▼9.27
Dashboard /wp-admin3,015 ▲785.92 ▼0.02133.51 ▼25.99104.68 ▼17.29
Posts /wp-admin/edit.php2,787 ▲482.75 ▲0.0469.99 ▼10.57100.30 ▲0.80
Add New Post /wp-admin/post-new.php1,727 ▲4419.00 ▲0.34366.16 ▼26.20112.00 ▲0.38
Media Library /wp-admin/upload.php1,862 ▲555.07 ▲0.09118.80 ▼32.58116.98 ▼7.49
Forms /wp-admin/edit.php?post_type=formality_form1,7522.7972.24123.43
Results /wp-admin/edit.php?post_type=formality_result1,5112.6767.7790.87

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 1 option in the database
    • formality_welcome

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: design form, form, conversational, gutenberg, multistep...

formality/formality.php Passed 13 tests

"Formality" version 1.4.1'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,416 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
PHP233178212,307
XML17678959
PO File1338393820
JSON400318
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 complexity31.06
▷ Minimum class complexity1.00
▷ Maximum class complexity125.00
Average method complexity4.50
▷ 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-rating.png5.22KB5.22KB0.00%
dist/images/admin/block-preview-text.png3.75KB3.75KB0.03%
dist/images/admin/block-preview-multiple.png11.86KB11.86KB0.01%
dist/images/admin/block-preview-message.png9.94KB9.94KB0.00%
dist/images/admin/block-preview-select.png8.83KB8.83KB0.00%