84% category-widget

Code Review | Category Widget

WordPress plugin Category Widget scored 84% from 54 tests.

About plugin

  • Plugin page: category-widget
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2-4.6.1
  • WordPress version: 5.8.1
  • First release: Nov 19, 2013
  • Latest release: Nov 12, 2016
  • Number of updates: 98
  • Update frequency: every 11.1 days
  • Top authors: vinoth06 (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active / 22,940 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼136.31ms] Passed 4 tests

Server-side resources used by Category Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.91 ▲0.2039.40 ▲15.76
Dashboard /wp-admin3.20 ▲0.1465.56 ▲19.73
Posts /wp-admin/edit.php3.27 ▲0.1656.14 ▲9.43
Add New Post /wp-admin/post-new.php5.50 ▲0.0795.82 ▼571.77
Media Library /wp-admin/upload.php3.08 ▲0.0836.12 ▲1.35

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 2 new options
New WordPress options

Browser metrics Passed 4 tests

Category Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,907 ▲31117.45 ▲1.8112.77 ▲2.0949.32 ▲0.73
Dashboard /wp-admin3,193 ▲2598.05 ▲2.06181.34 ▲13.45122.82 ▼2.37
Posts /wp-admin/edit.php2,994 ▲2554.42 ▲1.7291.19 ▲8.7199.83 ▲3.18
Add New Post /wp-admin/post-new.php1,531 ▼15217.70 ▼0.59383.55 ▼21.19122.02 ▲11.20
Media Library /wp-admin/upload.php1,840 ▲184.82 ▼0.21133.45 ▼29.09122.46 ▼6.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 2 options in the database
    • bc_category_widget_db_version
    • widget_buffercode_category_widget_info

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/category-widget/category-widget.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-widget/include/script.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-widget/include/menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-widget/include/widget/widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/category-widget/include/function.php:58

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #2 (Widget Selection)
You can look at the official readme.txt

category-widget/category-widget.php Passed 13 tests

The main PHP file in "Category Widget" ver. 2.0.2 adds more information about the plugin and also serves as the entry point for this plugin
74 characters long description:
Display post by drop-down or list by category or categories using Widgets.

Code Analysis Passed 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
There were no executable files found in this plugin1,602 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity42.00
▷ Minimum class complexity42.00
▷ Maximum class complexity42.00
Average method complexity11.25
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions18100.00%
▷ Anonymous functions00.00%
▷ Global constants4100.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
5 PNG files occupy 0.39MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/paypal.png21.61KB7.46KB▼ 65.46%
assets/images/dropdown.png7.43KB2.24KB▼ 69.86%
screenshot-1.png346.49KB164.81KB▼ 52.43%
assets/css/multiple-select.png3.30KB0.62KB▼ 81.18%
assets/images/list.png18.17KB5.62KB▼ 69.09%