90% opay-payment-gateway-for-woocommerce

Code Review | OPay Payment Gateway for WooCommerce

WordPress plugin OPay Payment Gateway for WooCommerce scored 90% from 54 tests.

About plugin

  • Plugin page: opay-payment-gate...
  • Plugin version: 2.5.5
  • PHP compatiblity: 7.2.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.8
  • WordPress version: 6.3.1
  • First release: Dec 8, 2021
  • Latest release: Apr 28, 2022
  • Number of updates: 26
  • Update frequency: every 5.5 days
  • Top authors: opaycheckout (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 2,905 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.00MB] [CPU: ▼5.48ms] Passed 4 tests

A check of server-side resources used by OPay Payment Gateway for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.76 ▼3.03
Dashboard /wp-admin3.31 ▲0.0043.37 ▼1.31
Posts /wp-admin/edit.php3.36 ▲0.0047.51 ▲0.96
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.11 ▼14.83
Media Library /wp-admin/upload.php3.23 ▲0.0034.35 ▼2.73

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for OPay Payment Gateway for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.22 ▼1.142.10 ▲0.2742.13 ▼6.01
Dashboard /wp-admin2,206 ▲185.91 ▲0.01101.16 ▼1.3539.54 ▲0.59
Posts /wp-admin/edit.php2,092 ▲32.02 ▼0.0339.37 ▼0.5236.49 ▲2.07
Add New Post /wp-admin/post-new.php1,533 ▼023.47 ▲0.31655.49 ▲8.9761.22 ▼2.66
Media Library /wp-admin/upload.php1,385 ▲64.17 ▼0.0299.55 ▼6.3243.10 ▼4.63

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% 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: payment, woocommerce, opay, payment gateway

opay-payment-gateway-for-woocommerce/opay_woocommerce.php 92% from 13 tests

The main PHP file in "OPay Payment Gateway for WooCommerce" ver. 2.5.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("opay-payment-gateway-for-woocommerce.php" instead of "opay_woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected1,742 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8119181,742

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity16.14
▷ Minimum class complexity16.00
▷ Maximum class complexity17.00
Average method complexity3.16
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods49
▷ Static methods00.00%
▷ Public methods4285.71%
▷ Protected methods00.00%
▷ Private methods714.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
10 PNG files occupy 0.30MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/SHAHRY.png33.46KB10.55KB▼ 68.47%
img/BANK_CARD.png10.88KB4.14KB▼ 61.97%
img/BANK_CARD_1.png8.21KB3.46KB▼ 57.91%
img/RC_CODE.png11.38KB4.42KB▼ 61.19%
img/VALU.png4.58KB2.50KB▼ 45.41%