73% stripe-woocommerce-addon

Code Review | Stripe Payment Gateway WooCommerce Addon

WordPress plugin Stripe Payment Gateway WooCommerce Addon scored73%from 54 tests.

About plugin

  • Plugin page: stripe-woocommerc...
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 12, 2015
  • Latest release: Jul 22, 2017
  • Number of updates: 192
  • Update frequency: every 4.7 days
  • Top authors: nazrulhassanmca (100%)

Code review

54 tests

User reviews

49 reviews

Install metrics

1,000+ active /49,628 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼9.79ms] Passed 4 tests

A check of server-side resources used by Stripe Payment Gateway WooCommerce Addon
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2639.22 ▼10.80
Dashboard /wp-admin3.57 ▲0.2247.31 ▼21.74
Posts /wp-admin/edit.php3.62 ▲0.2646.38 ▼0.18
Add New Post /wp-admin/post-new.php6.09 ▲0.2088.74 ▼3.21
Media Library /wp-admin/upload.php3.43 ▲0.2033.30 ▼3.40

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Stripe Payment Gateway WooCommerce Addon
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.421.64 ▼0.1840.97 ▼2.50
Dashboard /wp-admin2,209 ▲215.91 ▲1.00102.00 ▼19.7340.75 ▼3.43
Posts /wp-admin/edit.php2,089 ▲32.00 ▼0.0034.26 ▼2.7034.44 ▼0.94
Add New Post /wp-admin/post-new.php1,533 ▲1423.49 ▲0.33651.10 ▼40.6154.12 ▼5.18
Media Library /wp-admin/upload.php1,391 ▲34.22 ▲0.0099.30 ▼1.7645.11 ▼0.12

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 83× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/RefundTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/ApplicationFeeRefundTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/DisputeTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/ThreeDSecureTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/RecipientTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/TransferTest.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/stripe-woocommerce-addon/lib/lib/ApplicationFee.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/stripe-woocommerce-addon/lib/lib/Order.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/stripe-woocommerce-addon/lib/lib/ExternalAccount.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\TestCase' not found in wp-content/plugins/stripe-woocommerce-addon/lib/tests/CustomerTest.php:5

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 90% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
  • Tested up to: Invalid version format
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

stripe-woocommerce-addon/stripe-woocommerce-addon.php Passed 13 tests

The main PHP script in "Stripe Payment Gateway WooCommerce Addon" version 1.0.8 is automatically included on every request by WordPress
105 characters long description:
This plugin adds a payment option in WooCommerce for customers to pay with their Credit Cards Via Stripe.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Almost there! Just fix the following issues
  • Do not include executable or dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/stripe-woocommerce-addon/lib/data/ca-certificates.crt
5,341 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP961,0651,6155,235
JavaScript123288
YAML23018

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.71
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity1.54
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes90
▷ Abstract classes55.56%
▷ Concrete classes8594.44%
▷ Final classes00.00%
Methods430
▷ Static methods13130.47%
▷ Public methods39090.70%
▷ Protected methods225.12%
▷ Private methods184.19%
Functions10
▷ Named functions770.00%
▷ Anonymous functions330.00%
Constants14
▷ Global constants535.71%
▷ Class constants964.29%
▷ Public constants9100.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
10 PNG files occupy 0.07MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/maestro.png9.75KB3.88KB▼ 60.26%
images/discover.png5.78KB3.07KB▼ 46.82%
images/stripe.png7.23KB3.10KB▼ 57.09%
images/visa.png6.19KB3.09KB▼ 50.13%
images/dinersclub.png6.35KB3.25KB▼ 48.74%