78% customer-reviews-woocommerce

Code Review | Customer Reviews for WooCommerce

WordPress plugin Customer Reviews for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: customer-reviews-...
  • Plugin version: 5.38.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Apr 5, 2017
  • Latest release: Dec 1, 2023
  • Number of updates: 333
  • Update frequency: every 7.3 days
  • Top authors: ivole (100%)

Code review

54 tests

User reviews

1315 reviews

Install metrics

60,000+ active /3,615,743 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.35MB] [CPU: ▼4.88ms] Passed 4 tests

This is a short check of server-side resources used by Customer Reviews for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3834.23 ▼4.26
Dashboard /wp-admin3.67 ▲0.3249.84 ▼15.32
Posts /wp-admin/edit.php3.72 ▲0.3648.73 ▼2.40
Add New Post /wp-admin/post-new.php6.25 ▲0.3694.54 ▲2.48
Media Library /wp-admin/upload.php3.59 ▲0.3634.97 ▲2.81

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 834 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
ivole_activation_notice
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Customer Reviews for WooCommerce
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲4614.21 ▼0.051.57 ▼0.1636.77 ▼6.22
Dashboard /wp-admin2,210 ▲365.56 ▼0.0290.61 ▼10.4643.73 ▼2.61
Posts /wp-admin/edit.php2,119 ▲191.94 ▼0.0739.98 ▲2.8136.14 ▲2.21
Add New Post /wp-admin/post-new.php1,546 ▲2023.21 ▲0.04624.74 ▼49.8846.05 ▼9.21
Media Library /wp-admin/upload.php1,412 ▲124.28 ▲0.0895.81 ▼4.5542.47 ▼1.38

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/customer-reviews-woocommerce/templates/badge-small.php
    • > /wp-content/plugins/customer-reviews-woocommerce/templates/badge-wide-vs.php
    • > /wp-content/plugins/customer-reviews-woocommerce/templates/compact-wide.php
    • > /wp-content/plugins/customer-reviews-woocommerce/templates/badge-wide.php
    • > /wp-content/plugins/customer-reviews-woocommerce/templates/compact.php
  • 71× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: strCount in wp-content/plugins/customer-reviews-woocommerce/templates/badge-wide-vs.php on line 47
    • > PHP Notice
      Undefined variable: badgeClass in wp-content/plugins/customer-reviews-woocommerce/templates/compact.php on line 1
    • > PHP Parse error
      syntax error, unexpected 'protected' (T_PROTECTED), expecting variable (T_VARIABLE) in wp-content/plugins/customer-reviews-woocommerce/vendor/giggsey/libphonenumber-for-php-lite/src/MultiFileMetadataSourceImpl.php on line 30
    • > PHP Parse error
      syntax error, unexpected '|', expecting variable (T_VARIABLE) in wp-content/plugins/customer-reviews-woocommerce/vendor/giggsey/libphonenumber-for-php-lite/src/PhoneNumberUtil.php on line 1005
    • > PHP Notice
      Undefined variable: badgeVerified in wp-content/plugins/customer-reviews-woocommerce/templates/compact.php on line 3
    • > PHP Notice
      Undefined variable: avRating in wp-content/plugins/customer-reviews-woocommerce/templates/badge-wide.php on line 43
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/customer-reviews-woocommerce/templates/badge-small.php on line 3
    • > PHP Notice
      Undefined variable: verifiedPage in wp-content/plugins/customer-reviews-woocommerce/templates/badge-small.php on line 29
    • > PHP Notice
      Undefined variable: storeStats in wp-content/plugins/customer-reviews-woocommerce/templates/compact-wide.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/customer-reviews-woocommerce/templates/badge-wide-vs.php on line 15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: woocommerce, customer reviews, review plugin, review reminder, review for discount

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

The main PHP script in "Customer Reviews for WooCommerce" version 5.38.4 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("customer-reviews-woocommerce.php" instead of "ivole.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin180,229 lines of code in 763 files:
LanguageFilesBlank linesComment linesLines of code
PHP4134,7298,51177,089
PO File2226,65938,04671,681
SVG2721117,854
CSS723336,370
JavaScript375076306,232
JSON510459
Markdown3800279
Sass4498265

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 115)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity46.13
▷ Minimum class complexity1.00
▷ Maximum class complexity388.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity115.00
Code structure
Namespaces5
Interfaces3
Traits0
Classes112
▷ Abstract classes32.68%
▷ Concrete classes10997.32%
▷ Final classes32.75%
Methods1,233
▷ Static methods18815.25%
▷ Public methods1,04885.00%
▷ Protected methods1209.73%
▷ Private methods655.27%
Functions134
▷ Named functions8966.42%
▷ Anonymous functions4533.58%
Constants112
▷ Global constants98.04%
▷ Class constants10391.96%
▷ Public constants6260.19%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 PNG files occupy 0.12MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/shield-20.png1.14KB0.80KB▼ 30.03%
img/small-star-full.png1.70KB0.82KB▼ 51.64%
img/small-star-empty-light.png1.55KB0.76KB▼ 50.94%
img/wide-star-empty-dark.png29.61KB0.86KB▼ 97.10%
img/wide-star-full-dark.png29.63KB0.86KB▼ 97.10%