10% woocommerce-payplug

Code Review | WooCommerce PayPlug

WordPress plugin WooCommerce PayPlug scored 10% from 54 tests.

About plugin

  • Plugin page: woocommerce-payplug
  • Plugin version: 3.5.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-5.4.2
  • WordPress version: 5.8.1
  • First release: Nov 19, 2013
  • Latest release: Jun 23, 2021
  • Number of updates: 63
  • Update frequency: every 46.3 days
  • Top authors: BorisColombier (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

900+ active / 21,553 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/woocommerce-payplug/woocommerce-payplug.php+41
    array_keys() expects parameter 1 to be array, bool given

Server metrics [RAM: ▼1.86MB] [CPU: ▼189.90ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce PayPlug
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.77 ▼1.065.86 ▼28.19
Dashboard /wp-admin1.79 ▼1.266.03 ▼43.34
Posts /wp-admin/edit.php1.79 ▼1.315.48 ▼40.68
Add New Post /wp-admin/post-new.php1.79 ▼3.645.46 ▼645.12
Media Library /wp-admin/upload.php1.79 ▼1.226.93 ▼30.47

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 283 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WooCommerce PayPlug: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.26 ▲0.718.51 ▲0.3551.38 ▲5.29
Dashboard /wp-admin2,973 ▲425.90 ▼0.02132.66 ▼10.73115.08 ▼6.57
Posts /wp-admin/edit.php2,739 ▼02.69 ▼0.0065.70 ▼2.0788.49 ▲0.75
Add New Post /wp-admin/post-new.php1,683 ▲18318.72 ▲0.19367.22 ▼7.45108.74 ▼2.28
Media Library /wp-admin/upload.php1,804 ▼05.01 ▼0.03139.16 ▼16.43123.34 ▲0.21

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/woocommerce-payplug/woocommerce-payplug.php+41
    array_keys() expects parameter 1 to be array, bool given

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/woocommerce-payplug/inc/freemius/templates/ajax-loader.php
  • 40× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Resource/PaymentHostedPayment.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\PayplugException' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Exception/HttpException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Resource/PaymentBilling.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\HttpException' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Exception/UnauthorizedException.php:7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/woocommerce-payplug/inc/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Resource/Refund.php:8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/woocommerce-payplug/inc/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Resource\\APIResource' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Resource/Payment.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\PayplugException' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Exception/DependencyException.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Payplug\\Exception\\HttpException' not found in wp-content/plugins/woocommerce-payplug/inc/lib/Payplug/Exception/PayplugServerException.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: woocommerce, extension, shopping cart, gateway, payplug...

woocommerce-payplug/woocommerce-payplug.php 92% from 13 tests

The principal PHP file in "WooCommerce PayPlug" v. 3.5.3 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0.1" instead of "2.6.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin51,981 lines of code in 218 files:
LanguageFilesBlank linesComment linesLines of code
PHP1587,54817,31432,219
PO File157,6119,21116,698
Sass25391772,457
Markdown1680214
JavaScript43559196
CSS14240170
JSON10027

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity44.55
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.38
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces4
Interfaces3
Traits0
Classes93
▷ Abstract classes44.30%
▷ Concrete classes8995.70%
▷ Final classes00.00%
Methods1,277
▷ Static methods23418.32%
▷ Public methods92772.59%
▷ Protected methods211.64%
▷ Private methods32925.76%
Functions95
▷ Named functions9498.95%
▷ Anonymous functions11.05%
Constants139
▷ Global constants10474.82%
▷ Class constants3525.18%
▷ Public constants35100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
11 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/chart.png2.73KB2.09KB▼ 23.37%
images/star.png1.51KB1.46KB▼ 3.37%
assets/images/cards_logo.png4.94KB2.94KB▼ 40.46%
images/payplug.png1.62KB1.82KB0.00%
images/payplug-logo-large.png3.51KB2.78KB▼ 20.68%