68% wordpress-simple-paypal-shopping-cart

Code Review | WordPress Simple Shopping Cart

WordPress plugin WordPress Simple Shopping Cart scored68%from 54 tests.

About plugin

  • Plugin page: wordpress-simple-...
  • Plugin version: 4.7.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.4
  • WordPress version: 6.3.1
  • First release: Feb 17, 2009
  • Latest release: Nov 10, 2023
  • Number of updates: 220
  • Update frequency: every 24.5 days
  • Top authors: mra13 (99.09%)wptipsntricks (1.36%)

Code review

54 tests

User reviews

194 reviews

Install metrics

20,000+ active /1,723,889 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▲2.60ms] Passed 4 tests

Server-side resources used by WordPress Simple Shopping Cart
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.15 ▲0.6846.69 ▲5.16
Dashboard /wp-admin4.01 ▲0.7055.52 ▲8.12
Posts /wp-admin/edit.php4.06 ▲0.7051.10 ▲2.72
Add New Post /wp-admin/post-new.php6.55 ▲0.6692.79 ▼5.59
Media Library /wp-admin/upload.php3.87 ▲0.6446.45 ▲13.88
Add-ons /wp-admin/admin.php?page=wspsc-addons3.8333.68
Settings /wp-admin/admin.php?page=wspsc-menu-main4.0741.02
Add New /wp-admin/post-new.php?post_type=wpsc_cart_orders3.9646.15
Cart Orders /wp-admin/edit.php?post_type=wpsc_cart_orders3.9739.69
WP Shopping Cart /wp-admin/options-general.php?page=wordpress-paypal-shopping-cart3.4321.63
Tools /wp-admin/admin.php?page=wspsc-tools3.8336.94
Coupons /wp-admin/admin.php?page=wspsc-discounts3.8334.97

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 384 new files
Database: no new tables, 19 new options
New WordPress options
wspsc_plugin_user_feedback_notice
wpspc_buyer_email_subj
widget_recent-comments
wpspc_send_buyer_email
wspsc_private_key_one
wpspc_notify_email_address
db_upgraded
wpspc_buyer_email_body
wp_cart_title
widget_recent-posts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Simple Shopping Cart
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲18013.40 ▼0.628.23 ▲6.4141.17 ▼2.46
Dashboard /wp-admin2,265 ▲885.60 ▲0.0389.43 ▼4.4742.19 ▲2.36
Posts /wp-admin/edit.php2,167 ▲671.96 ▲0.0234.52 ▼2.6535.76 ▼0.46
Add New Post /wp-admin/post-new.php6,224 ▲4,69822.73 ▼0.68933.61 ▲254.2537.48 ▼13.93
Media Library /wp-admin/upload.php1,464 ▲674.20 ▲0.03111.41 ▲10.4449.60 ▲8.19
Add-ons /wp-admin/admin.php?page=wspsc-addons8912.0023.8532.69
Settings /wp-admin/admin.php?page=wspsc-menu-main1,5202.0022.5739.04
Add New /wp-admin/post-new.php?post_type=wpsc_cart_orders1,6202.5349.8259.43
Cart Orders /wp-admin/edit.php?post_type=wpsc_cart_orders1,1801.9129.9830.00
WP Shopping Cart /wp-admin/options-general.php?page=wordpress-paypal-shopping-cart1,5232.0022.3837.38
Tools /wp-admin/admin.php?page=wspsc-tools8991.9922.2523.90
Coupons /wp-admin/admin.php?page=wspsc-discounts1,0061.8435.1326.35

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
  • Zombie WordPress options detected upon uninstall: 19 options
    • wpspc_seller_email_body
    • wspsc_plugin_user_feedback_notice
    • cart_return_from_paypal_url
    • can_compress_scripts
    • theysaidso_admin_options
    • wspsc_plugin_activated_time
    • wpspc_buyer_email_subj
    • widget_theysaidso_widget
    • wpspc_seller_email_subj
    • widget_recent-posts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/gallery-wp-cart.php
    • > /wp-content/plugins/wordpress-simple-paypal-shopping-cart/gallery-wp-cart.php
  • 253× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/SourceTransaction.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/FinancialConnections/Session.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/Service/SetupIntentService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/AccountLink.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\InvalidRequestException' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/Exception/RateLimitException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/BillingPortal/Configuration.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/Service/EphemeralKeyService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/Refund.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/LineItem.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/lib/TaxId.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed: Please take inspiration from this readme.txt

wordpress-simple-paypal-shopping-cart/wp_shopping_cart.php 92% from 13 tests

The main PHP script in "WordPress Simple Shopping Cart" version 4.7.1 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wordpress-simple-paypal-shopping-cart.php" instead of "wp_shopping_cart.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wordpress-simple-paypal-shopping-cart/lib/stripe-gateway/data/ca-certificates.crt
20,633 lines of code in 333 files:
LanguageFilesBlank linesComment linesLines of code
PHP3083,22312,18714,105
PO File121,5881,7664,368
Markdown278301,538
JavaScript76063359
CSS31215215
JSON10048

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.17
▷ Minimum class complexity1.00
▷ Maximum class complexity74.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces36
Interfaces9
Traits9
Classes273
▷ Abstract classes103.66%
▷ Concrete classes26396.34%
▷ Final classes00.00%
Methods963
▷ Static methods18619.31%
▷ Public methods87590.86%
▷ Protected methods444.57%
▷ Private methods444.57%
Functions103
▷ Named functions8885.44%
▷ Anonymous functions1514.56%
Constants1,061
▷ Global constants131.23%
▷ Class constants1,04898.77%
▷ Public constants1,048100.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
21 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/paypal_checkout_DE.png8.32KB3.68KB▼ 55.81%
assets/images/ui-icons_555555_256x240.png6.82KB4.17KB▼ 38.82%
assets/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
images/cart-orders-icon.png0.32KB0.33KB0.00%
includes/admin/images/wp-affiliate-plugin-integration.png3.73KB2.75KB▼ 26.20%