84% woo-paypal-pro

Code Review | Payment Gateway for PayPal Pro on WooCommerce

WordPress plugin Payment Gateway for PayPal Pro on WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: woo-paypal-pro
  • Plugin version: 6.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-6.0.2
  • WordPress version: 6.3.1
  • First release: Jul 21, 2016
  • Latest release: Sep 8, 2022
  • Number of updates: 29
  • Update frequency: every 77.2 days
  • Top authors: easypayment (75.86%)wpremiumdev (27.59%)

Code review

54 tests

User reviews

6 reviews

Install metrics

300+ active /13,272 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.14ms] Passed 4 tests

This is a short check of server-side resources used by Payment Gateway for PayPal Pro on WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.96 ▲3.92
Dashboard /wp-admin3.32 ▼0.0341.60 ▼14.50
Posts /wp-admin/edit.php3.37 ▲0.0142.23 ▼3.17
Add New Post /wp-admin/post-new.php5.90 ▲0.0178.90 ▼16.07
Media Library /wp-admin/upload.php3.24 ▲0.0135.13 ▲1.20

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Payment Gateway for PayPal Pro on WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.10 ▼0.251.68 ▲0.0943.78 ▲1.75
Dashboard /wp-admin2,192 ▲155.49 ▼0.1780.95 ▼4.3637.33 ▼6.45
Posts /wp-admin/edit.php2,097 ▼32.01 ▲0.0033.18 ▼3.1334.60 ▲5.44
Add New Post /wp-admin/post-new.php1,531 ▲323.14 ▼0.02650.56 ▲26.1947.45 ▼2.79
Media Library /wp-admin/upload.php1,403 ▲94.21 ▼0.0192.75 ▼5.9040.80 ▼3.89

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway_CC' not found in wp-content/plugins/woo-paypal-pro/includes/class-premiumdev-woo-paypal-pro-gateway.php:9

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

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: paypal pro, pro, paypal, paypal payment, ecommerce...

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

The main PHP script in "Payment Gateway for PayPal Pro on WooCommerce" version 6.0.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "3.8")

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
Everything looks great! No dangerous files found in this plugin938 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP11123274938

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity23.00
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods45
▷ Static methods24.44%
▷ Public methods3986.67%
▷ Protected methods24.44%
▷ Private methods48.89%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/cards.png8.09KB3.33KB▼ 58.77%