68% wp-stripe-cart

Code Review | WP Stripe Cart

WordPress plugin WP Stripe Cart scored68%from 54 tests.

About plugin

  • Plugin page: wp-stripe-cart
  • Plugin version: 1.0.7
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.9
  • WordPress version: 6.3.1
  • First release: Dec 1, 2020
  • Latest release: Feb 5, 2022
  • Number of updates: 12
  • Update frequency: every 35.9 days
  • Top authors: metrocode (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,086 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 gracefully, with no errors

Server metrics [RAM: ▲0.54MB] [CPU: ▼4.71ms] Passed 4 tests

A check of server-side resources used by WP Stripe Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5745.35 ▲4.76
Dashboard /wp-admin3.88 ▲0.5752.56 ▲3.29
Posts /wp-admin/edit.php3.93 ▲0.5749.11 ▲3.96
Add New Post /wp-admin/post-new.php6.41 ▲0.5280.80 ▼28.15
Media Library /wp-admin/upload.php3.74 ▲0.5037.55 ▲2.08
Setting /wp-admin/admin.php?page=wp-stripe-cart-setting3.7137.50
Order /wp-admin/admin.php?page=wp-stripe-cart3.7941.00

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 1,697 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Stripe Cart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,911 ▲1,16516.17 ▲1.81173.92 ▲172.11108.19 ▲66.43
Dashboard /wp-admin2,237 ▲464.87 ▼1.03111.06 ▲7.0542.12 ▲1.31
Posts /wp-admin/edit.php2,120 ▲312.02 ▼0.0137.45 ▼1.0731.59 ▼2.41
Add New Post /wp-admin/post-new.php1,539 ▼323.40 ▲5.24621.32 ▼26.4645.60 ▼8.92
Media Library /wp-admin/upload.php1,419 ▲284.21 ▼0.04101.09 ▲5.2141.63 ▼2.35
Setting /wp-admin/admin.php?page=wp-stripe-cart-setting2,3732.2025.4339.09
Order /wp-admin/admin.php?page=wp-stripe-cart9502.0724.4428.80

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
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/build.php
    • > /wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/update_certs.php
    • > /wp-content/plugins/wp-stripe-cart/vendor/symfony/intl/Resources/bin/update-data.php
  • 257× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/Exception/AuthenticationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/Account.php:35
    • > PHP Notice
      Undefined variable: argv in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/build.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\DateFormatter\\DateFormat\\HourTransformer' not found in wp-content/plugins/wp-stripe-cart/vendor/symfony/intl/DateFormatter/DateFormat/Hour2401Transformer.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/Exception/OAuth/ExceptionInterface.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Intl\\Exception\\ExceptionInterface' not found in wp-content/plugins/wp-stripe-cart/vendor/symfony/intl/Exception/BadMethodCallException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/Radar/ValueList.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Intl\\ResourceBundle' not found in wp-content/plugins/wp-stripe-cart/vendor/symfony/intl/Scripts.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/Service/CustomerService.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/lib/SubscriptionItem.php:20

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: payment, credit card, google pay, apple pay, stripe

wp-stripe-cart/wp-stripe-cart.php Passed 13 tests

The main PHP script in "WP Stripe Cart" version 1.0.7 is automatically included on every request by WordPress
101 characters long description:
Simple cart for WordPress with STRIPE payment. Ideal for someone who wants to sell only few products.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-stripe-cart/vendor/stripe/stripe-php/data/ca-certificates.crt
351,081 lines of code in 1,569 files:
LanguageFilesBlank linesComment linesLines of code
JSON1,23710336,386
PHP3123,12512,15312,717
Markdown765701,018
PO File13401,031869
XML10031
make19027
SVG42017
Bourne Again Shell12011
JavaScript3033
CSS2002

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 247)
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.41
▷ Minimum class complexity1.00
▷ Maximum class complexity285.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity247.00
Code structure
Namespaces37
Interfaces12
Traits8
Classes276
▷ Abstract classes196.88%
▷ Concrete classes25793.12%
▷ Final classes103.89%
Methods1,093
▷ Static methods29727.17%
▷ Public methods91083.26%
▷ Protected methods948.60%
▷ Private methods898.14%
Functions42
▷ Named functions1945.24%
▷ Anonymous functions2354.76%
Constants813
▷ Global constants60.74%
▷ Class constants80799.26%
▷ Public constants80399.50%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
asset/images/noimage.png4.91KB5.25KB0.00%