68% gd-rating-system

Code Review | GD Rating System

WordPress plugin GD Rating System scored68%from 54 tests.

About plugin

  • Plugin page: gd-rating-system
  • Plugin version: 3.5
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 25, 2015
  • Latest release: Mar 29, 2023
  • Number of updates: 94
  • Update frequency: every 28.3 days
  • Top authors: GDragoN (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

2,000+ active /115,712 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲3.29MB] [CPU: ▲15.04ms] Passed 4 tests

Analyzing server-side resources used by GD Rating System
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.24 ▲2.7862.84 ▲16.44
Dashboard /wp-admin6.78 ▲3.4371.06 ▲7.42
Posts /wp-admin/edit.php6.83 ▲3.4771.15 ▲15.48
Add New Post /wp-admin/post-new.php9.61 ▲3.72123.01 ▲26.54
Media Library /wp-admin/upload.php6.70 ▲3.4759.56 ▲20.80

Server storage [IO: ▲4.32MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 498 new files
Database: 6 new tables, 21 new options
New tables
wp_gdrts_cache
wp_gdrts_items
wp_gdrts_logs
wp_gdrts_items_basic
wp_gdrts_logmeta
wp_gdrts_itemmeta
New WordPress options
widget_gdrts_stars_rating_block
dev4press_gd-rating-system_templates
dev4press_gd-rating-system_load
widget_gdrts_stars_rating_list
dev4press_gd-rating-system_rules
dev4press_gd-rating-system_methods
dev4press_gd-rating-system_settings
widget_gdrts_like_this_block
widget_recent-posts
theysaidso_admin_options
...

Browser metrics Passed 4 tests

GD Rating System: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,858 ▲9714.76 ▲0.831.51 ▼0.1745.39 ▲1.07
Dashboard /wp-admin2,264 ▲905.64 ▲0.0483.85 ▼25.1242.11 ▼2.58
Posts /wp-admin/edit.php2,172 ▲722.03 ▲0.0437.46 ▼1.6036.12 ▼0.57
Add New Post /wp-admin/post-new.php11,062 ▲9,52719.46 ▲1.26937.33 ▲303.0543.50 ▼28.35
Media Library /wp-admin/upload.php1,469 ▲694.27 ▲0.0796.56 ▼8.0447.47 ▼2.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure failed, leaving 6 tables in the database
    • wp_gdrts_items_basic
    • wp_gdrts_itemmeta
    • wp_gdrts_cache
    • wp_gdrts_logmeta
    • wp_gdrts_logs
    • wp_gdrts_items
  • This plugin did not uninstall successfully, leaving 21 options in the database
    • dev4press_gd-rating-system_methods
    • dev4press_gd-rating-system_addons
    • dev4press_gd-rating-system_core
    • can_compress_scripts
    • widget_recent-posts
    • dev4press_gd-rating-system_early
    • dev4press_gd-rating-system_info
    • theysaidso_admin_options
    • db_upgraded
    • widget_gdrts_stars_rating_block
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gd-rating-system/templates/gdrts--system--run-javascript-core.php
  • 51× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/like-this/gdrts--like-this--list--widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/gd-rating-system/addons/shortcode-builder/forms/shortcode.php:6
    • > PHP Warning
      include(GDRTS_PATHforms/shared/top.php): failed to open stream: No such file or directory in wp-content/plugins/gd-rating-system/addons/shortcode-builder/forms/shortcodes.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/like-this/gdrts--like-this--list--default-list.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/like-this/gdrts--like-this--list--shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/like-this/gdrts--like-this--single--classic.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrtsa_rich_snippets() in wp-content/plugins/gd-rating-system/addons/rich-snippets/snippets/blog_posting/meta.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/like-this/gdrts--like-this--single--default.php:3
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/gd-rating-system/addons/rich-snippets/forms/preview.php on line 36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function gdrts_loop() in wp-content/plugins/gd-rating-system/templates/stars-rating/gdrts--stars-rating--single--feed.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: rate posts, vote, stars, dev4press, rating...

gd-rating-system/gd-rating-system.php 92% from 13 tests

The principal PHP file in "GD Rating System" v. 3.5 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected43,367 lines of code in 442 files:
LanguageFilesBlank linesComment linesLines of code
PHP2967,4621,07629,177
CSS50860475,504
JavaScript656111563,603
SVG3003,223
Sass2835201,860

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.12
▷ Minimum class complexity1.00
▷ Maximum class complexity117.00
Average method complexity2.78
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes185
▷ Abstract classes3217.30%
▷ Concrete classes15382.70%
▷ Final classes00.00%
Methods1,525
▷ Static methods865.64%
▷ Public methods1,23380.85%
▷ Protected methods15710.30%
▷ Private methods1358.85%
Functions251
▷ Named functions251100.00%
▷ Anonymous functions00.00%
Constants63
▷ Global constants2336.51%
▷ Class constants4063.49%
▷ Public constants40100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.42MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/methods/stars/heart.png28.34KB13.36KB▼ 52.87%
css/methods/stars/crystal.png62.42KB20.72KB▼ 66.80%
css/methods/stars/star.png27.93KB14.45KB▼ 48.25%
css/methods/likes/like.png8.89KB4.15KB▼ 53.29%
css/methods/stars/snowflake.png69.97KB33.54KB▼ 52.06%