84% gravity-forms-image-in-html

Code Review | Gravity Forms Image in HTML

WordPress plugin Gravity Forms Image in HTML scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-ima...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Oct 18, 2013
  • Latest release: Jan 11, 2014
  • Number of updates: 10
  • Update frequency: every 8.6 days
  • Top authors: ethanpil (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,761 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
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼11.09ms] Passed 4 tests

This is a short check of server-side resources used by Gravity Forms Image in HTML
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.02 ▼3.80
Dashboard /wp-admin3.31 ▼0.0341.74 ▼20.97
Posts /wp-admin/edit.php3.36 ▲0.0148.81 ▲1.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0181.82 ▼15.38
Media Library /wp-admin/upload.php3.23 ▲0.0132.53 ▼4.22

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

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

Browser metrics Passed 4 tests

Gravity Forms Image in HTML: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲4314.34 ▼0.051.86 ▼0.2142.59 ▼1.45
Dashboard /wp-admin2,195 ▲145.52 ▼0.1483.19 ▼14.3840.17 ▼1.02
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0339.76 ▲3.9837.41 ▲1.45
Add New Post /wp-admin/post-new.php1,526 ▼023.01 ▼0.54690.75 ▲22.0269.93 ▲14.11
Media Library /wp-admin/upload.php1,403 ▲34.23 ▲0.0493.89 ▼21.2441.69 ▼7.74

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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 | 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-image-in-html/gravity-forms-image-in-html.php:14

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 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
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The HTML field with the new Insert Image button.) image required
The official readme.txt might help

gravity-forms-image-in-html/gravity-forms-image-in-html.php Passed 13 tests

The main file in "Gravity Forms Image in HTML" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
118 characters long description:
Adds a button to Gravity Forms form editor HTML input field to insert or upload an image via Wordpress media uploader.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected46 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1191946

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
sreeenshot-1.png24.89KB15.74KB▼ 36.77%