83% sagepay-form-payment-gateway-for-gravity-forms

Code Review | Opayo Form Payment Gateway for Gravity Forms

WordPress plugin Opayo Form Payment Gateway for Gravity Forms scored83%from 54 tests.

About plugin

  • Plugin page: sagepay-form-paym...
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Oct 16, 2014
  • Latest release: Mar 28, 2023
  • Number of updates: 44
  • Update frequency: every 70.1 days
  • Top authors: patsatech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,661 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
The plugin installed successfully, without throwing any errors or notices

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

A check of server-side resources used by Opayo Form Payment Gateway for Gravity Forms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.23 ▼4.62
Dashboard /wp-admin3.31 ▲0.0045.50 ▼1.39
Posts /wp-admin/edit.php3.36 ▲0.0047.26 ▲0.15
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.27 ▲9.49
Media Library /wp-admin/upload.php3.23 ▲0.0036.00 ▲3.00

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Opayo Form Payment Gateway for Gravity Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.27 ▼1.035.39 ▲3.6640.99 ▼2.26
Dashboard /wp-admin2,209 ▲245.84 ▲0.02109.02 ▲8.9342.05 ▲0.56
Posts /wp-admin/edit.php2,089 ▼32.01 ▼0.0138.85 ▲0.3736.14 ▼0.12
Add New Post /wp-admin/post-new.php1,537 ▲2323.29 ▲5.81589.46 ▼80.4758.97 ▲7.12
Media Library /wp-admin/upload.php1,391 ▲64.27 ▲0.14100.94 ▼9.8447.28 ▲3.30

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sagepay-form-payment-gateway-for-gravity-forms/class-gf-sagepay-form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sagepay-form-payment-gateway-for-gravity-forms/sagepay-form.php:22

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: opayo go, wordpress, ecommerce, gravity forms, opayo server...

sagepay-form-payment-gateway-for-gravity-forms/sagepay-form.php 69% from 13 tests

The entry point to "Opayo Form Payment Gateway for Gravity Forms" version 1.1.9 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires at least: Required version does not match the one declared in readme.txt ("3.5" instead of "4.5")
  • Domain Path: The domain path points to an invalid folder, "/lang/" does not exist
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("sagepay-form-payment-gateway-for-gravity-forms.php" instead of "sagepay-form.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,776 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24863071,688
JavaScript1231288

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity107.50
▷ Minimum class complexity2.00
▷ Maximum class complexity213.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods69
▷ Static methods57.25%
▷ Public methods6391.30%
▷ Protected methods00.00%
▷ Private methods68.70%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
7 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/active0.png0.65KB0.61KB▼ 5.56%
images/tick.png0.52KB0.52KB0.00%
images/add.png3.37KB0.66KB▼ 80.54%
images/sagepay_form_wordpress_icon_32.png19.58KB1.53KB▼ 92.18%
images/tooltip_tip.png0.24KB0.28KB0.00%