83% sagepay-server-gateway-for-woocommerce

Code Review | SagePay Server Gateway for WooCommerce

WordPress plugin SagePay Server Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: sagepay-server-ga...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.8
  • WordPress version: 6.3.1
  • First release: Dec 24, 2013
  • Latest release: Jul 30, 2021
  • Number of updates: 59
  • Update frequency: every 47.1 days
  • Top authors: patsatech (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

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

A check of server-side resources used by SagePay Server Gateway for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0836.95 ▼8.27
Dashboard /wp-admin3.39 ▲0.0844.87 ▼2.61
Posts /wp-admin/edit.php3.44 ▲0.0850.21 ▲5.32
Add New Post /wp-admin/post-new.php5.97 ▲0.0889.11 ▼7.22
Media Library /wp-admin/upload.php3.31 ▲0.0836.90 ▲4.56

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

SagePay Server Gateway for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.39 ▲0.051.60 ▼0.8042.99 ▼2.44
Dashboard /wp-admin2,206 ▲185.04 ▼0.78115.00 ▲9.2741.47 ▼2.66
Posts /wp-admin/edit.php2,089 ▲32.06 ▲0.0440.96 ▲6.4235.56 ▲2.50
Add New Post /wp-admin/post-new.php1,536 ▲2223.23 ▲5.71636.21 ▼79.6550.56 ▼14.57
Media Library /wp-admin/upload.php1,385 ▼34.23 ▼0.06103.09 ▼9.0243.49 ▼3.35

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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
Everything seems fine, however this is by no means 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× 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-server-gateway-for-woocommerce/woosagepayserver.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: payment gateway, wordpress, sagepay go, woocommerce, ecommerce...

sagepay-server-gateway-for-woocommerce/woosagepayserver.php 77% from 13 tests

"SagePay Server Gateway for WooCommerce" version 1.1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/lang/")
  • 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: The principal plugin file should be the same as the plugin slug ("sagepay-server-gateway-for-woocommerce.php" instead of "woosagepayserver.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
Everything looks great! No dangerous files found in this plugin434 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP29165434

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity5.00
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods981.82%
▷ Protected methods00.00%
▷ Private methods218.18%
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

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/card-disc.png4.49KB1.47KB▼ 67.30%
images/card-dc.png6.16KB1.85KB▼ 70.00%
images/card-mc.png5.42KB1.77KB▼ 67.41%
images/card-jcb.png5.54KB1.72KB▼ 69.02%
images/card-amex.png4.45KB1.65KB▼ 62.79%