78% heartland-secure-submit-addon-for-gravity-forms

Code Review | Heartland Secure Submit Addon for Gravity Forms

WordPress plugin Heartland Secure Submit Addon for Gravity Forms scored78%from 54 tests.

About plugin

  • Plugin page: heartland-secure-...
  • Plugin version: 1.4.7
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 16, 2016
  • Latest release: Jul 12, 2022
  • Number of updates: 38
  • Update frequency: every 59.3 days
  • Top authors: markhagan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,456 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.00MB] [CPU: ▼7.78ms] Passed 4 tests

Server-side resources used by Heartland Secure Submit Addon for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0047.55 ▲0.19
Dashboard /wp-admin3.31 ▲0.0048.62 ▼3.81
Posts /wp-admin/edit.php3.36 ▲0.0050.64 ▼4.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.72 ▼21.44
Media Library /wp-admin/upload.php3.23 ▲0.0036.35 ▼1.35

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 248 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Heartland Secure Submit Addon for Gravity Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.31 ▼1.101.67 ▼0.1344.92 ▲4.10
Dashboard /wp-admin2,206 ▲184.86 ▼0.95107.36 ▼1.7436.78 ▼5.93
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0341.10 ▼5.3236.18 ▲0.66
Add New Post /wp-admin/post-new.php1,536 ▼023.29 ▲0.14631.91 ▼52.1550.22 ▼14.83
Media Library /wp-admin/upload.php1,385 ▼34.20 ▲0.03104.54 ▼3.6442.05 ▼5.48

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

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

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/templates/client-side-merge-tags.php
  • 140× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Services/Fluent/Gateway/Credit/HpsCreditServicePrepaidBalanceInquiryBuilder.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'HpsAuthorization' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Entities/Debit/HpsDebitReturn.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Services/Fluent/Gateway/GiftCard/HpsGiftCardServiceBalanceBuilder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HpsPayPlanResourceAbstract' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Entities/PayPlan/HpsPayPlanCustomer.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsRestGatewayService' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Services/Gateway/PayPlan/HpsPayPlanScheduleService.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsCardinalMPIResponse' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Entities/AltPayment/HpsCardinalMPIAuthresponseResponse.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsAltPaymentResponse' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Entities/AltPayment/HpsAltPaymentSessionInfo.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Services/Fluent/Gateway/GiftCard/HpsGiftCardServiceDeactivateBuilder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'HpsGiftCardActivate' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Entities/Gift/HpsGiftCardVoid.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'HpsBuilderAbstract' not found in wp-content/plugins/heartland-secure-submit-addon-for-gravity-forms/classes/includes/src/Services/Fluent/Gateway/Credit/HpsCreditServiceOfflineChargeBuilder.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: gravity, token, forms, gateway, payment...

heartland-secure-submit-addon-for-gravity-forms/gravityforms-securesubmit.php 92% from 13 tests

The primary PHP file in "Heartland Secure Submit Addon for Gravity Forms" version 1.4.7 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("heartland-secure-submit-addon-for-gravity-forms.php" instead of "gravityforms-securesubmit.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin12,052 lines of code in 204 files:
LanguageFilesBlank linesComment linesLines of code
PHP1971,8015,71010,726
JavaScript28164548
Markdown41230490
CSS1272288

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity8.28
▷ Minimum class complexity1.00
▷ Maximum class complexity226.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces5
Traits0
Classes187
▷ Abstract classes2111.23%
▷ Concrete classes16688.77%
▷ Final classes00.00%
Methods629
▷ Static methods7511.92%
▷ Public methods44069.95%
▷ Protected methods10416.53%
▷ Private methods8513.51%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants179
▷ Global constants42.23%
▷ Class constants17597.77%
▷ Public constants175100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
39 PNG files occupy 1.11MB with 0.68MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/img/down.png2.68KB1.57KB▼ 41.53%
assets/images/ss-saved-visa@2x.png10.23KB4.75KB▼ 53.54%
assets/images/ss-saved-amex@2x.png16.61KB7.50KB▼ 54.86%
images/img/visa.png42.97KB9.79KB▼ 77.21%
assets/images/ss-shield@2x.png58.35KB12.61KB▼ 78.39%