83% woo-paypalplus

Code Review | PayPal Plus for WooCommerce

WordPress plugin PayPal Plus for WooCommerce scored 83% from 54 tests.

About plugin

  • Plugin page: woo-paypalplus
  • Plugin version: 2.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.4-5.8
  • WordPress version: 5.9.2
  • First release: May 10, 2017
  • Latest release: Jul 23, 2021
  • Number of updates: 110
  • Update frequency: every 14.2 days
  • Top authors: wido (39.09%)carmen222 (19.09%)nullbyte (17.27%)cocreation (12.73%)vanvox (12.73%)

Code review

54 tests

User reviews

49 reviews

Install metrics

30,000+ active / 340,626 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼313.32ms] Passed 4 tests

This is a short check of server-side resources used by PayPal Plus for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.2960.38 ▲8.34
Dashboard /wp-admin3.64 ▲0.2335.00 ▼1.70
Posts /wp-admin/edit.php3.87 ▲0.2341.18 ▲4.48
Add New Post /wp-admin/post-new.php7.17 ▲0.2097.19 ▼1,254.59
Media Library /wp-admin/upload.php3.58 ▲0.2924.33 ▼1.47

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 379 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for PayPal Plus for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,801 ▲5915.70 ▲0.045.76 ▼0.412.42 ▲0.36
Dashboard /wp-admin2,898 ▲376.08 ▼0.10125.69 ▼14.92167.85 ▲4.53
Posts /wp-admin/edit.php2,695 ▲73.24 ▲0.0164.30 ▼0.21156.19 ▼74.95
Add New Post /wp-admin/post-new.php1,777 ▲7921.64 ▼0.02453.28 ▲25.87187.41 ▼11.56
Media Library /wp-admin/upload.php1,704 ▲125.49 ▼0.04177.98 ▲28.33198.75 ▼46.41

Uninstaller [IO: ▲1.38MB] [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 has failed uninstalling correctly, leaving 379 files (1.38MB) in the plugin directory
    • (new file) lib/PayPal/Api/AgreementTransactions.php
    • (new file) lib/PayPal/Api/Amount.php
    • (new file) LICENSE
    • (new file) lib/PayPal/Api/Agreement.php
    • (new file) lib/PayPal/Api/AgreementTransaction.php
    • (new file) lib/PayPal/Api/AgreementStateDescriptor.php
    • (new file) lib/PayPal/Api/Authorization.php
    • (new file) lib/PayPal/Api/AgreementDetails.php
    • (new file) lib/PayPal/Api/Address.php
    • (new file) lib/PayPal/Api/AlternatePayment.php
    • ...

Smoke tests 75% 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 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
Please fix the following items
  • 219× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/Tax.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'WCPayPalPlus\\Service\\ServiceProvider' not found in wp-content/plugins/woo-paypalplus/src/Request/ServiceProvider.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/PayoutBatchHeader.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/Error.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'WCPayPalPlus\\Service\\ServiceProvider' not found in wp-content/plugins/woo-paypalplus/src/Utils/ServiceProvider.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/BankAccountsList.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalResourceModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/VerifyWebhookSignature.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'Inpsyde\\Lib\\PayPal\\Log\\PayPalLogFactory' not found in wp-content/plugins/woo-paypalplus/src/Log/PayPalSdkLogFactory.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Inpsyde\\Lib\\PayPal\\Common\\PayPalModel' not found in wp-content/plugins/woo-paypalplus/lib/PayPal/Api/OpenIdError.php:15
    • > PHP Fatal error
      Trait 'WCPayPalPlus\\Utils\\PriceFormatterTrait' not found in wp-content/plugins/woo-paypalplus/src/Refund/RefundData.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: woocommerce, zahlungsarten, paypal plus, paypal, rechnung...

woo-paypalplus/paypalplus-woocommerce.php 77% from 13 tests

The entry point to "PayPal Plus for WooCommerce" version 2.2.1 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages/")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.4" instead of "3.6.4")
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-paypalplus.php" instead of "paypalplus-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected23,158 lines of code in 374 files:
LanguageFilesBlank linesComment linesLines of code
PHP3634,78620,70023,081
JSON10054
Markdown15014
JavaScript7007
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity3.48
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity1.32
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces48
Interfaces22
Traits13
Classes319
▷ Abstract classes30.94%
▷ Concrete classes31699.06%
▷ Final classes144.43%
Methods2,724
▷ Static methods973.56%
▷ Public methods2,55993.94%
▷ Protected methods341.25%
▷ Private methods1314.81%
Functions116
▷ Named functions86.90%
▷ Anonymous functions10893.10%
Constants192
▷ Global constants00.00%
▷ Class constants192100.00%
▷ Public constants192100.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