83% woo-coolpay

Code Review | WooCommerce CoolPay

WordPress plugin WooCommerce CoolPay scored 83% from 54 tests.

About plugin

  • Plugin page: woo-coolpay
  • Plugin version: 4.10.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9
  • WordPress version: 6.3.1
  • First release: Nov 20, 2018
  • Latest release: Feb 8, 2019
  • Number of updates: 9
  • Update frequency: every 9.7 days
  • Top authors: bolander (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 698 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: ▼120.24ms] Passed 4 tests

Server-side resources used by WooCommerce CoolPay
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.66 ▼5.73
Dashboard /wp-admin3.31 ▼0.0743.62 ▼471.64
Posts /wp-admin/edit.php3.43 ▲0.0746.50 ▼0.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0184.50 ▼3.33
Media Library /wp-admin/upload.php3.24 ▲0.0134.72 ▲0.06

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce CoolPay
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲6013.60 ▼0.781.79 ▼0.1539.26 ▼2.33
Dashboard /wp-admin2,215 ▲384.87 ▼1.0796.31 ▼3.9743.10 ▲4.48
Posts /wp-admin/edit.php2,094 ▲52.01 ▲0.0141.29 ▲2.0235.94 ▼0.31
Add New Post /wp-admin/post-new.php1,545 ▲2623.25 ▼0.23681.83 ▲59.5261.44 ▲6.15
Media Library /wp-admin/upload.php1,397 ▲94.33 ▲0.0996.67 ▼4.8644.67 ▼2.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • 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
Good news, no errors were detected

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
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CoolPay_Instance' not found in wp-content/plugins/woo-coolpay/classes/instances/klarna.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/woo-coolpay/classes/woocommerce-coolpay-order.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CoolPay_Instance' not found in wp-content/plugins/woo-coolpay/classes/instances/sofort.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CoolPay_API_Transaction' not found in wp-content/plugins/woo-coolpay/classes/api/woocommerce-coolpay-api-payment.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Order' not found in wp-content/plugins/woo-coolpay/classes/base/woocommerce-coolpay-base-order.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-coolpay/views/bulk-actions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woo-coolpay/views/html-order-table-transaction-data.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CoolPay_API_Transaction' not found in wp-content/plugins/woo-coolpay/classes/api/woocommerce-coolpay-api-subscription.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woo-coolpay/helpers/notices.php:58
    • > PHP Fatal error
      Uncaught Error: Class 'WC_CoolPay_Module' not found in wp-content/plugins/woo-coolpay/classes/modules/woocommerce-coolpay-emails.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
9 plugin tags: coolpay, woocommerce coolpay, gateway, integration, psp...

woo-coolpay/woocommerce-coolpay.php 85% from 13 tests

"WooCommerce CoolPay" version 4.10.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-coolpay.php" instead of "woocommerce-coolpay.php")
  • Requires at least: Required version must match the one declared in readme.txt ("4.0.0" instead of "3.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin7,309 lines of code in 63 files:
LanguageFilesBlank linesComment linesLines of code
PHP361,0392,5063,794
SVG217202,585
PO File1269515553
CSS1380203
JavaScript2253138
Markdown14027
XML1009

PHP code Passed 2 tests

A short review 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.37
Average class complexity17.78
▷ Minimum class complexity1.00
▷ Maximum class complexity149.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes13.70%
▷ Concrete classes2696.30%
▷ Final classes00.00%
Methods279
▷ Static methods6924.73%
▷ Public methods26494.62%
▷ Protected methods51.79%
▷ Private methods103.58%
Functions11
▷ Named functions872.73%
▷ Anonymous functions327.27%
Constants7
▷ Global constants342.86%
▷ Class constants457.14%
▷ Public constants4100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/cards/edankort.png1.00KB1.04KB0.00%
assets/images/icons/ok.png3.83KB2.20KB▼ 42.57%
assets/images/icons/error.png3.29KB2.08KB▼ 36.84%
(invalid) assets/images/cards/apple-pay.png7.33KB0.00KB▼ 100.00%
assets/images/cards/discovercard.png1.20KB1.25KB0.00%