88% formspammertrap-for-contact-form-7

Code Review | FormSpammerTrap for Contact Form 7

WordPress plugin FormSpammerTrap for Contact Form 7 scored 88% from 54 tests.

About plugin

  • Plugin page: formspammertrap-f...
  • Plugin version: 1.02
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8
  • WordPress version: 5.8.1
  • First release: Jun 27, 2017
  • Latest release: Jul 24, 2021
  • Number of updates: 15
  • Update frequency: every 99.2 days
  • Top authors: rhellewell@gmail.com (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 747 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.00MB] [CPU: ▼143.74ms] Passed 4 tests

This is a short check of server-side resources used by FormSpammerTrap for Contact Form 7
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.0036.28 ▲1.30
Dashboard /wp-admin3.06 ▲0.0042.56 ▼1.96
Posts /wp-admin/edit.php3.11 ▲0.0040.98 ▲0.27
Add New Post /wp-admin/post-new.php5.42 ▼0.0193.11 ▼573.66
Media Library /wp-admin/upload.php3.00 ▲0.0034.05 ▲0.41
FormSpammerTrap for Contact Form 7 Info/Usage /wp-admin/options-general.php?page=fst4cf7_settings2.7422.61

Server storage [IO: ▲1.72MB] [DB: ▲0.62MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for FormSpammerTrap for Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10715.88 ▲0.388.12 ▼1.6154.33 ▲6.97
Dashboard /wp-admin2,964 ▲305.93 ▲0.01135.88 ▼14.52118.30 ▲8.85
Posts /wp-admin/edit.php2,739 ▼02.70 ▲0.0170.43 ▼0.5392.64 ▼2.04
Add New Post /wp-admin/post-new.php1,683 ▲1118.78 ▼0.32377.21 ▼33.42112.92 ▼17.69
Media Library /wp-admin/upload.php1,804 ▼35.04 ▲0.03140.89 ▼8.17124.71 ▲0.11
FormSpammerTrap for Contact Form 7 Info/Usage /wp-admin/options-general.php?page=fst4cf7_settings280.900.119.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.62MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/formspammertrap-for-contact-form-7/backups/formspammertrap-for-contact-form-7.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/formspammertrap-for-contact-form-7/formspammertrap-for-contact-form-7.php:46

User-side errors 0% from 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
1 plugin tags: formspammertrap for contact form 7

formspammertrap-for-contact-form-7/formspammertrap-for-contact-form-7.php Passed 13 tests

The main file in "FormSpammerTrap for Contact Form 7" v. 1.02 serves as a complement to information provided in readme.txt and as the entry point to the plugin
120 characters long description:
Adds effective form spam bot blocking to Contact Form 7 forms via a simple shortcodes added to your Contact Form 7 form.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected415 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP270221393
XML20022

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.84MB with 0.75MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
backups/assets/icon-256x256.png101.07KB8.70KB▼ 91.39%
backups/assets/banner-772x250.png251.36KB32.84KB▼ 86.94%
assets/banner-772x250.png251.36KB32.84KB▼ 86.94%
assets/icon-256x256.png101.07KB8.70KB▼ 91.39%
assets/icon-128x128.png76.21KB5.16KB▼ 93.23%