84% oceanpayment-wechatpay-gateway

Code Review | Oceanpayment WechatPay Gateway

WordPress plugin Oceanpayment WechatPay Gateway scored84%from 54 tests.

About plugin

  • Plugin page: oceanpayment-wech...
  • 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 9, 2022
  • Latest release: May 6, 2023
  • Number of updates: 10
  • Update frequency: every 14.9 days
  • Top authors: oceanpayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /225 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

This is a short check of server-side resources used by Oceanpayment WechatPay Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.80 ▼5.76
Dashboard /wp-admin3.31 ▲0.0144.22 ▼10.22
Posts /wp-admin/edit.php3.36 ▲0.0046.07 ▼0.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.40 ▼7.29
Media Library /wp-admin/upload.php3.23 ▲0.0038.79 ▲2.23

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Oceanpayment WechatPay Gateway
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.23 ▼0.941.63 ▼0.3438.26 ▼9.00
Dashboard /wp-admin2,209 ▲185.85 ▼0.0598.16 ▼17.6442.76 ▼2.75
Posts /wp-admin/edit.php2,089 ▲32.05 ▼0.0139.94 ▲3.5434.38 ▼3.57
Add New Post /wp-admin/post-new.php1,533 ▲1323.35 ▼0.10689.02 ▼0.3152.91 ▼10.68
Media Library /wp-admin/upload.php1,391 ▲34.24 ▲0.08103.72 ▼5.9945.29 ▼0.68

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/oceanpayment-wechatpay-gateway/oceanwechat.php:18

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

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: payment

oceanpayment-wechatpay-gateway/oceanwechat.php 92% from 13 tests

"Oceanpayment WechatPay Gateway" version 6.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oceanpayment-wechatpay-gateway.php" instead of "oceanwechat.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin550 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2135190550

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity69.00
▷ Minimum class complexity69.00
▷ Maximum class complexity69.00
Average method complexity4.58
▷ 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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/op_Wechat.png1.68KB1.90KB0.00%