90% smart-post-rating

Code Review | Smart Post Rating

WordPress plugin Smart Post Rating scored 90% from 54 tests.

About plugin

  • Plugin page: smart-post-rating
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 5.8.1
  • First release: Jan 6, 2017
  • Latest release: Jan 7, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 329 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.90MB] [CPU: ▼181.16ms] Passed 4 tests

An overview of server-side resources used by Smart Post Rating
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0234.76 ▼2.53
Dashboard /wp-admin2.75 ▼0.3023.74 ▼29.18
Posts /wp-admin/edit.php2.75 ▼0.3624.34 ▼28.32
Add New Post /wp-admin/post-new.php2.75 ▼2.6821.34 ▼651.04
Media Library /wp-admin/upload.php2.75 ▼0.2518.73 ▼16.09

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Smart Post Rating
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,813 ▲21716.10 ▲0.1611.15 ▲0.6848.46 ▼8.65
Dashboard /wp-admin2,986 ▲555.89 ▼0.12136.94 ▼22.28118.12 ▼1.34
Posts /wp-admin/edit.php2,763 ▲242.69 ▼0.0165.24 ▼5.4588.78 ▼6.32
Add New Post /wp-admin/post-new.php1,693 ▲1018.99 ▲0.23374.55 ▼15.62108.94 ▲3.75
Media Library /wp-admin/upload.php1,831 ▲185.03 ▲0.02152.10 ▼7.28124.88 ▲7.41

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: post, star rating, post rating, page, rating

smart-post-rating/main.php 92% from 13 tests

The primary PHP file in "Smart Post Rating" version 1.0.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("smart-post-rating.php" instead of "main.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected165 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2221988
CSS16144
JavaScript15033

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/star.png1.31KB1.45KB0.00%