68% ratingwp

Code Review | RatingWP - Rating Sytem for WordPress

WordPress plugin RatingWP - Rating Sytem for WordPress scored68%from 54 tests.

About plugin

  • Plugin page: ratingwp
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Jul 28, 2021
  • Latest release: Sep 16, 2021
  • Number of updates: 7
  • Update frequency: every 7.1 days
  • Top authors: ratingwp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /586 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.39MB] [CPU: ▼2.50ms] Passed 4 tests

Server-side resources used by RatingWP - Rating Sytem for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2637.60 ▼6.65
Dashboard /wp-admin3.73 ▲0.4350.14 ▼4.90
Posts /wp-admin/edit.php3.84 ▲0.4952.98 ▲6.24
Add New Post /wp-admin/post-new.php6.35 ▲0.4686.36 ▼4.68
Media Library /wp-admin/upload.php3.65 ▲0.4241.54 ▲7.39
Submissions /wp-admin/admin.php?page=rawp_submissions3.6341.08
Forms /wp-admin/admin.php?page=rawp_forms3.6235.82
Settings /wp-admin/admin.php?page=rawp_settings3.6231.23

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 36 new files
Database: 8 new tables, 7 new options
New tables
wp_rawp_subject
wp_rawp_form_entry
wp_rawp_form
wp_rawp_criteria_numeric
wp_rawp_criteria
wp_rawp_form_criteria
wp_rawp_criteria_lookup
wp_rawp_criteria_star_rating
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
rawp_general_settings
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for RatingWP - Rating Sytem for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,966 ▲22013.92 ▼0.465.44 ▲3.6240.68 ▼2.51
Dashboard /wp-admin2,264 ▲765.17 ▲0.26101.72 ▼12.6636.56 ▼6.10
Posts /wp-admin/edit.php2,151 ▲622.50 ▲0.4943.07 ▲4.8835.94 ▲0.90
Add New Post /wp-admin/post-new.php6,406 ▲4,88728.06 ▲4.94948.42 ▲270.9639.34 ▼15.16
Media Library /wp-admin/upload.php1,443 ▲584.44 ▲0.2596.40 ▼3.0140.79 ▼3.14
Submissions /wp-admin/admin.php?page=rawp_submissions1,0812.1326.5126.64
Forms /wp-admin/admin.php?page=rawp_forms8912.1028.9424.23
Settings /wp-admin/admin.php?page=rawp_settings1,0482.5841.6629.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure failed, leaving 8 tables in the database
    • wp_rawp_criteria_numeric
    • wp_rawp_subject
    • wp_rawp_criteria
    • wp_rawp_criteria_star_rating
    • wp_rawp_criteria_lookup
    • wp_rawp_form
    • wp_rawp_form_entry
    • wp_rawp_form_criteria
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • rawp_general_settings
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ratingwp/templates/rating-list-table.php
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: subject_form_rating_list in wp-content/plugins/ratingwp/templates/rating-list-table.php on line 23
    • > PHP Notice
      Undefined variable: form in wp-content/plugins/ratingwp/templates/rating-form.php on line 6
    • > PHP Notice
      Undefined variable: default_style in wp-content/plugins/ratingwp/templates/rating-list-table.php on line 6
    • > PHP Notice
      Undefined variable: default_style in wp-content/plugins/ratingwp/templates/rating-list-table.php on line 6
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/ratingwp/templates/rating-list-table.php on line 23
    • > PHP Notice
      Undefined variable: fixed_width_table_cells in wp-content/plugins/ratingwp/templates/rating-list-table.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ratingwp/templates/rating-form.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/ratingwp/templates/rating-summary-details.php:82
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ratingwp/includes/admin/class-forms-admin.php:586
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/ratingwp/templates/star-rating.php:1

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 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in ratingwp/assets to your readme.txt
You can look at the official readme.txt

ratingwp/ratingwp.php 85% from 13 tests

The primary PHP file in "RatingWP - Rating Sytem for WordPress" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: The domain path must begin with a forward slash character ("/languages")

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
No dangerous file extensions were detected20,596 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
JSON20015,853
PHP186896082,733
JavaScript63021821,823
CSS2186186
Markdown1001

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.45
Average class complexity43.50
▷ Minimum class complexity15.00
▷ Maximum class complexity68.00
Average method complexity6.67
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods30
▷ Static methods516.67%
▷ Public methods2893.33%
▷ Protected methods00.00%
▷ Private methods26.67%
Functions48
▷ Named functions4491.67%
▷ Anonymous functions48.33%
Constants5
▷ Global constants5100.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
There were not PNG files found in your plugin