68% cosmick-star-rating

Code Review | Cosmick Star Rating

WordPress plugin Cosmick Star Rating scored 68% from 54 tests.

About plugin

  • Plugin page: cosmick-star-rating
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 5.8.1
  • First release: Apr 20, 2015
  • Latest release: Apr 15, 2016
  • Number of updates: 23
  • Update frequency: every 15.9 days
  • Top authors: cosmick (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 5,210 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼135.70ms] Passed 4 tests

Server-side resources used by Cosmick Star Rating
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1237.74 ▼4.48
Dashboard /wp-admin3.18 ▲0.1253.10 ▼2.59
Posts /wp-admin/edit.php3.27 ▲0.1669.73 ▲18.64
Add New Post /wp-admin/post-new.php5.54 ▲0.10118.50 ▼539.23
Media Library /wp-admin/upload.php3.12 ▲0.1240.75 ▲3.50
Reviews /wp-admin/edit.php?post_type=reviews3.1743.31
Cosmick Star Rating /wp-admin/options-general.php?page=cosmick_star_rating3.0935.91
Add New /wp-admin/post-new.php?post_type=reviews3.1848.29

Server storage [IO: ▲0.07MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: 1 new table, 1 new option
New tables
wp_csr_votes
New WordPress options
widget_csr_reviews_widget

Browser metrics Passed 4 tests

Cosmick Star Rating: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,876 ▲30416.91 ▲1.5420.96 ▲12.1050.53 ▼5.74
Dashboard /wp-admin3,022 ▲916.07 ▲0.03172.35 ▲5.92116.17 ▲3.09
Posts /wp-admin/edit.php2,791 ▲522.79 ▲0.0996.15 ▲14.34105.09 ▲14.88
Add New Post /wp-admin/post-new.php1,719 ▲3618.49 ▼0.26403.82 ▼69.41115.20 ▼1.37
Media Library /wp-admin/upload.php1,859 ▲525.20 ▲0.17178.52 ▲8.14121.94 ▲4.04
Reviews /wp-admin/edit.php?post_type=reviews1,4702.8573.8175.10
Cosmick Star Rating /wp-admin/options-general.php?page=cosmick_star_rating1,2372.3970.1079.14
Add New /wp-admin/post-new.php?post_type=reviews3,1129.35278.89141.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie tables detected upon uninstall: 1 table
    • wp_csr_votes
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_csr_reviews_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=reviews
    • > Notice in wp-content/plugins/cosmick-star-rating/star-rating-post.php+57
    Trying to get property 'overall_rating' of non-object

SRP 50% 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
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cosmick-star-rating/star-rating-widget.php:5
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/cosmick-star-rating/star-rating.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cosmick-star-rating/star-rating-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cosmick-star-rating/star-rating-post.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cosmick-star-rating/star-rating.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: post rating, admin, 5 star, google star rating, five-star

cosmick-star-rating/star-rating.php 92% from 13 tests

"Cosmick Star Rating" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("cosmick-star-rating.php" instead of "star-rating.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected877 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP47423439
JavaScript35126423
CSS10115

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin