83% peachpay-for-woocommerce

Code Review | Payments and Checkout Plugin for WooCommerce: Stripe, PayPal, Square, Authorize.net

WordPress plugin Payments and Checkout Plugin for WooCommerce: Stripe, PayPal, Square, Authorize.net scored83%from 54 tests.

About plugin

  • Plugin page: peachpay-for-wooc...
  • Plugin version: 1.99.9
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Aug 12, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 297
  • Update frequency: every 4.1 days
  • Top authors: peachpay (100%)

Code review

54 tests

User reviews

27 reviews

Install metrics

700+ active /119,698 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▲2.17ms] Passed 4 tests

This is a short check of server-side resources used by Payments and Checkout Plugin for WooCommerce: Stripe, PayPal, Square, Authorize.net
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.95 ▲0.4841.88 ▲5.08
Dashboard /wp-admin3.77 ▲0.4649.05 ▲0.60
Posts /wp-admin/edit.php3.82 ▲0.4650.65 ▲0.08
Add New Post /wp-admin/post-new.php6.29 ▲0.4093.57 ▲4.69
Media Library /wp-admin/upload.php3.63 ▲0.4037.94 ▲3.32

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 636 new files
Database: no new tables, 30 new options
New WordPress options
peachpay_migrated_wc_country_locale
peachpay_stripe_gateway_migration
peachpay_express_checkout_window
peachpay_migrated_quantity_changer_option
widget_theysaidso_widget
widget_recent-comments
peachpay_account_data_admin_settings
peachpay_express_checkout_product_recommendations
peachpay_migrate_button_defaults_completed
peachpay_button_options
...

Browser metrics Passed 4 tests

A check of browser resources used by Payments and Checkout Plugin for WooCommerce: Stripe, PayPal, Square, Authorize.net
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3714.34 ▼0.011.90 ▲0.2936.70 ▼8.48
Dashboard /wp-admin2,204 ▲235.60 ▼0.0790.57 ▼24.1938.17 ▼5.65
Posts /wp-admin/edit.php2,110 ▲132.00 ▲0.0039.74 ▲4.4837.18 ▲4.16
Add New Post /wp-admin/post-new.php1,535 ▲623.28 ▲0.12606.13 ▼38.8948.86 ▼3.01
Media Library /wp-admin/upload.php1,403 ▼04.16 ▼0.0397.65 ▲1.1541.89 ▼4.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 30 options in the database
    • peachpay_flip_cross_sell_option
    • peachpay_square_gateway_migration
    • widget_recent-posts
    • peachpay_express_checkout_branding
    • peachpay_express_checkout_window
    • peachpay_express_checkout_product_recommendations
    • peachpay_migrated_linked_products_option
    • peachpay_migrated_address_autocomplete
    • peachpay_flip_upsell_option
    • db_upgraded
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/peachpay-for-woocommerce/core/modules/currency-switcher/util/peachpay-currency-arrays.php:15
    • > PHP Warning
      Use of undefined constant PEACHPAY_ABSPATH - assumed 'PEACHPAY_ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/peachpay-for-woocommerce/core/modules/currency-switcher/util/peachpay-currency-arrays.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/peachpay-for-woocommerce/core/payments/payment.php:54
    • > PHP Fatal error
      Uncaught Error: Call to undefined function peachpay_get_settings_option() in wp-content/plugins/peachpay-for-woocommerce/core/modules/express-checkout/templates/html-express-checkout.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/peachpay-for-woocommerce/core/modules/one-click-upsell/assets/class-peachpay-ajax-product-search.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

peachpay-for-woocommerce/peachpay.php 77% from 13 tests

The main PHP file in "Payments and Checkout Plugin for WooCommerce: Stripe, PayPal, Square, Authorize.net" ver. 1.99.9 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: Please rename the main PHP file in this plugin to the plugin slug ("peachpay-for-woocommerce.php" instead of "peachpay.php")
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.8" instead of "5.0")
  • Plugin Name: Keep the plugin name shorter than 70 characters (currently 83 characters long)

Code Analysis 97% from 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 detected94,227 lines of code in 570 files:
LanguageFilesBlank linesComment linesLines of code
PO File2527,600055,350
PHP2564,8319,74330,017
JavaScript276002223,790
CSS18564493,155
SVG242221,708
HTML2380207

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please tend to the following items
  • Method cyclomatic complexity should be reduced to less than 100 (currently 101)
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity13.46
▷ Minimum class complexity1.00
▷ Maximum class complexity158.00
Average method complexity2.86
▷ Minimum method complexity1.00
▷ Maximum method complexity101.00
Code structure
Namespaces1
Interfaces0
Traits11
Classes101
▷ Abstract classes87.92%
▷ Concrete classes9392.08%
▷ Final classes3537.63%
Methods768
▷ Static methods22929.82%
▷ Public methods57274.48%
▷ Protected methods10613.80%
▷ Private methods9011.72%
Functions660
▷ Named functions61292.73%
▷ Anonymous functions487.27%
Constants27
▷ Global constants1866.67%
▷ Class constants933.33%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/peachpay-full-orange.png19.97KB8.38KB▼ 58.04%
public/img/marks/authnet.png14.05KB6.21KB▼ 55.77%
core/payments/square/admin/assets/square-logo.png19.26KB8.00KB▼ 58.47%
public/dist/img/d067b36f63345d495b52-apple-pay-button.png3.07KB2.98KB▼ 3.12%
core/modules/recommended-products/public/owl-carousel/grabbing.png0.11KB0.14KB0.00%