83% contact-form-7-honeypot

Code Review | Honeypot for Contact Form 7

WordPress plugin Honeypot for Contact Form 7 scored83%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ho...
  • Plugin version: 2.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.2
  • WordPress version: 6.3.1
  • First release: Jun 28, 2011
  • Latest release: Jun 20, 2023
  • Number of updates: 110
  • Update frequency: every 39.8 days
  • Top authors: DaoByDesign (65.45%)nocean (35.45%)

Code review

54 tests

User reviews

114 reviews

Install metrics

400,000+ active /2,693,938 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼6.62ms] Passed 4 tests

A check of server-side resources used by Honeypot for Contact Form 7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.81 ▼0.63
Dashboard /wp-admin3.43 ▲0.0850.02 ▼15.86
Posts /wp-admin/edit.php3.54 ▲0.1853.33 ▲4.11
Add New Post /wp-admin/post-new.php6.03 ▲0.1490.21 ▼13.70
Media Library /wp-admin/upload.php3.35 ▲0.1239.12 ▲3.72
Honeypot /wp-admin/admin.php?page=honeypot4cf73.3134.23

Server storage [IO: ▲1.20MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Please fix the following
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/contact-form-7-honeypot/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
honeypot4cf7_config

Browser metrics Passed 4 tests

An overview of browser requirements for Honeypot for Contact Form 7
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲4813.24 ▼1.141.77 ▼0.3443.37 ▼0.94
Dashboard /wp-admin2,240 ▲375.86 ▲0.9699.05 ▼18.4040.06 ▼4.34
Posts /wp-admin/edit.php2,120 ▲202.03 ▲0.0539.53 ▲2.1034.79 ▲1.03
Add New Post /wp-admin/post-new.php1,562 ▲2823.09 ▼0.02667.55 ▼13.5255.84 ▲2.25
Media Library /wp-admin/upload.php1,419 ▲254.22 ▼0.02100.31 ▲3.9944.82 ▼0.86
Honeypot /wp-admin/admin.php?page=honeypot4cf71,0742.0725.9963.09

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-honeypot/includes/honeypot4cf7.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-form-7-honeypot/honeypot.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-honeypot/includes/admin.php:9

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

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
You can take inspiration from this readme.txt

contact-form-7-honeypot/honeypot.php 92% from 13 tests

The main PHP file in "Honeypot for Contact Form 7" ver. 2.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("contact-form-7-honeypot.php" instead of "honeypot.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin685 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP311294558
CSS1290119
JavaScript1208

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
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%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

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.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/banners/semrush-2_300x250.png45.82KB21.03KB▼ 54.11%
includes/images/honeypot-icon-large.png35.71KB13.56KB▼ 62.01%
includes/images/honeypot-icon-small.png3.05KB1.93KB▼ 36.63%