84% image-choices-for-gravity-forms

Code Review | Image Choices For Gravity Forms

WordPress plugin Image Choices For Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: image-choices-for...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 9, 2022
  • Latest release: Jun 9, 2022
  • Number of updates: 7
  • Update frequency: N/A
  • Top authors: kaisarahmmed (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /2,957 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Server-side resources used by Image Choices For Gravity Forms
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.64 ▲2.02
Dashboard /wp-admin3.31 ▲0.0143.66 ▼1.96
Posts /wp-admin/edit.php3.36 ▲0.0142.04 ▼1.06
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.07 ▼7.07
Media Library /wp-admin/upload.php3.24 ▲0.0135.06 ▲2.55

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Image Choices For Gravity Forms
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.14 ▼0.511.73 ▲0.0143.09 ▲1.22
Dashboard /wp-admin2,192 ▲185.51 ▼0.0780.95 ▼4.0235.42 ▼7.43
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0635.04 ▼0.5431.47 ▼8.01
Add New Post /wp-admin/post-new.php1,531 ▼523.23 ▲5.16663.50 ▲38.5956.19 ▼10.68
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.0592.75 ▼16.0641.40 ▼6.39

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/image-choices-for-gravity-forms/class-gfImgChoice.php:3

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 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
5 plugin tags: radio image, image-choices, checkbox image, gf image upload, gravityforms

image-choices-for-gravity-forms/gf-img-choices.php 85% from 13 tests

The principal PHP file in "Image Choices For Gravity Forms" v. 1.0.0 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("image-choices-for-gravity-forms.php" instead of "gf-img-choices.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin413 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP26130183
JavaScript1264133
CSS212097

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.00
▷ Minimum class complexity2.00
▷ Maximum class complexity14.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods214.29%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin