84% sagepay-direct-gateway-for-gravity-forms

Code Review | Opayo Direct Gateway for Gravity Forms

WordPress plugin Opayo Direct Gateway for Gravity Forms scored84%from 54 tests.

About plugin

  • Plugin page: sagepay-direct-ga...
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.2
  • WordPress version: 6.3.1
  • First release: Apr 23, 2019
  • Latest release: Apr 1, 2023
  • Number of updates: 17
  • Update frequency: every 84.7 days
  • Top authors: patsatech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /721 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: ▼5.46ms] Passed 4 tests

Analyzing server-side resources used by Opayo Direct Gateway for Gravity Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.11 ▼4.42
Dashboard /wp-admin3.31 ▲0.0145.11 ▼3.13
Posts /wp-admin/edit.php3.36 ▲0.0148.07 ▼8.69
Add New Post /wp-admin/post-new.php5.89 ▲0.0192.49 ▼1.85
Media Library /wp-admin/upload.php3.23 ▲0.0136.69 ▼5.60

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Opayo Direct Gateway for Gravity Forms
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.53 ▲0.161.54 ▼0.1436.55 ▼7.62
Dashboard /wp-admin2,189 ▲155.62 ▲0.0992.81 ▲5.8141.20 ▼1.45
Posts /wp-admin/edit.php2,103 ▼02.02 ▲0.0138.54 ▼2.8835.90 ▼1.36
Add New Post /wp-admin/post-new.php1,526 ▼023.14 ▼0.13700.30 ▲93.2159.95 ▲4.22
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0299.32 ▼4.9841.09 ▼4.78

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sagepay-direct-gateway-for-gravity-forms/class-gf-sagepay-direct.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sagepay-direct-gateway-for-gravity-forms/sagepay-direct.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
8 plugin tags: gravityforms, opayo direct, payment gateway, credit card, opayo go...

sagepay-direct-gateway-for-gravity-forms/sagepay-direct.php 85% from 13 tests

The main PHP file in "Opayo Direct Gateway for Gravity Forms" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("sagepay-direct-gateway-for-gravity-forms.php" instead of "sagepay-direct.php")
  • 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

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 plugin903 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP233479903

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity58.00
▷ Minimum class complexity2.00
▷ Maximum class complexity114.00
Average method complexity4.45
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods412.12%
▷ Public methods2575.76%
▷ Protected methods00.00%
▷ Private methods824.24%
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

PNG files should be compressed to save space and minimize bandwidth usage
7 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/tick.png0.52KB0.52KB0.00%
images/active1.png0.71KB0.63KB▼ 11.28%
images/stop.png0.68KB0.78KB0.00%
images/add.png3.37KB0.66KB▼ 80.54%
images/remove.png3.32KB0.62KB▼ 81.33%