76% woo-badge-designer-lite

Code Review | Badge Designer Lite For WooCommerce

WordPress plugin Badge Designer Lite For WooCommerce scored 76% from 54 tests.

About plugin

  • Plugin page: woo-badge-designe...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9
  • WordPress version: 5.8.1
  • First release: Jul 16, 2019
  • Latest release: Feb 15, 2022
  • Number of updates: 36
  • Update frequency: every 26.4 days
  • Top authors: Access Keys (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active / 18,147 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼144.59ms] Passed 4 tests

This is a short check of server-side resources used by Badge Designer Lite For WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.0633.20 ▲8.81
Dashboard /wp-admin3.22 ▲0.1541.26 ▲5.13
Posts /wp-admin/edit.php3.27 ▲0.1637.24 ▲7.91
Add New Post /wp-admin/post-new.php5.50 ▲0.0671.71 ▼595.52
Media Library /wp-admin/upload.php3.08 ▲0.0725.91 ▲4.13
Settings /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-badges-settings3.1722.08
Check Premium Version /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-premium-wp2.8717.05
Add Badge /wp-admin/post-new.php?post_type=wobd-badge-designer3.2940.75
Documentation /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-documentation-wp2.8716.53
All Badge /wp-admin/edit.php?post_type=wobd-badge-designer3.2136.91
About The Plugin /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-about-us3.1425.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 102 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Badge Designer Lite For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,129 ▲52818.42 ▲2.318.27 ▲3.2276.32 ▼2.67
Dashboard /wp-admin3,227 ▲3328.40 ▲2.22144.90 ▲13.99168.90 ▲0.60
Posts /wp-admin/edit.php3,067 ▲3245.26 ▲1.8988.11 ▲24.64133.63 ▼7.25
Add New Post /wp-admin/post-new.php2,399 ▼1,30719.53 ▲0.43356.13 ▼92.30167.06 ▲4.06
Media Library /wp-admin/upload.php1,851 ▲995.97 ▲0.46113.06 ▼26.56186.17 ▼0.55
Settings /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-badges-settings1,9087.47165.48174.17
Check Premium Version /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-premium-wp2,13410.42299.23250.67
Add Badge /wp-admin/post-new.php?post_type=wobd-badge-designer3,6077.02130.72184.63
Documentation /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-documentation-wp1,43510.75300.33162.32
All Badge /wp-admin/edit.php?post_type=wobd-badge-designer1,7545.5980.56108.70
About The Plugin /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-about-us1,97012.13238.13206.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-badges-settings
    • > Notice in wp-content/plugins/woo-badge-designer-lite/includes/admin/view/settings/wobd-common-settings.php+89
    Trying to access array offset on value of type bool

SRP 0% from 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
Almost there! Just fix the following items
  • 30× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/sale-badge.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-text-background.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/image-background.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/image-template.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/both-template.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/admin/view/wobd-add-setting.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/admin/view/page/more.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/text-background.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/admin/view/wobd-post-action.php
    • > /wp-content/plugins/woo-badge-designer-lite/includes/admin/view/page/header.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: span_class in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-text-background.php on line 10
    • > PHP Warning
      include(WOBD_PATHincludes/frontend/template/both-template.php): failed to open stream: No such file or directory in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 18
    • > PHP Notice
      Undefined variable: badge_type in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 13
    • > PHP Notice
      Undefined variable: badge_type in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-text-background.php on line 18
    • > PHP Warning
      include(): Failed opening 'WOBD_PATHincludes/frontend/template/image-template.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 6
    • > PHP Warning
      Use of undefined constant WOBD_PATH - assumed 'WOBD_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-text-background.php on line 21
    • > PHP Warning
      Use of undefined constant WOBD_PATH - assumed 'WOBD_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 18
    • > PHP Warning
      include(): Failed opening 'WOBD_PATHincludes/frontend/template/both-template.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-text-background.php on line 21
    • > PHP Warning
      include(): Failed opening 'WOBD_PATHincludes/frontend/template/both-template.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 18
    • > PHP Notice
      Undefined variable: badge_type in wp-content/plugins/woo-badge-designer-lite/includes/frontend/template/sales/sales-image-background.php on line 15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-premium-wp
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/wordpress-plugins/woo-badge-designer/ - Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-documentation-wp
    • > Network (severe)
    https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms - Failed to load resource: net::ERR_FAILED
    • > GET request to /wp-admin/edit.php?post_type=wobd-badge-designer&page=wobd-documentation-wp
    • > Javascript (severe) in unknown
    https://accesspressthemes.com/documentation/woo-badge-designer-lite/ - Access to script at 'https://embed.tawk.to/60cc2bbb65b7290ac63693ec/1f8eollms' from origin 'https://accesspressthemes.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: A description for screenshot #6 is required in woo-badge-designer-lite/assets to your readme.txt
The official readme.txt might help

woo-badge-designer-lite/woo-badge-designer-lite.php 92% from 13 tests

"Badge Designer Lite For WooCommerce" version 1.1.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 374 characters long)

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
Success! There were no dangerous files found in this plugin18,569 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
SVG60127,864
CSS111,0671375,843
JavaScript435713,159
PHP321331191,665
PO File15538

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity26.00
▷ Minimum class complexity1.00
▷ Maximum class complexity92.00
Average method complexity3.91
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods43
▷ Static methods00.00%
▷ Public methods43100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 PNG files occupy 2.12MB with 1.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/theme.png52.01KB17.38KB▼ 66.59%
images/text-design/1.png0.95KB0.44KB▼ 53.89%
images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
images/upgrade-to-pro-feature.png664.51KB29.74KB▼ 95.52%
images/text-design/5.png0.82KB0.34KB▼ 58.73%