10% wp-stripe

Code Review | WP Stripe

WordPress plugin WP Stripe scored10%from 54 tests.

About plugin

  • Plugin page: wp-stripe
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.9
  • WordPress version: 6.3.1
  • First release: Jan 20, 2012
  • Latest release: Apr 23, 2014
  • Number of updates: 26
  • Update frequency: every 31.8 days
  • Top authors: Noel_Tock (92.31%)willmot (11.54%)

Code review

54 tests

User reviews

14 reviews

Install metrics

200+ active /23,450 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/wp-stripe/wp-stripe.php+60
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.85MB] [CPU: ▼49.45ms] Passed 4 tests

A check of server-side resources used by WP Stripe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.13 ▼1.335.14 ▼35.78
Dashboard /wp-admin2.15 ▼1.156.14 ▼41.71
Posts /wp-admin/edit.php2.15 ▼1.207.61 ▼39.31
Add New Post /wp-admin/post-new.php2.15 ▼3.737.64 ▼81.01
Media Library /wp-admin/upload.php2.15 ▼1.076.16 ▼26.10
WP Stripe /wp-admin/options-general.php?page=wp_stripe2.166.68

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 100 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Stripe
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,148 ▲40219.29 ▲4.7428.38 ▲26.6842.26 ▼0.04
Dashboard /wp-admin2,287 ▲967.26 ▲2.39136.89 ▲19.3138.15 ▼6.44
Posts /wp-admin/edit.php2,170 ▲813.79 ▲1.8088.44 ▲47.3832.73 ▼3.15
Add New Post /wp-admin/post-new.php1,535 ▲1618.29 ▼4.52627.37 ▼34.6264.90 ▲6.48
Media Library /wp-admin/upload.php1,466 ▲846.59 ▲2.38132.38 ▲11.6845.32 ▼7.10
WP Stripe /wp-admin/options-general.php?page=wp_stripe1,2815.0073.4636.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-stripe/wp-stripe.php+60
    Trying to access array offset on value of type bool
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_stripe
    • > Notice in wp-content/plugins/wp-stripe/includes/stripe-options.php+249
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/options-general.php?page=wp_stripe
    • > Warning in wp-content/plugins/wp-stripe/wp-stripe.php+103
    Use of undefined constant WP_STRIPE_KEY - assumed 'WP_STRIPE_KEY' (this will throw an Error in a future version of PHP)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp_stripe
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-stripe/stripe-php/test/Stripe.php
  • 56× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'UnitTestCase' not found in wp-content/plugins/wp-stripe/stripe-php/test/Stripe/InvalidRequestErrorTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/wp-stripe/stripe-php/lib/Stripe/Invoice.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'StripeTestCase' not found in wp-content/plugins/wp-stripe/stripe-php/test/Stripe/RecipientTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'StripeTestCase' not found in wp-content/plugins/wp-stripe/stripe-php/test/Stripe/UtilTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Util_Set' not found in wp-content/plugins/wp-stripe/stripe-php/lib/Stripe/Object.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'StripeTestCase' not found in wp-content/plugins/wp-stripe/stripe-php/test/Stripe/PlanTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'StripeTestCase' not found in wp-content/plugins/wp-stripe/stripe-php/test/Stripe/SubscriptionTest.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_ApiResource' not found in wp-content/plugins/wp-stripe/stripe-php/lib/Stripe/Plan.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-stripe/includes/stripe-cpt.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe_Error' not found in wp-content/plugins/wp-stripe/stripe-php/lib/Stripe/InvalidRequestError.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Payment Form), #2 (Payments Overview), #3 (Recent Payments Widget (largely unstyled, shows recent donations of users who opted-in))
  • Tags: There are too many tags (18 tag instead of maximum 10)
The official readme.txt might help

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

The entry point to "WP Stripe" version 1.5 is a PHP file that has certain tags in its header comment area
69 characters long description:
Integration of the payment system Stripe as an alternative to PayPal.

Code Analysis 5% from 3 tests

File types 0% from 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
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/wp-stripe/stripe-php/lib/data/ca-certificates.crt
4,142 lines of code in 76 files:
LanguageFilesBlank linesComment linesLines of code
PHP678358163,144
CSS412722872
JavaScript2381868
JSON10029
Markdown112015
YAML14014

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.16
Average class complexity3.42
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes55
▷ Abstract classes59.09%
▷ Concrete classes5090.91%
▷ Final classes00.00%
Methods209
▷ Static methods7033.49%
▷ Public methods18889.95%
▷ Protected methods136.22%
▷ Private methods83.83%
Functions47
▷ Named functions47100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/h-card.png1.04KB0.28KB▼ 73.20%
images/helper.png2.04KB1.00KB▼ 50.67%
images/h-amount.png1.17KB0.46KB▼ 61.10%
images/macFFBgHack.png0.19KB0.10KB▼ 48.98%
images/year.png1.13KB0.28KB▼ 75.39%