78% rating-schema

Code Review | Wordpress Star Rating Plugin

WordPress plugin Wordpress Star Rating Plugin scored78%from 54 tests.

About plugin

  • Plugin page: rating-schema
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.9.7
  • WordPress version: 6.3.1
  • First release: Nov 19, 2018
  • Latest release: Nov 29, 2018
  • Number of updates: 12
  • Update frequency: every 1.1 days
  • Top authors: jayanthi95 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /776 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.29MB] [CPU: ▼1.83ms] Passed 4 tests

Analyzing server-side resources used by Wordpress Star Rating Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2944.84 ▲2.93
Dashboard /wp-admin3.59 ▲0.2959.55 ▲9.75
Posts /wp-admin/edit.php3.70 ▲0.3554.25 ▲3.30
Add New Post /wp-admin/post-new.php6.20 ▲0.3192.20 ▼15.84
Media Library /wp-admin/upload.php3.51 ▲0.2836.47 ▲2.31
Settings /wp-admin/admin.php?page=wp-srp-schema-settings3.5238.49
WP Star Rating /wp-admin/admin.php?page=wp-srp-schema3.7637.64

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 24 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
wpsrp_wp_1_2_data_fix
theysaidso_admin_options
wpsrp_wp_installed_version

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Star Rating Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,823 ▲6214.35 ▼0.001.89 ▲0.1143.52 ▼1.52
Dashboard /wp-admin2,216 ▲395.56 ▼0.1086.35 ▼9.7539.50 ▼6.06
Posts /wp-admin/edit.php2,124 ▲212.02 ▼0.0038.50 ▲1.6332.32 ▼1.55
Add New Post /wp-admin/post-new.php7,047 ▲5,51126.48 ▲3.60920.80 ▲251.4469.86 ▲16.86
Media Library /wp-admin/upload.php1,430 ▲304.23 ▲0.05102.75 ▼6.7042.48 ▼2.08
Settings /wp-admin/admin.php?page=wp-srp-schema-settings1,0693.4247.8624.45
WP Star Rating /wp-admin/admin.php?page=wp-srp-schema5,4904.2882.6639.70

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 8 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • wpsrp_wp_1_2_data_fix
    • widget_recent-comments
    • wpsrp_wp_installed_version
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-srp-schema
    • > Notice in wp-content/plugins/rating-schema/includes/main.php+103
    Undefined variable: html
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-srp-schema
    • > Notice in wp-content/plugins/rating-schema/includes/views/schema-options.php+464
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-srp-schema
    • > Notice in wp-content/plugins/rating-schema/includes/views/schema-options.php+464
    Trying to access array offset on value of type null

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
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WP_SRP_SCHEMA_VERSION - assumed 'WP_SRP_SCHEMA_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/rating-schema/includes/main.php on line 15
    • > PHP Warning
      Use of undefined constant WP_SRP_SCHEMA_URL - assumed 'WP_SRP_SCHEMA_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/rating-schema/includes/main.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rating-schema/includes/views/schema-options.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/rating-schema/includes/classes/WpSrpMetaData.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/rating-schema/includes/views/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

rating-schema/rating-schema.php 92% from 13 tests

The entry point to "Wordpress Star Rating Plugin" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Everything looks great! No dangerous files found in this plugin5,716 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript56245382,608
PHP91861,2032,285
CSS616388823

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity40.50
▷ Minimum class complexity14.00
▷ Maximum class complexity78.00
Average method complexity5.65
▷ Minimum method complexity1.00
▷ Maximum method complexity75.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods51
▷ Static methods00.00%
▷ Public methods5098.04%
▷ Protected methods00.00%
▷ Private methods11.96%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wp-seo-schema.png3.11KB0.76KB▼ 75.44%
assets/images/help.png0.85KB0.87KB0.00%