84% restrict-comments

Code Review | Restrict Comments

WordPress plugin Restrict Comments scored84%from 54 tests.

About plugin

  • Plugin page: restrict-comments
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jun 25, 2021
  • Latest release: Jun 25, 2021
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: maurolopes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /376 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

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

Analyzing server-side resources used by Restrict Comments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.62 ▼2.92
Dashboard /wp-admin3.34 ▲0.0447.23 ▼6.69
Posts /wp-admin/edit.php3.39 ▲0.0448.82 ▼4.26
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.34 ▼13.70
Media Library /wp-admin/upload.php3.27 ▲0.0436.71 ▼0.90
Restrict Comments /wp-admin/edit-comments.php?page=restrict-comment3.2829.12
All Comments /wp-admin/edit-comments.php3.3341.96

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Restrict Comments
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲7014.44 ▼0.142.01 ▲0.2039.52 ▼1.64
Dashboard /wp-admin2,215 ▲385.68 ▲0.0794.98 ▲2.2442.19 ▲1.94
Posts /wp-admin/edit.php2,120 ▲172.02 ▼0.1336.29 ▼5.5231.24 ▼5.59
Add New Post /wp-admin/post-new.php1,561 ▲1623.15 ▲0.09669.64 ▲15.5555.19 ▲1.05
Media Library /wp-admin/upload.php1,417 ▲174.21 ▲0.01101.30 ▼12.4742.29 ▼6.42
Restrict Comments /wp-admin/edit-comments.php?page=restrict-comment9062.0228.4836.74
All Comments /wp-admin/edit-comments.php1,8242.2936.0335.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restrict-comments/admin/trrc-settings.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: comment, comments

restrict-comments/restrict-comments.php 85% from 13 tests

The main PHP file in "Restrict Comments" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path folder was not found ("/languages")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 154 characters long)

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 plugin350 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP34230180
CSS1202170

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin