83% woocommerce-hot-products-by-category-and-vendor

Code Review | Woocommerce Hot products by Category and Vendor

WordPress plugin Woocommerce Hot products by Category and Vendor scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-hot-p...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.8.1
  • WordPress version: 6.3.1
  • First release: Apr 4, 2014
  • Latest release: Apr 4, 2014
  • Number of updates: 10
  • Update frequency: every 0.1 days
  • Top authors: suifengtec (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,444 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
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by Woocommerce Hot products by Category and Vendor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.64 ▼13.21
Dashboard /wp-admin3.33 ▲0.0347.29 ▼1.58
Posts /wp-admin/edit.php3.38 ▲0.0247.66 ▼0.50
Add New Post /wp-admin/post-new.php5.91 ▲0.0294.94 ▼11.50
Media Library /wp-admin/upload.php3.25 ▲0.0234.30 ▲2.61

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Hot products by Category and Vendor
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲6313.37 ▼0.981.77 ▼0.0140.27 ▼3.82
Dashboard /wp-admin2,215 ▲245.85 ▲0.93101.14 ▼14.4540.79 ▼6.13
Posts /wp-admin/edit.php2,097 ▲82.06 ▲0.0641.04 ▲3.6537.02 ▲4.54
Add New Post /wp-admin/post-new.php1,542 ▲1923.30 ▲0.03640.87 ▲42.5653.34 ▲1.33
Media Library /wp-admin/upload.php1,391 ▲34.24 ▼0.05102.46 ▲5.0343.19 ▼0.73

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
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% 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 50% 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 items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/woocommerce-hot-products-by-category-and-vendor/inc/admin.php:5
    • > PHP Notice
      Undefined variable: best_seller_categories in wp-content/plugins/woocommerce-hot-products-by-category-and-vendor/inc/widget.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/woocommerce-hot-products-by-category-and-vendor/woocommerce-hot-products-by-seller-and-category.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots require images: #1 (Screenshot-1), #2 (Screenshot-2)
Please take inspiration from this readme.txt

woocommerce-hot-products-by-category-and-vendor/woocommerce-hot-products-by-seller-and-category.php 77% from 13 tests

"Woocommerce Hot products by Category and Vendor" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-hot-products-by-category-and-vendor.php" instead of "woocommerce-hot-products-by-seller-and-category.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 239 characters long)
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin324 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP43719217
CSS10078
PO File15529

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods00.00%
▷ Private methods114.29%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin