88% improved-badges-for-woocommerce

Code Review | Improved badges for woocommerce

WordPress plugin Improved badges for woocommerce scored 88% from 54 tests.

About plugin

  • Plugin page: improved-badges-f...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Dec 20, 2019
  • Latest release: Oct 4, 2021
  • Number of updates: 10
  • Update frequency: every 65.4 days
  • Top authors: vp956009 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

600+ active / 3,371 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼140.13ms] Passed 4 tests

This is a short check of server-side resources used by Improved badges for woocommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.83 ▲0.1240.06 ▲14.51
Dashboard /wp-admin3.06 ▲0.0050.47 ▼0.29
Posts /wp-admin/edit.php3.11 ▲0.0049.30 ▼0.42
Add New Post /wp-admin/post-new.php5.42 ▼0.0196.35 ▼554.71
Media Library /wp-admin/upload.php3.00 ▼0.0139.43 ▼5.11
Essential Kit /wp-admin/edit.php?post_type=ibfw_product_label&page=ibfw_kit2.7524.78
Add New /wp-admin/post-new.php?post_type=ibfw_product_label2.8228.41
All Product Labels /wp-admin/edit.php?post_type=ibfw_product_label2.8228.97

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 17 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Improved badges for woocommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,980 ▲39817.83 ▲2.1411.35 ▲3.0753.14 ▼2.52
Dashboard /wp-admin2,973 ▲365.91 ▼0.10145.82 ▼13.37121.60 ▼8.78
Posts /wp-admin/edit.php2,739 ▼02.71 ▲0.0075.85 ▲5.8096.16 ▲1.53
Add New Post /wp-admin/post-new.php1,683 ▲6818.12 ▼3.35412.15 ▲109.27122.73 ▲5.22
Media Library /wp-admin/upload.php1,807 ▼04.77 ▼0.35126.26 ▼28.02127.91 ▼2.93
Essential Kit /wp-admin/edit.php?post_type=ibfw_product_label&page=ibfw_kit280.900.0613.00
Add New /wp-admin/post-new.php?post_type=ibfw_product_label280.900.0613.15
All Product Labels /wp-admin/edit.php?post_type=ibfw_product_label280.900.1210.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/improved-badges-for-woocommerce/oc-product-label.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/edit.php?post_type=ibfw_product_label&page=ibfw_kit
    • > Network (severe)
    wp-admin/edit.php?post_type=ibfw_product_label&page=ibfw_kit - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/post-new.php?post_type=ibfw_product_label
    • > Network (severe)
    wp-admin/post-new.php?post_type=ibfw_product_label - Failed to load resource: the server responded with a status of 500 (Internal Server Error)
    • > GET request to /wp-admin/edit.php?post_type=ibfw_product_label
    • > Network (severe)
    wp-admin/edit.php?post_type=ibfw_product_label - Failed to load resource: the server responded with a status of 500 (Internal Server Error)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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: You can look at the official readme.txt

improved-badges-for-woocommerce/oc-product-label.php 92% from 13 tests

This is the main PHP file of "Improved badges for woocommerce" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("improved-badges-for-woocommerce.php" instead of "oc-product-label.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,461 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP4199281,226
CSS24843780
JavaScript274148454
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity42.00
▷ Minimum class complexity5.00
▷ Maximum class complexity73.00
Average method complexity6.12
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods32
▷ Static methods39.38%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.17MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/badge2.png33.90KB12.97KB▼ 61.75%
includes/images/badge3.png37.72KB15.55KB▼ 58.77%
includes/images/badge1.png16.75KB9.76KB▼ 41.76%
includes/images/badge.png23.76KB9.51KB▼ 59.98%
includes/images/review.png15.87KB11.90KB▼ 25.01%