84% oceanpayment-unionpay-gateway

Code Review | Oceanpayment UnionPay Gateway

WordPress plugin Oceanpayment UnionPay Gateway scored84%from 54 tests.

About plugin

  • Plugin page: oceanpayment-unio...
  • Plugin version: 6.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Dec 12, 2022
  • Latest release: Apr 28, 2023
  • Number of updates: 8
  • Update frequency: every 17.5 days
  • Top authors: oceanpayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /214 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.01MB] [CPU: ▼6.67ms] Passed 4 tests

This is a short check of server-side resources used by Oceanpayment UnionPay Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.20 ▲0.10
Dashboard /wp-admin3.31 ▼0.0444.71 ▼17.80
Posts /wp-admin/edit.php3.36 ▲0.0046.04 ▲0.21
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.74 ▼8.63
Media Library /wp-admin/upload.php3.23 ▲0.0036.20 ▼0.33

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Oceanpayment UnionPay Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.57 ▼0.732.06 ▲0.2039.36 ▼4.90
Dashboard /wp-admin2,206 ▲155.85 ▲0.87105.69 ▲1.8340.52 ▼2.54
Posts /wp-admin/edit.php2,089 ▼32.04 ▲0.0438.99 ▼2.1636.50 ▲3.13
Add New Post /wp-admin/post-new.php1,521 ▼723.19 ▼0.23604.18 ▼103.9659.99 ▼2.17
Media Library /wp-admin/upload.php1,382 ▼94.23 ▲0.0397.82 ▼3.6240.00 ▼1.62

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/oceanpayment-unionpay-gateway/oceanunionpay.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
1 plugin tags: payment

oceanpayment-unionpay-gateway/oceanunionpay.php 92% from 13 tests

Analyzing the main PHP file in "Oceanpayment UnionPay Gateway" version 6.0
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("oceanpayment-unionpay-gateway.php" instead of "oceanunionpay.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
There were no executable files found in this plugin538 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2135183538

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity66.00
▷ Minimum class complexity66.00
▷ Maximum class complexity66.00
Average method complexity4.61
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin