73% pay-with-square-in-gravity-forms

Code Review | Gravity Forms Square Lite

WordPress plugin Gravity Forms Square Lite scored 73% from 54 tests.

About plugin

  • Plugin page: pay-with-square-i...
  • Plugin version: 1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.0
  • WordPress version: 6.3.1
  • First release: May 5, 2021
  • Latest release: May 24, 2022
  • Number of updates: 16
  • Update frequency: every 24.3 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

40+ active / 1,119 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

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

A check of server-side resources used by Gravity Forms Square Lite
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.68 ▼9.12
Dashboard /wp-admin3.32 ▲0.0247.13 ▲0.87
Posts /wp-admin/edit.php3.37 ▲0.0147.72 ▼3.32
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.34 ▼7.65
Media Library /wp-admin/upload.php3.24 ▲0.0135.39 ▲3.48

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 44 new files
Database: 1 new table, 6 new options
New tables
wp_gfsr_transactions
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Gravity Forms Square Lite
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.67 ▼1.151.74 ▼0.4337.89 ▼4.88
Dashboard /wp-admin2,213 ▲255.84 ▲0.93116.06 ▲2.7546.56 ▲2.85
Posts /wp-admin/edit.php2,098 ▲92.03 ▲0.0339.39 ▼0.7934.87 ▼3.85
Add New Post /wp-admin/post-new.php1,540 ▲723.23 ▼0.01665.97 ▲49.2964.40 ▲1.93
Media Library /wp-admin/upload.php1,395 ▲44.20 ▲0.01106.12 ▲4.6145.90 ▲2.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables detected upon uninstall: 1 table
    • wp_gfsr_transactions
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'GF_Field' not found in wp-content/plugins/pay-with-square-in-gravity-forms/includes/class-square-gf.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pay-with-square-in-gravity-forms/includes/views/entry-detail-square-payment-history.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pay-with-square-in-gravity-forms/includes/views/entry-detail-square-payment-details.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pay-with-square-in-gravity-forms/includes/views/square-gf-settings.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #10, #11, #12, #13, #14, #15, #16, #17, #2, #3, #4, #5, #6, #7, #8, #9 in pay-with-square-in-gravity-forms/assets to your readme.txt
Please take inspiration from this readme.txt

pay-with-square-in-gravity-forms/gf-square.php 85% from 13 tests

Analyzing the main PHP file in "Gravity Forms Square Lite" version 1.1
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("pay-with-square-in-gravity-forms.php" instead of "gf-square.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected3,872 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP6305871,420
SVG235231,410
CSS25373625
JavaScript35424282
PO File1297106
Markdown116029

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity74.67
▷ Minimum class complexity30.00
▷ Maximum class complexity140.00
Average method complexity5.70
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods47
▷ Static methods12.13%
▷ Public methods4697.87%
▷ Protected methods00.00%
▷ Private methods12.13%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
5 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/_visa.png6.96KB2.75KB▼ 60.47%
assets/img/_discover.png5.56KB2.60KB▼ 53.28%
assets/img/_card.png10.82KB3.65KB▼ 66.25%
assets/img/_mastercard.png8.41KB3.12KB▼ 62.92%
assets/img/_dinerclub.png6.07KB2.74KB▼ 54.81%