83% woo-opay-payment

Code Review | OPay Payment for WooCommerce

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

About plugin

  • Plugin page: woo-opay-payment
  • Plugin version: 1.3.190829
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.8
  • WordPress version: 6.3.1
  • First release: Sep 6, 2019
  • Latest release: Sep 6, 2019
  • Number of updates: 7
  • Update frequency: every 0.1 days
  • Top authors: ecpaytechsupport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 853 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.86ms] Passed 4 tests

A check of server-side resources used by OPay Payment for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.37 ▼10.10
Dashboard /wp-admin3.33 ▲0.0347.22 ▼2.25
Posts /wp-admin/edit.php3.39 ▲0.0348.91 ▲2.89
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.79 ▼5.96
Media Library /wp-admin/upload.php3.26 ▲0.0336.80 ▲3.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for OPay Payment for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲6013.24 ▼1.141.74 ▼0.6041.16 ▼2.47
Dashboard /wp-admin2,212 ▲245.90 ▼0.01113.59 ▼5.5945.69 ▲0.05
Posts /wp-admin/edit.php2,097 ▲111.99 ▲0.0041.19 ▲1.6437.56 ▲2.80
Add New Post /wp-admin/post-new.php1,539 ▲1023.37 ▲5.05610.52 ▼7.4756.15 ▼18.41
Media Library /wp-admin/upload.php1,397 ▲124.31 ▲0.11100.23 ▼2.4545.09 ▲1.09

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • 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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/woo-opay-payment/lib/class-wc-gateway-opay.php:3

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 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires php: The plugin version is formatted incorrectly
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

woo-opay-payment/integration_plugin.php 85% from 13 tests

The primary PHP file in "OPay Payment for WooCommerce" version 1.3.190829 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("woo-opay-payment.php" instead of "integration_plugin.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 plugin3,361 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP76141,0132,922
SVG1141292
PO File1630147

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity7.58
▷ Minimum class complexity1.00
▷ Maximum class complexity97.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes50
▷ Abstract classes1734.00%
▷ Concrete classes3366.00%
▷ Final classes824.24%
Methods159
▷ Static methods2415.09%
▷ Public methods11974.84%
▷ Protected methods116.92%
▷ Private methods2918.24%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants80
▷ Global constants45.00%
▷ Class constants7695.00%
▷ Public constants76100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.56KB1.65KB0.00%