83% spam-prevention-for-contact-form-7-and-comments

Code Review | Spam Prevention for Contact Form 7 and Comments

WordPress plugin Spam Prevention for Contact Form 7 and Comments scored83%from 54 tests.

About plugin

  • Plugin page: spam-prevention-f...
  • Plugin version: 1.3.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Feb 18, 2023
  • Latest release: Aug 27, 2023
  • Number of updates: 21
  • Update frequency: every 9.1 days
  • Top authors: ctomczyk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /280 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Analyzing server-side resources used by Spam Prevention for Contact Form 7 and Comments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0646.00 ▼1.39
Dashboard /wp-admin3.40 ▲0.0154.35 ▼10.41
Posts /wp-admin/edit.php3.52 ▲0.1152.03 ▼4.79
Add New Post /wp-admin/post-new.php5.98 ▲0.0587.83 ▼17.66
Media Library /wp-admin/upload.php3.32 ▲0.0542.97 ▲4.43

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Spam Prevention for Contact Form 7 and Comments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,803 ▲3214.18 ▼0.481.85 ▲0.0446.64 ▲2.33
Dashboard /wp-admin2,198 ▲245.61 ▼0.0685.75 ▼10.7340.36 ▲1.71
Posts /wp-admin/edit.php2,100 ▼31.96 ▼0.0135.71 ▼7.4832.78 ▼3.85
Add New Post /wp-admin/post-new.php1,527 ▼123.44 ▲0.55697.44 ▲83.4554.85 ▲7.01
Media Library /wp-admin/upload.php1,397 ▼64.26 ▼0.04113.79 ▲16.5848.85 ▲3.85

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/spam-prevention-for-contact-form-7-and-comments/public/partials/plugin-name-public-display.php
    • > /wp-content/plugins/spam-prevention-for-contact-form-7-and-comments/1.3.6/public/partials/plugin-name-public-display.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

spam-prevention-for-contact-form-7-and-comments/sitelint.php 85% from 13 tests

The main file in "Spam Prevention for Contact Form 7 and Comments" v. 1.3.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("spam-prevention-for-contact-form-7-and-comments.php" instead of "sitelint.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin246 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP1186322246

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.67
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods50
▷ Static methods48.00%
▷ Public methods4284.00%
▷ Protected methods00.00%
▷ Private methods816.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
2 PNG files occupy 1.10MB with 0.72MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
1.3.6/screenshot-1.png564.78KB198.32KB▼ 64.89%
screenshot-1.png564.78KB198.32KB▼ 64.89%