78% customer-reviews-for-woocommerce

Code Review | Customer Reviews for WooCommerce

WordPress plugin Customer Reviews for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: customer-reviews-...
  • Plugin version: 3.2
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.8.1
  • First release: Aug 10, 2021
  • Latest release: Mar 2, 2022
  • Number of updates: 24
  • Update frequency: every 8.5 days
  • Top authors: trustindex (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 5,293 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.83MB] [CPU: ▼167.11ms] Passed 4 tests

Analyzing server-side resources used by Customer Reviews for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.7729.36 ▲2.84
Dashboard /wp-admin3.94 ▲0.8741.21 ▲0.20
Posts /wp-admin/edit.php3.98 ▲0.8637.71 ▲3.13
Add New Post /wp-admin/post-new.php6.47 ▲1.0367.65 ▼674.61
Media Library /wp-admin/upload.php3.84 ▲0.8327.11 ▲3.49
Customer Reviews (Trustindex) New /wp-admin/admin.php?page=customer-reviews-for-woocommerce/settings.php3.8129.20

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 105 new files
Database: no new tables, 3 new options
New WordPress options
widget_trustindex_woocommerce_widget
trustindex-woocommerce-active
trustindex-woocommerce-version

Browser metrics Passed 4 tests

A check of browser resources used by Customer Reviews for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲16715.57 ▼0.419.43 ▲4.5074.88 ▼3.39
Dashboard /wp-admin3,032 ▲1366.17 ▲0.01115.43 ▼13.18198.32 ▲28.97
Posts /wp-admin/edit.php2,846 ▲1033.39 ▲0.0264.67 ▲1.03142.16 ▲6.29
Add New Post /wp-admin/post-new.php3,535 ▼20818.44 ▼0.35422.25 ▼19.35183.67 ▲1.91
Media Library /wp-admin/upload.php1,856 ▲1045.55 ▲0.10126.70 ▼19.02201.97 ▲23.07
Customer Reviews (Trustindex) New /wp-admin/admin.php?page=customer-reviews-for-woocommerce/settings.php9482.4746.3669.67

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_trustindex_woocommerce_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% 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
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/invite_list.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/troubleshooting.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/customer-reviews-for-woocommerce.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/settings.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/more_features.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/trustindex-woocommerce-widget.class.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/my_reviews.php
    • > /wp-content/plugins/customer-reviews-for-woocommerce/tabs/unsubscribes.php
  • 28× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: ti_command in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/previous_invites.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_previous_orders() on null in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/previous_invites.php:36
    • > PHP Notice
      Undefined variable: ti_command in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/show_reviews.php on line 76
    • > PHP Notice
      Undefined variable: list_page_term in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/_filter_pagination.php on line 2
    • > PHP Notice
      Undefined variable: ti_command in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/setup_trustindex.php on line 28
    • > PHP Notice
      Undefined variable: page_url in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/_filter_pagination.php on line 2
    • > PHP Notice
      Undefined variable: trustindex_woocommerce in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/setup_trustindex.php on line 49
    • > PHP Notice
      Undefined variable: _page in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/setup_trustindex.php on line 9
    • > PHP Notice
      Undefined variable: ti_command in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/show_reviews.php on line 132
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/customer-reviews-for-woocommerce/tabs/setup/show_reviews.php:137

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention: The official readme.txt is a good inspiration

customer-reviews-for-woocommerce/customer-reviews-for-woocommerce.php 92% from 13 tests

The principal PHP file in "Customer Reviews for WooCommerce" v. 3.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 162 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin7,741 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP1712467,711
SVG30026
JavaScript3003
CSS1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity108.67
▷ Minimum class complexity3.00
▷ Maximum class complexity266.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods107
▷ Static methods109.35%
▷ Public methods10598.13%
▷ Protected methods00.00%
▷ Private methods21.87%
Functions16
▷ Named functions318.75%
▷ Anonymous functions1381.25%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
static/img/trustindex-sign-logo.png0.68KB0.46KB▼ 32.04%