89% woocommerce-paypal-pro-payment-gateway

Code Review | WooCommerce PayPal Pro Payment Gateway

WordPress plugin WooCommerce PayPal Pro Payment Gateway scored89%from 54 tests.

About plugin

  • Plugin page: woocommerce-paypa...
  • Plugin version: 2.9.12
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Apr 8, 2015
  • Latest release: Oct 24, 2023
  • Number of updates: 73
  • Update frequency: every 42.8 days
  • Top authors: wp.insider (97.26%)wpecommerce (4.11%)

Code review

54 tests

User reviews

9 reviews

Install metrics

4,000+ active /113,567 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼7.55ms] Passed 4 tests

An overview of server-side resources used by WooCommerce PayPal Pro Payment Gateway
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0936.45 ▲1.12
Dashboard /wp-admin3.39 ▲0.0545.35 ▼9.23
Posts /wp-admin/edit.php3.51 ▲0.1542.32 ▼5.28
Add New Post /wp-admin/post-new.php5.97 ▲0.0977.92 ▼16.81
Media Library /wp-admin/upload.php3.32 ▲0.0936.06 ▲3.85

Server storage [IO: ▲0.06MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce PayPal Pro Payment Gateway
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲6814.39 ▲0.121.93 ▲0.3938.28 ▲0.90
Dashboard /wp-admin2,192 ▲145.50 ▼0.1078.95 ▼26.3435.14 ▼0.93
Posts /wp-admin/edit.php2,100 ▼31.97 ▲0.0334.58 ▼5.6132.27 ▼3.65
Add New Post /wp-admin/post-new.php1,529 ▲323.18 ▼0.39636.40 ▼72.2959.56 ▲0.79
Media Library /wp-admin/upload.php1,403 ▼04.27 ▲0.1195.90 ▼0.7245.19 ▲2.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests Passed 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 Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

woocommerce-paypal-pro-payment-gateway/woo-paypal-pro.php 92% from 13 tests

The main PHP file in "WooCommerce PayPal Pro Payment Gateway" ver. 2.9.12 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-paypal-pro-payment-gateway.php" instead of "woo-paypal-pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected560 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP310174471
PO File1272788
CSS1101

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.28
Average class complexity17.67
▷ Minimum class complexity4.00
▷ Maximum class complexity33.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods515.62%
▷ Public methods2578.12%
▷ Protected methods618.75%
▷ Private methods13.12%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/card-security-code-hint.png8.82KB4.09KB▼ 53.65%
images/credit-cards.png5.35KB1.83KB▼ 65.70%