83% patsatech-wc-opayo-server

Code Review | PatSaTECH's Opayo Server Gateway for WooCommerce

WordPress plugin PatSaTECH's Opayo Server Gateway for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: patsatech-wc-opay...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 8, 2021
  • Latest release: Mar 28, 2023
  • Number of updates: 10
  • Update frequency: every 62.8 days
  • Top authors: patsatech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,291 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.66ms] Passed 4 tests

A check of server-side resources used by PatSaTECH's Opayo Server Gateway for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0933.93 ▼10.93
Dashboard /wp-admin3.39 ▲0.0945.10 ▼0.28
Posts /wp-admin/edit.php3.45 ▲0.0950.65 ▲1.16
Add New Post /wp-admin/post-new.php5.98 ▲0.0983.11 ▼12.41
Media Library /wp-admin/upload.php3.32 ▲0.0937.87 ▲0.98

Server storage [IO: ▲0.06MB] [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: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for PatSaTECH's Opayo Server Gateway for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.31 ▼1.074.44 ▲2.4543.74 ▲0.14
Dashboard /wp-admin2,209 ▲215.85 ▲0.03112.75 ▲8.5543.15 ▼0.04
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0533.57 ▼7.6931.07 ▼9.09
Add New Post /wp-admin/post-new.php1,542 ▲1418.22 ▼0.05645.54 ▼0.3959.16 ▼7.54
Media Library /wp-admin/upload.php1,391 ▲34.18 ▼0.02100.72 ▼0.1441.97 ▼3.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/patsatech-wc-opayo-server/class-patsatech-wc-opayo-server.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add images for these screenshots: #1 (Opayo WooCommerce Settings Page), #2 (Example Checkout Page displaying Opayo payment method.), #3 (Card Selection page on Opayo site.), #4 (Card Details entry page.), #5 (Page displaying cart and card details on opayo site.), #6 (Page displaying 3D Secure windows if the payment is challenged.), #7 (Payment being processed.), #8 (Order Received page displayed by WooCommerce.)
The official readme.txt might help

patsatech-wc-opayo-server/class-patsatech-wc-opayo-server.php 85% from 13 tests

The principal PHP file in "PatSaTECH's Opayo Server Gateway for WooCommerce" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder does not exist ("/lang/")
  • Main file name: The principal plugin file should be the same as the plugin slug ("patsatech-wc-opayo-server.php" instead of "class-patsatech-wc-opayo-server.php")

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
Success! There were no dangerous files found in this plugin480 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP112393480

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
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 complexity56.00
▷ Minimum class complexity56.00
▷ Maximum class complexity56.00
Average method complexity7.11
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ 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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
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-visa.png4.73KB1.66KB▼ 64.98%
images/card-mc.png5.42KB1.77KB▼ 67.41%
images/card-jcb.png5.54KB1.72KB▼ 69.02%
images/card-amex.png4.45KB1.65KB▼ 62.79%
images/card-disc.png4.49KB1.47KB▼ 67.30%