78% add-stripe-payments-for-contact-form-7

Code Review | Add Stripe Payments for Contact Form 7

WordPress plugin Add Stripe Payments for Contact Form 7 scored 78% from 54 tests.

About plugin

  • Plugin page: add-stripe-paymen...
  • Plugin version: 2.0.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.8
  • WordPress version: 5.9.2
  • First release: Aug 31, 2020
  • Latest release: Feb 22, 2022
  • Number of updates: 40
  • Update frequency: every 13.7 days
  • Top authors: performatechnologies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 441 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼323.23ms] Passed 4 tests

A check of server-side resources used by Add Stripe Payments for Contact Form 7
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0151.26 ▼1.05
Dashboard /wp-admin3.41 ▲0.0030.68 ▼3.13
Posts /wp-admin/edit.php3.64 ▲0.00107.05 ▲67.12
Add New Post /wp-admin/post-new.php6.88 ▼0.0996.64 ▼1,287.65
Media Library /wp-admin/upload.php3.30 ▲0.0025.11 ▼1.09

Server storage [IO: ▲1.19MB] [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: 194 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Add Stripe Payments for Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,774 ▲2016.04 ▲0.945.68 ▼0.532.04 ▼0.61
Dashboard /wp-admin2,895 ▲386.13 ▼0.05117.45 ▼3.12169.83 ▲12.64
Posts /wp-admin/edit.php2,691 ▲73.22 ▲0.1764.75 ▼29.42146.74 ▼6.09
Add New Post /wp-admin/post-new.php1,696 ▼5621.79 ▲0.18456.19 ▼10.03183.08 ▲22.87
Media Library /wp-admin/upload.php1,698 ▲35.48 ▼0.01149.97 ▼2.84202.06 ▲10.64

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/add-stripe-payments-for-contact-form-7/admin/partials/sp4cf7-admin-transaction-details.php
    • > /wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/build.php
    • > /wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/update_certs.php
  • 117× 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/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Plan.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/UsageRecordSummary.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/LoginLink.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Account.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/BillingPortal/Session.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Exception/PermissionException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Exception/ApiConnectionException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Issuing/Authorization.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\OAuth\\OAuthErrorException' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Exception/OAuth/UnsupportedGrantTypeException.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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 your attention:
  • Tags: Too many tags (15 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

add-stripe-payments-for-contact-form-7/add-stripe-payments-for-contact-form-7.php 92% from 13 tests

Analyzing the main PHP file in "Add Stripe Payments for Contact Form 7" version 2.0.3
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/data/ca-certificates.crt
14,057 lines of code in 181 files:
LanguageFilesBlank linesComment linesLines of code
PHP1541,5505,0536,564
JavaScript91,3865035,367
CSS7153371,116
Markdown36110897
JSON10048
XML10031
make19027
SVG4004
YAML1003

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity4.13
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces16
Interfaces5
Traits7
Classes129
▷ Abstract classes86.20%
▷ Concrete classes12193.80%
▷ Final classes00.00%
Methods400
▷ Static methods15438.50%
▷ Public methods34486.00%
▷ Protected methods153.75%
▷ Private methods4110.25%
Functions20
▷ Named functions735.00%
▷ Anonymous functions1365.00%
Constants649
▷ Global constants111.69%
▷ Class constants63898.31%
▷ Public constants638100.00%

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
There were not PNG files found in your plugin