84% wc-stripe-card-js

Code Review | Card Stripe js For WooCommerce

WordPress plugin Card Stripe js For WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: wc-stripe-card-js
  • Plugin version: 1.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 29, 2020
  • Latest release: May 24, 2022
  • Number of updates: 29
  • Update frequency: every 25.7 days
  • Top authors: wpexpertsio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,118 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.01MB] [CPU: ▼6.52ms] Passed 4 tests

This is a short check of server-side resources used by Card Stripe js For WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.43 ▼7.53
Dashboard /wp-admin3.32 ▼0.0253.74 ▼6.12
Posts /wp-admin/edit.php3.37 ▲0.0247.59 ▲1.69
Add New Post /wp-admin/post-new.php5.90 ▲0.0281.18 ▼14.12
Media Library /wp-admin/upload.php3.24 ▲0.0236.89 ▲3.39

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Card Stripe js For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5913.25 ▼1.111.68 ▼0.0444.14 ▲0.69
Dashboard /wp-admin2,211 ▲225.88 ▲0.94106.65 ▼19.2739.93 ▼5.98
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0740.06 ▲4.8235.62 ▲2.09
Add New Post /wp-admin/post-new.php1,519 ▼2317.84 ▼0.40679.62 ▲37.2551.94 ▼8.28
Media Library /wp-admin/upload.php1,393 ▲24.24 ▲0.0498.03 ▲5.2344.30 ▲2.16

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/wc-stripe-card-js/includes/class-wc-gateway-stripe.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: woocommerce, payment gateway, stripe, payments, payment

wc-stripe-card-js/woocommerce-gateway-stripe.php 85% from 13 tests

The primary PHP file in "Card Stripe js For WooCommerce" version 1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wc-stripe-card-js.php" instead of "woocommerce-gateway-stripe.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin2,388 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33045151,879
PHP476153509

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.00
▷ Minimum class complexity5.00
▷ Maximum class complexity38.00
Average method complexity2.76
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1235.29%
▷ Public methods3191.18%
▷ Protected methods00.00%
▷ Private methods38.82%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants571.43%
▷ Class constants228.57%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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