68% gf-stripe-extensions

Code Review | GF Stripe Extensions

WordPress plugin GF Stripe Extensions scored68%from 54 tests.

About plugin

  • Plugin page: gf-stripe-extensions
  • Plugin version: 2.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Feb 27, 2019
  • Latest release: Nov 28, 2023
  • Number of updates: 168
  • Update frequency: every 10.3 days
  • Top authors: jamesdlow (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /7,781 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.05MB] [CPU: ▼14.09ms] Passed 4 tests

An overview of server-side resources used by GF Stripe Extensions
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6545.57 ▲2.39
Dashboard /wp-admin3.95 ▲0.6150.75 ▼15.81
Posts /wp-admin/edit.php4.01 ▲0.6553.15 ▲6.02
Add New Post /wp-admin/post-new.php3.77 ▼2.1142.64 ▼45.90
Media Library /wp-admin/upload.php3.88 ▲0.6540.15 ▲2.97
Stripe Extensions /wp-admin/options-general.php?page=stripe-extensions3.9150.78

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 155 new files
Database: no new tables, 9 new options
New WordPress options
stripe-extensions-analytics-key
gfse_version
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
stripe-extensions-analytics-year
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for GF Stripe Extensions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,879 ▲9214.93 ▲0.6025.03 ▲22.7644.82 ▲0.44
Dashboard /wp-admin2,199 ▲225.63 ▼0.0492.52 ▼6.2642.52 ▼2.14
Posts /wp-admin/edit.php2,104 ▲11.94 ▲0.0141.60 ▲3.8936.12 ▲4.13
Add New Post /wp-admin/post-new.php1,529 ▲323.17 ▼0.47591.28 ▼101.0656.82 ▲2.06
Media Library /wp-admin/upload.php1,398 ▼24.17 ▼0.0897.42 ▼17.8841.87 ▼7.38
Stripe Extensions /wp-admin/options-general.php?page=stripe-extensions2,1286.51139.2867.49

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-posts
    • gfse_version
    • theysaidso_admin_options
    • db_upgraded
    • stripe-extensions-analytics-year
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • stripe-extensions-analytics-key

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)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gf-stripe-extensions/inc/stripe/stripe-php/build.php
    • > /wp-content/plugins/gf-stripe-extensions/inc/stripe/stripe-php/update_certs.php
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-stripe-extensions/gf-stripe-create-entries.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-stripe-extensions/gf-stripe-apple-pay.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'GFStripeExtensions' not found in wp-content/plugins/gf-stripe-extensions/gf-stripe-payment-recovery.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-stripe-extensions/gf-stripe-limit-payments.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-stripe-extensions/gf-stripe-limit-payments.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gf-stripe-extensions/gf-stripe-analytics.php:142

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
The official readme.txt is a good inspiration

gf-stripe-extensions/gf-stripe-extensions.php Passed 13 tests

The main PHP script in "GF Stripe Extensions" version 2.6.2 is automatically included on every request by WordPress
109 characters long description:
Add Stripe functions to Wordpress (Apple Pay) including limit payments and payment recovery to Gravity Forms.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
It is important to 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/gf-stripe-extensions/inc/stripe/stripe-php/data/ca-certificates.crt
11,274 lines of code in 149 files:
LanguageFilesBlank linesComment linesLines of code
PHP1431,2433,89110,397
Markdown22880650
JavaScript237130
JSON20097

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.37
▷ Minimum class complexity1.00
▷ Maximum class complexity305.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces13
Interfaces2
Traits7
Classes130
▷ Abstract classes75.38%
▷ Concrete classes12394.62%
▷ Final classes00.00%
Methods614
▷ Static methods37861.56%
▷ Public methods57193.00%
▷ Protected methods132.12%
▷ Private methods304.89%
Functions7
▷ Named functions228.57%
▷ Anonymous functions571.43%
Constants490
▷ Global constants30.61%
▷ Class constants48799.39%
▷ Public constants487100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/6by4.png0.16KB0.09KB▼ 42.86%