10% random-comment-widget

Code Review | Random Comment Widget

WordPress plugin Random Comment Widget scored10%from 54 tests.

About plugin

  • Plugin page: random-comment-wi...
  • Plugin version: 1...
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-3.5
  • WordPress version: 6.3.1
  • First release: Jan 6, 2013
  • Latest release: Jan 6, 2013
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: hammer404 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,298 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/random-comment-widget/random-comment-widget.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; random_comment_widget has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼51.79ms] Passed 4 tests

Server-side resources used by Random Comment Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.188.76 ▼31.63
Dashboard /wp-admin2.29 ▼1.0110.77 ▼41.17
Posts /wp-admin/edit.php2.29 ▼1.0610.01 ▼42.60
Add New Post /wp-admin/post-new.php2.29 ▼3.5910.07 ▼91.74
Media Library /wp-admin/upload.php2.29 ▼0.949.75 ▼26.52

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_rcw-widget
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Random Comment Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.31 ▼1.251.74 ▼0.0943.90 ▲0.31
Dashboard /wp-admin2,218 ▲155.86 ▼0.04102.76 ▼5.1042.90 ▲3.24
Posts /wp-admin/edit.php2,100 ▼32.01 ▼0.0037.82 ▼1.2636.28 ▼1.92
Add New Post /wp-admin/post-new.php1,550 ▼423.13 ▲5.14648.74 ▲27.1555.72 ▼3.82
Media Library /wp-admin/upload.php1,400 ▼04.24 ▲0.05101.77 ▼8.1746.26 ▲0.05

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in random_comment_widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_rcw-widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/random-comment-widget/random-comment-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === random-comment-widget === )
You can look at the official readme.txt

random-comment-widget/random-comment-widget.php 92% from 13 tests

"Random Comment Widget" version 1...'s primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "1...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin49 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1121049

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.06
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.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%
Functions1
▷ Named functions1100.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