74% gravity-forms-stripe

Code Review | Gravity Forms + Stripe

WordPress plugin Gravity Forms + Stripe scored74%from 54 tests.

About plugin

  • Plugin page: gravity-forms-stripe
  • Plugin version: 1.9.2.14
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.5
  • WordPress version: 6.3.1
  • First release: Apr 4, 2012
  • Latest release: Nov 19, 2020
  • Number of updates: 112
  • Update frequency: every 28.2 days
  • Top authors: naomicbush (100%)

Code review

54 tests

User reviews

54 reviews

Install metrics

1,000+ active /71,523 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.01MB] [CPU: ▼7.22ms] Passed 4 tests

Server-side resources used by Gravity Forms + Stripe
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.75 ▲5.42
Dashboard /wp-admin3.31 ▼0.0445.12 ▼12.82
Posts /wp-admin/edit.php3.36 ▲0.0044.10 ▼3.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.26 ▼14.40
Media Library /wp-admin/upload.php3.23 ▲0.0035.74 ▲2.17

Server storage [IO: ▲1.41MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Gravity Forms + Stripe
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.13 ▼0.431.84 ▲0.3343.83 ▼0.32
Dashboard /wp-admin2,195 ▲245.64 ▲0.0697.22 ▲11.5241.15 ▼2.22
Posts /wp-admin/edit.php2,100 ▲32.01 ▲0.0433.40 ▼2.3534.22 ▼0.44
Add New Post /wp-admin/post-new.php1,526 ▼223.64 ▲0.51691.95 ▲18.1658.82 ▲8.55
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.0195.82 ▼4.0243.78 ▲0.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 111× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/Recipient.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/Terminal/Location.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\SingletonApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/Balance.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/SubscriptionSchedule.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/Checkout/Session.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/Exception/OAuth/UnsupportedGrantTypeException.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\StripeObject' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/OrderItem.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/InvoiceLineItem.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gravity-forms-stripe/includes/views/field-setting-card_funding_types.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'PPP\\Stripe\\ApiResource' not found in wp-content/plugins/gravity-forms-stripe/includes/api/stripe-php/lib/OrderReturn.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 18 tag instead of maximum 10
You can take inspiration from this readme.txt

gravity-forms-stripe/gravity-forms-stripe.php Passed 13 tests

Analyzing the main PHP file in "Gravity Forms + Stripe" version 1.9.2.14
96 characters long description:
Use Stripe to process credit card payments on your site, easily and securely, with Gravity Forms

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
These items require your attention
  • 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/gravity-forms-stripe/includes/api/stripe-php/data/ca-certificates.crt
10,177 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP1401,8745,0878,838
JavaScript1218415579
SVG200531
CSS25414229

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity6.43
▷ Minimum class complexity1.00
▷ Maximum class complexity341.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces12
Interfaces5
Traits7
Classes118
▷ Abstract classes86.78%
▷ Concrete classes11093.22%
▷ Final classes00.00%
Methods458
▷ Static methods20644.98%
▷ Public methods38584.06%
▷ Protected methods153.28%
▷ Private methods5812.66%
Functions12
▷ Named functions866.67%
▷ Anonymous functions433.33%
Constants592
▷ Global constants61.01%
▷ Class constants58698.99%
▷ Public constants586100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/api/stripe-php/data/test.png0.09KB0.09KB0.00%