72% treerating-customer-reviews-and-ratings

Code Review | Treerating Customer Reviews and Ratings

WordPress plugin Treerating Customer Reviews and Ratings scored 72% from 53 tests.

About plugin

  • Plugin page: treerating-custom...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 5.8.1
  • First release: Nov 10, 2015
  • Latest release: Nov 10, 2015
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: marcuslind90 (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 483 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

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

Analyzing server-side resources used by Treerating Customer Reviews and Ratings
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1340.07 ▲20.54
Dashboard /wp-admin3.08 ▲0.0239.86 ▼9.17
Posts /wp-admin/edit.php3.13 ▲0.0236.78 ▼5.16
Add New Post /wp-admin/post-new.php5.44 ▲0.0187.75 ▼1,540.20
Media Library /wp-admin/upload.php3.02 ▲0.0133.65 ▼4.98
Treerating /wp-admin/options-general.php?page=treerating2.9624.74

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 1 new option
New WordPress options
widget_treerating_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Treerating Customer Reviews and Ratings
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,680 ▲7415.95 ▲0.437.30 ▼1.7447.17 ▼1.47
Dashboard /wp-admin2,938 ▲855.86 ▲0.01138.32 ▲7.6198.73 ▲2.82
Posts /wp-admin/edit.php2,711 ▲52.69 ▼0.0064.45 ▼3.4792.49 ▲3.26
Add New Post /wp-admin/post-new.php1,482 ▼9517.01 ▼1.47359.94 ▼33.94105.99 ▼7.59
Media Library /wp-admin/upload.php1,777 ▲25.01 ▼0.00157.56 ▼1.17102.08 ▼12.18
Treerating /wp-admin/options-general.php?page=treerating1,0252.0957.1474.31

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • widget_treerating_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=treerating
    • > Notice in wp-content/plugins/treerating-customer-reviews-and-ratings/treerating-admin.php+70
    Undefined index: action

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
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/treerating-customer-reviews-and-ratings/treerating-admin.php
    • > /wp-content/plugins/treerating-customer-reviews-and-ratings/treerating.php
    • > /wp-content/plugins/treerating-customer-reviews-and-ratings/treerating-widget.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/widget.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/admin-form.php:3
    • > PHP Notice
      Undefined variable: rating in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/widget.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/widget.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/widget.php on line 4
    • > PHP Notice
      Undefined variable: rating in wp-content/plugins/treerating-customer-reviews-and-ratings/templates/widget.php on line 4

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 errors were detected

Optimizations

Plugin configuration 90% 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
4 plugin tags: rating, reviews, treerating, woocommerce

treerating-customer-reviews-and-ratings/treerating.php 77% from 13 tests

Analyzing the main PHP file in "Treerating Customer Reviews and Ratings" version 1.0.0
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("treerating-customer-reviews-and-ratings.php" instead of "treerating.php")
  • Domain Path: The domain path folder does not exist ("/i18n/languages/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected207 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP53439192
CSS12015

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity5.00
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin