84% oceanpayment-alipay-gateway

Code Review | Oceanpayment Alipay Gateway

WordPress plugin Oceanpayment Alipay Gateway scored 84% from 54 tests.

About plugin

  • Plugin page: oceanpayment-alip...
  • 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: Nov 28, 2022
  • Latest release: Apr 28, 2023
  • Number of updates: 10
  • Update frequency: every 15.4 days
  • Top authors: oceanpayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 218 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

A check of server-side resources used by Oceanpayment Alipay Gateway
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.56 ▼6.43
Dashboard /wp-admin3.31 ▲0.0145.19 ▼3.33
Posts /wp-admin/edit.php3.36 ▲0.0048.55 ▲2.01
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.19 ▼11.00
Media Library /wp-admin/upload.php3.23 ▲0.0034.70 ▲0.04

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Oceanpayment Alipay Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.77 ▲0.421.79 ▼0.3041.11 ▼7.73
Dashboard /wp-admin2,209 ▲184.83 ▼1.0999.00 ▼0.0138.84 ▼1.21
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0939.91 ▼2.3234.11 ▼2.20
Add New Post /wp-admin/post-new.php1,533 ▲523.41 ▲5.38645.89 ▲9.3878.55 ▲26.43
Media Library /wp-admin/upload.php1,388 ▲34.20 ▲0.0296.36 ▼3.2140.75 ▼2.66

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 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-alipay-gateway/oceanalipay.php:18

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

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
1 plugin tags: payment

oceanpayment-alipay-gateway/oceanalipay.php 92% from 13 tests

The primary PHP file in "Oceanpayment Alipay Gateway" version 6.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oceanpayment-alipay-gateway.php" instead of "oceanalipay.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
Good job! No executable or dangerous file extensions detected517 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2136189517

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity65.00
▷ Minimum class complexity65.00
▷ Maximum class complexity65.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/op_Alipay.png3.15KB2.27KB▼ 28.09%