84% product-sticker

Code Review | Product Sticker

WordPress plugin Product Sticker scored84%from 54 tests.

About plugin

  • Plugin page: product-sticker
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.1-6.0.3
  • WordPress version: 6.3.1
  • First release: Oct 25, 2022
  • Latest release: Oct 25, 2022
  • Number of updates: 3
  • Update frequency: every 2.0 days
  • Top authors: sereginpro (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /277 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.01MB] [CPU: ▼6.35ms] Passed 4 tests

This is a short check of server-side resources used by Product Sticker
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.29 ▼1.31
Dashboard /wp-admin3.31 ▼0.0443.50 ▼18.66
Posts /wp-admin/edit.php3.36 ▲0.0044.25 ▼0.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0092.02 ▼3.38
Media Library /wp-admin/upload.php3.23 ▲0.0034.10 ▼2.05

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Product Sticker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.35 ▲0.011.76 ▲0.0742.54 ▲0.80
Dashboard /wp-admin2,198 ▲185.53 ▼0.1685.36 ▼5.0537.12 ▼3.47
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0637.31 ▲3.6830.84 ▼7.15
Add New Post /wp-admin/post-new.php1,537 ▲1118.45 ▼4.66625.62 ▼79.8762.65 ▲8.94
Media Library /wp-admin/upload.php1,403 ▲64.22 ▼0.0396.81 ▼7.0741.95 ▼4.82

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-sticker/includes/admin/sps-content-tab-general.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-sticker/includes/admin/sps-content-tab-sale.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-sticker/includes/admin/sps-content-tab-soldout.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-sticker/includes/admin/sps-content-tab-bestseller.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/product-sticker/includes/admin/sps-content-tab-new.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: stickers, woocommerce stickers, product badge, badge, product stickers...

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

The entry point to "Product Sticker" version 1.0.0 is a PHP file that has certain tags in its header comment area
32 characters long description:
Product stickers for WooCommerce

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin799 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP108526617
CSS184107
PO File1297975

PHP code Passed 2 tests

Analyzing 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.41
Average class complexity10.33
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.87
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes266.67%
Methods15
▷ Static methods00.00%
▷ Public methods1173.33%
▷ Protected methods00.00%
▷ Private methods426.67%
Functions0
▷ Named functions00.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
13 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/public/css/image/star/sticker-bestseller.png1.84KB1.89KB0.00%
includes/public/css/image/ribbon/sticker-soldout.png4.78KB3.40KB▼ 28.87%
includes/public/css/image/diagonal/sticker-sale.png21.40KB2.15KB▼ 89.94%
includes/admin/image/placeholder.png16.24KB1.94KB▼ 88.03%
includes/public/css/image/diagonal/diagonal-bestseller.png19.04KB2.19KB▼ 88.52%