83% wc-paypay-gateway

Code Review | Payment Gateway PayPay for WooCommerce

WordPress plugin Payment Gateway PayPay for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: wc-paypay-gateway
  • Plugin version: 0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.8.3
  • WordPress version: 6.3.1
  • First release: Mar 18, 2021
  • Latest release: Jan 22, 2022
  • Number of updates: 18
  • Update frequency: every 17.3 days
  • Top authors: Hiroaki Miyashita (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 2,375 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.15MB] [CPU: ▼9.61ms] Passed 4 tests

An overview of server-side resources used by Payment Gateway PayPay for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.18 ▼0.2822.48 ▼22.71
Dashboard /wp-admin3.64 ▲0.3452.79 ▲0.23
Posts /wp-admin/edit.php3.69 ▲0.3454.49 ▲0.04
Add New Post /wp-admin/post-new.php6.16 ▲0.2794.87 ▼16.01
Media Library /wp-admin/upload.php3.50 ▲0.2742.18 ▲4.78

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 243 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Payment Gateway PayPay for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,464 ▼29313.33 ▼1.070.49 ▼1.7520.91 ▼25.87
Dashboard /wp-admin2,214 ▲264.87 ▼1.01109.64 ▲0.4941.08 ▼6.15
Posts /wp-admin/edit.php2,096 ▲72.04 ▼0.1041.52 ▼1.0432.42 ▼0.73
Add New Post /wp-admin/post-new.php1,545 ▲923.41 ▼0.18632.40 ▼19.6360.67 ▼2.86
Media Library /wp-admin/upload.php1,390 ▲24.21 ▼0.10110.23 ▼7.3046.42 ▼1.66

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

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

SRP 50% from 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
Please fix the following items
  • 74× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/guzzle/src/Pool.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/psr7/src/AppendStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PayPay\\OpenPaymentAPI\\Models\\Model' not found in wp-content/plugins/wc-paypay-gateway/vendor/paypayopa/php-sdk/src/Models/ReverseCashBackPayload.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PayPay\\OpenPaymentAPI\\Models\\Model' not found in wp-content/plugins/wc-paypay-gateway/vendor/paypayopa/php-sdk/src/Models/RefundPaymentPayload.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'PayPay\\OpenPaymentAPI\\Models\\Model' not found in wp-content/plugins/wc-paypay-gateway/vendor/paypayopa/php-sdk/src/Models/CapturePaymentAuthPayload.php:7
    • > PHP Fatal error
      Uncaught UnexpectedValueException: creating archive "wp-content/plugins/wc-paypay-gateway/vendor/paragonie/random_compat/dist/random_compat.phar" disabled by the php.ini setting phar.readonly in /var/www/wordpress/wp-content/plugins/wc-paypay-gateway/vendor/paragonie/random_compat/other/build_phar.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/wc-paypay-gateway/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (PayPay - Settings), #2 (PayPay - Payment Screen)
The official readme.txt is a good inspiration

wc-paypay-gateway/wc-paypay-gateway.php 77% from 13 tests

The main PHP file in "Payment Gateway PayPay for WooCommerce" ver. 0.7 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Domain Path: Prefix the domain path with a forward slash character ("//")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0" instead of "4.4")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("/")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin35,754 lines of code in 218 files:
LanguageFilesBlank linesComment linesLines of code
PHP1802,8117,66130,037
Markdown181,30504,013
JSON14001,452
PO File11,5293,270196
XML20034
Dockerfile18010
make1409
Bourne Shell1203

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity14.20
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces19
Interfaces16
Traits2
Classes121
▷ Abstract classes00.00%
▷ Concrete classes121100.00%
▷ Final classes2419.83%
Methods953
▷ Static methods17718.57%
▷ Public methods79683.53%
▷ Protected methods101.05%
▷ Private methods14715.42%
Functions171
▷ Named functions8046.78%
▷ Anonymous functions9153.22%
Constants163
▷ Global constants4225.77%
▷ Class constants12174.23%
▷ Public constants121100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
paypay.png3.51KB1.90KB▼ 45.80%
screenshot-2.png52.71KB30.73KB▼ 41.70%
screenshot-1.png32.09KB13.65KB▼ 57.45%