84% disable-comments-by-referer

Code Review | Disable Comments By Referer

WordPress plugin Disable Comments By Referer scored84%from 54 tests.

About plugin

  • Plugin page: disable-comments-...
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-3.8
  • WordPress version: 6.3.1
  • First release: Nov 15, 2013
  • Latest release: Nov 16, 2013
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: codebykat (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /844 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.79ms] Passed 4 tests

Server-side resources used by Disable Comments By Referer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0037.66 ▼2.73
Dashboard /wp-admin3.32 ▼0.0245.17 ▼14.29
Posts /wp-admin/edit.php3.37 ▲0.0249.34 ▼0.92
Add New Post /wp-admin/post-new.php5.90 ▲0.0180.60 ▼21.20
Media Library /wp-admin/upload.php3.24 ▲0.0135.88 ▲2.06

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Disable Comments By Referer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.13 ▼0.111.96 ▲0.2739.28 ▼5.28
Dashboard /wp-admin2,198 ▲215.62 ▼0.0487.04 ▼12.7336.01 ▼4.94
Posts /wp-admin/edit.php2,100 ▼32.04 ▼0.1136.86 ▼7.0330.67 ▼9.50
Add New Post /wp-admin/post-new.php1,531 ▼522.72 ▲4.41575.91 ▼62.7964.45 ▼53.45
Media Library /wp-admin/upload.php1,397 ▼34.11 ▼0.0699.94 ▲6.1943.76 ▲1.99

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
The following issues need your attention
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-comments-by-referer/disable-comments-by-referer-admin.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/disable-comments-by-referer/disable-comments-by-referer.php:41

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: comments, referer, blacklist, referrer, spam

disable-comments-by-referer/disable-comments-by-referer.php Passed 13 tests

The main file in "Disable Comments By Referer" v. 0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
64 characters long description:
Ban visitors from certain sites from viewing or adding comments.

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 plugin98 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP3263573
Markdown114025

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 files were detected