83% cf7-blacklist

Code Review | Contact Form 7 Blacklist

WordPress plugin Contact Form 7 Blacklist scored83%from 54 tests.

About plugin

  • Plugin page: cf7-blacklist
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.9.7
  • WordPress version: 6.3.1
  • First release: Sep 12, 2018
  • Latest release: Sep 29, 2018
  • Number of updates: 9
  • Update frequency: every 1.9 days
  • Top authors: webmonkeyhu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /1,417 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.02MB] [CPU: ▼7.02ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 Blacklist
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.08 ▼1.51
Dashboard /wp-admin3.32 ▲0.0145.65 ▼4.37
Posts /wp-admin/edit.php3.37 ▲0.0143.50 ▼5.07
Add New Post /wp-admin/post-new.php5.92 ▲0.0383.24 ▼17.12
Media Library /wp-admin/upload.php3.24 ▲0.0138.64 ▲4.27

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 Blacklist
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15213.86 ▼0.548.08 ▲6.4343.94 ▲5.15
Dashboard /wp-admin2,210 ▲255.80 ▲0.9196.83 ▼3.8438.27 ▼7.82
Posts /wp-admin/edit.php2,090 ▲192.06 ▲0.0535.43 ▼1.3132.20 ▼1.10
Add New Post /wp-admin/post-new.php1,518 ▼1517.52 ▼5.67647.92 ▼29.9655.87 ▼2.52
Media Library /wp-admin/upload.php1,386 ▼54.24 ▲0.0698.96 ▼18.3444.32 ▼4.00

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/cf7-blacklist/admin/partials/wpcf7-blacklist-admin-display.php
    • > /wp-content/plugins/cf7-blacklist/public/partials/wpcf7-blacklist-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2 in cf7-blacklist/assets to your readme.txt
The official readme.txt might help

cf7-blacklist/wpcf7-blacklist.php 85% from 13 tests

"Contact Form 7 Blacklist" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cf7-blacklist.php" instead of "wpcf7-blacklist.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin243 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12128491231
CSS2246
JavaScript24546

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity3.57
▷ Minimum class complexity1.00
▷ Maximum class complexity11.00
Average method complexity1.64
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods725.00%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin