84% spam-trap-for-contact-form-7

Code Review | Spam Trap for Contact Form 7

WordPress plugin Spam Trap for Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: spam-trap-for-con...
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 8, 2017
  • Latest release: Nov 29, 2022
  • Number of updates: 14
  • Update frequency: every 145.3 days
  • Top authors: jsmcm (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /595 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼7.88ms] Passed 4 tests

Analyzing server-side resources used by Spam Trap for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.57 ▼0.32
Dashboard /wp-admin3.31 ▼0.0445.04 ▼14.36
Posts /wp-admin/edit.php3.36 ▲0.0044.30 ▼4.72
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.80 ▼12.12
Media Library /wp-admin/upload.php3.23 ▲0.0037.49 ▲3.23
Spam Trap for Contact Form 7 /wp-admin/options-general.php?page=spam_trap_for_contact_form_73.0023.15

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Spam Trap for Contact Form 7: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.75 ▲0.371.92 ▲0.2443.45 ▲2.05
Dashboard /wp-admin2,206 ▲215.91 ▲0.10111.55 ▲9.1641.69 ▼0.31
Posts /wp-admin/edit.php2,071 ▼182.02 ▼0.0134.15 ▼4.0033.82 ▼0.74
Add New Post /wp-admin/post-new.php1,514 ▼2017.68 ▼5.68683.92 ▲2.8353.06 ▼3.68
Media Library /wp-admin/upload.php1,388 ▼04.22 ▼0.0194.28 ▼12.8141.39 ▼6.80
Spam Trap for Contact Form 7 /wp-admin/options-general.php?page=spam_trap_for_contact_form_7280.440.083.72

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

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
The smoke test was a success, however most plugin functionality was not tested

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

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=spam_trap_for_contact_form_7
    • > Network (severe)
    wp-admin/options-general.php?page=spam_trap_for_contact_form_7 - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration Passed 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
5 plugin tags: comment spam, anti spam, contact form 7 anti spam, contact form 7, spam

spam-trap-for-contact-form-7/spam-trap-for-contact-form-7.php Passed 13 tests

The entry point to "Spam Trap for Contact Form 7" version 1.1.1 is a PHP file that has certain tags in its header comment area
57 characters long description:
This plugin adds spam checks to catch contact form 7 spam

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected368 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP619894368

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity5.12
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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
No PNG images were found in this plugin