78% sagepay-server-gateway-for-jigoshop

Code Review | SagePay Server Gateway for Jigoshop

WordPress plugin SagePay Server Gateway for Jigoshop scored78%from 54 tests.

About plugin

  • Plugin page: sagepay-server-ga...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0
  • WordPress version: 6.3.1
  • First release: Dec 26, 2013
  • Latest release: Oct 27, 2015
  • Number of updates: 10
  • Update frequency: every 67.1 days
  • Top authors: patsatech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /797 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.08MB] [CPU: ▼3.33ms] Passed 4 tests

An overview of server-side resources used by SagePay Server Gateway for Jigoshop
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.93 ▼3.72
Dashboard /wp-admin3.39 ▲0.0950.38 ▼0.17
Posts /wp-admin/edit.php3.44 ▲0.0854.82 ▲0.62
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.13 ▼10.06
Media Library /wp-admin/upload.php3.31 ▲0.0837.66 ▲2.63

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by SagePay Server Gateway for Jigoshop
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2914.48 ▲0.121.71 ▼0.1843.97 ▲1.29
Dashboard /wp-admin2,215 ▲95.83 ▲0.94102.80 ▲0.0939.92 ▼2.40
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0339.22 ▼2.3437.76 ▼3.80
Add New Post /wp-admin/post-new.php1,545 ▲523.04 ▼0.31642.91 ▼32.6448.02 ▼3.75
Media Library /wp-admin/upload.php1,403 ▲34.21 ▼0.06100.72 ▼4.2842.68 ▼8.23

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/sagepay-server-gateway-for-jigoshop/includes/pages/redirect.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sagepay-server-gateway-for-jigoshop/jigosagepayserver.php:20
    • > PHP Notice
      Undefined index: page in wp-content/plugins/sagepay-server-gateway-for-jigoshop/includes/pages/redirect.php on line 9

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, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: wordpress, ecommerce, jigoshop, payment gateway

sagepay-server-gateway-for-jigoshop/jigosagepayserver.php 77% from 13 tests

"SagePay Server Gateway for Jigoshop" version 1.0.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sagepay-server-gateway-for-jigoshop.php" instead of "jigosagepayserver.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path is invalid: folder "/lang/" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected376 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212055376

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity7.86
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods114.29%
▷ Private methods00.00%
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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/sagepay.png16.40KB4.63KB▼ 71.74%