68% 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 68% 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: 6.3.1
  • 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 / 793 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.47ms] Passed 4 tests

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.47 ▲0.0037.59 ▼7.86
Dashboard /wp-admin3.31 ▲0.0046.68 ▼3.46
Posts /wp-admin/edit.php3.36 ▲0.0049.28 ▼2.25
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.66 ▼12.29
Media Library /wp-admin/upload.php3.23 ▲0.0034.70 ▼0.16

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 194 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Stripe Payments for Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6114.44 ▲0.211.64 ▼0.6839.68 ▲1.05
Dashboard /wp-admin2,209 ▲215.85 ▲0.97111.59 ▼3.9243.05 ▲2.55
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0139.71 ▼0.6836.76 ▼0.12
Add New Post /wp-admin/post-new.php1,528 ▼022.87 ▲4.60581.44 ▼50.9954.49 ▲2.93
Media Library /wp-admin/upload.php1,391 ▼04.23 ▲0.03101.49 ▲4.3944.42 ▼0.33

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

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 take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/build.php
    • > /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/update_certs.php
  • 117× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > 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/InvalidRequestException.php:9
    • > 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
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/build.php on line 5
    • > 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\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/SourceTransaction.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/SetupIntent.php:62
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/EphemeralKey.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/Payout.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/Reporting/ReportType.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/add-stripe-payments-for-contact-form-7/includes/stripe/lib/SubscriptionItem.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
You can take inspiration from this readme.txt

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

The main PHP file in "Add Stripe Payments for Contact Form 7" ver. 2.0.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • You should never include executable (binary) or otherwise dangerous files in 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

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
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 are no PNG files in this plugin