10% vd-ratings

Code Review | VD Ratings

WordPress plugin VD Ratings scored10%from 54 tests.

About plugin

  • Plugin page: vd-ratings
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7
  • WordPress version: 6.3.1
  • First release: Aug 19, 2015
  • Latest release: Jan 9, 2017
  • Number of updates: 45
  • Update frequency: every 15.3 days
  • Top authors: vrajesh.dave (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,221 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Rating' does not have a method 'activate'

Server metrics [RAM: ▲0.02MB] [CPU: ▼3.95ms] Passed 4 tests

Server-side resources used by VD Ratings
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.22 ▼3.85
Dashboard /wp-admin3.32 ▲0.0250.15 ▲1.56
Posts /wp-admin/edit.php3.37 ▲0.0248.98 ▲3.31
Add New Post /wp-admin/post-new.php5.90 ▲0.0284.12 ▼11.63
Media Library /wp-admin/upload.php3.25 ▲0.0234.57 ▼1.88
VD Ratings /wp-admin/options-general.php?page=vd_rating_template3.2630.01

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for VD Ratings
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲8813.62 ▼0.761.97 ▲0.2439.80 ▼4.02
Dashboard /wp-admin2,212 ▲244.85 ▼0.04108.10 ▼8.5137.96 ▼5.39
Posts /wp-admin/edit.php2,095 ▲62.00 ▼0.0441.89 ▲5.6336.17 ▲4.37
Add New Post /wp-admin/post-new.php1,533 ▲1423.38 ▲0.51686.29 ▲17.0569.85 ▲16.24
Media Library /wp-admin/upload.php1,394 ▲94.17 ▼0.0291.93 ▼5.4342.47 ▼2.18
VD Ratings /wp-admin/options-general.php?page=vd_rating_template6921.536.3517.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Rating' does not have a method 'deactivate'
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=vd_rating_template
    • > Error in wp-admin/includes/template.php+1801
    Uncaught ArgumentCountError: Too few arguments to function do_settings_fields(), 1 passed in wp-content/plugins/vd-ratings/templates/settings.php on line 5 and exactly 2 expected in wp-admin/includes/template.php:1801
    Stack trace:
    #0 wp-content/plugins/vd-ratings/templates/settings.php(5): do_settings_fields()
    #1 wp-content/plugins/vd-ratings/vd_ratings.php(196): include('/var/www/wordpr...')
    #2 wp-includes/class-wp-hook.php(310): Rating->vd_rating_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

SRP 0% 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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/vd-ratings/vd_ratings.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/vd-ratings/templates/settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
2 plugin tags: star rating, rating

vd-ratings/vd_ratings.php 92% from 13 tests

The main PHP file in "VD Ratings" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("vd-ratings.php" instead of "vd_ratings.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin775 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript612378511
PHP21913227
CSS291037

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity23.00
▷ Minimum class complexity23.00
▷ Maximum class complexity23.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods220.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin