84% comments-ratings

Code Review | Comments Ratings

WordPress plugin Comments Ratings scored84%from 54 tests.

About plugin

  • Plugin page: comments-ratings
  • Plugin version: 1.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.0-5.9.0
  • WordPress version: 6.3.1
  • First release: Oct 14, 2015
  • Latest release: Apr 6, 2023
  • Number of updates: 18
  • Update frequency: every 151.7 days
  • Top authors: euthelup (77.78%)pixelgrade (16.67%)babbardel (16.67%)

Code review

54 tests

User reviews

5 reviews

Install metrics

6,000+ active /162,125 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.25MB] [CPU: ▼7.46ms] Passed 4 tests

An overview of server-side resources used by Comments Ratings
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.3036.89 ▼4.76
Dashboard /wp-admin3.59 ▲0.2545.33 ▼14.11
Posts /wp-admin/edit.php3.64 ▲0.2947.94 ▼2.61
Add New Post /wp-admin/post-new.php6.12 ▲0.2381.05 ▼8.34
Media Library /wp-admin/upload.php3.45 ▲0.2336.67 ▲4.65
Comments Ratings /wp-admin/options-general.php?page=comments-ratings3.5133.08

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 67 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
pixreviews_settings
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Comments Ratings
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲14614.07 ▼0.305.83 ▲3.7442.95 ▲1.43
Dashboard /wp-admin2,210 ▲224.88 ▲0.02103.83 ▼10.4339.96 ▼5.36
Posts /wp-admin/edit.php2,090 ▲11.98 ▼0.0736.34 ▼1.1534.22 ▲0.08
Add New Post /wp-admin/post-new.php1,537 ▲1823.15 ▼0.14631.38 ▼62.3654.90 ▼3.49
Media Library /wp-admin/upload.php1,389 ▲44.19 ▼0.0095.03 ▼5.6940.36 ▼1.15
Comments Ratings /wp-admin/options-general.php?page=comments-ratings1,0911.9822.5729.23

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • pixreviews_settings
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/comments-ratings/settings/labels.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'pixreviews' not found in wp-content/plugins/comments-ratings/views/admin.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/comments-ratings/core/defaults.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/comments-ratings/plugin-defaults.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/comments-ratings/settings/general.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: reviews, comments, rating

comments-ratings/comments-ratings.php 92% from 13 tests

Analyzing the main PHP file in "Comments Ratings" version 1.1.7
You should first fix the following items:
  • Domain Path: The domain path is invalid: folder "/lang" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin2,336 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP454891,0391,510
JavaScript318931665
CSS211174
Sass16034
Markdown17026
SVG10015
XML10012

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.35
Average class complexity8.25
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces7
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods137
▷ Static methods3223.36%
▷ Public methods11886.13%
▷ Protected methods1913.87%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/star-on.png0.62KB0.61KB▼ 1.58%
images/star-off.png0.67KB0.61KB▼ 9.05%
images/cancel-on.png0.70KB0.72KB0.00%
images/star-half.png0.65KB0.65KB0.00%
images/default_radio_image.png2.62KB1.89KB▼ 27.94%