10% honey-coinhive-widget

Code Review | Honey Coinhive Widget

WordPress plugin Honey Coinhive Widget scored10%from 54 tests.

About plugin

  • Plugin page: honey-coinhive-wi...
  • Plugin version: 1.1.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.1
  • WordPress version: 6.3.1
  • First release: May 15, 2018
  • Latest release: Jan 17, 2019
  • Number of updates: 12
  • Update frequency: every 21.1 days
  • Top authors: honeyplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,942 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/honey-coinhive-widget/honey_widget.php+392
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼48.75ms] Passed 4 tests

Server-side resources used by Honey Coinhive Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.88 ▼32.63
Dashboard /wp-admin2.05 ▼1.255.95 ▼38.43
Posts /wp-admin/edit.php2.05 ▼1.315.41 ▼37.81
Add New Post /wp-admin/post-new.php2.05 ▼3.846.21 ▼86.12
Media Library /wp-admin/upload.php2.05 ▼1.186.23 ▼29.61
Coinhive Widget /wp-admin/options-general.php?page=coinhiveWidget2.055.07

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 13 new files
Database: 1 new table, 11 new options
New tables
wp_honey_widget
New WordPress options
db_upgraded
theysaidso_admin_options
chw_db_version
coinhiveWidget_secret_key
can_compress_scripts
widget_coinhive_widget
widget_recent-posts
widget_theysaidso_widget
coinhiveWidget_color_setting
widget_recent-comments
...

Browser metrics Passed 4 tests

An overview of browser requirements for Honey Coinhive Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,013 ▲27815.21 ▲0.648.73 ▲6.7924.95 ▼23.68
Dashboard /wp-admin2,235 ▲465.92 ▲1.02109.61 ▼8.0450.39 ▲2.39
Posts /wp-admin/edit.php2,102 ▲102.67 ▲0.6351.65 ▲12.3142.13 ▲3.31
Add New Post /wp-admin/post-new.php1,698 ▲16523.39 ▲0.23607.70 ▼64.5130.32 ▼31.75
Media Library /wp-admin/upload.php1,417 ▲295.18 ▲0.97109.21 ▼0.2948.62 ▲4.55
Coinhive Widget /wp-admin/options-general.php?page=coinhiveWidget9842.6847.0631.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/honey-coinhive-widget/honey_widget.php+392
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_honey_widget
  • Zombie WordPress options were found after uninstall: 11 options
    • db_upgraded
    • coinhiveWidget_color_setting
    • theysaidso_admin_options
    • coinhiveWidget_secret_key
    • coinhiveWidget_site_key
    • widget_recent-comments
    • widget_recent-posts
    • widget_coinhive_widget
    • widget_theysaidso_widget
    • can_compress_scripts
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > Deprecated in wp-content/plugins/honey-coinhive-widget/honey_widget.php+392
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in Coinhive_Widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > User deprecated in wp-includes/functions.php+5737
    Function get_bloginfo was called with an argument that is deprecated since version 2.2.0! The siteurl option is deprecated for the family of bloginfo() functions. Use the url option instead.
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > Notice in wp-content/plugins/honey-coinhive-widget/honey_widget.php+462
    Trying to get property 'id' of non-object
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/honey-coinhive-widget/scripts/styles.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/honey-coinhive-widget/honey_widget.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > Network (severe)
    http://authedmine.com/lib/authedmine.min.js?ver=6.3.1 - Failed to load resource: net::ERR_NAME_NOT_RESOLVED
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: CoinHive is not defined" "ReferenceError: CoinHive is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/honey-coinhive-widget/scripts/chw_scripts.js?v1&ver=6.3.1:136:11)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=coinhiveWidget
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught ReferenceError: CoinHive is not defined

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • License uri: Invalid url: "URI: http://www.gnu.org/licenses/gpl-2.0.html"
The official readme.txt is a good inspiration

honey-coinhive-widget/honey_widget.php 92% from 13 tests

This is the main PHP file of "Honey Coinhive Widget" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("honey-coinhive-widget.php" instead of "honey_widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,175 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP37325637
JavaScript4499534
CSS2064

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity10.75
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin