10% okpay-payment-gateway

Code Review | OKPAY Payment gateway

WordPress plugin OKPAY Payment gateway scored10%from 54 tests.

About plugin

  • Plugin page: okpay-payment-gat...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4.2
  • WordPress version: 6.3.1
  • First release: Dec 6, 2012
  • Latest release: Dec 6, 2012
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: saadat68 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,485 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Parse error in wp-content/plugins/okpay-payment-gateway/OKpay payment gateway.php+255
    syntax error, unexpected 'new' (T_NEW)

Server metrics [RAM: ▲0.00MB] [CPU: ▼12.74ms] Passed 4 tests

A check of server-side resources used by OKPAY Payment gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.22 ▼2.10
Dashboard /wp-admin3.31 ▲0.0048.92 ▼7.16
Posts /wp-admin/edit.php3.36 ▲0.0052.60 ▲0.18
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.87 ▼38.57
Media Library /wp-admin/upload.php3.23 ▲0.0038.27 ▼3.12

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

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

Browser metrics Passed 4 tests

OKPAY Payment gateway: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.301.77 ▲0.0842.11 ▲2.87
Dashboard /wp-admin2,195 ▲155.59 ▼0.0591.68 ▼3.3739.76 ▼5.70
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0438.26 ▲4.3536.19 ▲1.67
Add New Post /wp-admin/post-new.php1,526 ▼1123.02 ▲4.45738.61 ▲96.1559.58 ▼13.76
Media Library /wp-admin/upload.php1,400 ▲34.15 ▼0.04106.20 ▲5.9645.90 ▲1.51

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
6 plugin tags: woocommerce, gateway, extension, okpay, payment gateway...

okpay-payment-gateway/OKpay payment gateway.php 92% from 13 tests

The primary PHP file in "OKPAY Payment gateway" version 0.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("okpay-payment-gateway.php" instead of "OKpay payment gateway.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin233 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16325233

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity31.00
▷ Minimum class complexity31.00
▷ Maximum class complexity31.00
Average method complexity4.33
▷ Minimum method complexity1.00
▷ Maximum method complexity25.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png7.70KB3.40KB▼ 55.80%