78% form-blocks

Code Review | Form Blocks

WordPress plugin Form Blocks scored 78% from 54 tests.

About plugin

  • Plugin page: form-blocks
  • Plugin version: 0.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9.1
  • WordPress version: 6.3.1
  • First release: Dec 31, 2017
  • Latest release: Dec 31, 2017
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: kbjohnson90 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 906 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.40ms] Passed 4 tests

Server-side resources used by Form Blocks
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0249.17 ▲2.16
Dashboard /wp-admin3.33 ▲0.0244.27 ▼1.64
Posts /wp-admin/edit.php3.38 ▲0.0240.31 ▼4.49
Add New Post /wp-admin/post-new.php5.91 ▲0.0291.91 ▼0.31
Media Library /wp-admin/upload.php3.25 ▲0.0233.92 ▼11.14

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Form Blocks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲10114.47 ▲0.072.16 ▲0.2756.83 ▲10.23
Dashboard /wp-admin2,206 ▲184.92 ▲0.03115.48 ▼1.4945.95 ▼3.03
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0241.48 ▲1.5640.29 ▲2.22
Add New Post /wp-admin/post-new.php1,529 ▲13317.48 ▼0.45623.01 ▼85.3559.15 ▼3.38
Media Library /wp-admin/upload.php1,388 ▼04.19 ▲0.0495.31 ▼38.1841.19 ▼19.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, 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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/form-blocks/resources/views/contact-form.html.php
  • 19× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 9
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 37
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 18
    • > PHP Notice
      Undefined variable: email_label in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 36
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 47
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 27
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 21
    • > PHP Notice
      Undefined variable: name_label in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 26
    • > PHP Notice
      Undefined variable: form_blocks_success in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/form-blocks/resources/views/contact-form.html.php on line 13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (The default contact form.) image required
You can take inspiration from this readme.txt

form-blocks/form-blocks.php Passed 13 tests

Analyzing the main PHP file in "Form Blocks" version 0.1.0
54 characters long description:
Adds a new contact form block to the Gutenberg editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected559 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript44351273
PHP33125185
CSS24350
JSON10027
Markdown26024

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected