83% contact-form-7-paypal-extension

Code Review | Accept PayPal Payments using Contact Form 7

WordPress plugin Accept PayPal Payments using Contact Form 7 scored 83% from 54 tests.

About plugin

  • Plugin page: contact-form-7-pa...
  • Plugin version: 3.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 17, 2015
  • Latest release: Aug 18, 2023
  • Number of updates: 147
  • Update frequency: every 20.7 days
  • Top authors: zealopensource (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

1,000+ active / 63,421 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Accept PayPal Payments using Contact Form 7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.62 ▼0.90
Dashboard /wp-admin3.31 ▲0.0044.79 ▼1.60
Posts /wp-admin/edit.php3.36 ▲0.0049.71 ▲3.87
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.68 ▼9.81
Media Library /wp-admin/upload.php3.23 ▲0.0033.28 ▼1.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 219 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Accept PayPal Payments using Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▼0.111.75 ▼0.0544.25 ▼0.22
Dashboard /wp-admin2,206 ▲185.77 ▼0.1299.42 ▼14.9941.67 ▲4.13
Posts /wp-admin/edit.php2,089 ▲32.00 ▲0.0140.11 ▲3.1235.06 ▲2.26
Add New Post /wp-admin/post-new.php1,545 ▲218.10 ▼4.66662.31 ▼2.8552.50 ▲0.51
Media Library /wp-admin/upload.php1,388 ▲34.18 ▼0.0195.00 ▼10.2442.29 ▼2.24

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% 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 50% 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
Almost there! Just fix the following items
  • 145× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Log\\LoggerInterface' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/psr/log/Psr/Log/AbstractLogger.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/InvoiceSearchResponse.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/CancelNotification.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/Capture.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/OpenIdUserinfo.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/PaymentCardToken.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Api\\BaseAddress' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/Address.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Common/PayPalResourceModel.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/NameValuePair.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'PayPal\\Common\\PayPalModel' not found in wp-content/plugins/contact-form-7-paypal-extension/inc/lib/sdk/paypal/rest-api-sdk-php/lib/PayPal/Api/RefundDetail.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt might help

contact-form-7-paypal-extension/accept-paypal-payments-using-contact-form-7.php 77% from 13 tests

The main PHP file in "Accept PayPal Payments using Contact Form 7" ver. 3.7 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: It is recommended to name the main PHP file as the plugin slug ("contact-form-7-paypal-extension.php" instead of "accept-paypal-payments-using-contact-form-7.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 184 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected14,804 lines of code in 209 files:
LanguageFilesBlank linesComment linesLines of code
PHP1943,07215,64114,108
Markdown4880351
JSON300156
JavaScript425082
XML28064
CSS27043

PHP code Passed 2 tests

Analyzing 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.13
Average class complexity3.72
▷ Minimum class complexity1.00
▷ Maximum class complexity106.00
Average method complexity1.24
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces16
Interfaces5
Traits2
Classes182
▷ Abstract classes31.65%
▷ Concrete classes17998.35%
▷ Final classes00.00%
Methods2,117
▷ Static methods733.45%
▷ Public methods2,09699.01%
▷ Protected methods40.19%
▷ Private methods170.80%
Functions14
▷ Named functions214.29%
▷ Anonymous functions1285.71%
Constants26
▷ Global constants726.92%
▷ Class constants1973.08%
▷ Public constants19100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected