89% wc-advanced-paypal-payments

Code Review | Advanced PayPal Payments for WooCommerce - Compatible with most dynamic discount plugins like Conditional Discounts for WooCommerce, WooCommerce Dynamic Pricing & Discounts, Discount Rules...

WordPress plugin Advanced PayPal Payments for WooCommerce - Compatible with most dynamic discount plugins like Conditional Discounts for WooCommerce, WooCommerce Dynamic Pricing & Discounts, Discount Rules... scored89%from 54 tests.

About plugin

  • Plugin page: wc-advanced-paypa...
  • Plugin version: 3.1.9
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.4.1
  • WordPress version: 6.3.1
  • First release: Mar 10, 2023
  • Latest release: Dec 1, 2023
  • Number of updates: 307
  • Update frequency: every 0.9 days
  • Top authors: iamcalvin (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,485 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼7.83ms] Passed 4 tests

This is a short check of server-side resources used by Advanced PayPal Payments for WooCommerce - Compatible with most dynamic discount plugins like Conditional Discounts for WooCommerce, WooCommerce Dynamic Pricing & Discounts, Discount Rules...
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0941.34 ▼1.63
Dashboard /wp-admin3.39 ▲0.0444.35 ▼18.17
Posts /wp-admin/edit.php3.44 ▲0.0846.51 ▼1.70
Add New Post /wp-admin/post-new.php5.97 ▲0.0888.14 ▼9.83
Media Library /wp-admin/upload.php3.31 ▲0.0835.40 ▲5.71

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Advanced PayPal Payments for WooCommerce - Compatible with most dynamic discount plugins like Conditional Discounts for WooCommerce, WooCommerce Dynamic Pricing & Discounts, Discount Rules...
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5014.13 ▼0.541.69 ▲0.1043.66 ▼1.82
Dashboard /wp-admin2,205 ▲275.60 ▼0.0192.83 ▼23.1038.36 ▼7.63
Posts /wp-admin/edit.php2,107 ▲71.96 ▼0.0639.71 ▲0.1137.66 ▲6.79
Add New Post /wp-admin/post-new.php1,533 ▲723.00 ▼0.14656.73 ▼45.2559.48 ▲3.22
Media Library /wp-admin/upload.php1,407 ▲44.27 ▲0.0494.36 ▼1.3243.93 ▲1.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
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 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: There are too many tags (13 tag instead of maximum 10)
Please take inspiration from this readme.txt

wc-advanced-paypal-payments/advanced-paypal-payments-for-woocommerce.php 85% from 13 tests

The primary PHP file in "Advanced PayPal Payments for WooCommerce - Compatible with most dynamic discount plugins like Conditional Discounts for WooCommerce, WooCommerce Dynamic Pricing & Discounts, Discount Rules..." version 3.1.9 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("wc-advanced-paypal-payments.php" instead of "advanced-paypal-payments-for-woocommerce.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
Success! There were no dangerous files found in this plugin4,630 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP143839493,464
JavaScript46134640
PO File1166146356
CSS1238170

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for 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.34
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity59.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods106
▷ Static methods32.83%
▷ Public methods7974.53%
▷ Protected methods00.00%
▷ Private methods2725.47%
Functions21
▷ Named functions1466.67%
▷ Anonymous functions733.33%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ 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
1 PNG file occupies 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/paypal.png28.27KB13.28KB▼ 53.03%