94% sitewide-comment-control

Code Review | Sitewide Comment Control

WordPress plugin Sitewide Comment Control scored 94% from 54 tests.

About plugin

  • Plugin page: sitewide-comment-...
  • Plugin version: 3.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 5.9.2
  • First release: Mar 22, 2012
  • Latest release: Jul 29, 2021
  • Number of updates: 43
  • Update frequency: every 79.4 days
  • Top authors: Ipstenu (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 4,900 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
Install script ran successfully

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

Analyzing server-side resources used by Sitewide Comment Control
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0158.37 ▼3.77
Dashboard /wp-admin3.41 ▲0.0035.43 ▲1.06
Posts /wp-admin/edit.php3.64 ▲0.0038.23 ▼0.16
Add New Post /wp-admin/post-new.php6.88 ▼0.0993.19 ▼1,175.27
Media Library /wp-admin/upload.php3.29 ▲0.0024.54 ▼0.84

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Sitewide Comment Control
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲5516.21 ▲0.475.79 ▼0.692.58 ▲0.16
Dashboard /wp-admin2,902 ▲516.15 ▲0.00130.57 ▼13.76166.34 ▼23.11
Posts /wp-admin/edit.php2,688 ▼63.24 ▲0.0162.03 ▼2.16141.58 ▼4.84
Add New Post /wp-admin/post-new.php1,773 ▲2121.95 ▲0.35447.76 ▼26.45176.79 ▲13.66
Media Library /wp-admin/upload.php1,695 ▲15.54 ▲0.06146.82 ▼27.18230.27 ▲44.27

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 Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sitewide-comment-control/sitewide-comment-control.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: moderate, network, multisite, ban, comment...

sitewide-comment-control/sitewide-comment-control.php Passed 13 tests

The main PHP script in "Sitewide Comment Control" version 3.1.1 is automatically included on every request by WordPress
70 characters long description:
Block specific users from commenting network wide by user ID or email.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin240 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP25072229
XML10011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity6.12
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected