73% kk-star-ratings

Code Review | kk Star Ratings

WordPress plugin kk Star Ratings scored73%from 54 tests.

About plugin

  • Plugin page: kk-star-ratings
  • Plugin version: 5.4.6
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: May 28, 2011
  • Latest release: Oct 21, 2023
  • Number of updates: 299
  • Update frequency: every 15.2 days
  • Top authors: bhittani (100%)

Code review

54 tests

User reviews

166 reviews

Install metrics

100,000+ active /1,754,391 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲5.15MB] [CPU: ▲26.66ms] 75% from 4 tests

Server-side resources used by kk Star Ratings
Please have a look at the following items
  • Extra RAM: Extra memory usage must be kept under 5MB (currently 5.15MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.89 ▲5.4393.44 ▲49.89
Dashboard /wp-admin8.91 ▲5.5777.57 ▲12.64
Posts /wp-admin/edit.php8.91 ▲5.5685.45 ▲35.50
Add New Post /wp-admin/post-new.php9.92 ▲4.03120.67 ▲21.48
Media Library /wp-admin/upload.php8.91 ▲5.6872.73 ▲37.03
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9162.91

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 370 new files
Database: no new tables, 24 new options
New WordPress options
kksr_greet
db_upgraded
kksr_locations
kksr_grs
fs_accounts
kksr_position
kksr_migrations
kksr_gap
fs_active_plugins
widget_recent-posts
...

Browser metrics Passed 4 tests

An overview of browser requirements for kk Star Ratings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.63 ▲0.351.91 ▼0.1530.62 ▼12.79
Dashboard /wp-admin2,228 ▲515.54 ▼0.0497.40 ▼1.6546.74 ▲2.08
Posts /wp-admin/edit.php2,131 ▲311.95 ▼0.0735.38 ▼2.1734.77 ▼3.12
Add New Post /wp-admin/post-new.php6,294 ▲4,88820.92 ▲3.07860.77 ▲205.7475.15 ▲22.39
Media Library /wp-admin/upload.php1,433 ▲364.20 ▼0.01100.19 ▲0.8144.02 ▲1.92
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0881.6722.4026.35

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
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/kk-star-ratings/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 24 options in the database
    • widget_recent-posts
    • kksr_enable
    • widget_recent-comments
    • fs_accounts
    • kksr_stars
    • fs_active_plugins
    • widget_theysaidso_widget
    • kksr_legend
    • theysaidso_admin_options
    • kksr_gap
    • ...

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
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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Bhittani\\StarRating\\functions\\autoload_class() in wp-content/plugins/kk-star-ratings/src/classes/Migration.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
10 plugin tags: unlimited stars, google rich snippets, ajax ratings, star ratings, rate posts...

kk-star-ratings/index.php 92% from 13 tests

The main file in "kk Star Ratings" v. 5.4.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("kk-star-ratings.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin37,461 lines of code in 301 files:
LanguageFilesBlank linesComment linesLines of code
PHP2729,11718,61536,641
Markdown21800357
JavaScript97083352
CSS152523102
SVG3009

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity88.20
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.57
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces18
Interfaces0
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes00.00%
Methods1,274
▷ Static methods19715.46%
▷ Public methods88569.47%
▷ Protected methods171.33%
▷ Private methods37229.20%
Functions257
▷ Named functions23189.88%
▷ Anonymous functions2610.12%
Constants147
▷ Global constants9967.35%
▷ Class constants4832.65%
▷ Public constants48100.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
3 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/kk-star-ratings.png9.16KB5.26KB▼ 42.58%