84% woocommerce-payment-gateway-for-saferpay

Code Review | WooCommerce Payment Gateway for Saferpay

WordPress plugin WooCommerce Payment Gateway for Saferpay scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-payme...
  • Plugin version: 0.4.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.5
  • WordPress version: 6.3.1
  • First release: Sep 3, 2013
  • Latest release: Jan 20, 2020
  • Number of updates: 24
  • Update frequency: every 97.1 days
  • Top authors: smkb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

80+ active /2,841 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.83ms] Passed 4 tests

An overview of server-side resources used by WooCommerce Payment Gateway for Saferpay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.40 ▲4.25
Dashboard /wp-admin3.31 ▲0.0148.81 ▼7.17
Posts /wp-admin/edit.php3.37 ▲0.0152.43 ▲2.99
Add New Post /wp-admin/post-new.php5.89 ▲0.0186.03 ▼23.38
Media Library /wp-admin/upload.php3.24 ▲0.0139.45 ▲5.46

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
saferpay_page_id
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

WooCommerce Payment Gateway for Saferpay: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲3914.37 ▲0.022.08 ▲0.1144.56 ▼4.96
Dashboard /wp-admin2,206 ▲295.64 ▲0.0685.48 ▼6.1641.92 ▲1.44
Posts /wp-admin/edit.php2,111 ▲112.10 ▲0.0640.67 ▲4.3236.61 ▼0.83
Add New Post /wp-admin/post-new.php1,535 ▲923.97 ▲1.04661.55 ▼33.5354.76 ▼8.25
Media Library /wp-admin/upload.php1,402 ▲24.21 ▼0.02105.85 ▼3.6442.75 ▼4.81

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 1× 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/woocommerce-payment-gateway-for-saferpay/fn-plugin.php:119

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Settings panel in WooCommerce.), #2 (Payment method on the checkout page)
The official readme.txt might help

woocommerce-payment-gateway-for-saferpay/fn-plugin.php 92% from 13 tests

The main PHP file in "WooCommerce Payment Gateway for Saferpay" ver. 0.4.9 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-payment-gateway-for-saferpay.php" instead of "fn-plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin573 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4256242472
PO File13340101

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity13.00
▷ Minimum class complexity13.00
▷ Maximum class complexity13.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/credit_cards.png2.76KB0.09KB▼ 96.57%