68% woocommerce-for-paygent-payment-main

Code Review | PAYGENT for WooCommerce

WordPress plugin PAYGENT for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: woocommerce-for-p...
  • Plugin version: 2.3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jul 28, 2014
  • Latest release: Nov 27, 2023
  • Number of updates: 216
  • Update frequency: every 15.8 days
  • Top authors: shohei.tanaka (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /9,964 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.91ms] Passed 4 tests

This is a short check of server-side resources used by PAYGENT for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.25 ▼7.90
Dashboard /wp-admin3.33 ▼0.0149.15 ▼9.19
Posts /wp-admin/edit.php3.38 ▲0.0346.69 ▲4.61
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.18 ▼15.52
Media Library /wp-admin/upload.php3.26 ▲0.0330.75 ▲0.99

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 127 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for PAYGENT for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲1414.21 ▼0.161.50 ▼0.5237.10 ▼11.48
Dashboard /wp-admin2,203 ▲265.59 ▼0.0395.86 ▼3.1543.13 ▲1.08
Posts /wp-admin/edit.php2,115 ▲151.94 ▼0.0839.26 ▼0.3638.23 ▲0.65
Add New Post /wp-admin/post-new.php1,535 ▲923.10 ▼0.07647.44 ▲43.2657.55 ▲5.57
Media Library /wp-admin/upload.php1,411 ▲84.16 ▼0.01100.68 ▲0.7443.36 ▲0.70

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/woocommerce-for-paygent-payment-main/uninstall.php+27
    unlink(wp-content/uploads/wc-paygent/client_cert.pem): No such file or directory
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/paygent/connect/src/paygent_module/sandbox_modenv_properties.php
    • > /wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/paygent/connect/src/paygent_module/modenv_properties.php
  • 19× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/symfony/yaml/Tests/ParseExceptionTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/symfony/yaml/Tests/InlineTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/symfony/yaml/Tests/Command/LintCommandTest.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/symfony/yaml/Tests/DumperTest.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Gateway_Paygent_CC' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/includes/gateways/paygent/class-wc-gateway-paygent-addon-cc.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Console\\Command\\Command' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/symfony/yaml/Command/LintCommand.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/woocommerce-for-paygent-payment-main/includes/admin/views/html-admin-info-screen.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'PaygentModule\\Entity\\ResponseData' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/paygent/connect/src/paygent_module/Entity/ReferenceResponseDataImpl.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-for-paygent-payment-main/includes/gateways/paygent/class-wc-paygent-endpoint.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PaygentModule\\Entity\\ResponseData' not found in wp-content/plugins/woocommerce-for-paygent-payment-main/vendor/paygent/connect/src/paygent_module/Entity/PaymentResponseDataImpl.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 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
7 plugin tags: ecommerce, woocommerce, japan, payment gateway, credit cards...

woocommerce-for-paygent-payment-main/woocommerce-for-paygent-payment-main.php Passed 13 tests

Analyzing the main PHP file in "PAYGENT for WooCommerce" version 2.3.0
41 characters long description:
Paygent Payments for WooCommerce in Japan

Code Analysis 97% from 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
No dangerous file extensions were detected17,480 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
PHP652,3535,15613,456
YAML301522013,520
JSON400232
Markdown3560118
JavaScript118771
CSS21256
XML13027

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 109)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity34.61
▷ Minimum class complexity1.00
▷ Maximum class complexity263.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity109.00
Code structure
Namespaces14
Interfaces1
Traits0
Classes53
▷ Abstract classes00.00%
▷ Concrete classes53100.00%
▷ Final classes23.77%
Methods708
▷ Static methods517.20%
▷ Public methods63589.69%
▷ Protected methods192.68%
▷ Private methods547.63%
Functions55
▷ Named functions4785.45%
▷ Anonymous functions814.55%
Constants31
▷ Global constants929.03%
▷ Class constants2270.97%
▷ Public constants22100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.40MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/gateways/paygent/images/paygent-cards-a-j.png48.71KB1.46KB▼ 97.00%
assets/images/checkout_banner_320x100.png25.86KB9.74KB▼ 62.33%
includes/gateways/paygent/images/paygent-cards-v-m.png51.70KB1.89KB▼ 96.35%
includes/gateways/paygent/images/paygent-cards-d.png48.97KB1.24KB▼ 97.46%
includes/gateways/paygent/images/paygent-cards-d-a-j.png51.08KB1.81KB▼ 96.46%