93% ether-and-erc20-tokens-woocommerce-payment-gateway

Code Review | Ether and ERC20 tokens WooCommerce Payment Gateway

WordPress plugin Ether and ERC20 tokens WooCommerce Payment Gateway scored 93% from 54 tests.

About plugin

  • Plugin page: ether-and-erc20-t...
  • Plugin version: 4.12.9
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5.1-5.9.1
  • WordPress version: 5.9.2
  • First release: Mar 15, 2018
  • Latest release: Mar 2, 2022
  • Number of updates: 262
  • Update frequency: every 5.5 days
  • Top authors: ethereumicoio (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

300+ active / 18,529 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼305.13ms] Passed 4 tests

Server-side resources used by Ether and ERC20 tokens WooCommerce Payment Gateway
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0161.18 ▼43.27
Dashboard /wp-admin3.41 ▲0.0033.63 ▼2.75
Posts /wp-admin/edit.php3.64 ▲0.0038.19 ▼1.42
Add New Post /wp-admin/post-new.php6.88 ▼0.0994.83 ▼1,171.37
Media Library /wp-admin/upload.php3.29 ▲0.0025.17 ▼3.11

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 953 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Ether and ERC20 tokens WooCommerce Payment Gateway
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲4115.90 ▲0.255.72 ▼0.952.82 ▲0.13
Dashboard /wp-admin2,892 ▲466.10 ▼0.08121.94 ▼5.02214.23 ▼15.63
Posts /wp-admin/edit.php2,688 ▼63.24 ▼0.0163.93 ▼6.75139.94 ▼6.76
Add New Post /wp-admin/post-new.php1,759 ▲9816.79 ▲0.56403.01 ▼26.25213.63 ▲59.14
Media Library /wp-admin/upload.php1,695 ▼05.55 ▼0.00152.89 ▼10.32227.37 ▲12.97

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 347× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\Web3\\Methods\\EthMethod' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/olegabr/web3.php/src/Methods/Eth/GetLogs.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/guzzlehttp/promises/src/CancellationException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\Web3\\Methods\\EthMethod' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/olegabr/web3.php/src/Methods/Eth/GetBlockTransactionCountByHash.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/secp112r2.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_Abstract_QueueRunner' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/woocommerce/action-scheduler/classes/WP_CLI/ActionScheduler_WPCLI_QueueRunner.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\phpseclib3\\Crypt\\EC\\BaseCurves\\Prime' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Curves/prime192v3.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\Web3\\Methods\\EthMethod' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/olegabr/web3.php/src/Methods/Eth/GetBlockByHash.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'ActionScheduler_SimpleSchedule' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/woocommerce/action-scheduler/classes/schedules/ActionScheduler_CanceledSchedule.php:6
    • > PHP Fatal error
      Uncaught Error: Interface 'Ethereumico\\Epg\\Dependencies\\GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Ethereumico\\Epg\\Dependencies\\Web3\\Methods\\EthMethod' not found in wp-content/plugins/ether-and-erc20-tokens-woocommerce-payment-gateway/vendor/olegabr/web3.php/src/Methods/Eth/GetTransactionByBlockNumberAndIndex.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

ether-and-erc20-tokens-woocommerce-payment-gateway/ether-and-erc20-tokens-woocommerce-payment-gateway.php 85% from 13 tests

The main PHP script in "Ether and ERC20 tokens WooCommerce Payment Gateway" version 4.12.9 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.7" instead of "5.5.1")
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected122,676 lines of code in 867 files:
LanguageFilesBlank linesComment linesLines of code
PHP79711,19056,57086,191
CSS181,0655810,447
JavaScript172,7677,4409,546
PO File142,8863,4469,255
SVG7254,991
JSON6001,802
XML663371
Markdown122070
Bourne Shell1203

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,029)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity18.03
▷ Minimum class complexity1.00
▷ Maximum class complexity3,029.00
Average method complexity3.87
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces69
Interfaces39
Traits7
Classes661
▷ Abstract classes22233.59%
▷ Concrete classes43966.41%
▷ Final classes5011.39%
Methods4,243
▷ Static methods91321.52%
▷ Public methods3,14974.22%
▷ Protected methods3909.19%
▷ Private methods70416.59%
Functions336
▷ Named functions19558.04%
▷ Anonymous functions14141.96%
Constants542
▷ Global constants10519.37%
▷ Class constants43780.63%
▷ Public constants42697.48%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
10 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sort_asc.png0.16KB0.25KB0.00%
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
img/ethereum-icon.png2.09KB1.57KB▼ 24.85%
images/sort_asc_disabled.png0.14KB0.25KB0.00%
assets/icon-256x256.png8.02KB3.85KB▼ 52.04%