83% woocommerce-product-labels-lite

Code Review | Woocommerce Product Labels Lite

WordPress plugin Woocommerce Product Labels Lite scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-produ...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2014
  • Latest release: Mar 25, 2014
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: evgendob (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 1,835 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼15.47ms] Passed 4 tests

This is a short check of server-side resources used by Woocommerce Product Labels Lite
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0847.85 ▲8.54
Dashboard /wp-admin3.40 ▲0.1051.17 ▼0.63
Posts /wp-admin/edit.php3.52 ▲0.1651.56 ▲4.60
Add New Post /wp-admin/post-new.php3.20 ▼2.6834.82 ▼66.06
Media Library /wp-admin/upload.php3.30 ▲0.0737.60 ▲0.21

Server storage [IO: ▲1.12MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
These are issues you should consider
  • The plugin illegally modified 1 file (0.00KB) outside of "wp-content/plugins/woocommerce-product-labels-lite/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/woocommerce-product-labels-lite/modules/css/images/arrow/navigator - _\302\256___.png"
Filesystem: 94 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Woocommerce Product Labels Lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,130 ▲39515.70 ▲1.337.74 ▲5.8341.36 ▼0.41
Dashboard /wp-admin2,393 ▲2026.83 ▲1.96132.04 ▲27.2642.07 ▲3.74
Posts /wp-admin/edit.php2,299 ▲2073.71 ▲1.6955.54 ▲18.2935.21 ▲4.37
Add New Post /wp-admin/post-new.php1,528 ▼123.12 ▲0.06600.17 ▲0.3332.17 ▼51.06
Media Library /wp-admin/upload.php1,504 ▲1224.52 ▲0.2386.60 ▼14.1442.62 ▼0.77

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-labels-lite/modules/hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/woocommerce-product-labels-lite/modules/shortcodes.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-labels-lite/modules/meta_box.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-labels-lite/modules/scripts.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-labels-lite/modules/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-product-labels-lite/modules/meta_box.php:4

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)
No browser issues were 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
Attributes that require attention:
  • Contributors: Contributors not specified
You can take inspiration from this readme.txt

woocommerce-product-labels-lite/wp-woo-labels-lite.php 92% from 13 tests

The principal PHP file in "Woocommerce Product Labels Lite" v. 1.1 is loaded by WordPress automatically on each request
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-product-labels-lite.php" instead of "wp-woo-labels-lite.php")

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
No dangerous file extensions were detected24,175 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS141,33823915,882
JavaScript106632,5427,134
PHP79611468
HTML1400316
SVG500292
PO File17712483

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
30 compressed PNG files occupy 0.08MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/css/images/arrow/down.png0.92KB0.77KB▼ 16.28%
modules/css/images/arrow/up_dark.png0.69KB0.59KB▼ 14.85%
modules/css/images/arrow/vert_large.png2.38KB1.89KB▼ 20.75%
modules/css/images/arrow/right_dark.png0.71KB0.60KB▼ 14.92%
modules/inc/assets/css/glyphicons-halflings-white.png8.57KB9.20KB0.00%