77% judgeme-product-reviews-woocommerce

Code Review | Judge.me Product Reviews for WooCommerce

WordPress plugin Judge.me Product Reviews for WooCommerce scored77%from 54 tests.

About plugin

  • Plugin page: judgeme-product-r...
  • Plugin version: 1.3.22
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Jan 18, 2018
  • Latest release: Sep 12, 2023
  • Number of updates: 89
  • Update frequency: every 23.2 days
  • Top authors: judgeme (100%)

Code review

54 tests

User reviews

491 reviews

Install metrics

10,000+ active /104,295 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.60ms] Passed 4 tests

Server-side resources used by Judge.me Product Reviews for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.23 ▼4.92
Dashboard /wp-admin3.31 ▲0.0145.83 ▼8.11
Posts /wp-admin/edit.php3.36 ▲0.0047.90 ▼2.69
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.00 ▼6.66
Media Library /wp-admin/upload.php3.23 ▲0.0035.77 ▲1.56

Server storage [IO: ▲3.64MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 86 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Judge.me Product Reviews for WooCommerce: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.134.90 ▲2.9835.95 ▼7.84
Dashboard /wp-admin2,206 ▲155.84 ▲0.95107.79 ▲6.1438.96 ▼1.48
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0140.07 ▲2.3435.45 ▲0.75
Add New Post /wp-admin/post-new.php1,533 ▼023.27 ▼0.01612.62 ▼53.0854.72 ▼8.60
Media Library /wp-admin/upload.php1,388 ▼34.23 ▲0.0195.57 ▼1.3140.01 ▼6.05

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/all-reviews-template.php
    • > /wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php
    • > /wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/ugc-media-grid-template.php
  • 28× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: jdgm_cdn_domain in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/header-template.php on line 6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/ugc-media-grid-template.php on line 2
    • > PHP Warning
      Use of undefined constant JGM_PLUGIN_PATH - assumed 'JGM_PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/admin/style.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/admin/export-reviews-template.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/judgeme-product-reviews-woocommerce/vendor/scssphp/src/Formatter/Debug.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/judgeme-product-reviews-woocommerce/vendor/scssphp/src/Formatter/Expanded.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/judgeme-product-reviews-woocommerce/vendor/scssphp/src/Formatter/Crunched.php:22
    • > PHP Notice
      Undefined variable: all_reviews in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/all-reviews-template.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/review-tab-template.php:2
    • > PHP Notice
      Undefined variable: all_reviews in wp-content/plugins/judgeme-product-reviews-woocommerce/templates/judgeme/all-reviews-template.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
10 plugin tags: answers, review snippets, reminders, seo, woocommerce product reviews...

judgeme-product-reviews-woocommerce/judgeme.php 77% from 13 tests

The primary PHP file in "Judge.me Product Reviews for WooCommerce" version 1.3.22 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("judgeme-product-reviews-woocommerce.php" instead of "judgeme.php")
  • Requires at least: Required version must match the one declared in readme.txt ("3.5.1" instead of "3.0")
  • Description: Please keep the plugin description shorter than 140 characters (currently 164 characters long)

Code Analysis 95% 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 plugin36,049 lines of code in 60 files:
LanguageFilesBlank linesComment linesLines of code
CSS32,6541311,865
PHP472,8173,23610,278
SVG30129,061
JavaScript31,0596003,980
Sass11571769
JSON10051
Markdown221045

PHP code 0% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,178)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 163)
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity61.51
▷ Minimum class complexity1.00
▷ Maximum class complexity1,178.00
Average method complexity5.53
▷ Minimum method complexity1.00
▷ Maximum method complexity163.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes35
▷ Abstract classes25.71%
▷ Concrete classes3394.29%
▷ Final classes13.03%
Methods456
▷ Static methods194.17%
▷ Public methods14832.46%
▷ Protected methods28863.16%
▷ Private methods204.39%
Functions16
▷ Named functions212.50%
▷ Anonymous functions1487.50%
Constants76
▷ Global constants810.53%
▷ Class constants6889.47%
▷ Public constants68100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/jdgm-logo.png28.18KB14.39KB▼ 48.94%
assets/images/set-up-reviews.png1.52KB0.74KB▼ 51.57%
assets/images/review-widget.png5.18KB2.85KB▼ 45.06%
assets/images/stars.png1.50KB0.89KB▼ 40.78%
assets/images/improve-workflow.png1.47KB0.80KB▼ 45.68%