94% block-spam-comment

Code Review | Block Spam Comment

WordPress plugin Block Spam Comment scored 94% from 54 tests.

About plugin

  • Plugin page: block-spam-comment
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.1
  • WordPress version: 5.8.1
  • First release: Oct 28, 2018
  • Latest release: Apr 21, 2019
  • Number of updates: 16
  • Update frequency: every 10.9 days
  • Top authors: poku (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 830 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

This is a short check of server-side resources used by Block Spam Comment
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1536.63 ▲11.47
Dashboard /wp-admin3.10 ▲0.0547.38 ▲0.57
Posts /wp-admin/edit.php3.15 ▲0.0449.75 ▲0.12
Add New Post /wp-admin/post-new.php5.46 ▲0.0292.51 ▼563.01
Media Library /wp-admin/upload.php3.04 ▲0.0432.95 ▼1.20
All Comments /wp-admin/edit-comments.php3.1134.60
Block Spam Comment /wp-admin/edit-comments.php?page=block-spam-comment3.0431.83

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Block Spam Comment
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲6515.77 ▲0.308.41 ▲0.3049.22 ▼6.75
Dashboard /wp-admin2,993 ▲596.10 ▲0.17148.37 ▼17.70118.74 ▼0.61
Posts /wp-admin/edit.php2,762 ▲232.68 ▼0.0167.89 ▲0.86102.47 ▲8.05
Add New Post /wp-admin/post-new.php1,698 ▲1518.77 ▼0.17387.81 ▲14.58119.74 ▲5.72
Media Library /wp-admin/upload.php1,830 ▲205.04 ▲0.05173.89 ▲18.93132.48 ▲6.23
All Comments /wp-admin/edit-comments.php2,4522.8770.88109.44
Block Spam Comment /wp-admin/edit-comments.php?page=block-spam-comment1,0882.0556.9983.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/edit-comments.php?page=block-spam-comment
    • > Notice in wp-content/plugins/block-spam-comment/Block-Spam-Comment.php+145
    date_default_timezone_set(): Timezone ID '' is invalid

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: antispam, comments, anti-spam, comment, spam

block-spam-comment/Block-Spam-Comment.php 85% from 13 tests

Analyzing the main PHP file in "Block Spam Comment" version 1.1.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("block-spam-comment.php" instead of "Block-Spam-Comment.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin225 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22352165
PO File1161660

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions337.50%
▷ Anonymous functions562.50%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin