84% product-badges

Code Review | Product Labels For WooCommerce

WordPress plugin Product Labels For WooCommerce scored 84% from 54 tests.

About plugin

  • Plugin page: product-badges
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Jul 26, 2021
  • Number of updates: 10
  • Update frequency: every 41.8 days
  • Top authors: lionplugins (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active / 3,455 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼5.95ms] Passed 4 tests

Server-side resources used by Product Labels For WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0237.54 ▼5.51
Dashboard /wp-admin3.32 ▲0.0250.28 ▲1.68
Posts /wp-admin/edit.php3.37 ▲0.0144.34 ▼5.36
Add New Post /wp-admin/post-new.php5.90 ▲0.0192.70 ▼10.09
Media Library /wp-admin/upload.php3.24 ▲0.0133.72 ▼2.85

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Product Labels For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲7913.29 ▼1.011.56 ▼0.2640.78 ▼7.93
Dashboard /wp-admin2,220 ▲355.80 ▼0.0297.10 ▼2.9137.01 ▼7.91
Posts /wp-admin/edit.php2,103 ▲142.05 ▲0.0437.07 ▲2.8233.46 ▼0.72
Add New Post /wp-admin/post-new.php1,529 ▲1523.24 ▲5.63649.19 ▲15.0650.30 ▲2.73
Media Library /wp-admin/upload.php1,402 ▲114.24 ▲0.0494.65 ▼0.5140.48 ▼1.85

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/product-badges/templates/badge.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
6 plugin tags: product stickers, product labels, badge for sale, product badges, woocommerce...

product-badges/product-badges.php Passed 13 tests

The principal PHP file in "Product Labels For WooCommerce" v. 1.0.0 is loaded by WordPress automatically on each request
69 characters long description:
Allows to create beautiful product labels for your WooCommerce store.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,306 lines of code in 31 files:
LanguageFilesBlank linesComment linesLines of code
PHP25260170929
JavaScript34513202
CSS33510175

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity5.54
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods55
▷ Static methods610.91%
▷ Public methods5294.55%
▷ Protected methods11.82%
▷ Private methods23.64%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants480.00%
▷ Class constants120.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/circle.png1.55KB0.65KB▼ 57.70%
admin/assets/images/square.png0.31KB0.09KB▼ 70.98%