10% book-collection-star-rating

Code Review | Simple Star Rating

WordPress plugin Simple Star Rating scored10%from 54 tests.

About plugin

  • Plugin page: book-collection-s...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Jun 27, 2016
  • Latest release: Nov 19, 2016
  • Number of updates: 6
  • Update frequency: every 24.2 days
  • Top authors: kwbridge (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,357 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/book-collection-star-rating/star-rating.php+16
    Constant STAR_PLUGIN_DIR already defined

Server metrics [RAM: ▼1.93MB] [CPU: ▼52.34ms] Passed 4 tests

Server-side resources used by Simple Star Rating
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.23 ▼36.59
Dashboard /wp-admin2.08 ▼1.235.35 ▼42.39
Posts /wp-admin/edit.php2.08 ▼1.286.36 ▼41.22
Add New Post /wp-admin/post-new.php2.08 ▼3.816.41 ▼89.17
Media Library /wp-admin/upload.php2.08 ▼1.155.20 ▼26.72

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Star Rating
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲7013.56 ▼1.061.59 ▼0.3139.41 ▼11.99
Dashboard /wp-admin2,206 ▲175.83 ▲0.89104.52 ▼12.7540.31 ▼3.64
Posts /wp-admin/edit.php2,092 ▼01.99 ▼0.0741.63 ▼3.7234.40 ▼4.48
Add New Post /wp-admin/post-new.php6,311 ▲4,76922.51 ▲4.33894.93 ▲285.7258.35 ▲0.09
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.0098.23 ▼7.9341.26 ▼4.38

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
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/book-collection-star-rating/star-rating.php+16
    Constant STAR_PLUGIN_DIR already defined
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/book-collection-star-rating/includes/functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/book-collection-star-rating/star-rating.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
3 plugin tags: reviews, rating, star rating

book-collection-star-rating/star-rating.php 92% from 13 tests

This is the main PHP file of "Simple Star Rating" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("book-collection-star-rating.php" instead of "star-rating.php")

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
Success! There were no dangerous files found in this plugin159 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2352696
CSS15037
JavaScript18326

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
includes/star.png1.40KB1.44KB0.00%