10% wc-wax-payment-gateway

Code Review | Payment Gateway for Wax with WooCommerce

WordPress plugin Payment Gateway for Wax with WooCommerce scored 10% from 54 tests.

About plugin

  • Plugin page: wc-wax-payment-ga...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.5
  • WordPress version: 5.9.2
  • First release: Oct 5, 2020
  • Latest release: Nov 2, 2020
  • Number of updates: 10
  • Update frequency: every 4.0 days
  • Top authors: eosbarcelona (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 301 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-includes/class-wp-hook.php+307
    call_user_func_array() expects parameter 1 to be a valid callback, class '\WSB\Activator' not found

Server metrics [RAM: ▼0.01MB] [CPU: ▼313.72ms] Passed 4 tests

Analyzing server-side resources used by Payment Gateway for Wax with WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.0854.61 ▲3.86
Dashboard /wp-admin3.42 ▲0.0135.72 ▲1.56
Posts /wp-admin/edit.php3.65 ▲0.0139.85 ▲2.24
Add New Post /wp-admin/post-new.php6.89 ▼0.0892.93 ▼1,258.35
Media Library /wp-admin/upload.php3.30 ▲0.0124.89 ▼0.34

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Payment Gateway for Wax with WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,773 ▲1915.55 ▼0.206.69 ▲0.482.03 ▼0.62
Dashboard /wp-admin2,898 ▲376.02 ▼0.13121.28 ▼16.23155.63 ▼6.76
Posts /wp-admin/edit.php2,695 ▲73.23 ▼0.0166.24 ▲2.60141.87 ▲4.66
Add New Post /wp-admin/post-new.php1,672 ▼8618.19 ▼3.86397.39 ▼65.29156.60 ▼6.54
Media Library /wp-admin/upload.php1,704 ▲65.55 ▲0.01143.69 ▼16.54185.08 ▼5.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wc-wax-payment-gateway/includes/class-wc-wax-ajax.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/wc-wax-payment-gateway/includes/class-wc-gateway-wax.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (The payment method show to customer under checkout.), #2 (The settings panel for store managers.)
The official readme.txt is a good inspiration

wc-wax-payment-gateway/woocommerce-gateway-wax.php 85% from 13 tests

The main PHP file in "Payment Gateway for Wax with WooCommerce" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-wax-payment-gateway.php" instead of "woocommerce-gateway-wax.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin1,387 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP6169209649
PO File4168168450
Sass190140
CSS1154120
SVG10123
JavaScript5095

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity17.40
▷ Minimum class complexity7.00
▷ Maximum class complexity28.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods50
▷ Static methods2244.00%
▷ Public methods4182.00%
▷ Protected methods12.00%
▷ Private methods816.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/copy.png0.42KB0.34KB▼ 19.59%