83% woocommerce-product-review-sorting

Code Review | WooCommerce Product Review Sorting

WordPress plugin WooCommerce Product Review Sorting scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.9.5
  • WordPress version: 6.3.1
  • First release: Apr 3, 2015
  • Latest release: May 17, 2018
  • Number of updates: 27
  • Update frequency: every 42.2 days
  • Top authors: Dualcube (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /2,342 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
Install script ran successfully

Server metrics [RAM: ▲0.24MB] [CPU: ▼9.19ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Product Review Sorting
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1846.44 ▲4.10
Dashboard /wp-admin3.58 ▲0.2354.43 ▼11.40
Posts /wp-admin/edit.php3.69 ▲0.3351.28 ▼7.40
Add New Post /wp-admin/post-new.php6.16 ▲0.2789.76 ▼22.05
Media Library /wp-admin/upload.php3.50 ▲0.2746.46 ▲7.06
WC Review Sort /wp-admin/admin.php?page=wc-product-review-sorting-setting-admin3.4834.98

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Product Review Sorting
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,923 ▲16213.48 ▼1.219.69 ▲8.1242.08 ▲3.93
Dashboard /wp-admin2,224 ▲545.60 ▼0.0598.01 ▼1.0443.11 ▲2.08
Posts /wp-admin/edit.php2,124 ▲212.14 ▲0.0935.61 ▼4.3333.47 ▼5.57
Add New Post /wp-admin/post-new.php1,571 ▲1723.21 ▲4.98706.09 ▲50.9154.09 ▲2.98
Media Library /wp-admin/upload.php1,426 ▲294.32 ▲0.05106.29 ▼1.4447.10 ▼1.57
WC Review Sort /wp-admin/admin.php?page=wc-product-review-sorting-setting-admin9232.1524.4328.47

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woocommerce-product-review-sorting/templates/woocommerce/single-product-reviews.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woocommerce-product-review-sorting/templates/woocommerce-2.3/single-product-reviews.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

woocommerce-product-review-sorting/product_review_sorting.php 92% from 13 tests

The main file in "WooCommerce Product Review Sorting" v. 1.0.7 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("woocommerce-product-review-sorting.php" instead of "product_review_sorting.php")

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
Success! There were no dangerous files found in this plugin3,849 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS43612162,162
PHP143412551,428
PO File15373130
JavaScript3172129

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity31.33
▷ Minimum class complexity2.00
▷ Maximum class complexity165.00
Average method complexity5.20
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods65
▷ Static methods23.08%
▷ Public methods65100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/fpd/grid.png2.69KB0.13KB▼ 95.17%
assets/images/dualcube.png3.29KB0.65KB▼ 80.17%
assets/images/placeholder.png2.75KB2.92KB0.00%
(invalid) assets/images/question_mark.png0.86KB0.00KB▼ 100.00%
assets/images/dclogo-2x.png4.35KB1.74KB▼ 60.10%