10% formspammertrap-for-comments

Code Review | Form Spammer Trap for Comments

WordPress plugin Form Spammer Trap for Comments scored10%from 54 tests.

About plugin

  • Plugin page: formspammertrap-f...
  • Plugin version: 4.00
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.9
  • WordPress version: 6.3.1
  • First release: Feb 4, 2015
  • Latest release: Mar 3, 2022
  • Number of updates: 61
  • Update frequency: every 42.4 days
  • Top authors: rhellewell@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,151 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/formspammertrap-for-comments/FormSpammerTrap4Comments.php+769
    Trying to access array offset on value of type bool

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

Server-side resources used by Form Spammer Trap for Comments
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.445.66 ▼35.28
Dashboard /wp-admin2.05 ▼1.267.03 ▼47.90
Posts /wp-admin/edit.php2.05 ▼1.316.71 ▼45.19
Add New Post /wp-admin/post-new.php2.05 ▼3.846.81 ▼102.55
Media Library /wp-admin/upload.php2.05 ▼1.185.82 ▼30.27
FormSpammerTrap for Comments Settings /wp-admin/options-general.php?page=fst4c_settings_options_page2.055.78

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Form Spammer Trap for Comments
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.27 ▼0.121.73 ▲0.0937.87 ▼6.32
Dashboard /wp-admin2,192 ▲155.53 ▼0.0388.04 ▼4.6336.64 ▼8.02
Posts /wp-admin/edit.php2,109 ▲92.00 ▼0.0039.30 ▲1.2931.35 ▼5.24
Add New Post /wp-admin/post-new.php1,530 ▲423.55 ▲0.16638.81 ▼16.3258.76 ▲13.05
Media Library /wp-admin/upload.php1,403 ▲64.19 ▼0.12104.01 ▼2.0240.85 ▼5.66
FormSpammerTrap for Comments Settings /wp-admin/options-general.php?page=fst4c_settings_options_page1,3132.0323.7060.41

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/formspammertrap-for-comments/FormSpammerTrap4Comments.php+769
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=fst4c_settings_options_page
    • > Notice in wp-content/plugins/formspammertrap-for-comments/FormSpammerTrap4Comments.php+632
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/formspammertrap-for-comments/FormSpammerTrap4Comments.php:53

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: spam, spambot protection, stop, comments, form spam

formspammertrap-for-comments/FormSpammerTrap4Comments.php 62% from 13 tests

The main PHP script in "Form Spammer Trap for Comments" version 4.00 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 622 characters long)
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("formspammertrap-for-comments.php" instead of "FormSpammerTrap4Comments.php")
  • Domain Path: Please prefix the domain path with a forward slash character ("/")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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
There were no executable files found in this plugin1,053 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1202289963
CSS131176
XML20014

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.32
Average class complexity30.00
▷ Minimum class complexity15.00
▷ Maximum class complexity45.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods41
▷ Static methods00.00%
▷ Public methods3892.68%
▷ Protected methods00.00%
▷ Private methods37.32%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 3.07MB with 2.55MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png569.28KB34.29KB▼ 93.98%
css/soda-cup-straw.png121.76KB58.15KB▼ 52.24%
assets/banner-1000x200.png604.59KB80.94KB▼ 86.61%
assets/icon-128x128.png220.70KB11.40KB▼ 94.83%
assets/banner-772x250.png677.74KB84.80KB▼ 87.49%