78% salamantex-payment-for-woocommerce

Code Review | Salamantex Payment for WooCommerce

WordPress plugin Salamantex Payment for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: salamantex-paymen...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Jul 15, 2020
  • Latest release: Oct 20, 2021
  • Number of updates: 12
  • Update frequency: every 38.5 days
  • Top authors: salamantex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /563 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by Salamantex Payment for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.33 ▼4.84
Dashboard /wp-admin3.31 ▲0.0146.49 ▼5.48
Posts /wp-admin/edit.php3.36 ▲0.0147.81 ▼0.96
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.34 ▼9.38
Media Library /wp-admin/upload.php3.23 ▲0.0138.08 ▲4.87

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Salamantex Payment for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.23 ▼0.121.63 ▼0.2543.26 ▼2.53
Dashboard /wp-admin2,192 ▲185.54 ▼0.1488.29 ▼11.2939.56 ▼2.81
Posts /wp-admin/edit.php2,097 ▼32.01 ▼0.0136.96 ▲1.4638.00 ▼0.64
Add New Post /wp-admin/post-new.php1,531 ▲523.03 ▼0.05661.32 ▼22.6053.97 ▲1.94
Media Library /wp-admin/upload.php1,403 ▲34.16 ▲0.0198.83 ▼7.7143.18 ▼0.77

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/salamantex-payment-for-woocommerce/public/partials/woocommerce-salamantex-public-display.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Payment_Gateway' not found in wp-content/plugins/salamantex-payment-for-woocommerce/admin/class-wc-gateway-salamantex.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
9 plugin tags: crypto, dash, bitcoin, nimiq, litecoin...

salamantex-payment-for-woocommerce/salamantex-payment-for-woocommerce.php 85% from 13 tests

"Salamantex Payment for WooCommerce" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.4" instead of "4.0")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin718 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12197671571
PO File14747128
CSS22813
JavaScript26566

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity9.75
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods42
▷ Static methods24.76%
▷ Public methods3480.95%
▷ Protected methods00.00%
▷ Private methods819.05%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.27MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/salamantex-icon.png74.25KB26.90KB▼ 63.77%
public/images/dash.png0.94KB0.93KB▼ 1.14%
public/images/eth.png1.34KB1.01KB▼ 24.64%
public/images/btc.png1.31KB1.00KB▼ 24.24%
public/images/ltc.png0.80KB0.80KB0.24%