84% google-quick-ratings

Code Review | Google Quick Ratings

WordPress plugin Google Quick Ratings scored 84% from 54 tests.

About plugin

  • Plugin page: google-quick-ratings
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.6.1
  • WordPress version: 5.9.2
  • First release: Sep 22, 2013
  • Latest release: Aug 23, 2015
  • Number of updates: 37
  • Update frequency: every 18.9 days
  • Top authors: admn.bpg (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active / 3,035 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼303.25ms] Passed 4 tests

Analyzing server-side resources used by Google Quick Ratings
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1059.05 ▲0.75
Dashboard /wp-admin3.48 ▲0.0840.56 ▼16.07
Posts /wp-admin/edit.php3.72 ▲0.0843.19 ▼23.32
Add New Post /wp-admin/post-new.php6.96 ▼0.01102.84 ▼1,174.37
Media Library /wp-admin/upload.php3.37 ▲0.0834.93 ▲7.99
Google Quick Ratings /wp-admin/options-general.php?page=google-quick-ratings3.3426.51

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 1 new option
New WordPress options
pn_apr_settings

Browser metrics Passed 4 tests

Google Quick Ratings: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,800 ▲4616.22 ▲0.445.87 ▼0.682.46 ▼0.28
Dashboard /wp-admin2,893 ▲336.13 ▼0.02115.72 ▼7.08153.31 ▼16.13
Posts /wp-admin/edit.php2,662 ▼263.24 ▲0.0179.43 ▲13.77139.39 ▼9.32
Add New Post /wp-admin/post-new.php1,854 ▲18823.42 ▲3.02406.70 ▼19.35217.52 ▲53.20
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.06146.79 ▲4.10191.67 ▼3.47
Google Quick Ratings /wp-admin/options-general.php?page=google-quick-ratings1,2132.4298.65167.87

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 1 option
    • pn_apr_settings

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/google-quick-ratings/google-quick-ratings.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/google-quick-ratings/trunk/google-quick-ratings.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === google-quick-ratings === )
  • Screenshots: Please add an image for screenshot #1 (Google Quick Ratings plugin option)
Please take inspiration from this readme.txt

google-quick-ratings/google-quick-ratings.php Passed 13 tests

The entry point to "Google Quick Ratings" version 1.2 is a PHP file that has certain tags in its header comment area
60 characters long description:
Allows a post author to add a simple 5-star rating to posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected334 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP112951271
PO File1171763

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
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%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
10 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/star2-rating-sprite.png4.37KB2.22KB▼ 49.09%
images/euro-rating-sprite.png4.51KB2.18KB▼ 51.60%
trunk/images/heart-rating-sprite.png0.40KB0.40KB0.00%
images/heart-rating-sprite.png0.40KB0.40KB0.00%
images/star-rating-sprite.png0.48KB0.54KB0.00%