73% ethereumico

Code Review | EthereumICO

WordPress plugin EthereumICO scored73%from 54 tests.

About plugin

  • Plugin page: ethereumico
  • Plugin version: 2.4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 28, 2017
  • Latest release: Jul 8, 2023
  • Number of updates: 172
  • Update frequency: every 11.7 days
  • Top authors: ethereumicoio (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /18,780 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲5.43MB] [CPU: ▲27.59ms] 50% from 4 tests

Analyzing server-side resources used by EthereumICO
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 2,105.54ms on /wp-admin/options-general.php?page=ethereum-ico)
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.43MB on /wp-admin/options-general.php?page=ethereum-ico)
PageMemory (MB)CPU Time (ms)
Home /9.14 ▲5.67702.37 ▲664.10
Dashboard /wp-admin9.16 ▲5.8578.30 ▲30.11
Posts /wp-admin/edit.php9.16 ▲5.8091.34 ▲39.75
Add New Post /wp-admin/post-new.php10.28 ▲4.39110.86 ▲3.25
Media Library /wp-admin/upload.php9.16 ▲5.9273.96 ▲37.23
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius9.1662.88
EthereumICO /wp-admin/options-general.php?page=ethereum-ico9.162,105.54

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 843 new files
Database: no new tables, 9 new options
New WordPress options
fs_debug_mode
widget_theysaidso_widget
fs_accounts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
fs_active_plugins
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for EthereumICO
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8114.74 ▲0.061.62 ▼0.3132.68 ▼10.46
Dashboard /wp-admin2,225 ▲375.80 ▼0.09101.38 ▼8.7542.25 ▲2.03
Posts /wp-admin/edit.php2,114 ▲252.05 ▲0.0340.18 ▼1.8337.63 ▲2.04
Add New Post /wp-admin/post-new.php1,522 ▼1123.00 ▼0.02633.32 ▲25.1451.28 ▲1.73
Media Library /wp-admin/upload.php1,407 ▲194.18 ▲0.0294.82 ▼6.9546.35 ▲2.38
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0671.6829.6024.78
EthereumICO /wp-admin/options-general.php?page=ethereum-ico9801.7126.6960.55

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/ethereumico/vendor/freemius/wordpress-sdk/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_active_plugins
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • fs_accounts
    • db_upgraded
    • theysaidso_admin_options
    • fs_debug_mode
    • widget_theysaidso_widget

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 325× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ParagonIE\\ConstantTime\\Base64' not found in wp-content/plugins/ethereumico/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/ethereumico/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\Formats\\Signature\\Raw' not found in wp-content/plugins/ethereumico/vendor/phpseclib/phpseclib/phpseclib/Crypt/EC/Formats/Signature/Raw.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Crypt\\Common\\BlockCipher' not found in wp-content/plugins/ethereumico/vendor/phpseclib/phpseclib/phpseclib/Crypt/Blowfish.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ethereumico/vendor/olegabr/ethereumicoio-blockchains-info/bsc-mainnet.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Web3\\Methods\\EthMethod' not found in wp-content/plugins/ethereumico/vendor/olegabr/web3.php/src/Methods/Eth/GetBlockTransactionCountByNumber.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UploadedFileInterface' not found in wp-content/plugins/ethereumico/vendor/guzzlehttp/psr7/src/UploadedFile.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/ethereumico/vendor/guzzlehttp/psr7/src/DroppingStream.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/ethereumico/vendor/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib3\\Math\\BigInteger\\Engines\\PHP\\Base' not found in wp-content/plugins/ethereumico/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP/Reductions/EvalBarrett.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
6 plugin tags: cryptocurrency, initial coin offering, ethereum, ico, crypto...

ethereumico/ethereum-ico.php 85% from 13 tests

This is the main PHP file of "EthereumICO" version 2.4.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ethereumico.php" instead of "ethereum-ico.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin103,542 lines of code in 779 files:
LanguageFilesBlank linesComment linesLines of code
PHP73918,28151,78488,304
CSS181,1203610,363
SVG1002,671
JSON7001,170
PO File1136152491
XML500336
JavaScript63463197
YAML1007
Bourne Shell1203

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,073)
  • Method cyclomatic complexity should be reduced to less than 100 (currently 105)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity18.96
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity105.00
Code structure
Namespaces65
Interfaces36
Traits7
Classes577
▷ Abstract classes20735.88%
▷ Concrete classes37064.12%
▷ Final classes5013.51%
Methods3,636
▷ Static methods86723.84%
▷ Public methods2,69974.23%
▷ Protected methods2346.44%
▷ Private methods70319.33%
Functions447
▷ Named functions23151.68%
▷ Anonymous functions21648.32%
Constants526
▷ Global constants10519.96%
▷ Class constants42180.04%
▷ Public constants41097.39%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/freemius/wordpress-sdk/assets/img/ethereumico.png7.79KB3.92KB▼ 49.69%
vendor/freemius/wordpress-sdk/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
vendor/freemius/wordpress-sdk/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%