90% coin-miner

Code Review | Coin Miner - Coin Hive, and CoinImp monero miner

WordPress plugin Coin Miner - Coin Hive, and CoinImp monero miner scored90%from 54 tests.

About plugin

  • Plugin page: coin-miner
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Feb 4, 2018
  • Latest release: Apr 15, 2018
  • Number of updates: 17
  • Update frequency: every 4.1 days
  • Top authors: zlager (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /8,686 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.17MB] [CPU: ▼2.59ms] Passed 4 tests

Analyzing server-side resources used by Coin Miner - Coin Hive, and CoinImp monero miner
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.81 ▲0.3538.63 ▼4.54
Dashboard /wp-admin3.46 ▲0.1550.67 ▼0.50
Posts /wp-admin/edit.php3.57 ▲0.2152.97 ▲3.41
Add New Post /wp-admin/post-new.php6.06 ▲0.1785.31 ▼8.74
Media Library /wp-admin/upload.php3.38 ▲0.1542.40 ▲6.83
Coin-Miner /wp-admin/options-general.php?page=coin-miner3.3533.60

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 21 new files
Database: 2 new tables, 22 new options
New tables
wp_coin_hive
wp_coin_imp
New WordPress options
widget_recent-comments
ci_delayed_miner_time
ch_delayed_miner_time
theysaidso_admin_options
can_compress_scripts
ci_disable
ci_public_key
ch_mobile_disable
ch_public_key
ci_miner_speed
...

Browser metrics Passed 4 tests

Coin Miner - Coin Hive, and CoinImp monero miner: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲11213.75 ▼0.617.76 ▲5.5142.19 ▼2.92
Dashboard /wp-admin2,220 ▲465.59 ▲0.0688.54 ▼6.4040.57 ▼3.55
Posts /wp-admin/edit.php2,125 ▲251.96 ▼0.0336.27 ▼0.6338.01 ▲2.74
Add New Post /wp-admin/post-new.php1,547 ▲2123.23 ▼0.11684.78 ▲6.1455.15 ▼5.67
Media Library /wp-admin/upload.php1,428 ▲284.20 ▲0.0196.73 ▼8.2345.46 ▼2.48
Coin-Miner /wp-admin/options-general.php?page=coin-miner1,1692.0024.7442.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 22 options in the database
    • ch_secret_key
    • ci_disable
    • widget_theysaidso_widget
    • ci_mobile_disable
    • ci_public_key
    • db_upgraded
    • ci_miner_speed
    • ci_delayed_miner_time
    • ch_user_concent_needed
    • widget_recent-posts
    • ...

Smoke tests Passed 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 no errors were found, this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: monero, coinhive, coinimp, mining, monetization...

coin-miner/coin-miner.php Passed 13 tests

The principal PHP file in "Coin Miner - Coin Hive, and CoinImp monero miner" v. 1.0.0 is loaded by WordPress automatically on each request
10 characters long description:
Coin-Miner

Code Analysis Passed 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 detected1,164 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP96476853
CSS1197192
JavaScript123119

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.40
▷ Minimum class complexity1.00
▷ Maximum class complexity32.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 compressed PNG files occupy 0.12MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/coin-hive-3.png6.82KB7.25KB0.00%
img/coin-imp-5.png13.81KB13.83KB0.00%
img/coin-imp-4.png24.22KB24.47KB0.00%
img/coin-imp-1.png10.07KB10.70KB0.00%
img/coin-imp-3.png3.50KB3.49KB0.42%