84% comment-star-rating

Code Review | Comment Star Rating

WordPress plugin Comment Star Rating scored84%from 54 tests.

About plugin

  • Plugin page: comment-star-rating
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.0.3
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Feb 10, 2019
  • Number of updates: 7
  • Update frequency: every 102.4 days
  • Top authors: metaru (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,815 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
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.43ms] Passed 4 tests

This is a short check of server-side resources used by Comment Star Rating
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1147.62 ▲3.19
Dashboard /wp-admin3.40 ▲0.0549.49 ▼15.14
Posts /wp-admin/edit.php3.52 ▲0.1749.78 ▼4.40
Add New Post /wp-admin/post-new.php5.98 ▲0.0986.99 ▼13.38
Media Library /wp-admin/upload.php3.32 ▲0.0938.44 ▲3.57
Comment Star Rating /wp-admin/options-general.php?page=comment-star-rating3.2936.37

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Comment Star Rating
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,943 ▲19714.13 ▼0.1215.29 ▲13.4438.76 ▼4.31
Dashboard /wp-admin2,199 ▲225.61 ▼0.0592.47 ▲0.8640.77 ▼2.50
Posts /wp-admin/edit.php2,104 ▲31.97 ▲0.0036.97 ▼0.2935.06 ▲2.56
Add New Post /wp-admin/post-new.php1,531 ▼422.91 ▲4.68643.72 ▼0.3852.89 ▼7.69
Media Library /wp-admin/upload.php1,404 ▲44.24 ▲0.0398.68 ▼5.3946.46 ▼3.49
Comment Star Rating /wp-admin/options-general.php?page=comment-star-rating8561.9625.6455.09

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

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 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 10× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Controller' not found in wp-content/plugins/comment-star-rating/classes/controllers/class.shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Model' not found in wp-content/plugins/comment-star-rating/classes/models/class.comment.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/comment-star-rating/templates/shortcode/settings.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Model' not found in wp-content/plugins/comment-star-rating/classes/models/class.post.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/comment-star-rating/comment-star-rating.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Controller' not found in wp-content/plugins/comment-star-rating/classes/controllers/class.comment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Controller' not found in wp-content/plugins/comment-star-rating/classes/controllers/class.main.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Model' not found in wp-content/plugins/comment-star-rating/classes/models/class.option.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CSR_Controller' not found in wp-content/plugins/comment-star-rating/classes/controllers/class.admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/comment-star-rating/templates/admin/settings.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (setting), #2 (comment form), #3 (total rating)
You can take inspiration from this readme.txt

comment-star-rating/comment-star-rating.php Passed 13 tests

"Comment Star Rating" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
55 characters long description:
WordPress plugin to rate comments on 5 beautiful stars.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,352 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP15120292649
JavaScript217512581
CSS2189122

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity3.69
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods54
▷ Static methods916.67%
▷ Public methods5296.30%
▷ Protected methods23.70%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.12MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/fivestar01.png4.93KB3.03KB▼ 38.54%
css/images/star-off.png0.67KB0.61KB▼ 9.05%
screenshot-3.png35.76KB9.30KB▼ 73.98%
screenshot-2.png18.48KB3.53KB▼ 80.88%
css/images/cancel-off.png0.68KB0.61KB▼ 11.30%