72% accept-stripe-payments-using-contact-form-7

Code Review | Accept Stripe Payments Using Contact Form 7

WordPress plugin Accept Stripe Payments Using Contact Form 7 scored 72% from 54 tests.

About plugin

  • Plugin page: accept-stripe-pay...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 5.8.1
  • First release: Nov 3, 2020
  • Latest release: Apr 12, 2021
  • Number of updates: 15
  • Update frequency: every 10.7 days
  • Top authors: zealopensource (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 481 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
This plugin's installer ran successfully

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

This is a short check of server-side resources used by Accept Stripe Payments Using Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0031.24 ▲1.53
Dashboard /wp-admin3.07 ▼0.0041.16 ▼0.50
Posts /wp-admin/edit.php3.12 ▲0.0031.29 ▼0.76
Add New Post /wp-admin/post-new.php5.43 ▼0.0272.23 ▼580.82
Media Library /wp-admin/upload.php3.01 ▲0.0026.13 ▲0.92
Stripe Add-on /wp-admin/edit.php?post_type=cf7sa_data2.8316.93

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 157 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Accept Stripe Payments Using Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,666 ▲1515.91 ▲0.735.13 ▼1.1873.87 ▼3.82
Dashboard /wp-admin2,927 ▲316.00 ▼0.20112.99 ▼16.04164.73 ▼1.91
Posts /wp-admin/edit.php2,737 ▼63.22 ▼0.0162.61 ▼0.83142.46 ▲6.44
Add New Post /wp-admin/post-new.php3,743 ▲4519.15 ▲0.54418.12 ▼12.09160.74 ▼6.84
Media Library /wp-admin/upload.php1,752 ▼05.51 ▼0.04140.71 ▲4.19188.92 ▲4.96
Stripe Add-on /wp-admin/edit.php?post_type=cf7sa_data280.940.0418.33

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
Uninstall script ran successfully

Smoke tests 25% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/update_certs.php
    • > /wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/front/template/cf7sa-info.php
    • > /wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/build.php
  • 107× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Card.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Refund.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Person.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/ApplicationFee.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Issuing/Transaction.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Account.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Error\\OAuth\\OAuthBase' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Error/OAuth/InvalidGrant.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/TaxId.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/Issuing/Dispute.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/sdk/UsageRecordSummary.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/edit.php?post_type=cf7sa_data
    • > Network (severe)
    wp-admin/edit.php?post_type=cf7sa_data - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (Stripe Demo Form), #2 (Stripe Settings and Configuration), #3 (Stripe Card Field Configuration), #4 (Stripe Payments List Page), #5 (Stripe Transaction Detail Page)
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
The official readme.txt might help

accept-stripe-payments-using-contact-form-7/accept-stripe-payments-using-contact-form-7.php 92% from 13 tests

The main PHP script in "Accept Stripe Payments Using Contact Form 7" version 1.2 is automatically included on every request by WordPress
It is important 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 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • Do not distribute dangerous files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/accept-stripe-payments-using-contact-form-7/inc/lib/data/ca-certificates.crt
12,641 lines of code in 154 files:
LanguageFilesBlank linesComment linesLines of code
PHP1391,4954,2526,580
JavaScript81,4223825,487
CSS6750537
JSON10037

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.42
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces12
Interfaces2
Traits7
Classes122
▷ Abstract classes75.74%
▷ Concrete classes11594.26%
▷ Final classes00.00%
Methods393
▷ Static methods14837.66%
▷ Public methods35389.82%
▷ Protected methods133.31%
▷ Private methods276.87%
Functions7
▷ Named functions342.86%
▷ Anonymous functions457.14%
Constants514
▷ Global constants112.14%
▷ Class constants50397.86%
▷ Public constants503100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin