84% woocommerce-payments

Code Review | WooPayments - Fully Integrated Solution Built and Supported by Woo

WordPress plugin WooPayments - Fully Integrated Solution Built and Supported by Woo scored84%from 54 tests.

About plugin

  • Plugin page: woocommerce-payments
  • Plugin version: 6.8.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 7.6-6.4
  • WordPress version: 6.3.1
  • First release: Apr 8, 2020
  • Latest release: Nov 16, 2023
  • Number of updates: 147
  • Update frequency: every 9.1 days
  • Top authors: automattic (100%)

Code review

54 tests

User reviews

60 reviews

Install metrics

700,000+ active /19,145,213 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: ▲2.60MB] [CPU: ▲13.06ms] Passed 4 tests

This is a short check of server-side resources used by WooPayments - Fully Integrated Solution Built and Supported by Woo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.08 ▲2.6261.79 ▲23.60
Dashboard /wp-admin5.90 ▲2.5565.19 ▲8.44
Posts /wp-admin/edit.php6.01 ▲2.6560.87 ▲15.67
Add New Post /wp-admin/post-new.php8.76 ▲2.87103.27 ▲4.91
Media Library /wp-admin/upload.php5.82 ▲2.5958.60 ▲23.23

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,213 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
jetpack_sync_settings_disable
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
jetpack_options
widget_recent-posts
jetpack_connection_active_plugins
db_upgraded

Browser metrics Passed 4 tests

WooPayments - Fully Integrated Solution Built and Supported by Woo: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲5814.20 ▼0.081.98 ▲0.3742.81 ▲5.32
Dashboard /wp-admin2,213 ▲355.64 ▼0.0885.99 ▼13.7440.64 ▼2.06
Posts /wp-admin/edit.php2,116 ▲161.99 ▼0.0236.06 ▼3.3339.57 ▲3.93
Add New Post /wp-admin/post-new.php1,546 ▲1122.25 ▼2.70595.64 ▼49.0760.61 ▼5.62
Media Library /wp-admin/upload.php1,415 ▲154.15 ▼0.03101.25 ▼0.1746.13 ▲3.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 9 options in the database
    • db_upgraded
    • jetpack_sync_settings_disable
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • jetpack_connection_active_plugins
    • widget_recent-comments
    • jetpack_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 272× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'WCPay\\Vendor\\League\\Container\\Argument\\ArgumentResolverInterface' not found in wp-content/plugins/woocommerce-payments/lib/packages/League/Container/ReflectionContainer.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/woocommerce-payments/vendor/automattic/jetpack-sync/src/modules/class-menus.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WCPay\\Payment_Methods\\UPE_Payment_Method' not found in wp-content/plugins/woocommerce-payments/includes/payment-methods/class-sepa-payment-method.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-payments/vendor/composer/installers/src/Composer/Installers/LithiumInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WCPay\\Vendor\\League\\Container\\Argument\\ResolvableArgument' not found in wp-content/plugins/woocommerce-payments/lib/packages/League/Container/Argument/DefaultValueArgument.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-payments/vendor/composer/installers/src/Composer/Installers/ExpressionEngineInstaller.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'WCPay\\Vendor\\League\\Container\\Argument\\ResolvableArgumentInterface' not found in wp-content/plugins/woocommerce-payments/lib/packages/League/Container/Argument/ResolvableArgument.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-payments/vendor/composer/installers/src/Composer/Installers/KnownInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-payments/vendor/composer/installers/src/Composer/Installers/DokuWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WCPay\\Internal\\DependencyManagement\\AbstractServiceProvider' not found in wp-content/plugins/woocommerce-payments/src/Internal/DependencyManagement/ServiceProvider/ProxiesServiceProvider.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% 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
6 plugin tags: woocommerce payments, google pay, payment, credit card, apple pay...

woocommerce-payments/woocommerce-payments.php 92% from 13 tests

The main file in "WooPayments - Fully Integrated Solution Built and Supported by Woo" v. 6.8.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("6.0" instead of "7.6")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin124,054 lines of code in 1,122 files:
LanguageFilesBlank linesComment linesLines of code
PHP89024,44765,346103,120
Markdown712,26506,075
JavaScript477506805,804
PO File11,3052,1664,718
JSON19001,927
CSS36132351,580
SVG4900550
YAML3303118
XML35180
JSX16449
Sass26033

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity18.31
▷ Minimum class complexity1.00
▷ Maximum class complexity369.00
Average method complexity3.07
▷ Minimum method complexity1.00
▷ Maximum method complexity92.00
Code structure
Namespaces55
Interfaces23
Traits9
Classes707
▷ Abstract classes273.82%
▷ Concrete classes68096.18%
▷ Final classes40.59%
Methods6,236
▷ Static methods1,74127.92%
▷ Public methods5,18083.07%
▷ Protected methods4547.28%
▷ Private methods6029.65%
Functions350
▷ Named functions22664.57%
▷ Anonymous functions12435.43%
Constants555
▷ Global constants213.78%
▷ Class constants53496.22%
▷ Public constants534100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
15 PNG files occupy 1.24MB with 0.67MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/woocommerce/subscriptions-core/assets/images/subscriptions-importer-exporter.png89.65KB31.87KB▼ 64.45%
vendor/woocommerce/subscriptions-core/assets/images/view-subscription.png249.57KB75.74KB▼ 69.65%
vendor/woocommerce/subscriptions-core/assets/images/add-edit-subscription-screen.png39.26KB34.69KB▼ 11.63%
vendor/woocommerce/subscriptions-core/assets/images/subscription-reports.png132.87KB42.71KB▼ 67.85%
vendor/woocommerce/subscriptions-core/assets/images/checkout-recurring-totals.png66.92KB29.36KB▼ 56.12%