68% wp-monero-miner-using-coin-hive

Code Review | WP Monero Miner

WordPress plugin WP Monero Miner scored 68% from 54 tests.

About plugin

  • Plugin page: wp-monero-miner-u...
  • Plugin version: 4.1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2
  • WordPress version: 5.9.2
  • First release: Sep 18, 2017
  • Latest release: Jun 22, 2019
  • Number of updates: 91
  • Update frequency: every 7.1 days
  • Top authors: denniske1001 (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

100+ active / 25,379 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.52MB] [CPU: ▼290.79ms] Passed 4 tests

An overview of server-side resources used by WP Monero Miner
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.5960.69 ▲10.08
Dashboard /wp-admin3.94 ▲0.5343.08 ▲10.11
Posts /wp-admin/edit.php4.16 ▲0.5247.69 ▲7.54
Add New Post /wp-admin/post-new.php7.41 ▲0.4498.68 ▼1,181.80
Media Library /wp-admin/upload.php3.91 ▲0.6127.16 ▲1.03
WP Monero Miner /wp-admin/options-general.php?page=wp-coin-hive3.8925.99

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 801 new files
Database: no new tables, 9 new options
New WordPress options
wp_monero_miner_secret_key
wp_monero_miner_captcha_login_enabled
wp_monero_miner_captcha_autostart
wp_monero_miner_captcha_registration_enabled
wp_monero_miner_enabled
wp_monero_miner_site_key
widget_monero-miner-for-coin-hive
wp_monero_miner_captcha_hashes
wp_monero_miner_log

Browser metrics Passed 4 tests

WP Monero Miner: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,948 ▲22216.38 ▲0.4310.76 ▲5.042.70 ▲0.66
Dashboard /wp-admin2,913 ▲556.18 ▲0.03115.36 ▼17.22152.87 ▼2.10
Posts /wp-admin/edit.php2,683 ▼83.38 ▲0.1465.75 ▼0.31138.20 ▼6.32
Add New Post /wp-admin/post-new.php1,692 ▲2419.74 ▲0.78374.20 ▼10.86168.82 ▲17.10
Media Library /wp-admin/upload.php1,723 ▲285.56 ▲0.04122.61 ▼29.98186.38 ▼2.47
WP Monero Miner /wp-admin/options-general.php?page=wp-coin-hive1,3262.8662.07168.57

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
These items require your attention
  • Zombie WordPress options were found after uninstall: 9 options
    • wp_monero_miner_captcha_registration_enabled
    • wp_monero_miner_captcha_hashes
    • wp_monero_miner_log
    • wp_monero_miner_enabled
    • wp_monero_miner_captcha_autostart
    • wp_monero_miner_captcha_login_enabled
    • widget_monero-miner-for-coin-hive
    • wp_monero_miner_site_key
    • wp_monero_miner_secret_key

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/bin/build_bootstrap.php
    • > /wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php
  • 64× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/HelperCollectionTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/SpecTestCase.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Mustache_Test_SpecTestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/Functional/MustacheSpecTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Logger' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/FiveThree/Functional/LambdaHelperTest.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/Loader/FilesystemLoaderTest.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/Loader/ArrayLoaderTest.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Loader' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/src/Mustache/Loader/CascadingLoader.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/Mustache/Test/Exception/UnknownFilterExceptionTest.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
3 plugin tags: monero, mining, monetization

wp-monero-miner-using-coin-hive/wp-coin-hive.php 92% from 13 tests

The entry point to "WP Monero Miner" version 4.1.2 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wp-monero-miner-using-coin-hive.php" instead of "wp-coin-hive.php")

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .ms - Maxwell Script in Maxwell Render
      • wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/fixtures/templates/alpha.ms
      • wp-content/plugins/wp-monero-miner-using-coin-hive/vendor/mustache/mustache/test/fixtures/templates/beta.ms
98,205 lines of code in 740 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2957,2195,62763,616
HTML1743,620921,919
PHP1421,8344,3228,132
CSS684872502,673
Markdown659501,156
JSON700234
PO File44848176
Mustache3740164
XML2477879
YAML36032
SVG10019
Bourne Shell1015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.80
▷ Minimum class complexity1.00
▷ Maximum class complexity134.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces2
Interfaces6
Traits0
Classes145
▷ Abstract classes53.45%
▷ Concrete classes14096.55%
▷ Final classes00.00%
Methods612
▷ Static methods416.70%
▷ Public methods52986.44%
▷ Protected methods233.76%
▷ Private methods609.80%
Functions40
▷ Named functions410.00%
▷ Anonymous functions3690.00%
Constants76
▷ Global constants11.32%
▷ Class constants7598.68%
▷ Public constants75100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/js/codemirror/doc/logo.png9.09KB4.10KB▼ 54.95%
admin/js/codemirror/doc/yinyang.png4.52KB2.03KB▼ 55.19%