61% rating-widget

Code Review | Rating-Widget: Star Review System

WordPress plugin Rating-Widget: Star Review System scored61%from 54 tests.

About plugin

  • Plugin page: rating-widget
  • Plugin version: 3.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2010
  • Latest release: Oct 10, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

887 reviews

Install metrics

7,000+ active /1,138,679 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲6.27MB] [CPU: ▲39.36ms] 50% from 4 tests

Server-side resources used by Rating-Widget: Star Review System
Please take the time to fix the following items
  • RAM: You should keep total memory usage under 10MB (currently 10.06MB on /wp-admin/options-general.php?page=rating-widget)
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.27MB on /wp-admin/options-general.php?page=rating-widget)
PageMemory (MB)CPU Time (ms)
Home /10.04 ▲6.5874.26 ▲33.26
Dashboard /wp-admin10.06 ▲6.7698.89 ▲50.26
Posts /wp-admin/edit.php10.06 ▲6.7182.71 ▲32.35
Add New Post /wp-admin/post-new.php10.90 ▲5.01141.42 ▲43.39
Media Library /wp-admin/upload.php10.06 ▲6.8383.33 ▲48.45
Freemius Debug [v.2.5.12.7] /wp-admin/admin.php?page=freemius10.0682.89
RatingWidget /wp-admin/options-general.php?page=rating-widget10.0681.46

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 533 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
fs_active_plugins
db_upgraded
fs_debug_mode
fs_accounts
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_ratingwidgetplugin_topratedwidget

Browser metrics Passed 4 tests

A check of browser resources used by Rating-Widget: Star Review System
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲10014.36 ▼0.191.65 ▼0.0628.80 ▼10.98
Dashboard /wp-admin2,226 ▲525.63 ▼0.0585.04 ▼19.1493.75 ▲52.62
Posts /wp-admin/edit.php2,150 ▲501.97 ▼0.0535.45 ▼1.2436.44 ▼1.89
Add New Post /wp-admin/post-new.php1,562 ▲3122.05 ▼1.08762.82 ▲72.1660.72 ▲7.78
Media Library /wp-admin/upload.php1,449 ▲494.22 ▲0.02102.83 ▲3.6271.30 ▲27.75
Freemius Debug [v.2.5.12.7] /wp-admin/admin.php?page=freemius1,1011.6830.7028.05
RatingWidget /wp-admin/options-general.php?page=rating-widget1,0671.8927.5160.00

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/rating-widget/freemius/includes/class-freemius.php+8546
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • theysaidso_admin_options
    • fs_active_plugins
    • widget_recent-comments
    • fs_accounts
    • db_upgraded
    • can_compress_scripts
    • fs_debug_mode
    • widget_ratingwidgetplugin_topratedwidget
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/rating-widget/view/pages/admin/ga.php
  • 124× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rw_settings() in wp-content/plugins/rating-widget/view/pages/admin/advanced.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/rating-widget/view/powerusers.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _erw() in wp-content/plugins/rating-widget/view/save.php:2
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/rating-widget/view/pages/admin/ga.php on line 7
    • > PHP Notice
      Trying to get property 'criteria' of non-object in wp-content/plugins/rating-widget/view/site/multi-rating.php on line 21
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/rating-widget/view/rating.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'RW_InvalidArgumentException' not found in wp-content/plugins/rating-widget/lib/sdk/exceptions/EmptyArgumentException.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function rw_options() in wp-content/plugins/rating-widget/view/settings/advanced/star.php:10
    • > PHP Notice
      Trying to get property 'size' of non-object in wp-content/plugins/rating-widget/view/star_rating.php on line 7
    • > PHP Notice
      Trying to get property 'advanced' of non-object in wp-content/plugins/rating-widget/view/star_rating.php on line 11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=rating-widget
    • > Javascript (severe) in unknown
    /wp-content/plugins/rating-widget/resources/js/jquery.ba-postmessage.min.js?ver=6.3.1 8:97 Uncaught TypeError: Cannot read properties of undefined (reading 'opera')

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (51 tag instead of maximum 10)
Please take inspiration from this readme.txt

rating-widget/rating-widget.php Passed 13 tests

This is the main PHP file of "Rating-Widget: Star Review System" version 3.2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
53 characters long description:
Create and manage Rating-Widget ratings in WordPress.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected69,461 lines of code in 455 files:
LanguageFilesBlank linesComment linesLines of code
PHP31510,02920,12348,173
CSS272378510,133
LESS558971,0974,043
Sass36496863,005
JavaScript154443641,822
PO File57338041,783
SVG100288
Markdown1680214

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,096)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 119)
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity83.43
▷ Minimum class complexity1.00
▷ Maximum class complexity3,096.00
Average method complexity4.56
▷ Minimum method complexity1.00
▷ Maximum method complexity119.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes69
▷ Abstract classes45.80%
▷ Concrete classes6594.20%
▷ Final classes11.54%
Methods1,663
▷ Static methods23614.19%
▷ Public methods1,20772.58%
▷ Protected methods231.38%
▷ Private methods43326.04%
Functions192
▷ Named functions192100.00%
▷ Anonymous functions00.00%
Constants355
▷ Global constants29783.66%
▷ Class constants5816.34%
▷ Public constants58100.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
12 PNG files occupy 0.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/img/top-rated/add-widget.png37.63KB13.82KB▼ 63.28%
resources/img/header-logo.png4.93KB2.97KB▼ 39.76%
icon.png3.71KB1.00KB▼ 72.93%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
resources/img/add-ons/facebook_likes.png6.32KB2.62KB▼ 58.59%