84% gravity-forms-related-fields

Code Review | Gravity Forms Related Fields Add-On

WordPress plugin Gravity Forms Related Fields Add-On scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-rel...
  • Plugin version: 1.0.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Jul 16, 2015
  • Latest release: Dec 5, 2018
  • Number of updates: 59
  • Update frequency: every 21.1 days
  • Top authors: mikemanger (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /4,353 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼4.51ms] Passed 4 tests

An overview of server-side resources used by Gravity Forms Related Fields Add-On
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0441.80 ▼4.75
Dashboard /wp-admin3.39 ▲0.0449.08 ▼11.56
Posts /wp-admin/edit.php3.50 ▲0.1453.19 ▲2.91
Add New Post /wp-admin/post-new.php5.97 ▲0.0896.53 ▲2.05
Media Library /wp-admin/upload.php3.31 ▲0.0835.96 ▼3.77

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Gravity Forms Related Fields Add-On
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲9413.29 ▼1.091.82 ▲0.0239.52 ▼2.53
Dashboard /wp-admin2,221 ▲154.89 ▼1.14109.01 ▲6.5342.58 ▼3.42
Posts /wp-admin/edit.php2,100 ▼02.06 ▼0.1239.87 ▲2.6935.76 ▼0.67
Add New Post /wp-admin/post-new.php1,545 ▼023.18 ▼0.30678.36 ▲45.4169.44 ▲21.60
Media Library /wp-admin/upload.php1,400 ▼34.18 ▼0.0399.89 ▼5.5846.06 ▲1.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/gravity-forms-related-fields/related-fields.php:71
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/gravity-forms-related-fields/class-related-fields-table.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Adding a new related field connection. This will map the entries in the form "B2B Buyer Personas" to be Checkbox options.), #2 (You can have multiple related field connections for each form and disable them when they are not needed.)
The official readme.txt is a good inspiration

gravity-forms-related-fields/related-fields.php 92% from 13 tests

The main PHP script in "Gravity Forms Related Fields Add-On" version 1.0.6 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("gravity-forms-related-fields.php" instead of "related-fields.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,338 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
JSON200851
PHP3139157474
JavaScript112713

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.50
▷ Minimum class complexity17.00
▷ Maximum class complexity22.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods15.26%
▷ Public methods19100.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

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png14.99KB9.30KB▼ 37.97%
screenshot-2.png17.80KB11.34KB▼ 36.28%