78% simple-comment-rating

Code Review | Simple Comment Rating

WordPress plugin Simple Comment Rating scored78%from 54 tests.

About plugin

  • Plugin page: simple-comment-ra...
  • Plugin version: 0.1 Alpha...
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.6-3.5.2
  • WordPress version: 6.3.1
  • First release: Oct 16, 2012
  • Latest release: Jun 26, 2013
  • Number of updates: 62
  • Update frequency: every 4.1 days
  • Top authors: rockschtar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,708 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.10MB] [CPU: ▼4.81ms] Passed 4 tests

Analyzing server-side resources used by Simple Comment Rating
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1044.06 ▲2.13
Dashboard /wp-admin3.41 ▲0.1048.65 ▼5.84
Posts /wp-admin/edit.php3.52 ▲0.1650.32 ▼5.94
Add New Post /wp-admin/post-new.php5.99 ▲0.1091.88 ▼9.60
Media Library /wp-admin/upload.php3.33 ▲0.1042.35 ▲5.28

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 24 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Simple Comment Rating
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.23 ▼0.161.86 ▼0.1144.62 ▼1.43
Dashboard /wp-admin2,186 ▲65.54 ▼0.0686.87 ▼8.8040.77 ▼1.99
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0335.19 ▼1.5333.41 ▼6.75
Add New Post /wp-admin/post-new.php1,526 ▼023.06 ▼0.37694.92 ▲19.7767.32 ▲14.32
Media Library /wp-admin/upload.php1,403 ▲34.19 ▼0.0297.18 ▼15.7643.16 ▼2.16

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/simple-comment-rating/controller/SettingsController.php
    • > /wp-content/plugins/simple-comment-rating/classes/Constants.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/simple-comment-rating/widgets/TopRatedCommentsWidget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/simple-comment-rating/views/admin/settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/simple-comment-rating/plugin.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === simple-comment-rating === )
Please take inspiration from this readme.txt

simple-comment-rating/plugin.php 85% from 13 tests

The principal PHP file in "Simple Comment Rating" v. 0.1 Alpha... is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("simple-comment-rating.php" instead of "plugin.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "0.1 Alpha...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected626 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP1015517452
CSS217099
JavaScript224154
PO File12921

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity5.20
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods49
▷ Static methods4795.92%
▷ Public methods4183.67%
▷ Protected methods00.00%
▷ Private methods816.33%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants28
▷ Global constants414.29%
▷ Class constants2485.71%
▷ Public constants24100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
styles/images/thumb_up.png0.95KB1.03KB0.00%
styles/images/accept.png1.82KB1.62KB▼ 10.74%
styles/images/thumb_down.png0.95KB1.04KB0.00%
styles/images/thumb_up_disabled.png3.84KB1.13KB▼ 70.59%
styles/images/thumb_down_disabled.png3.83KB1.11KB▼ 71.12%