84% oceanpayment-alipayhk-gateway

Code Review | Oceanpayment AlipayHK Gateway

WordPress plugin Oceanpayment AlipayHK Gateway scored84%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: Dec 2, 2022
  • Latest release: Apr 28, 2023
  • Number of updates: 10
  • Update frequency: every 14.7 days
  • Top authors: oceanpayment (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /229 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: ▼0.37ms] Passed 4 tests

This is a short check of server-side resources used by Oceanpayment AlipayHK Gateway
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.36 ▼0.35
Dashboard /wp-admin3.31 ▲0.0052.90 ▼2.41
Posts /wp-admin/edit.php3.36 ▲0.0046.87 ▲4.52
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.51 ▲1.95
Media Library /wp-admin/upload.php3.23 ▲0.0033.88 ▼0.66

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Oceanpayment AlipayHK Gateway: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.55 ▼1.084.78 ▲2.5945.93 ▲1.71
Dashboard /wp-admin2,206 ▲185.85 ▼0.11109.50 ▼7.1942.27 ▼0.27
Posts /wp-admin/edit.php2,089 ▲32.01 ▲0.0240.19 ▲3.3334.31 ▲1.29
Add New Post /wp-admin/post-new.php1,533 ▼223.22 ▼0.03601.04 ▼62.8447.72 ▼15.96
Media Library /wp-admin/upload.php1,385 ▼64.21 ▲0.0098.46 ▼1.6945.49 ▲2.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • 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
Please fix the following
  • 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-alipayhk-gateway/oceanalipayhk.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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-alipayhk-gateway/oceanalipayhk.php 92% from 13 tests

Analyzing the main PHP file in "Oceanpayment AlipayHK Gateway" version 6.0
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("oceanpayment-alipayhk-gateway.php" instead of "oceanalipayhk.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin517 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2132189517

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/op_Alipayhk.png1.92KB1.98KB0.00%