77% categories-for-gravity-forms

Code Review | Categories For Gravity Forms

WordPress plugin Categories For Gravity Forms scored77%from 54 tests.

About plugin

  • Plugin page: categories-for-gr...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Dec 23, 2022
  • Latest release: Dec 23, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: biztechc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /220 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.65ms] Passed 4 tests

A check of server-side resources used by Categories For Gravity Forms
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.54 ▲0.97
Dashboard /wp-admin3.33 ▼0.0248.62 ▼12.97
Posts /wp-admin/edit.php3.38 ▲0.0251.02 ▲4.62
Add New Post /wp-admin/post-new.php5.91 ▲0.0283.39 ▼16.94
Media Library /wp-admin/upload.php3.25 ▲0.0238.56 ▲2.33

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Categories For Gravity Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8814.27 ▼0.021.95 ▲0.4144.34 ▲4.88
Dashboard /wp-admin2,218 ▲375.62 ▼0.0986.66 ▼10.8945.46 ▲1.41
Posts /wp-admin/edit.php2,121 ▲212.13 ▲0.1133.91 ▼3.3333.02 ▼4.19
Add New Post /wp-admin/post-new.php1,544 ▲1823.09 ▼0.10669.17 ▲9.7159.85 ▲12.57
Media Library /wp-admin/upload.php1,420 ▲174.27 ▲0.05100.69 ▲2.5044.93 ▲1.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/categories-for-gravity-forms/index.php
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/categories-for-gravity-forms/includes/class-gf-categories-addon.php:3

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)
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png)
Please take inspiration from this readme.txt

categories-for-gravity-forms/gravityforms-categories.php 77% from 13 tests

"Categories For Gravity Forms" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("categories-for-gravity-forms.php" instead of "gravityforms-categories.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Domain Path: The domain path is invalid: folder "/languages" does not exist

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
Success! There were no dangerous files found in this plugin560 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3150181560

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity36.00
▷ Minimum class complexity10.00
▷ Maximum class complexity62.00
Average method complexity3.80
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods14.00%
▷ Public methods25100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.32MB with 0.23MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png102.67KB28.33KB▼ 72.40%
screenshot-1.png96.59KB25.89KB▼ 73.20%
screenshot-3.png128.04KB35.86KB▼ 72.00%