68% category-with-image

Code Review | Show category with image WooCommerce

WordPress plugin Show category with image WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: category-with-image
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 5, 2020
  • Latest release: Oct 7, 2020
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: huykiradotnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /400 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.96MB] [CPU: ▼53.72ms] Passed 4 tests

A check of server-side resources used by Show category with image WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.42 ▼32.39
Dashboard /wp-admin2.06 ▼1.286.37 ▼50.73
Posts /wp-admin/edit.php2.06 ▼1.295.68 ▼39.59
Add New Post /wp-admin/post-new.php2.06 ▼3.825.14 ▼92.15
Media Library /wp-admin/upload.php2.06 ▼1.175.99 ▼29.13

Server storage [IO: ▲0.01MB] [DB: ▲0.07MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_hk_category_image_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Show category with image WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲10913.47 ▼0.898.60 ▲6.8541.68 ▲0.26
Dashboard /wp-admin2,196 ▲195.58 ▼0.0481.93 ▼5.2637.46 ▼6.32
Posts /wp-admin/edit.php2,104 ▲71.99 ▲0.0335.34 ▼1.0735.99 ▲1.49
Add New Post /wp-admin/post-new.php1,539 ▲718.21 ▼5.27603.08 ▼81.5667.10 ▲11.33
Media Library /wp-admin/upload.php1,398 ▼24.22 ▲0.0796.52 ▲0.7944.29 ▼0.04

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the catimg handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_hk_category_image_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Please fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/category-with-image/woo-category-image.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/category-with-image/include/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
3 plugin tags: wiget woocommerce category, category image, woocommerce category image

category-with-image/woo-category-image.php 92% from 13 tests

The main PHP script in "Show category with image WooCommerce" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("category-with-image.php" instead of "woo-category-image.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin279 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP3510137
SVG20279
Sass10056
JavaScript1006
CSS1011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity14.00
▷ Minimum class complexity14.00
▷ Maximum class complexity14.00
Average method complexity4.25
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin