83% wp-contact-form7-email-spam-blocker

Code Review | WP Contact Form7 Email Spam Blocker

WordPress plugin WP Contact Form7 Email Spam Blocker scored83%from 54 tests.

About plugin

  • Plugin page: wp-contact-form7-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4
  • WordPress version: 6.3.1
  • First release: Dec 7, 2018
  • Latest release: Apr 25, 2020
  • Number of updates: 16
  • Update frequency: every 31.9 days
  • Top authors: hk1993 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

2,000+ active /6,986 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.07ms] Passed 4 tests

This is a short check of server-side resources used by WP Contact Form7 Email Spam Blocker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.68 ▼6.66
Dashboard /wp-admin3.37 ▲0.0343.91 ▼13.83
Posts /wp-admin/edit.php3.48 ▲0.1350.73 ▲4.25
Add New Post /wp-admin/post-new.php5.97 ▲0.0981.63 ▼8.79
Media Library /wp-admin/upload.php3.29 ▲0.0736.63 ▲0.99

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

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

Browser metrics Passed 4 tests

WP Contact Form7 Email Spam Blocker: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲14113.57 ▼0.684.89 ▲2.9338.07 ▼0.41
Dashboard /wp-admin2,210 ▲254.82 ▼1.09105.32 ▼1.7540.15 ▼4.89
Posts /wp-admin/edit.php2,096 ▲72.02 ▲0.0339.62 ▲2.0734.79 ▲0.40
Add New Post /wp-admin/post-new.php1,527 ▲1318.31 ▲0.57633.70 ▲13.6557.19 ▼8.48
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.0894.90 ▼4.4842.18 ▼0.90

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-contact-form7-email-spam-blocker/admin/partials/contact-form-7-email-spam-blocker-admin-display.php
    • > /wp-content/plugins/wp-contact-form7-email-spam-blocker/public/partials/contact-form-7-email-spam-blocker-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can take inspiration from this readme.txt

wp-contact-form7-email-spam-blocker/contact-form-7-email-spam-blocker.php 85% from 13 tests

The entry point to "WP Contact Form7 Email Spam Blocker" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-contact-form7-email-spam-blocker.php" instead of "contact-form-7-email-spam-blocker.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin253 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12128547244
JavaScript24546
CSS2183

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.14
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.29
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG images were found in this plugin