78% simple-stripe-payment

Code Review | Simple Stripe Payment

WordPress plugin Simple Stripe Payment scored 78% from 54 tests.

About plugin

  • Plugin page: simple-stripe-pay...
  • Plugin version: 1.19
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.7
  • WordPress version: 5.9.2
  • First release: Jan 4, 2019
  • Latest release: Mar 7, 2021
  • Number of updates: 54
  • Update frequency: every 14.7 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,181 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼295.07ms] Passed 4 tests

Server-side resources used by Simple Stripe Payment
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.74 ▲0.2355.91 ▲8.07
Dashboard /wp-admin3.58 ▲0.1735.77 ▲2.30
Posts /wp-admin/edit.php3.80 ▲0.1636.63 ▼1.57
Add New Post /wp-admin/post-new.php7.04 ▲0.0790.24 ▼1,183.40
Media Library /wp-admin/upload.php3.45 ▲0.1626.10 ▲2.41
Simple Stripe Payment /wp-admin/options-general.php?page=simplestripepayment3.4223.85

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 268 new files
Database: no new tables, 3 new options
New WordPress options
simplestripepayment_settings
simplestripepayment_ids
widget_simplestripepaymentwidgetitem

Browser metrics Passed 4 tests

Checking browser requirements for Simple Stripe Payment
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4516.01 ▲0.326.33 ▲0.362.91 ▲0.42
Dashboard /wp-admin2,897 ▲366.13 ▼0.04114.63 ▼17.26155.43 ▼7.41
Posts /wp-admin/edit.php2,693 ▼13.23 ▼0.0061.91 ▼3.38134.77 ▼6.06
Add New Post /wp-admin/post-new.php1,802 ▲14121.94 ▲5.57450.81 ▲11.64160.09 ▲5.26
Media Library /wp-admin/upload.php1,703 ▲55.52 ▲0.00141.79 ▲0.62185.00 ▲0.75
Simple Stripe Payment /wp-admin/options-general.php?page=simplestripepayment1,7752.3853.08101.07

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/simple-stripe-payment/stripe-php-master/build.php
    • > /wp-content/plugins/simple-stripe-payment/stripe-php-master/update_certs.php
  • 210× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/Terminal/TerminalServiceFactory.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractServiceFactory' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/Sigma/SigmaServiceFactory.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Exception/OAuth/ExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/Checkout/SessionService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Event.php:53
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/SubscriptionItemService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/CountrySpecService.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Exception/SignatureVerificationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Exception/ApiConnectionException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/simple-stripe-payment/stripe-php-master/lib/Service/InvoiceItemService.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: block, shortcode, widget, stripe

simple-stripe-payment/simplestripepayment.php 92% from 13 tests

This is the main PHP file of "Simple Stripe Payment" version 1.19, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-stripe-payment.php" instead of "simplestripepayment.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please make sure to remedy the following
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/simple-stripe-payment/stripe-php-master/data/ca-certificates.crt
9,460 lines of code in 259 files:
LanguageFilesBlank linesComment linesLines of code
PHP2431,9949,2007,964
Markdown366601,019
JavaScript52052240
CSS3171108
JSON20068
XML10031
make19027
YAML1003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.07
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces23
Interfaces6
Traits7
Classes223
▷ Abstract classes114.93%
▷ Concrete classes21295.07%
▷ Final classes00.00%
Methods713
▷ Static methods15722.02%
▷ Public methods64590.46%
▷ Protected methods283.93%
▷ Private methods405.61%
Functions7
▷ Named functions00.00%
▷ Anonymous functions7100.00%
Constants709
▷ Global constants20.28%
▷ Class constants70799.72%
▷ Public constants707100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin