78% woocommerce-for-japan

Code Review | Japanized For WooCommerce

WordPress plugin Japanized For WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-for-j...
  • Plugin version: 2.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 22, 2014
  • Latest release: Nov 28, 2023
  • Number of updates: 329
  • Update frequency: every 10.5 days
  • Top authors: shohei.tanaka (100%)

Code review

54 tests

User reviews

19 reviews

Install metrics

10,000+ active /390,859 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼8.08ms] Passed 4 tests

A check of server-side resources used by Japanized For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0435.29 ▼7.32
Dashboard /wp-admin3.35 ▲0.0451.50 ▲0.32
Posts /wp-admin/edit.php3.40 ▲0.0449.16 ▼1.72
Add New Post /wp-admin/post-new.php5.93 ▲0.0480.75 ▼19.03
Media Library /wp-admin/upload.php3.27 ▲0.0430.28 ▼4.26

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

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

Browser metrics Passed 4 tests

Japanized For WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲7914.18 ▼0.211.95 ▼0.0536.93 ▼7.14
Dashboard /wp-admin2,209 ▲325.60 ▼0.0395.76 ▼8.5843.56 ▼11.61
Posts /wp-admin/edit.php2,112 ▲122.00 ▼0.0039.61 ▲4.0437.09 ▲0.26
Add New Post /wp-admin/post-new.php1,535 ▼023.44 ▼1.74672.56 ▼16.9860.16 ▼9.58
Media Library /wp-admin/upload.php1,411 ▲114.26 ▼0.0393.07 ▼6.7241.90 ▼1.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/uninstall.php
  • 160× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/vendor/dhii/human-readable-interface/tests/functional/MessageAwareInterfaceTest.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Button\\Endpoint\\EndpointInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/modules/ppcp-button/src/Endpoint/DataClientIdEndpoint.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Vendor\\Dhii\\Collection\\ContainerInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/lib/packages/Dhii/Container/MappingContainer.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Http\\RedirectorInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/src/Http/WpRedirector.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Vendor\\Dhii\\Collection\\ContainerFactoryInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/lib/packages/Dhii/Collection/WritableContainerFactoryInterface.php:12
    • > PHP Fatal error
      Trait 'WooCommerce\\PayPalCommerce\\Webhooks\\Handler\\PrefixTrait' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php on line 20
    • > PHP Warning
      require_once(wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/vendor/dhii/human-readable-interface/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/vendor/dhii/human-readable-interface/tests/bootstrap.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Button\\Endpoint\\EndpointInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/modules/ppcp-button/src/Endpoint/CartScriptParamsEndpoint.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\Vendor\\Psr\\Container\\ContainerInterface' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/modules/ppcp-wc-gateway/src/Settings/Settings.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'WooCommerce\\PayPalCommerce\\ApiClient\\Authentication\\Bearer' not found in wp-content/plugins/woocommerce-for-japan/includes/gateways/paypal/modules/ppcp-api-client/src/Authentication/ConnectBearer.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
4 plugin tags: ecommerce, e-commerce, woocommerce, japanese

woocommerce-for-japan/woocommerce-for-japan.php 92% from 13 tests

The primary PHP file in "Japanized For WooCommerce" version 2.6.6 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.0.0" instead of "5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected42,106 lines of code in 591 files:
LanguageFilesBlank linesComment linesLines of code
PHP4746,78419,36134,924
JavaScript625771363,316
JSON3002,320
Sass8720435
XML6226423
SVG2102363
CSS12148198
Markdown325074
YAML12029
Dockerfile113224

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.78
▷ Minimum class complexity1.00
▷ Maximum class complexity170.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces98
Interfaces62
Traits16
Classes311
▷ Abstract classes20.64%
▷ Concrete classes30999.36%
▷ Final classes20.65%
Methods1,698
▷ Static methods834.89%
▷ Public methods1,43184.28%
▷ Protected methods1166.83%
▷ Private methods1518.89%
Functions506
▷ Named functions326.32%
▷ Anonymous functions47493.68%
Constants304
▷ Global constants185.92%
▷ Class constants28694.08%
▷ Public constants27696.50%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 0.38MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/linepay_white.png2.91KB1.61KB▼ 44.69%
assets/images/paidy_logo_tagline_100.png7.59KB2.20KB▼ 71.01%
assets/images/2021Checkout_320x100.png23.66KB9.59KB▼ 59.47%
includes/gateways/paypal/modules/ppcp-onboarding/assets/images/cards-screen-basic.png89.25KB77.75KB▼ 12.88%
assets/images/jp4wc-bank-transfer.png0.77KB0.40KB▼ 48.60%