100% woocommerce-category-banner

Code Review | WooCommerce Category Banner

WordPress plugin WooCommerce Category Banner scored 100% from 53 tests.

About plugin

  • Plugin page: woocommerce-categ...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.0.1
  • WordPress version: 5.8.1
  • First release: Apr 25, 2014
  • Latest release: Dec 17, 2014
  • Number of updates: 8
  • Update frequency: every 29.5 days
  • Top authors: WPBackOffice (62.5%)jtwiest (50%)

Code review

53 tests

User reviews

14 reviews

Install metrics

2,000+ active / 22,721 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
This plugin's installer ran successfully

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

An overview of server-side resources used by WooCommerce Category Banner
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1240.98 ▲20.85
Dashboard /wp-admin3.06 ▲0.0144.75 ▼7.36
Posts /wp-admin/edit.php3.12 ▲0.0134.05 ▼6.06
Add New Post /wp-admin/post-new.php5.43 ▼0.0089.75 ▼1,081.13
Media Library /wp-admin/upload.php3.01 ▲0.0030.62 ▼7.69

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WooCommerce Category Banner
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,702 ▲9616.24 ▲0.359.85 ▲2.4544.73 ▼7.48
Dashboard /wp-admin2,956 ▲1035.90 ▲0.09140.88 ▲10.75115.13 ▲15.11
Posts /wp-admin/edit.php2,706 ▼02.69 ▲0.0265.23 ▲0.2692.33 ▲12.16
Add New Post /wp-admin/post-new.php1,651 ▼1717.41 ▼1.42352.73 ▼15.91100.96 ▼16.53
Media Library /wp-admin/upload.php1,772 ▼04.99 ▲0.01142.24 ▼10.62113.35 ▼6.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Category edit page, upload your image here.)
The official readme.txt is a good inspiration

woocommerce-category-banner/woocommerce-category-banner.php Passed 13 tests

The main PHP file in "WooCommerce Category Banner" ver. 1.1.2 adds more information about the plugin and also serves as the entry point for this plugin
138 characters long description:
Place a custom banner and link at the top of your product category pages. Easily update the image through your product category edit page.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin176 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14535128
JavaScript1101129
CSS13019

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.69
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity6.80
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Using a strong compression for your PNG files is a great way to speed-up your plugin
2 PNG files occupy 0.26MB with 0.18MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png111.88KB34.76KB▼ 68.93%
screenshot-1.png156.41KB52.86KB▼ 66.21%