83% express-checkout-paypal-payment-gateway-for-woocommerce

Code Review | Payment Gateway Plugin for PayPal WooCommerce

WordPress plugin Payment Gateway Plugin for PayPal WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: express-checkout-...
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Oct 12, 2016
  • Latest release: Oct 19, 2023
  • Number of updates: 105
  • Update frequency: every 24.4 days
  • Top authors: webtoffee (66.67%)mujeebur (13.33%)extensionhawk (12.38%)xadapter (10.48%)

Code review

54 tests

User reviews

76 reviews

Install metrics

10,000+ active /485,041 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.01MB] [CPU: ▼6.03ms] Passed 4 tests

An overview of server-side resources used by Payment Gateway Plugin for PayPal WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.65 ▼5.16
Dashboard /wp-admin3.31 ▼0.0450.43 ▼16.20
Posts /wp-admin/edit.php3.36 ▲0.0048.20 ▲3.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.78 ▲0.12
Media Library /wp-admin/upload.php3.23 ▲0.0033.82 ▼2.88

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 46 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Payment Gateway Plugin for PayPal WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.16 ▼0.571.89 ▲0.1042.32 ▼1.13
Dashboard /wp-admin2,195 ▲185.80 ▲0.1593.62 ▼7.5941.61 ▼1.45
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0534.48 ▼0.4235.82 ▼1.79
Add New Post /wp-admin/post-new.php1,526 ▼223.64 ▲0.87643.49 ▼15.6751.48 ▼7.22
Media Library /wp-admin/upload.php1,400 ▼34.17 ▼0.0194.60 ▼17.0841.16 ▼7.54

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

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
Even though everything seems fine, this is not 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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/express-checkout-paypal-payment-gateway-for-woocommerce/includes/market.php:39

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
10 plugin tags: debit card, paypal checkout, payment plugin, cart page checkout, woocommerce...

express-checkout-paypal-payment-gateway-for-woocommerce/express-checkout-paypal-payment-gateway-for-woocommerce.php 85% from 13 tests

The main file in "Payment Gateway Plugin for PayPal WooCommerce" v. 1.8.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)
  • Requires at least: Required version must match the one declared in readme.txt ("5.6" instead of "3.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin7,573 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP137914125,127
PO File46056741,908
SVG1200228
JavaScript3347190
CSS220120

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 260)
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity100.44
▷ Minimum class complexity1.00
▷ Maximum class complexity542.00
Average method complexity9.61
▷ Minimum method complexity1.00
▷ Maximum method complexity260.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods104
▷ Static methods54.81%
▷ Public methods10096.15%
▷ Protected methods10.96%
▷ Private methods32.88%
Functions15
▷ Named functions1386.67%
▷ Anonymous functions213.33%
Constants6
▷ Global constants583.33%
▷ Class constants116.67%
▷ Public constants1100.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.18MB with 0.08MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/credit_button_preview.png94.74KB50.99KB▼ 46.17%
assets/img/express_button_preview.png88.61KB45.22KB▼ 48.97%
assets/img/webtoffee-logo_small.png4.04KB2.85KB▼ 29.40%