10% banner-management-for-woocommerce

Code Review | Banner Management For WooCommerce

WordPress plugin Banner Management For WooCommerce scored10%from 54 tests.

About plugin

  • Plugin page: banner-management...
  • Plugin version: 2.4.3
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 20, 2016
  • Latest release: Sep 6, 2023
  • Number of updates: 196
  • Update frequency: every 13.3 days
  • Top authors: dots (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active /147,574 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Error in wp-content/plugins/banner-management-for-woocommerce/woocommerce-category-banner-management.php+335
    Uncaught Error: Call to undefined function wcbm_fs() in wp-content/plugins/banner-management-for-woocommerce/woocommerce-category-banner-management.php:335
    Stack trace:
    #0 wp-admin/includes/plugin.php(2318): include_once()
    #1 wp-admin/includes/plugin.php(663): plugin_sandbox_scrape()

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

This is a short check of server-side resources used by Banner Management For WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.81 ▲2.60
Dashboard /wp-admin3.31 ▲0.0046.22 ▼2.02
Posts /wp-admin/edit.php3.36 ▲0.0047.50 ▼3.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.30 ▼19.74
Media Library /wp-admin/upload.php3.23 ▲0.0035.32 ▲0.01

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 310 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Banner Management For WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.34 ▼0.021.56 ▼0.3239.86 ▼7.98
Dashboard /wp-admin2,189 ▲125.51 ▼0.0384.93 ▼21.2635.40 ▼8.56
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0639.16 ▼1.3535.89 ▼3.64
Add New Post /wp-admin/post-new.php1,536 ▲1018.31 ▼4.62599.29 ▼69.54101.08 ▲13.20
Media Library /wp-admin/upload.php1,394 ▼64.20 ▼0.0396.84 ▼10.1640.09 ▼12.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/banner-management-for-woocommerce/public/partials/woocommerce-category-banner-management-public-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Screenshots: These screenshots need descriptions #12, #13, #14 in banner-management-for-woocommerce/assets to your readme.txt
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

banner-management-for-woocommerce/woocommerce-category-banner-management.php 85% from 13 tests

"Banner Management For WooCommerce" version 2.4.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 142 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("banner-management-for-woocommerce.php" instead of "woocommerce-category-banner-management.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin72,301 lines of code in 197 files:
LanguageFilesBlank linesComment linesLines of code
PHP1459,15418,71150,788
SVG14089,805
PO File31,7975,6464,331
JavaScript96192524,234
CSS253871033,127
XML13016

PHP code 0% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,088)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 268)
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity97.35
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity5.30
▷ Minimum method complexity1.00
▷ Maximum method complexity268.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes60
▷ Abstract classes23.33%
▷ Concrete classes5896.67%
▷ Final classes00.00%
Methods1,371
▷ Static methods22216.19%
▷ Public methods96570.39%
▷ Protected methods231.68%
▷ Private methods38327.94%
Functions125
▷ Named functions12499.20%
▷ Anonymous functions10.80%
Constants153
▷ Global constants10266.67%
▷ Class constants5133.33%
▷ Public constants51100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
33 PNG files occupy 9.62MB with 6.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/partials/images/category_setting_image.png104.94KB32.62KB▼ 68.92%
public/css/images/controls.png2.74KB1.42KB▼ 48.29%
admin/partials/images/product_banner_metabox_setting_image.png243.11KB64.30KB▼ 73.55%
admin/images/product_banner_global_setting_image.png227.69KB55.99KB▼ 75.41%
admin/images/pro-features-img/feature-box-five-img.png669.41KB200.26KB▼ 70.08%