10% woocommerce-smart-collection

Code Review | WooCommerce Smart Collection

WordPress plugin WooCommerce Smart Collection scored10%from 54 tests.

About plugin

  • Plugin page: woocommerce-smart...
  • Plugin version: 1.0.13
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6
  • WordPress version: 6.3.1
  • First release: Mar 25, 2014
  • Latest release: Feb 23, 2017
  • Number of updates: 34
  • Update frequency: every 31.4 days
  • Top authors: Dualcube (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

60+ active /4,566 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method DC_Woo_Smart_Collection::activate_dc_Woo_Smart_Collection() should not be called statically

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

A check of server-side resources used by WooCommerce Smart Collection
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.89 ▼1.71
Dashboard /wp-admin3.34 ▲0.0046.90 ▼13.27
Posts /wp-admin/edit.php3.40 ▲0.0445.94 ▲0.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.64 ▼23.89
Media Library /wp-admin/upload.php3.27 ▲0.0440.08 ▲5.84

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 31 new files
Database: no new tables, 8 new options
New WordPress options
dc_Woo_Smart_Collection_installed
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_recent-comments
dc_dc_WC_SC_general_settings_name

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Smart Collection
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲5713.27 ▼1.111.72 ▼0.2243.81 ▼0.57
Dashboard /wp-admin2,234 ▲435.86 ▲0.98102.67 ▲1.4083.10 ▲41.04
Posts /wp-admin/edit.php2,120 ▲312.01 ▼0.0438.08 ▲0.2333.98 ▼1.89
Add New Post /wp-admin/post-new.php1,693 ▲16522.03 ▲3.71747.58 ▲69.1654.24 ▼14.86
Media Library /wp-admin/upload.php1,410 ▲224.18 ▼0.1197.91 ▼5.1176.78 ▲31.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method DC_Woo_Smart_Collection::deactivate_dc_Woo_Smart_Collection() should not be called statically
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • dc_dc_WC_SC_general_settings_name
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

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

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 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
These attributes need your attention:
  • Tags: You are using too many tags: 29 tag instead of maximum 10
Please take inspiration from this readme.txt

woocommerce-smart-collection/Woo_Smart_Collection.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce Smart Collection" version 1.0.13
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-smart-collection.php" instead of "Woo_Smart_Collection.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,364 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP102922641,103
JavaScript4141157
CSS39165
PO File1111439

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity35.43
▷ Minimum class complexity2.00
▷ Maximum class complexity137.00
Average method complexity4.77
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods64100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png2.75KB2.92KB0.00%
lib/jquery/upload/images/Placeholder.png4.94KB2.59KB▼ 47.59%
assets/images/fpd/grid.png2.69KB0.13KB▼ 95.17%
assets/images/dualcube_logo.png3.86KB3.47KB▼ 9.97%
(invalid) assets/images/question_mark.png0.86KB0.00KB▼ 100.00%