68% contact-form-7-paypal-add-on

Code Review | Contact Form 7 - PayPal & Stripe Add-on

WordPress plugin Contact Form 7 - PayPal & Stripe Add-on scored68%from 54 tests.

About plugin

  • Plugin page: contact-form-7-pa...
  • Plugin version: 2.0
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 31, 2015
  • Latest release: Nov 4, 2023
  • Number of updates: 99
  • Update frequency: every 31.7 days
  • Top authors: scottpaterson (100%)

Code review

54 tests

User reviews

119 reviews

Install metrics

10,000+ active /337,030 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by Contact Form 7 - PayPal & Stripe Add-on
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.15 ▼4.67
Dashboard /wp-admin3.32 ▼0.0345.68 ▼18.21
Posts /wp-admin/edit.php3.37 ▲0.0147.20 ▲1.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.77 ▼22.39
Media Library /wp-admin/upload.php3.24 ▲0.0135.31 ▲5.07

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 256 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
cf7pp_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form 7 - PayPal & Stripe Add-on
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲2914.37 ▲0.011.85 ▼0.2445.12 ▼3.98
Dashboard /wp-admin2,206 ▲295.61 ▲0.1088.79 ▼16.4341.34 ▼1.86
Posts /wp-admin/edit.php2,115 ▲151.96 ▼0.0736.44 ▼0.0636.66 ▲1.29
Add New Post /wp-admin/post-new.php1,537 ▲223.18 ▲0.13677.77 ▼6.0851.29 ▼2.75
Media Library /wp-admin/upload.php1,414 ▲144.18 ▼0.0795.25 ▼5.0442.55 ▼2.34

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
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • cf7pp_options
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/update_certs.php
    • > /wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/build.php
  • 185× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\Exception\\ExceptionInterface' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Exception/SignatureVerificationException.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Capability.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Exception\\ApiErrorException' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Exception/UnknownApiErrorException.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Service/SkuService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/LineItem.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/CreditNoteLineItem.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Service/Radar/ValueListItemService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\Service\\AbstractService' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/Service/AccountLinkService.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/ApplicationFee.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/contact-form-7-paypal-add-on/includes/stripe_library/lib/OrderReturn.php:26

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

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed: Please take inspiration from this readme.txt

contact-form-7-paypal-add-on/paypal.php 92% from 13 tests

The main PHP file in "Contact Form 7 - PayPal & Stripe Add-on" ver. 2.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("contact-form-7-paypal-add-on.php" instead of "paypal.php")

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
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/contact-form-7-paypal-add-on/includes/stripe_library/data/ca-certificates.crt
10,869 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
PHP2332,4489,1249,270
Markdown36520986
CSS2405335
JavaScript25311165
JSON10048
XML10031
make19027
SVG1004
YAML1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity2.83
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity1.53
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces21
Interfaces6
Traits7
Classes197
▷ Abstract classes105.08%
▷ Concrete classes18794.92%
▷ Final classes00.00%
Methods665
▷ Static methods15523.31%
▷ Public methods60090.23%
▷ Protected methods284.21%
▷ Private methods375.56%
Functions97
▷ Named functions9193.81%
▷ Anonymous functions66.19%
Constants705
▷ Global constants60.85%
▷ Class constants69999.15%
▷ Public constants699100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
imgs/paypal-logo.png3.94KB2.17KB▼ 45.03%
imgs/paypal-advanced.png8.45KB3.54KB▼ 58.07%
imgs/paypal-express.png5.46KB2.48KB▼ 54.68%