74% honey-coinhive-captcha

Code Review | Honey Coinhive Captcha

WordPress plugin Honey Coinhive Captcha scored74%from 54 tests.

About plugin

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

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,144 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.19ms] Passed 4 tests

A check of server-side resources used by Honey Coinhive Captcha
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0441.91 ▼1.00
Dashboard /wp-admin3.34 ▲0.0454.90 ▲2.86
Posts /wp-admin/edit.php3.39 ▲0.0450.54 ▼0.86
Add New Post /wp-admin/post-new.php5.94 ▲0.0699.36 ▼5.17
Media Library /wp-admin/upload.php3.26 ▲0.0437.40 ▼1.74
Coinhive Captcha /wp-admin/options-general.php?page=coinhive-captcha-options3.2434.10

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: 2 new tables, 7 new options
New tables
wp_honey_captcha
wp_honey_captcha_tokens
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
chc_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Honey Coinhive Captcha
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲11913.33 ▼1.061.74 ▲0.0544.35 ▲1.97
Dashboard /wp-admin2,229 ▲475.08 ▲0.17114.72 ▲7.2539.58 ▼6.14
Posts /wp-admin/edit.php2,114 ▲252.32 ▲0.2640.35 ▼1.4935.71 ▲1.75
Add New Post /wp-admin/post-new.php1,535 ▲223.53 ▲0.42688.04 ▲14.5939.21 ▼15.73
Media Library /wp-admin/upload.php1,405 ▲174.46 ▲0.2398.02 ▼1.2843.68 ▲0.51
Coinhive Captcha /wp-admin/options-general.php?page=coinhive-captcha-options1,0282.4143.7225.31

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_honey_captcha_tokens
    • wp_honey_captcha
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • chc_db_version
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/honey-coinhive-captcha/honey_captcha.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • License uri: Please fix this invalid url: "URI: http://www.gnu.org/licenses/gpl-2.0.html"
Please take inspiration from this readme.txt

honey-coinhive-captcha/honey_captcha.php 92% from 13 tests

The main file in "Honey Coinhive Captcha" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("honey-coinhive-captcha.php" instead of "honey_captcha.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 detected697 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP27324454
JavaScript2281243

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions40
▷ Named functions40100.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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/honeylogo.png38.97KB5.05KB▼ 87.04%