68% simple-pay-jp-payment

Code Review | Simple PAY.JP Payment

WordPress plugin Simple PAY.JP Payment scored68%from 54 tests.

About plugin

  • Plugin page: simple-pay-jp-pay...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Nov 24, 2018
  • Latest release: Apr 30, 2023
  • Number of updates: 44
  • Update frequency: every 36.8 days
  • Top authors: koyacode (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /2,764 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
Installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼0.12ms] Passed 4 tests

An overview of server-side resources used by Simple PAY.JP Payment
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1138.33 ▼0.20
Dashboard /wp-admin3.41 ▲0.1144.19 ▼3.35
Posts /wp-admin/edit.php3.47 ▲0.1148.50 ▲1.99
Add New Post /wp-admin/post-new.php5.93 ▲0.0589.36 ▲3.56
Media Library /wp-admin/upload.php3.27 ▲0.0535.12 ▲1.08
Simple PAY.JP Payment /wp-admin/options-general.php?page=simplepayjppayment_show_admin_panel3.2430.34

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 77 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Simple PAY.JP Payment
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲4913.13 ▼1.251.64 ▼0.3344.18 ▲0.86
Dashboard /wp-admin2,207 ▲164.85 ▼0.0598.74 ▲1.1239.29 ▼5.59
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0139.13 ▲4.1034.33 ▼1.44
Add New Post /wp-admin/post-new.php1,541 ▲823.29 ▼0.07630.19 ▼58.2167.74 ▲5.31
Media Library /wp-admin/upload.php1,389 ▲44.27 ▲0.0993.15 ▼7.8641.31 ▼4.28
Simple PAY.JP Payment /wp-admin/options-general.php?page=simplepayjppayment_show_admin_panel8432.0626.3425.86

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded

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
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
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/build.php
  • 43× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\PayjpObject' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/ApiResource.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\TestCase' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/tests/InvalidRequestErrorTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\Error\\Base' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/Error/Card.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\PayjpObject' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/AttachedObject.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\TestCase' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/tests/EventTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\Error\\InvalidRequest' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/Error/RateLimit.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\ApiResource' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/Token.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\TestCase' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/tests/PayjpObjectTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Payjp\\ApiResource' not found in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/lib/Transfer.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/build.php on line 5

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: e-commerce, credit card, payment request, shopping, payment

simple-pay-jp-payment/simple-payjp-payment.php 85% from 13 tests

The main PHP script in "Simple PAY.JP Payment" version 1.2.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("simple-pay-jp-payment.php" instead of "simple-payjp-payment.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Please make sure to remedy the following
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/simple-pay-jp-payment/vendor/payjp/payjp-php/data/ca-certificates.crt
3,904 lines of code in 68 files:
LanguageFilesBlank linesComment linesLines of code
PHP586546223,492
Markdown21610217
JSON20095
PO File120751
XML20030
YAML13011
CSS2008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.26
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces5
Interfaces1
Traits0
Classes49
▷ Abstract classes48.16%
▷ Concrete classes4591.84%
▷ Final classes00.00%
Methods217
▷ Static methods5625.81%
▷ Public methods18886.64%
▷ Protected methods167.37%
▷ Private methods135.99%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin